Write and debug instruction text on any surface: requests, standing context such as CLAUDE.md, tool and schema descriptions, and prompts written for other model instances.
A model that reasons natively does not need to be taught how to think. It needs to be told what done looks like, and
left alone. Instruction text that explains, encourages, or supervises costs more than it buys — the model already does
those things, and your text competes with its own judgment.
Prompt text lives on four surfaces, and the same words behave differently on each. A rule that helps in a request can
tax every turn for months as persistent context. Identify the surface before writing.
On encountering a defective prompt
Do not read past it. Prompt text that violates these rules is found far more often than it is written — in a skill, a
tool description, a standing instruction file, a subagent brief.
Already editing that file — fix it, in the same change.
Not editing that file — name the defect and the fix, once, in a sentence. Then continue the task you were asked to
do.
Flag what changes behavior, not what offends taste. A stale fact, a contradiction between two rules, a filter that
suppresses recall, a rule the model already follows — these cost output. Wording preferences do not.
One flag, then proceed. A task does not become a prompt audit because a prompt was involved. Raising the same
class of defect repeatedly in one session costs more attention than the defect does.
Not a prompt problem
Write nothing for these. Each has a fix that prompt text cannot reach, and reaching for words instead is the most common
wasted motion in this skill's domain.
Reasoning is too shallow or too deep → the effort setting, not the wording
Context degrades across a multi-turn run → compaction and reasoning persistence. This is not the same as a single
prompt carrying large documents, which is prompt text — see Long context
A prohibition must actually hold → permissions, schemas, sandboxes. Prose steers; it does not enforce
The rule is deterministic and machine-checkable → compile it into code and have the model call it
Deterministic filtering or aggregation over tool output → run it as code outside the context window
The scale matters. A wrong setting can cost more than every prompt decision on the page combined, and no amount of craft
in the wording recovers it. Check the setting first; it is faster to rule out than to write around.
A standing rule is ignored despite being stated → persistent context. The file is too
long and the rule is lost. Delete others rather than restating this one louder
A subagent returns work that misses context you never gave it → delegated prompts
The model obeyed exactly and the result got worse → literalism
Output is consistently the wrong shape and the prompt has examples → the examples are specifying it. See
Examples are read literally too
Answers degrade as the prompt grows, or cite the wrong part of a document → long context
The instruction was true when written and is false now → timelessness
The four surfaces
1. The request
The one-shot ask. Read once, acted on once. This is the surface where explicit structure pays: clear sectioning,
examples, tags when a prompt mixes instructions with data, and a stated output contract.
Specify the output contract. Format, length, constraints, and what "done" means. This is the one thing the model
cannot infer, and the one thing worth spending words on.
Give the reason, not only the rule. "Never use ellipses" underperforms "this is read aloud by a speech engine,
which cannot pronounce them." Stated motivation generalizes to cases you did not enumerate; a bare rule does not.
Examples pin shape, never reasoning path. Three to five, wrapped in tags, when the target is a format, a tone, or
a genuinely ambiguous label the model cannot infer from a description. An example demonstrating how to approach a
problem is read as the approach to take — see Examples are read literally too,
which is the mechanism behind every rule in this bullet.
The cost of an example scales with how often it is read. In a one-shot request an unhelpful example wastes tokens
once. In persistent context it constrains every future run, silently, in a direction nobody re-examines. This skill
therefore carries no worked prompt: a "here is a bad prompt, here is the fix" walkthrough would teach the shape of
that one fix to every prompt written afterward.
Ask for uncertainty explicitly. Permission to say "I don't know" has to be granted or the model fills the gap.
Say what you want, not what you fear. Positive examples of the target style outperform prohibitions against the
wrong one.
2. Persistent context
System prompts, CLAUDE.md, skills, memory files. Read on every request, forever.
A request that is slightly wrong costs one bad response. A standing rule that is slightly wrong costs a small tax on
every request for months — and because it is always present, you stop seeing it.
Admit a rule only if changing it would change intended behavior. Everything else belongs in runtime injection or
retrieval.
Never restate what the agent can discover. Repository overviews measurably fail: context files did not improve
task success while adding over 20% inference cost. The mechanism is not that agents ignore them — it is that agents
follow them too diligently, treating the extra content as additional constraints to satisfy.
Prefer prohibitions with real thresholds over style prescriptions. Prohibitions with a stated boundary hold;
prescriptions about how to do the work compete with the judgment the model applies to the case in front of it.
Four categories earn their place — operator opinions the model cannot infer, project facts that surprise, routing
rules with stated thresholds, named integrations. Persona framing, restated general knowledge, emphasis scaffolding
(CRITICAL, all-caps, emoji markers), and redundant verification demands do not.
Prime the domain instead of assigning a persona. Audience, register, length, and structure give the model a
target. A persona gives it a vibe, and vibes drift.
Add back one rule at a time, only after repeated failure on the same specific issue. Never speculatively — the
model reads every line on every turn.
Deleting is not automatically safe. Cutting a standing rule is the default move, but confirm the behavior it
prevented does not return. A rule that earns its place survives this check; most do not.
Read [${CLAUDE_SKILL_DIR}/references/persistent-context.md] when a standing rule is being added, cut, or defended — it
carries U-shaped attention, instruction drift, constraint overload, and the declarative-over-procedural split.
3. Tool and schema text
Parameter names, enums, constraints, and tool descriptions. This is prompt text: the model reads it to decide what a
tool is for and how to call it.
Encode behavior in the interface rather than in usage examples. A status enum of
pending | in_progress | completed plus one constraint sentence in the description teaches more reliably than worked
examples — and does not narrow the model's exploration space the way examples do.
Put tool instructions in the tool description, not the system prompt. Duplicating them across both is where
conflicting guidance comes from, and a model burns reasoning deciding which instruction wins before doing the work.
Name parameters so the name carries the constraint. Expressive names and enums do work that prose cannot, because
they are present at the moment of the call.
State the trigger in the description. "Call this when the user asks about current prices" belongs on the tool, not
in a system-prompt paragraph the model reads a thousand tokens earlier.
4. Delegated prompts
Text you write for another model instance — a subagent, a pipeline stage, a generated skill.
The receiving agent has none of your context. Every delegated prompt must be self-contained; orchestrator state
that leaks in as an unexplained reference is the dominant failure mode.
Define the contract before the prose — inputs, outputs, and how the receiver knows it succeeded.
Include a concrete output example, not a description of one.
Sanitize anything user-supplied before it enters a generated prompt.
Read [${CLAUDE_SKILL_DIR}/references/delegated-prompts.md] before writing a prompt another model instance will execute
— it carries the contract-first workflow, the failure modes, trust boundaries for untrusted content, verifier
delegation, and the self-containment check. It covers the text; whether to delegate at all, and how to scope the
isolation, is a separate decision.
The instruction budget
A context holds roughly 100 to 150 instructions before adherence degrades measurably. Past that, the model does not
report strain — it drops or partially applies clauses, and which ones it drops is not predictable. The number is
calibrated against one model generation and moves with capability; the shape of the curve does not.
The budget is shared, not per-file. System prompt, every active skill, every instruction file, and every tool
description draw on the same allowance. A 30-line addition to a context already holding 120 instructions is not a
30-line decision.
The ceiling is not a target. Fewer is strictly better at every point below it. There is no threshold under which
additional instructions become free.
Count before adding, not after. The cost of an instruction is paid on every turn; the benefit only on turns where
it applies. A rule that matters one time in twenty is a bad trade at any length.
Over budget: delete, do not compress. A rule shortened from three lines to one still occupies a slot. Compression
buys back tokens, never a slot; only removal returns budget.
Load conditionally what applies conditionally. Rules needed in one phase belong in a file read at that phase. A
rule present on every turn should be one that matters on most of them.
Long context
Arranging large inputs inside a prompt is prompt text, not configuration. The rules below apply to a single request
carrying documents and to an agent whose standing context has grown — both are the same problem.
Volume itself carries a cost that relevance does not offset. One controlled run put the passing rate at 8/10 with
~11k characters of context and 3/10 with ~299k, and the drop was the same whether the added material was relevant or
irrelevant. One run is a direction, not a constant — and the direction is that selection beats relevance, so adding
context to fix a wrong answer is the wrong reflex.
Documents at the top, the question at the bottom. Attention is U-shaped: the middle is where content goes to be
forgotten. Put the instruction after the material it operates on, not before.
Label every document with identifying metadata — source, type, date, id — in a wrapper tag. Unlabeled documents
cannot be cited, and a model that cannot cite will paraphrase from the wrong one without signalling.
Ask for quotes before answers. Requiring the model to quote the passages it relies on, before it reasons over
them, grounds the answer and makes a wrong retrieval visible in the output instead of invisible inside it.
Strip noise before including. Boilerplate, navigation, headers, and changelog cruft consume the same budget as
signal and degrade the same way.
Do not rebuild state from raw history every turn. Maintain the authoritative state as its own object and pass
that. Re-deriving it from an accumulating transcript is how a long-running agent drifts.
Cut before you add. When an answer is wrong at high volume, the reflex to add clarifying context is backwards; the
first move is removing material that is present but not load-bearing.
Read [${CLAUDE_SKILL_DIR}/references/long-context.md] when a prompt carries documents, or when answers degrade as the
prompt grows — it carries document templates, chunking strategies, quote-grounding patterns, and the point where this
stops being a prompt problem.
Wording
A rule is read by a system that resolves ambiguity silently — and read again months later, when what it describes has
moved. A sentence fails in two directions: misread now, or read exactly right and no longer true. Neither failure
reports itself, and both are decided at the level of the sentence.
One term per concept, every time. Synonyms read as distinctions. A "rule" that becomes a "directive" three lines
later may be treated as a second thing with separate scope.
Imperative for instructions. "Return the parsed result." Not "you should return" or "the result should be
returned."
One instruction per sentence. A sentence carrying two requirements reliably gets one of them applied.
Active voice with a named actor. "The verifier reports findings" leaves no question about who acts. "Findings are
reported" leaves it open, and the model will pick.
Short sentences. A long sentence buries its operative clause in the middle, where attention is weakest — the same
curve that governs a whole file governs a sentence.
No noun stacks. Three nouns in a row is the ceiling. "Prompt quality review process checklist" parses as many
things and specifies none.
Every pronoun resolves to exactly one antecedent. "It", "this", and "that" are where silent misreadings enter. If
two candidates exist, name the thing.
Rules about rules
A rule must be checkable. If you cannot tell from the output whether it was followed, it is a sentiment. "Write
clearly" cannot be checked. "One instruction per sentence" can.
State the boundary, not the sentiment. Bounded beats unbounded regardless of polarity: "do not refactor unrelated
code" and "keep responses under 200 words" both work. "Follow good style" and "avoid verbosity" do not.
Delete hedges. "Generally", "typically", "where possible", "as appropriate", and "try to" convert a rule into a
preference the model may weigh away against something else. If the rule has real exceptions, name them. If it does
not, state it flat.
The reason earns its place only when it generalizes. In a one-shot request, motivation extends the rule to cases
you did not enumerate. In persistent context, a reason that explains only the stated case is read on every turn and
changes nothing.
Terse is not compressed. Cut words that do not change meaning. A rule shortened past the point where its scope is
clear costs more than the tokens it saved.
Timelessness
Persistent instructions are read later by a reader that cannot discount them. A human meeting "not currently supported"
in an old document notices its age and downgrades the claim; a model reads a present-tense assertion from a
system-authority source and complies. A stale instruction is not ignored — it is obeyed, and nothing errors.
The runtime owns now; the text owns invariants. Never assert a date, a live version, or a model roster in
persistent context. The harness already injects the real current date, and your text competes with a channel that is
always more current than it is.
Rolling referents are banned — currently, now, latest, newer, no longer, soon, still,
does not yet, as of this writing. Each names a moving target.
A rolling word is admissible only with a fixed anchor beside it — a version range or a date. "Removed in current
versions" rots; "removed in 3.0 and later" does not.
Domain time is preserved verbatim. Durations, expiry, retry backoff, ordering, and migrations are part of what the
subject does. The naive reading of this rule — delete temporal words — destroys meaning. The test is whether the
referent moves with the reader, not whether the word looks temporal.
A plan is never written as a fact. "Planned for Q4" stays modal. Canonicalizing it into "the product supports X"
makes the prose cleaner and the claim false.
Time-stamped genres are exempt — changelogs, release notes, migration guides, decision records, and evidence logs
are dated by design. Keep them out of persistent context rather than de-tensing them.
Timeless is not immutable. Hard invariants outlive model generations; soft defaults are calibrated against one and
need re-examining when it moves. A file nobody revisits is not timeless, it is abandoned.
This buys durability, not compliance. Tense has no measured effect on instruction-following. Write timeless to keep
the artifact true, not to make the model obey harder.
Read [${CLAUDE_SKILL_DIR}/references/timelessness.md] when a temporal word is ambiguous between a moving referent and
domain time — it carries the deictic-vs-domain table, both-direction failure modes, and the evidence.
Formatting
Sentence-level precision is not enough alone — the shape of the surrounding text decides whether the model reads a rule
as one thing or several.
Choosing a data shape
Independent entries → key-value list. Route tables, tool inventories, configuration mappings, permission modes.
Each entry stands alone and nothing is gained by scanning across.
Genuine comparison → table. Only where cross-criteria scanning is the point. The test: remove a column. If
comparative meaning is lost it is a table; if the rows still stand alone it was a list wearing table formatting.
Nested structure → YAML. Configurations and hierarchies beyond two levels. More accurate than JSON or XML at
depth, and cheaper.
Ordered procedure → numbered list. Only where sequence changes the outcome.
Everything else → bullets. If items reorder without changing meaning, they are bullets.
Misusing a table for independent entries is the most common formatting defect and the cheapest to fix. Read
[${CLAUDE_SKILL_DIR}/references/structured-data-formats.md] when the shape choice is contested, or when an output
schema is being imposed — it carries selection depth and why a rigid schema costs reasoning quality.
Marking regions with tags
Tags separate parts of a prompt a reader could otherwise run together — instructions, supplied data, examples, and the
output specification.
Tag where the prompt has parts that could be confused. A single-purpose prompt gains nothing from tags and pays
for them in noise.
One tag name per concept, reused exactly. The same discipline as terminology: a region called <context> in one
place and <background> in another reads as two regions.
Reference the tag from the instruction. "Using the constraints in <constraints>" creates a link the model can
follow. An unreferenced tag is decoration.
Nest for real hierarchy only. Documents inside <documents>, each in its own <document>. Nesting that mirrors
no actual structure adds depth without meaning.
Tags mark, they do not enforce. A region labelled as data is still read, and labelling it does not stop
instructions inside it from being followed. Where that matters, the boundary belongs in permissions or schema.
Instructions compound with defaults
An instruction does not replace the model's default behavior. It adds to it. Where the two push the same direction, the
result overshoots — and the overshoot is invisible, because the output looks like compliance.
Delete verification instructions. "Include a final verification step", "double-check your answer", "use a subagent
to verify" stack on top of checking the model already does. Removing them costs nothing in quality.
Delete thoroughness nudges, forced progress scaffolding, and if in doubt, use X. A model that reaches for a tool
appropriately does not need telling; the nudge makes it reach when it should not.
The same trap runs the other way. "Be concise" added to a model that is already terse produces answers too short
to be useful. Whichever direction the default already points, a redundant instruction pushes past the useful amount.
Check the target model before generalizing. Guidance for one model can say strip self-verification while guidance
for another recommends explicit interval checks with fresh-context verifier subagents on long-horizon runs. Both hold;
the split is by task horizon.
Read [${CLAUDE_SKILL_DIR}/references/superseded-techniques.md] before adopting a named technique — CoT, few-shot,
self-consistency, Tree-of-Thoughts, ReAct, PAL, Reflexion, personas, chaining, meta-prompting, APE, DSPy, XML tags,
prefilling — it says which are still worth reaching for.
Instructions are followed exactly
An instruction is applied as written, to exactly the scope named, without the charitable interpretation a person would
supply. Reasonable-sounding instructions therefore produce unreasonable outcomes.
Separate finding from filtering. "Only report high-severity issues" is obeyed literally — the model finds the bugs
and then declines to report them. Ask for everything; filter downstream.
Every caution instruction is a threshold decision with a recall cost. Stronger evidence-gating cut false answers
by 30.6pp on one model while raising unnecessary abstention by 9.7pp on the same benchmark.
State scope explicitly. The model will not infer that a rule extends past the item you named.
Examples are read literally too
An example is not an illustration of what you want. It is a specification, and the model complies with every
property of it — including the ones you never decided.
Incidental properties become requirements. If all your examples happen to have three bullets, you have specified
three bullets. Length, ordering, field presence, register, punctuation, and depth all transfer whether or not you
intended them. Nothing marks which parts were the point.
Vary what you do not want copied. One example is a template; several that differ only in content are the same
template stated three times. If the acceptable output spans a range, the examples must span it — otherwise you have
demonstrated a point and asked for a space.
The last example weighs most. Recency applies inside the example block. Put the most representative case last, not
the most interesting one.
This is why examples narrow exploration. The model reads a demonstrated approach as the approach to take and stops
looking for a better one it would otherwise have found. Demonstrating how to solve is the costly case; demonstrating
what the answer looks like is the safe one.
When output is consistently the wrong shape and examples are present, the examples are the cause. Adding an
instruction to correct it puts prose in conflict with a specification, and the specification wins.
Quality checklist
Confirmed this is a prompt problem — not effort, compaction, permissions, or code
Surface identified before drafting; the rule is written for the surface it lands on
Output contract explicit — format, length, and what "done" means
Reasons given alongside rules, so they generalize
No instruction pushing the same direction as a default the model already has
Tool behavior in parameters, enums, and descriptions — not in prompt prose or usage examples
Nothing restates what the agent can discover for itself
Filtering separated from finding; no severity filter suppressing recall
Delegated prompts self-contained, with a concrete output example
Instruction count checked against what the context already holds, not against this file alone
Key-value lists for independent entries; tables only where removing a column loses meaning
Tags used only where parts could be confused, named consistently, referenced from the instruction
Rules are imperative, one instruction per sentence, one term per concept
No hedges — every rule states a boundary that can be checked from the output
Defective prompt text encountered during the task was fixed or flagged once
Every standing rule survives the deletion test and stays true over time
No rolling referents; version-gated facts carry a fixed anchor
1---2name: prompt-engineering3description: Write and debug instruction text on any surface: requests, standing context such as CLAUDE.md, tool and schema descriptions, and prompts written for other model instances.4---56**A model that reasons natively does not need to be taught how to think. It needs to be told what done looks like, and7left alone.** Instruction text that explains, encourages, or supervises costs more than it buys — the model already does8those things, and your text competes with its own judgment.910Prompt text lives on four surfaces, and the same words behave differently on each. A rule that helps in a request can11tax every turn for months as persistent context. Identify the surface before writing.1213## On encountering a defective prompt1415Do not read past it. Prompt text that violates these rules is found far more often than it is written — in a skill, a16tool description, a standing instruction file, a subagent brief.1718- **Already editing that file** — fix it, in the same change.19- **Not editing that file** — name the defect and the fix, once, in a sentence. Then continue the task you were asked to20 do.21- **Flag what changes behavior**, not what offends taste. A stale fact, a contradiction between two rules, a filter that22 suppresses recall, a rule the model already follows — these cost output. Wording preferences do not.23- **One flag, then proceed.** A task does not become a prompt audit because a prompt was involved. Raising the same24 class of defect repeatedly in one session costs more attention than the defect does.2526## Not a prompt problem2728Write nothing for these. Each has a fix that prompt text cannot reach, and reaching for words instead is the most common29wasted motion in this skill's domain.3031- **Reasoning is too shallow or too deep** → the effort setting, not the wording32- **Context degrades across a multi-turn run** → compaction and reasoning persistence. This is not the same as a single33 prompt carrying large documents, which is prompt text — see [Long context](#long-context)34- **A prohibition must actually hold** → permissions, schemas, sandboxes. Prose steers; it does not enforce35- **The rule is deterministic and machine-checkable** → compile it into code and have the model call it36- **Deterministic filtering or aggregation over tool output** → run it as code outside the context window3738The scale matters. A wrong setting can cost more than every prompt decision on the page combined, and no amount of craft39in the wording recovers it. Check the setting first; it is faster to rule out than to write around.4041## Routing by symptom4243- **Output shape, tone, or format is wrong** → [request](#1-the-request)44- **A standing rule is ignored despite being stated** → [persistent context](#2-persistent-context). The file is too45 long and the rule is lost. Delete others rather than restating this one louder46- **A tool is used wrongly, or not at all** → [tool and schema text](#3-tool-and-schema-text)47- **A subagent returns work that misses context you never gave it** → [delegated prompts](#4-delegated-prompts)48- **The model obeyed exactly and the result got worse** → [literalism](#instructions-are-followed-exactly)49- **Output is consistently the wrong shape and the prompt has examples** → the examples are specifying it. See50 [Examples are read literally too](#examples-are-read-literally-too)51- **Answers degrade as the prompt grows, or cite the wrong part of a document** → [long context](#long-context)52- **The instruction was true when written and is false now** → [timelessness](#timelessness)5354## The four surfaces5556### 1. The request5758The one-shot ask. Read once, acted on once. This is the surface where explicit structure pays: clear sectioning,59examples, tags when a prompt mixes instructions with data, and a stated output contract.6061- **Specify the output contract.** Format, length, constraints, and what "done" means. This is the one thing the model62 cannot infer, and the one thing worth spending words on.63- **Give the reason, not only the rule.** "Never use ellipses" underperforms "this is read aloud by a speech engine,64 which cannot pronounce them." Stated motivation generalizes to cases you did not enumerate; a bare rule does not.65- **Examples pin shape, never reasoning path.** Three to five, wrapped in tags, when the target is a format, a tone, or66 a genuinely ambiguous label the model cannot infer from a description. An example demonstrating _how to approach_ a67 problem is read as the approach to take — see [Examples are read literally too](#examples-are-read-literally-too),68 which is the mechanism behind every rule in this bullet.69- **The cost of an example scales with how often it is read.** In a one-shot request an unhelpful example wastes tokens70 once. In persistent context it constrains every future run, silently, in a direction nobody re-examines. This skill71 therefore carries no worked prompt: a "here is a bad prompt, here is the fix" walkthrough would teach the shape of72 that one fix to every prompt written afterward.73- **Ask for uncertainty explicitly.** Permission to say "I don't know" has to be granted or the model fills the gap.74- **Say what you want, not what you fear.** Positive examples of the target style outperform prohibitions against the75 wrong one.7677### 2. Persistent context7879System prompts, CLAUDE.md, skills, memory files. Read on every request, forever.8081**A request that is slightly wrong costs one bad response. A standing rule that is slightly wrong costs a small tax on82every request for months — and because it is always present, you stop seeing it.**8384- **Admit a rule only if changing it would change intended behavior.** Everything else belongs in runtime injection or85 retrieval.86- **Never restate what the agent can discover.** Repository overviews measurably fail: context files did not improve87 task success while adding over 20% inference cost. The mechanism is not that agents ignore them — it is that agents88 follow them _too_ diligently, treating the extra content as additional constraints to satisfy.89- **Prefer prohibitions with real thresholds over style prescriptions.** Prohibitions with a stated boundary hold;90 prescriptions about how to do the work compete with the judgment the model applies to the case in front of it.91- **Four categories earn their place** — operator opinions the model cannot infer, project facts that surprise, routing92 rules with stated thresholds, named integrations. Persona framing, restated general knowledge, emphasis scaffolding93 (`CRITICAL`, all-caps, emoji markers), and redundant verification demands do not.94- **Prime the domain instead of assigning a persona.** Audience, register, length, and structure give the model a95 target. A persona gives it a vibe, and vibes drift.96- **Add back one rule at a time, only after repeated failure on the same specific issue.** Never speculatively — the97 model reads every line on every turn.98- **Deleting is not automatically safe.** Cutting a standing rule is the default move, but confirm the behavior it99 prevented does not return. A rule that earns its place survives this check; most do not.100101Read [`${CLAUDE_SKILL_DIR}/references/persistent-context.md`] when a standing rule is being added, cut, or defended — it102carries U-shaped attention, instruction drift, constraint overload, and the declarative-over-procedural split.103104### 3. Tool and schema text105106Parameter names, enums, constraints, and tool descriptions. This is prompt text: the model reads it to decide what a107tool is for and how to call it.108109- **Encode behavior in the interface rather than in usage examples.** A `status` enum of110 `pending | in_progress | completed` plus one constraint sentence in the description teaches more reliably than worked111 examples — and does not narrow the model's exploration space the way examples do.112- **Put tool instructions in the tool description, not the system prompt.** Duplicating them across both is where113 conflicting guidance comes from, and a model burns reasoning deciding which instruction wins before doing the work.114- **Name parameters so the name carries the constraint.** Expressive names and enums do work that prose cannot, because115 they are present at the moment of the call.116- **State the trigger in the description.** "Call this when the user asks about current prices" belongs on the tool, not117 in a system-prompt paragraph the model reads a thousand tokens earlier.118119### 4. Delegated prompts120121Text you write for another model instance — a subagent, a pipeline stage, a generated skill.122123- **The receiving agent has none of your context.** Every delegated prompt must be self-contained; orchestrator state124 that leaks in as an unexplained reference is the dominant failure mode.125- **Define the contract before the prose** — inputs, outputs, and how the receiver knows it succeeded.126- **Include a concrete output example**, not a description of one.127- **Sanitize anything user-supplied** before it enters a generated prompt.128129Read [`${CLAUDE_SKILL_DIR}/references/delegated-prompts.md`] before writing a prompt another model instance will execute130— it carries the contract-first workflow, the failure modes, trust boundaries for untrusted content, verifier131delegation, and the self-containment check. It covers the text; whether to delegate at all, and how to scope the132isolation, is a separate decision.133134## The instruction budget135136A context holds roughly 100 to 150 instructions before adherence degrades measurably. Past that, the model does not137report strain — it drops or partially applies clauses, and which ones it drops is not predictable. The number is138calibrated against one model generation and moves with capability; the shape of the curve does not.139140- **The budget is shared, not per-file.** System prompt, every active skill, every instruction file, and every tool141 description draw on the same allowance. A 30-line addition to a context already holding 120 instructions is not a142 30-line decision.143- **The ceiling is not a target.** Fewer is strictly better at every point below it. There is no threshold under which144 additional instructions become free.145- **Count before adding, not after.** The cost of an instruction is paid on every turn; the benefit only on turns where146 it applies. A rule that matters one time in twenty is a bad trade at any length.147- **Over budget: delete, do not compress.** A rule shortened from three lines to one still occupies a slot. Compression148 buys back tokens, never a slot; only removal returns budget.149- **Load conditionally what applies conditionally.** Rules needed in one phase belong in a file read at that phase. A150 rule present on every turn should be one that matters on most of them.151152## Long context153154Arranging large inputs inside a prompt is prompt text, not configuration. The rules below apply to a single request155carrying documents and to an agent whose standing context has grown — both are the same problem.156157**Volume itself carries a cost that relevance does not offset.** One controlled run put the passing rate at 8/10 with158~11k characters of context and 3/10 with ~299k, and the drop was the same whether the added material was relevant or159irrelevant. One run is a direction, not a constant — and the direction is that selection beats relevance, so adding160context to fix a wrong answer is the wrong reflex.161162- **Documents at the top, the question at the bottom.** Attention is U-shaped: the middle is where content goes to be163 forgotten. Put the instruction after the material it operates on, not before.164- **Label every document with identifying metadata** — source, type, date, id — in a wrapper tag. Unlabeled documents165 cannot be cited, and a model that cannot cite will paraphrase from the wrong one without signalling.166- **Ask for quotes before answers.** Requiring the model to quote the passages it relies on, before it reasons over167 them, grounds the answer and makes a wrong retrieval visible in the output instead of invisible inside it.168- **Strip noise before including.** Boilerplate, navigation, headers, and changelog cruft consume the same budget as169 signal and degrade the same way.170- **Do not rebuild state from raw history every turn.** Maintain the authoritative state as its own object and pass171 that. Re-deriving it from an accumulating transcript is how a long-running agent drifts.172- **Cut before you add.** When an answer is wrong at high volume, the reflex to add clarifying context is backwards; the173 first move is removing material that is present but not load-bearing.174175Read [`${CLAUDE_SKILL_DIR}/references/long-context.md`] when a prompt carries documents, or when answers degrade as the176prompt grows — it carries document templates, chunking strategies, quote-grounding patterns, and the point where this177stops being a prompt problem.178179## Wording180181A rule is read by a system that resolves ambiguity silently — and read again months later, when what it describes has182moved. A sentence fails in two directions: misread now, or read exactly right and no longer true. Neither failure183reports itself, and both are decided at the level of the sentence.184185- **One term per concept, every time.** Synonyms read as distinctions. A "rule" that becomes a "directive" three lines186 later may be treated as a second thing with separate scope.187- **Imperative for instructions.** "Return the parsed result." Not "you should return" or "the result should be188 returned."189- **One instruction per sentence.** A sentence carrying two requirements reliably gets one of them applied.190- **Active voice with a named actor.** "The verifier reports findings" leaves no question about who acts. "Findings are191 reported" leaves it open, and the model will pick.192- **Short sentences.** A long sentence buries its operative clause in the middle, where attention is weakest — the same193 curve that governs a whole file governs a sentence.194- **No noun stacks.** Three nouns in a row is the ceiling. "Prompt quality review process checklist" parses as many195 things and specifies none.196- **Every pronoun resolves to exactly one antecedent.** "It", "this", and "that" are where silent misreadings enter. If197 two candidates exist, name the thing.198199### Rules about rules200201- **A rule must be checkable.** If you cannot tell from the output whether it was followed, it is a sentiment. "Write202 clearly" cannot be checked. "One instruction per sentence" can.203- **State the boundary, not the sentiment.** Bounded beats unbounded regardless of polarity: "do not refactor unrelated204 code" and "keep responses under 200 words" both work. "Follow good style" and "avoid verbosity" do not.205- **Delete hedges.** "Generally", "typically", "where possible", "as appropriate", and "try to" convert a rule into a206 preference the model may weigh away against something else. If the rule has real exceptions, name them. If it does207 not, state it flat.208- **The reason earns its place only when it generalizes.** In a one-shot request, motivation extends the rule to cases209 you did not enumerate. In persistent context, a reason that explains only the stated case is read on every turn and210 changes nothing.211- **Terse is not compressed.** Cut words that do not change meaning. A rule shortened past the point where its scope is212 clear costs more than the tokens it saved.213214### Timelessness215216Persistent instructions are read later by a reader that cannot discount them. A human meeting "not currently supported"217in an old document notices its age and downgrades the claim; a model reads a present-tense assertion from a218system-authority source and complies. **A stale instruction is not ignored — it is obeyed**, and nothing errors.219220- **The runtime owns `now`; the text owns invariants.** Never assert a date, a live version, or a model roster in221 persistent context. The harness already injects the real current date, and your text competes with a channel that is222 always more current than it is.223- **Rolling referents are banned** — `currently`, `now`, `latest`, `newer`, `no longer`, `soon`, `still`,224 `does not yet`, `as of this writing`. Each names a moving target.225- **A rolling word is admissible only with a fixed anchor beside it** — a version range or a date. "Removed in current226 versions" rots; "removed in 3.0 and later" does not.227- **Domain time is preserved verbatim.** Durations, expiry, retry backoff, ordering, and migrations are part of what the228 subject does. The naive reading of this rule — delete temporal words — destroys meaning. The test is whether the229 referent moves with the reader, not whether the word looks temporal.230- **A plan is never written as a fact.** "Planned for Q4" stays modal. Canonicalizing it into "the product supports X"231 makes the prose cleaner and the claim false.232- **Time-stamped genres are exempt** — changelogs, release notes, migration guides, decision records, and evidence logs233 are dated by design. Keep them out of persistent context rather than de-tensing them.234- **Timeless is not immutable.** Hard invariants outlive model generations; soft defaults are calibrated against one and235 need re-examining when it moves. A file nobody revisits is not timeless, it is abandoned.236237**This buys durability, not compliance.** Tense has no measured effect on instruction-following. Write timeless to keep238the artifact true, not to make the model obey harder.239240Read [`${CLAUDE_SKILL_DIR}/references/timelessness.md`] when a temporal word is ambiguous between a moving referent and241domain time — it carries the deictic-vs-domain table, both-direction failure modes, and the evidence.242243## Formatting244245Sentence-level precision is not enough alone — the shape of the surrounding text decides whether the model reads a rule246as one thing or several.247248### Choosing a data shape249250- **Independent entries → key-value list.** Route tables, tool inventories, configuration mappings, permission modes.251 Each entry stands alone and nothing is gained by scanning across.252- **Genuine comparison → table.** Only where cross-criteria scanning is the point. **The test**: remove a column. If253 comparative meaning is lost it is a table; if the rows still stand alone it was a list wearing table formatting.254- **Nested structure → YAML.** Configurations and hierarchies beyond two levels. More accurate than JSON or XML at255 depth, and cheaper.256- **Ordered procedure → numbered list.** Only where sequence changes the outcome.257- **Everything else → bullets.** If items reorder without changing meaning, they are bullets.258259Misusing a table for independent entries is the most common formatting defect and the cheapest to fix. Read260[`${CLAUDE_SKILL_DIR}/references/structured-data-formats.md`] when the shape choice is contested, or when an output261schema is being imposed — it carries selection depth and why a rigid schema costs reasoning quality.262263### Marking regions with tags264265Tags separate parts of a prompt a reader could otherwise run together — instructions, supplied data, examples, and the266output specification.267268- **Tag where the prompt has parts that could be confused.** A single-purpose prompt gains nothing from tags and pays269 for them in noise.270- **One tag name per concept, reused exactly.** The same discipline as terminology: a region called `<context>` in one271 place and `<background>` in another reads as two regions.272- **Reference the tag from the instruction.** "Using the constraints in `<constraints>`" creates a link the model can273 follow. An unreferenced tag is decoration.274- **Nest for real hierarchy only.** Documents inside `<documents>`, each in its own `<document>`. Nesting that mirrors275 no actual structure adds depth without meaning.276- **Tags mark, they do not enforce.** A region labelled as data is still read, and labelling it does not stop277 instructions inside it from being followed. Where that matters, the boundary belongs in permissions or schema.278279## Instructions compound with defaults280281An instruction does not replace the model's default behavior. It adds to it. Where the two push the same direction, the282result overshoots — and the overshoot is invisible, because the output looks like compliance.283284- **Delete verification instructions.** "Include a final verification step", "double-check your answer", "use a subagent285 to verify" stack on top of checking the model already does. Removing them costs nothing in quality.286- **Delete thoroughness nudges, forced progress scaffolding, and `if in doubt, use X`.** A model that reaches for a tool287 appropriately does not need telling; the nudge makes it reach when it should not.288- **The same trap runs the other way.** "Be concise" added to a model that is already terse produces answers too short289 to be useful. Whichever direction the default already points, a redundant instruction pushes past the useful amount.290- **Check the target model before generalizing.** Guidance for one model can say strip self-verification while guidance291 for another recommends explicit interval checks with fresh-context verifier subagents on long-horizon runs. Both hold;292 the split is by task horizon.293294Read [`${CLAUDE_SKILL_DIR}/references/superseded-techniques.md`] before adopting a named technique — CoT, few-shot,295self-consistency, Tree-of-Thoughts, ReAct, PAL, Reflexion, personas, chaining, meta-prompting, APE, DSPy, XML tags,296prefilling — it says which are still worth reaching for.297298## Instructions are followed exactly299300An instruction is applied as written, to exactly the scope named, without the charitable interpretation a person would301supply. Reasonable-sounding instructions therefore produce unreasonable outcomes.302303- **Separate finding from filtering.** "Only report high-severity issues" is obeyed literally — the model finds the bugs304 and then declines to report them. Ask for everything; filter downstream.305- **Every caution instruction is a threshold decision with a recall cost.** Stronger evidence-gating cut false answers306 by 30.6pp on one model while raising unnecessary abstention by 9.7pp on the same benchmark.307- **State scope explicitly.** The model will not infer that a rule extends past the item you named.308309### Examples are read literally too310311An example is not an illustration of what you want. It is a specification, and the model complies with **every**312property of it — including the ones you never decided.313314- **Incidental properties become requirements.** If all your examples happen to have three bullets, you have specified315 three bullets. Length, ordering, field presence, register, punctuation, and depth all transfer whether or not you316 intended them. Nothing marks which parts were the point.317- **Vary what you do not want copied.** One example is a template; several that differ only in content are the same318 template stated three times. If the acceptable output spans a range, the examples must span it — otherwise you have319 demonstrated a point and asked for a space.320- **The last example weighs most.** Recency applies inside the example block. Put the most representative case last, not321 the most interesting one.322- **This is why examples narrow exploration.** The model reads a demonstrated approach as the approach to take and stops323 looking for a better one it would otherwise have found. Demonstrating _how to solve_ is the costly case; demonstrating324 _what the answer looks like_ is the safe one.325- **When output is consistently the wrong shape and examples are present, the examples are the cause.** Adding an326 instruction to correct it puts prose in conflict with a specification, and the specification wins.327328## Quality checklist329330- [ ] Confirmed this is a prompt problem — not effort, compaction, permissions, or code331- [ ] Surface identified before drafting; the rule is written for the surface it lands on332- [ ] Output contract explicit — format, length, and what "done" means333- [ ] Reasons given alongside rules, so they generalize334- [ ] No instruction pushing the same direction as a default the model already has335- [ ] Tool behavior in parameters, enums, and descriptions — not in prompt prose or usage examples336- [ ] Nothing restates what the agent can discover for itself337- [ ] Filtering separated from finding; no severity filter suppressing recall338- [ ] Delegated prompts self-contained, with a concrete output example339- [ ] Instruction count checked against what the context already holds, not against this file alone340- [ ] Key-value lists for independent entries; tables only where removing a column loses meaning341- [ ] Tags used only where parts could be confused, named consistently, referenced from the instruction342- [ ] Rules are imperative, one instruction per sentence, one term per concept343- [ ] No hedges — every rule states a boundary that can be checked from the output344- [ ] Defective prompt text encountered during the task was fixed or flagged once345- [ ] Every standing rule survives the deletion test and stays true over time346- [ ] No rolling referents; version-gated facts carry a fixed anchor
Run npx skillmds@latest add xobotyi/prompt-engineering in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Write and debug instruction text on any surface: requests, standing context such as CLAUDE.md, tool and schema descriptions, and prompts written for other model instances. It is listed under AI & ML on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
xobotyi (@xobotyi) published this skill. Their other Agent Skills are listed on their SkillMD profile.