Writes specs and PRDs a team can build from, and the product communication around them: release notes, updates, exec summaries, memos. Use when asked for a PRD, a spec, acceptance criteria, release notes, a status update or a decision memo.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Spec Writing?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/mariomile-spec-writing)
---
name: spec-writing
description: "Writes specs and PRDs a team can build from, and the product communication around them: release notes, updates, exec summaries, memos. Use when asked for a PRD, a spec, acceptance criteria, release notes, a status update or a decision memo."
---
# Spec Writing
Phase 4 makes the chosen bet buildable by someone who was not in the conversation, and measurable three months later.
**Mode.** Standalone writes the requested scope, numbered assertions and relevant states from the supplied requirements, current behavior and constraints, marking unknown facts and owner decisions; a draft authorizes no implementation. The lifecycle runs every step, writes `SPEC.md` and gate 4. Both per [operating modes](../../references/operating-modes.md). Step 5 calls the other design skills; a standalone spec loads only those it needs, `tracking-standards` for events. Two further modes, each with its own procedure and marker: **synthesis**, a spec from the conversation with no interview ([synthesis](references/synthesis.md), `to-spec` by name), and **communication**, release notes, updates, exec summaries and memos ([product communication](references/pm-artifacts.md)). Read the section of [spec methods](references/spec-methods.md) behind the step you are on.
## Procedure
1. **Read `BRIEF.md` → Bet and Definition**: the selected bet with its primary user action, the kill criteria, the success metric with its baseline; a missing bet stops the phase. **Change track:** the mandate in `CHANGE.md` → Request is the bet, and the spec its Spec part; there is no phase 2 metric (step 7 runs only for a guardrail event), and a choice between solutions found while writing upgrades the work to feature (`lifecycle-setup`, the ratchet). Done when the bet, its primary action and the metric (or the mandate) are in front of you.
2. **State what exists today** in the area the bet touches, from the code where `repo.read` resolved, from the person otherwise. `TECH.md`, `DOMAIN.md` and the `PRODUCT.md` constraints bound the spec; contradicting one means naming it and why. Done when current behavior is written and every constraint that bounds it is named.
3. **Write the impact on what exists** (gate 4.11), one row each: **existing data** (shape, backfill or default, rows a new rule breaks, counted with `db.query`), **contracts** (APIs, webhooks, exports, integrations others consume), **tracking events**, **permissions** (who sees the change), **current users** (default on or off, what moves, how they hear). "Nothing to do" with its reason counts; with nothing built yet, `**Impact on what exists:** not applicable, {reason}`; a change writes only the rows it touches, and current users. Done when every row it owes has a handling.
4. **Bound the scope.** In scope, then out of scope as not now, not ever by design, or not until X, including the boundary someone will argue with. A boundary someone could draw elsewhere is a round question; the rest you write. An undecided in-scope question goes under **Not yet specified** with who decides it and which criteria wait on it. On the change track write `**Touches:**`: what the change touches (interface, copy, data, personal data, permissions, money, messages, contracts, stack, or none of these), each explained in parentheses; it decides which of steps 5 to 11 apply ([gate 4](../gate-checks/references/gate-4-shape.md), Change track). Done when the out-of-scope list is non-empty (gate 4.2) and every contested boundary has the owner's answer.
5. **Shape it with the person**, in this order; each sub-step asks the person, and where this phase runs delegated the delegate returns the round and the main conversation asks it:
1. **Flows.** `ux-architecture` writes information architecture, flows, per-step states, the component inventory and the accessibility floor into `SPEC.md` → Design; every flow traces to the phase 3 primary action. On the product track one flow is the first day, and the spec's `**Activation:**` names its criterion and event (gate 4.17).
2. **A real user, on a clickable prototype** (product track, gate 4.13), before anything costly rests on the concept: `ux-architecture` (direction) builds one self-contained HTML file walking the primary flow with real words, and the person runs one session with someone from the ICP per [spec methods](references/spec-methods.md#real-user-session), notes saved with `scripts/bos.mjs evidence add --class interview --id P{n}` under `## Real users` with `**Willingness to pay:**` (4.14) and `**Channel result:**` (4.22) once the channel test returned. A concept that fails here goes back to phase 3.
3. **The domain.** `domain-model`: entities, transitions with who and guard, invariants, awkward scenarios, rules put to the person, a logic prototype when the rules are non-trivial, the data sketch (gate 4.10).
4. **The agent** (model output, gate 4.16). `agent-design`: autonomy per action, hand-off, injection surfaces with must-pass cases, degradation, the latency budget.
5. **The look.** `ux-architecture` (direction) on the primary flow: reference screens, rendered versions, a choice in rounds (gate 4.9); the kit waits for the stack.
6. **The stack.** `system-design` (stack): inherited layers read from the repository, a decision card per open layer, ADRs for the hard-to-reverse ones, `TECH.md` → Stack, the spec's `## Stack` (gate 4.8); then back to `ux-architecture` (direction) for the kit.
7. **The system.** `system-design`: components, contracts, external calls planned for failure, the scale defaults, the capacity, and a threat model whose mitigations are criteria (gates 4.18, 4.19).
**Build track:** the prototype picked at the solution stop is the source: Design points at it and writes only what a screen cannot show (data, rules, integrations, failures, who may do what); 5.3 to 5.7 are drafted and asked together at the build stop ([depth](../pressure-testing/references/intent-round.md#depth-where-it-pays-build-track)).
Done when `SPEC.md` → Design carries the flows, the domain model and the visual direction, the spec carries `## Stack`, `## Architecture` and `## Threat model`, and on the product track `## Real users` records a session that happened or the override with its reason.
6. **Write the stories, then the acceptance criteria.** Numbered stories ("As a {actor}, I want {capability}, so that {benefit}") for every actor and flow. Then one criterion per requirement, numbered for phase 5, each tracing to a story: a subject that exists in the product, a verb with an observable outcome, and the condition under which it is checked (gate 4.1). Name the **test seams**: the highest points to test the behavior from, existing ones first, few, each with its criteria. Done when every story has a criterion and every criterion survives the adjective test and has a seam.
7. **Enumerate states and edge cases.** Six states per flow: empty, loading, partial, error, success, permission (gate 4.3 needs empty and error). Edge cases: zero/one/many/too many, concurrency, interruption, hostile input. Done when every case has a behavior, or a deliberate "undefined".
8. **Write the quality bar** (gate 4.12): **permissions** (who sees and does what; what someone outside the role gets), **personal data** (what is stored, who reads it, retention, deletion), **performance** (a budget with a number on the primary action, measured at gate 5.14), each as numbered criteria or "not applicable" with why; accessibility, end-to-end and secrets belong to the guardrail (5.10). Then `## Maintainability` (4.23). Done when all four are answered.
9. **Design the tracking plan before the build** (gate 4.4): work backwards from the phase 2 metric to the events and properties that compute it, check each against the catalogue via `tracking-standards`, new or existing. Done when the plan shows how its events produce the number.
10. **Write the eval set** when a criterion depends on model output, before the build and before the prompt: declare `**Model output:** yes` and write at least 20 cases (10 in lite mode) with a threshold, a judge and must-pass cases, including one per injection surface (gate 4.6); synthetic cases are labeled synthetic. Done when the dataset file exists, or the spec declares no model output.
11. **List the constraint conflicts** (gate 4.7): each requirement against the `PRODUCT.md` and `TECH.md` constraints, every collision with who decides it and the criteria it blocks, or none colliding. Conflicts close with their owner before acceptance, or travel as blocking edges into phase 5. Done when `## Conflicts` is written.
12. **Write, gate and get it accepted.** Write `SPEC.md` → Spec per the [spec template](references/spec-template.md), headings and labels exact, and confirm the Design part exists. Write `## What we chose` in plain words, one row per choice as the template shows, opening with the rules that will surprise someone. Run gate 4. On a pass, present that summary first, then the spec, and ask for acceptance (a technical reviewer joins for a high-risk change); record it with the person's answer (`scripts/bos.mjs record 4 --judged "{judge-id}=pass|fail,..." --accepted-by "who"` where commands run). Done when gate 4 is recorded with the person's acceptance.
## Watch for
| Do | Instead of |
|---|---|
| An undecided in-scope question under Not yet specified | Filing it out of scope, where the implementer answers it silently |
| Strike the adjectives; keep what is verifiable | An adjective doing the work in a criterion |
| Six states per flow | Happy-path states only |
| Declare model output and write the eval set with a threshold | "The summary is accurate" as a criterion |
| Ask, and record acceptance with the person's answer | Recording gate 4 because it passed |
More in [spec methods](references/spec-methods.md).
## Capabilities
| Capability | Used for | Floor if absent |
|-----------|----------|-----------------|
| `repo.read` | What exists, what the current flows do, what is already instrumented | Ask the person to describe the current behavior; mark the spec as written without code access |
| `analytics.events` | Which of the planned events already exist | Read the instrumentation from source; where there is no source, design from scratch and note it |
| `docs.search` | Prior specs, design decisions, constraints already agreed | Ask |
| `tickets.read` | Bugs and requests that bound the scope | Skip |
| `ui.render` | The clickable prototype a real user walks (step 5.2) | Self-contained HTML the person opens and shares |
| `files.read` / `files.write` | Previous artifacts, this artifact, state | Required |
**Phase 4 needs no data capability.** Without `repo.read` "what exists today" is thinner; the phase still runs.
## Output Contract
`## SPEC COMPLETE` with the scope boundaries, the conflicts, the domain rules, the agent's behavior when a model acts, the stack, the architecture, the threat model and the visual direction with who chose them, the numbered acceptance criteria, the quality bar, the real-user session (product track), the state coverage, the tracking plan, the gate result and who accepted. The lifecycle artifact is `SPEC.md` per the [spec template](references/spec-template.md); gate 4 parses its headings, bold labels and tables.