Skip to content

docs(prompt-optimizer): fill in three guidance gaps (#120, #121, #122)#123

Merged
dcramer merged 4 commits into
mainfrom
prompt-optimizer-issues-120-121-122
Apr 24, 2026
Merged

docs(prompt-optimizer): fill in three guidance gaps (#120, #121, #122)#123
dcramer merged 4 commits into
mainfrom
prompt-optimizer-issues-120-121-122

Conversation

@dcramer
Copy link
Copy Markdown
Member

@dcramer dcramer commented Apr 24, 2026

Close three open enhancement issues on the prompt-optimizer skill by filling
gaps where the skill was either silent or actively nudging authors toward
weaker patterns. All edits land in the existing skill structure — no new
workflow steps, no new reference files.

What changed

#120 — tool policy vs. native tool disclosure

  • Renamed the <tools> marker to <tool_policy> in the portable skeleton,
    Example 1, and the canonical "good section names" list.
  • Added a note in core-patterns.md and one line per provider section in
    model-family-notes.md clarifying that tool schemas are disclosed via the
    provider-native tools parameter (Anthropic, OpenAI, Gemini) — the prompt
    should carry policy, not schema restatements.
  • Tightened the "Layer the prompt correctly" long-prompt bullet to match.

#121 — layered prompts with multiple owners

  • New ### Layered prompts with multiple owners subsection in
    core-patterns.md covering the platform-layer vs. deployer-persona-layer
    split (SOUL.md, CLAUDE.md, AGENTS.md).
  • The invariant: the deployer layer is voice-only; platform behavior rules
    must still fire if the deployer layer is empty or sparse.
  • Cross-reference added from SKILL.md Step 3.

#122 — directives in descriptive markers

  • New ### Where rules live subsection in core-patterns.md noting that
    descriptive markers (<context>, <state>, <turn-state>,
    <environment>) read as data and state-conditional directives buried
    in them can underperform the same directive in a canonical rules section
    (<behavior>, <constraints>, <tool_policy>, <workflow>).
  • New bullet in "High-value prompt moves".
  • New ## Example 4 in transformed-examples.md with the resume-notice
    before/after (0.5 → ≥0.75 on the relevant eval with no other change).

Why

Each issue came with a concrete field finding. The skill was either silent
on the topic (#121 layered prompts, #122 rule placement) or actively nudging
authors toward the weaker pattern (#120 enumerating tools in the prompt).
The edits keep the skill's "empirical finding → rule" voice and stay inside
the existing file structure.

Prior art consulted

Rather than rely purely on the field observations in the issues, I checked
authoritative sources for each claim:

  • Anthropic tool-use docs:
    "When you call the Claude API with the tools parameter, the API constructs
    a special system prompt from the tool definitions, tool configuration, and
    any user-specified system prompt" — schemas are injected automatically.
  • pi-agent-core packages/agent/src/agent-loop.ts:
    LLM is invoked with llmContext = { systemPrompt, messages, tools } — tools
    are a distinct native parameter alongside prompt text.
  • OpenAI Codex CLI system prompt:
    references tools contextually as policy ("prefer rg for searching") and
    does not restate schemas.
  • Hermes Agent SOUL.md
    and soul-md.xyz: direct industry prior art for
    the platform + persona layering model (SOUL.md for voice, AGENTS.md for
    project, platform defaults code-level). Hermes explicitly falls back to a
    built-in default identity when SOUL.md is empty — the pattern the skill
    now documents.

Notably, Codex and Claude Code system prompts both do embed directives in
descriptive sections in places, so the #122 guidance is scoped to
state-conditional rules where the author's eval showed a measurable gap,
not an absolute rule against context-section prose.

Fixes #120
Fixes #121
Fixes #122

dcramer and others added 4 commits April 24, 2026 12:15
Rename the `<tools>` marker to `<tool_policy>` in the portable skeleton,
Example 1, and the "good section names" list. Add a note in core-patterns
explaining that tool schemas are disclosed by the provider-native tools
parameter (Anthropic, OpenAI, Gemini all accept a `tools` field that is
surfaced to the model automatically), so the user-authored prompt should
carry policy, not enumeration. Add one matching line per provider section
in model-family-notes.

The old `<tools>` label invited authors to restate tool inventories and
schemas in the prompt text, which duplicates what the API already passes
and bloats the prompt without adding signal.

Fixes #120
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add a "Layered prompts with multiple owners" subsection to core-patterns
covering the platform-layer vs. deployer/persona-layer split used by
SOUL.md, CLAUDE.md, AGENTS.md, Hermes, OpenClaw, and similar runtimes.
The invariant is that the deployer layer is voice-only — every platform
behavior rule must still fire if the deployer layer is empty or sparse.
Point at the new subsection from SKILL.md Step 3.

The existing layering model assumed a single author owns the whole
system prompt, which nudged authors to delete platform bullets on the
theory that a downstream persona file would cover them. In practice
deployer-authored files are often five lines of voice and tone, so
load-bearing rules silently drop when they live there.

Fixes #121
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add a "Where rules live" subsection to core-patterns noting that
descriptive markers (`<context>`, `<state>`, `<turn-state>`,
`<environment>`) read as data and state-conditional directives buried
in them can underperform the same directive placed in a canonical
rules section (`<behavior>`, `<constraints>`, `<tool_policy>`,
`<workflow>`). Add a matching bullet to "High-value prompt moves"
and a new Example 4 showing the before/after (resume-notice case,
0.5 → ≥0.75 on the relevant eval with no other change).

The previous guidance said each rule needs one owner but said nothing
about *where* that owner should be. Authors following the "collapse
duplicates and group related content" advice could land a directive
in a state block that reads correctly but underperforms.

Fixes #122
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…policy terminology

Fold tool-schema disclosure into the long-prompt separation guidance so
the "Layer the prompt correctly" section stays consistent with the new
tool-policy language. Previously the bullet read "tool rules and schemas
in their own labeled sections" which still nudged authors to restate
schemas in the prompt text.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dcramer dcramer marked this pull request as ready for review April 24, 2026 18:56
@dcramer dcramer merged commit 6a844a0 into main Apr 24, 2026
12 checks passed
@dcramer dcramer deleted the prompt-optimizer-issues-120-121-122 branch April 24, 2026 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant