build-prompt
Use this skill when the user wants to author or refine a prompt under
docs/build/prompts/ — i.e. a durable, repo-checked-in instruction that
they (or another agent) will hand to Claude Code, Cursor, Codex, Aider, or
similar to do real engineering work.
Your job is to convert the user's rough expression ($ARGUMENTS) into a
fully-engineered markdown prompt that another capable agent can execute
end-to-end without re-asking the user. Do not over-clarify; do not pad.
Interpret confidently from what they said and what the repo shows.
What a "good prompt" must contain
Every prompt this skill produces embeds these layers. If any are weak, the
prompt is not done.
- Clear communication. Say what you actually want. Name the audience
(which agent / which human reviewer), the format, and the constraints.
Treat the model as a capable collaborator who needs the same instructions
any new hire would need on day one — not less, not more.
- Context — only the relevant parts. Who the audience is, what tone to
strike, what's already been tried, what the constraints are, what files
or systems are load-bearing. Link the specific files (
path:line) and
prior prompts/docs the agent will need. Skip everything else.
- Definition of Done. Concrete, observable, verifiable. "Write me a
fundraising appeal" is vague. "Write me a 400-word fundraising appeal to
lapsed mid-level donors in the tone of a personal letter from our ED,
focused on our youth program's recent expansion, ending with a specific
gift ask" is a Definition of Done. The prompt must spell out what
finished looks like in checkable terms.
- Iteration. First output is rarely final. The prompt must tell the
executing agent how to iterate, how to surface tradeoffs, when to ask
the human, and when to keep going. It should also close the loop:
verify against the DoD, then stop.
The skill also embeds the supporting structure every strong prompt needs:
- Role / identity for the executing agent (what stance to take).
- Output format (file path(s), structure, what to write vs. propose).
- Examples or references (when a tone, layout, or pattern is non-obvious).
- Reasoning approach (when to think step-by-step, when to plan first,
when to act).
- Guardrails (what NOT to do — known failure modes, files not to touch,
patterns to avoid).
- Acceptance criteria & verification commands (typecheck, lint, tests,
smoke checks, screenshots — whatever proves the DoD is met).
- Closed-loop protocol (how the agent reports back and how iteration
terminates).
Process
Step 1 — Read the user's input and the repo, then decide if you can proceed
$ARGUMENTS is whatever the user typed. It may be a one-liner, a paragraph,
or a paste of notes. Read it. Then quickly orient:
- Is there a
docs/build/prompts/ directory already? (ls docs/build/prompts/
— create the directory if missing.)
- Are there 1–3 sibling prompts that look like the right shape to match?
Skim them for tone, depth, and conventions.
- Is there a
CLAUDE.md, AGENTS.md, or docs/design/DESIGN.md worth
referencing in the prompt's Context section? Skim only the parts the
prompt will actually need to cite.
- Does the user's input name files, routes, or tables? If so, verify they
exist before quoting them in the prompt.
Ask the user a question only if a load-bearing fact is genuinely unknowable
from input + repo. Examples of load-bearing unknowns: the target file the
prompt operates on, the user role of the executor, an ambiguous reference
("the thing we discussed last week"). Examples that are NOT worth asking:
preferred section ordering, exact word count, whether to include examples —
make a reasonable call and let iteration correct it.
If you must ask, ask at most one focused question. Otherwise proceed.
Step 2 — Draft the prompt
Generate the markdown file at docs/build/prompts/<slug>.md where <slug>
is short kebab-case derived from the user's intent (5 words or fewer when
possible). If a file at that path already exists, treat the run as
adding to / refining it rather than overwriting — preserve prior
content, append or edit surgically, and note the edit in the log section
at the bottom.
Use the canonical structure in template.md. The skeleton:
# Prompt: <Title that names the outcome>
**Target agent:** <Claude Code / Cursor / Codex / any capable coding agent>
**Audience for review:** <who reads the result — engineer, designer, PM, the user>
**Repo / surface:** <repo name and the path or route this prompt operates on>
**Last updated:** <YYYY-MM-DD>
---
## 1. Role and stance
You are <role — e.g. "a senior full-stack engineer working in this Next.js 16
+ Supabase repo">. <One or two lines on the stance to take — e.g. "Prefer
small, reversible edits. Read before you write. Cite the files you change.">
## 2. Goal (one paragraph)
<Plain-language statement of the outcome the user actually wants. Lead with
the verb. Name the user-visible change. Do not bury the goal in background.>
## 3. Context — only what's load-bearing
- **Why now:** <motivating constraint, incident, deadline, or decision>
- **Key files:** <path:line — path:line — short note on what each does>
- **Related prompts / docs:** <links to sibling prompts or design docs>
- **What's already been tried:** <one bullet per attempt, with outcome>
- **Constraints:** <stack rules, design tokens, security boundaries, perf
budgets, anything that narrows the solution space>
## 4. Definition of Done
Concrete, observable, verifiable. Each line is a thing a human or a CI step
can check.
- [ ] <user-visible behavior X works in route Y>
- [ ] <typecheck / lint / tests pass — name the commands>
- [ ] <no regressions in surface Z — name what to spot-check>
- [ ] <copy / tone matches reference doc, if applicable>
- [ ] <files touched stay within the named scope>
## 5. Output format
<What the executing agent should produce: files to change, commits to make,
PRs to open, artifacts to write. If the prompt is for content (copy, docs),
specify length, tone, headings, citations. If it's for code, specify which
layers may be touched and which must not.>
## 6. Approach (recommended path, not a cage)
<3–7 numbered steps the agent should generally follow. End with verification
and a self-check against the DoD. Leave room for judgment; flag the places
where the agent should pause and surface a tradeoff to the user.>
## 7. Guardrails — do not
- <known anti-patterns specific to this repo or this surface>
- <files / systems explicitly out of scope>
- <patterns that prior attempts got wrong>
## 8. Iteration protocol (closed loop)
1. Produce the first pass end-to-end. Do not stop short for confirmation
unless a Section 7 guardrail forces a pause.
2. Self-check against Section 4. Report which boxes are checked and which
are not, with one-line reasons for any gap.
3. If gaps remain that you can fix without new information, fix them and
re-check. Repeat until either all boxes are checked or you hit a
genuine unknown.
4. When all DoD boxes are checked, post a final summary: what changed,
how to verify, and what was deliberately left out of scope.
5. Treat the first user reply as iteration input, not approval. Apply
targeted edits ("more concise", "wrong tone here", "rewrite this
paragraph in our voice") and re-run the loop.
## 9. Verification commands
```bash
<typecheck command>
<lint command>
<test command — unit / e2e>
<smoke check — curl, screenshot, manual route>
10. Attempt log (append-only)
| Date (ISO) |
Actor |
Summary |
Outcome |
|
build-prompt skill |
Initial draft from user input |
Drafted |
Adapt the skeleton to the prompt's nature. A copy/editorial prompt does not
need a "Verification commands" code block — replace it with a tone or
reference check. A migration prompt needs explicit rollback notes. Do not
mechanically copy sections that don't apply; do not skip the four pillars.
### Step 3 — Write the file, then run the iteration loop
1. Use the `Write` tool to create `docs/build/prompts/<slug>.md`. If the
file already exists, use `Read` then `Edit` to append or refine
surgically.
2. Tell the user, in 2–4 lines, what you wrote and where. Quote the title
and the DoD bullet count. Do not paste the whole file back.
3. Invite iteration with a concrete prompt: "Want it tighter on X? Different
tone? Different DoD bar?" Do not ask abstract "does this look good?"
questions — give them levers to pull.
4. Apply the user's iteration as targeted `Edit` calls. Re-state what
changed in 1–2 lines.
5. Continue until the user says "done", or the DoD as written is met and
the user has no further changes.
6. On final close, append a row to the prompt's Section 10 attempt log.
### Step 4 — When the prompt is done
A prompt is done when:
- The four pillars are all present and load-bearing (not boilerplate).
- The DoD is concrete enough that a different agent could execute the
prompt without re-asking the user.
- The user has had a chance to redirect tone, scope, or emphasis at least
once.
- The attempt log is updated.
Tell the user the prompt is done and where it lives. Suggest, in one line,
how they'd run it (e.g. "paste the contents into Claude Code, or reference
this file from another prompt").
---
## Style rules for the prompts you produce
- **Lead with the verb.** "Ship a working per-org workspace nav preset."
not "This prompt is about navigation."
- **Name the audience.** Every prompt has a target agent and a human
reviewer. Both belong in the header.
- **Cite, don't summarize, the repo.** When referencing a file, use the
exact path. When referencing a line range, use `path:line` or
`path:line-line`. Don't paraphrase what's already in the code.
- **No vague modifiers in the DoD.** Replace "clean", "robust", "good UX"
with observable outcomes — a route renders, a test passes, a tone
matches a named reference.
- **One next prompt at a time.** If the user's input contains several
follow-on prompts, generate the first and list the others as
"Follow-on prompts (do not start yet)" at the bottom.
- **Markdown only.** Tables for parallel structure, code fences for
commands and schema, bullet lists for parallel items. No HTML unless
the user explicitly wants it.
- **Inter-prompt links.** When a related prompt already exists under
`docs/build/prompts/`, link it instead of duplicating its content.
---
## What this skill does NOT do
- It does not execute the prompt it produces. The prompt is an artifact;
running it is a separate act.
- It does not author code in `src/` as a side effect. The only file it
writes is the prompt markdown (and possibly the `docs/build/prompts/`
directory if missing).
- It does not invent files, routes, tables, or stakeholders. If a fact
is not in the user's input or the repo, either ask or omit.
---
## Related skills
- [studio-prompt](../../studio/studio-prompt/SKILL.md) — Generates AI Studio Build-mode
prompts (system instructions + build prompt + iterations) for UI
prototyping. Use that when the target tool is AI Studio, not a coding
agent.
- [figma-prompt](../../design/figma-prompt/SKILL.md) — Generates Figma Make prompts
for design artifacts.
- [authoring-skills](../authoring-skills/SKILL.md) — How to author the
skill itself, not the prompts it produces.
1---2name: build-prompt3description: Turn a rough idea, voice memo, or half-formed brief into a fully engineered markdown prompt at docs/build/prompts/<slug>.md for any agentic coding situation (Claude Code, Cursor, Codex, Aider, etc.). Embeds the four prompt-engineering pillars — Clear Communication, Context, Definition of Done, Iteration — plus role, output format, guardrails, and a closed-loop acceptance protocol. Interprets confidently; asks only when truly ambiguous; iterates with the user until the Definition of Done is met.4---56# build-prompt78Use this skill when the user wants to author or refine a prompt under9`docs/build/prompts/` — i.e. a durable, repo-checked-in instruction that10they (or another agent) will hand to Claude Code, Cursor, Codex, Aider, or11similar to do real engineering work.1213Your job is to convert the user's rough expression (`$ARGUMENTS`) into a14fully-engineered markdown prompt that another capable agent can execute15end-to-end without re-asking the user. Do not over-clarify; do not pad.16Interpret confidently from what they said and what the repo shows.1718---1920## What a "good prompt" must contain2122Every prompt this skill produces embeds these layers. If any are weak, the23prompt is not done.24251. **Clear communication.** Say what you actually want. Name the audience26 (which agent / which human reviewer), the format, and the constraints.27 Treat the model as a capable collaborator who needs the same instructions28 any new hire would need on day one — not less, not more.292. **Context — only the relevant parts.** Who the audience is, what tone to30 strike, what's already been tried, what the constraints are, what files31 or systems are load-bearing. Link the specific files (`path:line`) and32 prior prompts/docs the agent will need. Skip everything else.333. **Definition of Done.** Concrete, observable, verifiable. "Write me a34 fundraising appeal" is vague. "Write me a 400-word fundraising appeal to35 lapsed mid-level donors in the tone of a personal letter from our ED,36 focused on our youth program's recent expansion, ending with a specific37 gift ask" is a Definition of Done. The prompt must spell out what38 finished looks like in checkable terms.394. **Iteration.** First output is rarely final. The prompt must tell the40 executing agent how to iterate, how to surface tradeoffs, when to ask41 the human, and when to keep going. It should also close the loop:42 verify against the DoD, then stop.4344The skill also embeds the supporting structure every strong prompt needs:4546- **Role / identity** for the executing agent (what stance to take).47- **Output format** (file path(s), structure, what to write vs. propose).48- **Examples or references** (when a tone, layout, or pattern is non-obvious).49- **Reasoning approach** (when to think step-by-step, when to plan first,50 when to act).51- **Guardrails** (what NOT to do — known failure modes, files not to touch,52 patterns to avoid).53- **Acceptance criteria & verification commands** (typecheck, lint, tests,54 smoke checks, screenshots — whatever proves the DoD is met).55- **Closed-loop protocol** (how the agent reports back and how iteration56 terminates).5758---5960## Process6162### Step 1 — Read the user's input and the repo, then decide if you can proceed6364`$ARGUMENTS` is whatever the user typed. It may be a one-liner, a paragraph,65or a paste of notes. Read it. Then quickly orient:66671. Is there a `docs/build/prompts/` directory already? (`ls docs/build/prompts/`68 — create the directory if missing.)692. Are there 1–3 sibling prompts that look like the right shape to match?70 Skim them for tone, depth, and conventions.713. Is there a `CLAUDE.md`, `AGENTS.md`, or `docs/design/DESIGN.md` worth72 referencing in the prompt's Context section? Skim only the parts the73 prompt will actually need to cite.744. Does the user's input name files, routes, or tables? If so, verify they75 exist before quoting them in the prompt.7677**Ask the user a question only if a load-bearing fact is genuinely unknowable78from input + repo.** Examples of load-bearing unknowns: the target file the79prompt operates on, the user role of the executor, an ambiguous reference80("the thing we discussed last week"). Examples that are NOT worth asking:81preferred section ordering, exact word count, whether to include examples —82make a reasonable call and let iteration correct it.8384If you must ask, ask **at most one** focused question. Otherwise proceed.8586### Step 2 — Draft the prompt8788Generate the markdown file at `docs/build/prompts/<slug>.md` where `<slug>`89is short kebab-case derived from the user's intent (5 words or fewer when90possible). If a file at that path already exists, treat the run as91**adding to / refining** it rather than overwriting — preserve prior92content, append or edit surgically, and note the edit in the log section93at the bottom.9495Use the canonical structure in [template.md](template.md). The skeleton:9697```markdown98# Prompt: <Title that names the outcome>99100**Target agent:** <Claude Code / Cursor / Codex / any capable coding agent>101**Audience for review:** <who reads the result — engineer, designer, PM, the user>102**Repo / surface:** <repo name and the path or route this prompt operates on>103**Last updated:** <YYYY-MM-DD>104105---106107## 1. Role and stance108109You are <role — e.g. "a senior full-stack engineer working in this Next.js 16110+ Supabase repo">. <One or two lines on the stance to take — e.g. "Prefer111small, reversible edits. Read before you write. Cite the files you change.">112113## 2. Goal (one paragraph)114115<Plain-language statement of the outcome the user actually wants. Lead with116the verb. Name the user-visible change. Do not bury the goal in background.>117118## 3. Context — only what's load-bearing119120- **Why now:** <motivating constraint, incident, deadline, or decision>121- **Key files:** <path:line — path:line — short note on what each does>122- **Related prompts / docs:** <links to sibling prompts or design docs>123- **What's already been tried:** <one bullet per attempt, with outcome>124- **Constraints:** <stack rules, design tokens, security boundaries, perf125 budgets, anything that narrows the solution space>126127## 4. Definition of Done128129Concrete, observable, verifiable. Each line is a thing a human or a CI step130can check.131132- [ ] <user-visible behavior X works in route Y>133- [ ] <typecheck / lint / tests pass — name the commands>134- [ ] <no regressions in surface Z — name what to spot-check>135- [ ] <copy / tone matches reference doc, if applicable>136- [ ] <files touched stay within the named scope>137138## 5. Output format139140<What the executing agent should produce: files to change, commits to make,141PRs to open, artifacts to write. If the prompt is for content (copy, docs),142specify length, tone, headings, citations. If it's for code, specify which143layers may be touched and which must not.>144145## 6. Approach (recommended path, not a cage)146147<3–7 numbered steps the agent should generally follow. End with verification148and a self-check against the DoD. Leave room for judgment; flag the places149where the agent should pause and surface a tradeoff to the user.>150151## 7. Guardrails — do not152153- <known anti-patterns specific to this repo or this surface>154- <files / systems explicitly out of scope>155- <patterns that prior attempts got wrong>156157## 8. Iteration protocol (closed loop)1581591. Produce the first pass end-to-end. Do not stop short for confirmation160 unless a Section 7 guardrail forces a pause.1612. Self-check against Section 4. Report which boxes are checked and which162 are not, with one-line reasons for any gap.1633. If gaps remain that you can fix without new information, fix them and164 re-check. Repeat until either all boxes are checked or you hit a165 genuine unknown.1664. When all DoD boxes are checked, post a final summary: what changed,167 how to verify, and what was deliberately left out of scope.1685. Treat the first user reply as iteration input, not approval. Apply169 targeted edits ("more concise", "wrong tone here", "rewrite this170 paragraph in our voice") and re-run the loop.171172## 9. Verification commands173174```bash175<typecheck command>176<lint command>177<test command — unit / e2e>178<smoke check — curl, screenshot, manual route>179```180181## 10. Attempt log (append-only)182183| Date (ISO) | Actor | Summary | Outcome |184|------------|-------|---------|---------|185| <YYYY-MM-DD> | build-prompt skill | Initial draft from user input | Drafted |186```187188Adapt the skeleton to the prompt's nature. A copy/editorial prompt does not189need a "Verification commands" code block — replace it with a tone or190reference check. A migration prompt needs explicit rollback notes. Do not191mechanically copy sections that don't apply; do not skip the four pillars.192193### Step 3 — Write the file, then run the iteration loop1941951. Use the `Write` tool to create `docs/build/prompts/<slug>.md`. If the196 file already exists, use `Read` then `Edit` to append or refine197 surgically.1982. Tell the user, in 2–4 lines, what you wrote and where. Quote the title199 and the DoD bullet count. Do not paste the whole file back.2003. Invite iteration with a concrete prompt: "Want it tighter on X? Different201 tone? Different DoD bar?" Do not ask abstract "does this look good?"202 questions — give them levers to pull.2034. Apply the user's iteration as targeted `Edit` calls. Re-state what204 changed in 1–2 lines.2055. Continue until the user says "done", or the DoD as written is met and206 the user has no further changes.2076. On final close, append a row to the prompt's Section 10 attempt log.208209### Step 4 — When the prompt is done210211A prompt is done when:212213- The four pillars are all present and load-bearing (not boilerplate).214- The DoD is concrete enough that a different agent could execute the215 prompt without re-asking the user.216- The user has had a chance to redirect tone, scope, or emphasis at least217 once.218- The attempt log is updated.219220Tell the user the prompt is done and where it lives. Suggest, in one line,221how they'd run it (e.g. "paste the contents into Claude Code, or reference222this file from another prompt").223224---225226## Style rules for the prompts you produce227228- **Lead with the verb.** "Ship a working per-org workspace nav preset."229 not "This prompt is about navigation."230- **Name the audience.** Every prompt has a target agent and a human231 reviewer. Both belong in the header.232- **Cite, don't summarize, the repo.** When referencing a file, use the233 exact path. When referencing a line range, use `path:line` or234 `path:line-line`. Don't paraphrase what's already in the code.235- **No vague modifiers in the DoD.** Replace "clean", "robust", "good UX"236 with observable outcomes — a route renders, a test passes, a tone237 matches a named reference.238- **One next prompt at a time.** If the user's input contains several239 follow-on prompts, generate the first and list the others as240 "Follow-on prompts (do not start yet)" at the bottom.241- **Markdown only.** Tables for parallel structure, code fences for242 commands and schema, bullet lists for parallel items. No HTML unless243 the user explicitly wants it.244- **Inter-prompt links.** When a related prompt already exists under245 `docs/build/prompts/`, link it instead of duplicating its content.246247---248249## What this skill does NOT do250251- It does not execute the prompt it produces. The prompt is an artifact;252 running it is a separate act.253- It does not author code in `src/` as a side effect. The only file it254 writes is the prompt markdown (and possibly the `docs/build/prompts/`255 directory if missing).256- It does not invent files, routes, tables, or stakeholders. If a fact257 is not in the user's input or the repo, either ask or omit.258259---260261## Related skills262263- [studio-prompt](../../studio/studio-prompt/SKILL.md) — Generates AI Studio Build-mode264 prompts (system instructions + build prompt + iterations) for UI265 prototyping. Use that when the target tool is AI Studio, not a coding266 agent.267- [figma-prompt](../../design/figma-prompt/SKILL.md) — Generates Figma Make prompts268 for design artifacts.269- [authoring-skills](../authoring-skills/SKILL.md) — How to author the270 skill itself, not the prompts it produces.