docs(prompt-optimizer): fill in three guidance gaps (#120, #121, #122)#123
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Close three open enhancement issues on the
prompt-optimizerskill by fillinggaps 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
<tools>marker to<tool_policy>in the portable skeleton,Example 1, and the canonical "good section names" list.
core-patterns.mdand one line per provider section inmodel-family-notes.mdclarifying that tool schemas are disclosed via theprovider-native
toolsparameter (Anthropic, OpenAI, Gemini) — the promptshould carry policy, not schema restatements.
#121 — layered prompts with multiple owners
### Layered prompts with multiple ownerssubsection incore-patterns.mdcovering the platform-layer vs. deployer-persona-layersplit (
SOUL.md,CLAUDE.md,AGENTS.md).must still fire if the deployer layer is empty or sparse.
SKILL.mdStep 3.#122 — directives in descriptive markers
### Where rules livesubsection incore-patterns.mdnoting thatdescriptive markers (
<context>,<state>,<turn-state>,<environment>) read as data and state-conditional directives buriedin them can underperform the same directive in a canonical rules section
(
<behavior>,<constraints>,<tool_policy>,<workflow>).## Example 4intransformed-examples.mdwith the resume-noticebefore/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:
"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.
packages/agent/src/agent-loop.ts:LLM is invoked with
llmContext = { systemPrompt, messages, tools }— toolsare a distinct native parameter alongside prompt text.
references tools contextually as policy ("prefer
rgfor searching") anddoes not restate schemas.
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