Prompt Polish
A human prompt is often under-specified, ambiguous, or missing the context that
makes Claude do its best work. This skill refines the user's request into a
precise internal spec before you act on it or hand it to worker subagents.
The goal is not to inflate short requests or change what the user wants. It is to
remove ambiguity, surface the implied scope and success criteria, and structure
the request so the executor (you or a subagent) has everything it needs.
When this runs
The prompt-polish UserPromptSubmit hook injects a short directive on every
prompt, so refinement is always in the loop. Scale the effort to the request:
- Trivial / already-clear (e.g. "yes", "continue", "fix the typo on line 12"):
pass through unchanged. Do not pad it. Proceed.
- Underspecified or large (vague goal, missing scope, "change X across the
app"): run the full refinement below before doing the work.
The refinement procedure
Rewrite the request into a compact spec with these parts. Keep only the parts
that apply — omit the rest rather than inventing them.
- Intent — one sentence: what outcome the user actually wants.
- Scope — which files / layers / pages / entities are in scope, and what is
explicitly out of scope. State the breadth explicitly (Claude Opus 4.8 follows
scope literally and will not silently generalize "this page" to "all pages").
- Success criteria — how "done and correct" is judged (behavior, tests,
contract parity, lint/typecheck clean).
- Constraints — patterns to follow, things not to touch, performance/security
requirements, the project constitution if one exists.
- Output / format — what the deliverable is (code, diff, report, answer) and
any format requirements.
- Action vs. advice — make explicit whether the user wants changes made or
only suggestions. If they want action, say so with a direct verb ("implement",
"edit") rather than "could you suggest".
Apply these best practices while rewriting:
- Be clear, direct, specific. Replace vague verbs with concrete ones. If the
user wants "above and beyond", say so; otherwise keep the scope minimal.
- Add the motivation. When the user gives a reason, keep it — it lets the
executor generalize correctly.
- Structure with XML tags when the spec mixes instructions, context, and
inputs, so a subagent parses it unambiguously.
- Carry examples forward. If the user gave an example of the desired output,
preserve it in
<example> tags.
- Prefer "do this" over "don't do that" for format and behavior.
Clarify vs. proceed
- If the request is genuinely ambiguous on a point that changes the outcome, ask
up to 3 focused clarifying questions before doing the work.
- If it is merely under-specified but the best interpretation is clear, state the
interpretation you are proceeding with in one line, then proceed. Do not stall
on questions you can answer yourself from the codebase.
Passing the refined spec to workers
When you delegate to subagents (see the orchestration agent), pass the refined
spec, not the raw prompt. Well-specified, self-contained task descriptions are
what let workers run autonomously and correctly. Each worker should receive its
intent, scope (the exact unit it owns), success criteria, and constraints.
Calibration notes (Claude Opus 4.x)
- Literal scope: spell out breadth ("apply to every page, not just the first")
— the model will not infer it.
- Calm language: do not wrap the refined spec in "CRITICAL / YOU MUST"
shouting; current models over-trigger on that. Normal, direct instructions work.
- Don't over-engineer the spec: a refined prompt is still minimal. Don't add
features, abstractions, or defensive requirements the user didn't ask for.
- Front-load specificity: a clear, complete first instruction maximizes
autonomy and reduces back-and-forth.
Example
Raw: "make the tables use the new filter style"
Refined spec:
Intent: Migrate existing data-table pages to the new server-driven filter style.
Scope: All data-table pages under app/(pages)/**; only the filter panel + URL
wiring. Out of scope: table columns, row actions, backend endpoints.
Success: Filters live in the URL (server-driven), no optimistic UI, rows repaint
from the backend response; tsc + lint clean.
Constraints: Follow the data-table skill's URL-driven pattern and the project's
existing filter component; do not introduce client-only state.
Output: Edits to each page + a list of pages changed.
Action: Implement the changes.
This is a large, repetitive change — hand it to the orchestration agent to split
per page, confirm concurrency with the user, and audit each unit.
1---2name: prompt-polish3description: Refine a raw user instruction into a precise, well-structured prompt before acting on it or delegating it to worker subagents. Applies Claude prompt-engineering best practices (clear intent, explicit scope, success criteria, format, context). Runs on every request via the prompt-polish UserPromptSubmit hook; this skill carries the method. Use whenever a request is about to drive code generation, review, debugging, or multi-agent work.4---56# Prompt Polish78A human prompt is often under-specified, ambiguous, or missing the context that9makes Claude do its best work. This skill refines the user's request into a10precise internal spec **before** you act on it or hand it to worker subagents.1112The goal is not to inflate short requests or change what the user wants. It is to13remove ambiguity, surface the implied scope and success criteria, and structure14the request so the executor (you or a subagent) has everything it needs.1516## When this runs1718The `prompt-polish` UserPromptSubmit hook injects a short directive on every19prompt, so refinement is always in the loop. Scale the effort to the request:2021- **Trivial / already-clear** (e.g. "yes", "continue", "fix the typo on line 12"):22 pass through unchanged. Do not pad it. Proceed.23- **Underspecified or large** (vague goal, missing scope, "change X across the24 app"): run the full refinement below before doing the work.2526## The refinement procedure2728Rewrite the request into a compact spec with these parts. Keep only the parts29that apply — omit the rest rather than inventing them.30311. **Intent** — one sentence: what outcome the user actually wants.322. **Scope** — which files / layers / pages / entities are in scope, and what is33 explicitly out of scope. State the breadth explicitly (Claude Opus 4.8 follows34 scope literally and will not silently generalize "this page" to "all pages").353. **Success criteria** — how "done and correct" is judged (behavior, tests,36 contract parity, lint/typecheck clean).374. **Constraints** — patterns to follow, things not to touch, performance/security38 requirements, the project constitution if one exists.395. **Output / format** — what the deliverable is (code, diff, report, answer) and40 any format requirements.416. **Action vs. advice** — make explicit whether the user wants changes made or42 only suggestions. If they want action, say so with a direct verb ("implement",43 "edit") rather than "could you suggest".4445Apply these best practices while rewriting:4647- **Be clear, direct, specific.** Replace vague verbs with concrete ones. If the48 user wants "above and beyond", say so; otherwise keep the scope minimal.49- **Add the motivation.** When the user gives a reason, keep it — it lets the50 executor generalize correctly.51- **Structure with XML tags** when the spec mixes instructions, context, and52 inputs, so a subagent parses it unambiguously.53- **Carry examples forward.** If the user gave an example of the desired output,54 preserve it in `<example>` tags.55- **Prefer "do this" over "don't do that"** for format and behavior.5657## Clarify vs. proceed5859- If the request is genuinely ambiguous on a point that changes the outcome, ask60 **up to 3** focused clarifying questions before doing the work.61- If it is merely under-specified but the best interpretation is clear, state the62 interpretation you are proceeding with in one line, then proceed. Do not stall63 on questions you can answer yourself from the codebase.6465## Passing the refined spec to workers6667When you delegate to subagents (see the orchestration agent), pass the **refined68spec**, not the raw prompt. Well-specified, self-contained task descriptions are69what let workers run autonomously and correctly. Each worker should receive its70intent, scope (the exact unit it owns), success criteria, and constraints.7172## Calibration notes (Claude Opus 4.x)7374- **Literal scope:** spell out breadth ("apply to every page, not just the first")75 — the model will not infer it.76- **Calm language:** do not wrap the refined spec in "CRITICAL / YOU MUST"77 shouting; current models over-trigger on that. Normal, direct instructions work.78- **Don't over-engineer the spec:** a refined prompt is still minimal. Don't add79 features, abstractions, or defensive requirements the user didn't ask for.80- **Front-load specificity:** a clear, complete first instruction maximizes81 autonomy and reduces back-and-forth.8283## Example8485**Raw:** "make the tables use the new filter style"8687**Refined spec:**88```89Intent: Migrate existing data-table pages to the new server-driven filter style.90Scope: All data-table pages under app/(pages)/**; only the filter panel + URL91 wiring. Out of scope: table columns, row actions, backend endpoints.92Success: Filters live in the URL (server-driven), no optimistic UI, rows repaint93 from the backend response; tsc + lint clean.94Constraints: Follow the data-table skill's URL-driven pattern and the project's95 existing filter component; do not introduce client-only state.96Output: Edits to each page + a list of pages changed.97Action: Implement the changes.98```99100This is a large, repetitive change — hand it to the orchestration agent to split101per page, confirm concurrency with the user, and audit each unit.