write-tech-spec
Writes or revises a spec for a work item — the problem, the intended outcome, user-visible stories, decisions already made, and what is out of scope. Use when a kit::spec MR needs its SPEC.md written or corrected, before any plan exists.
Synopsis
User-invoked. Name this skill when you want the agent to apply it. disable-model-invocation is true.
Source file: skills/write-tech-spec/SKILL.md.
Front matter
- name
write-tech-spec- description
- Writes or revises a spec for a work item — the problem, the intended outcome, user-visible stories, decisions already made, and what is out of scope. Use when a kit::spec MR needs its SPEC.md written or corrected, before any plan exists.
- disable-model-invocation
true
Full contents
---
name: write-tech-spec
description: Writes or revises a spec for a work item — the problem, the intended outcome, user-visible stories, decisions already made, and what is out of scope. Use when a kit::spec MR needs its SPEC.md written or corrected, before any plan exists.
disable-model-invocation: true
---
# Write a spec
Read [write-tech-core](../write-tech-core/SKILL.md) first.
A spec records what to build and why. It does not choose files, plan the
implementation, or repeat the codebase. Write it at the size the work deserves:
a tiny change earns a short spec, not a product brief.
## Before writing
- Read the code the change touches, the domain glossary, and any ADR in that
area. The spec uses the words the codebase already uses.
- Read the brief that started the work. If the brief and the repository
disagree, say so; do not smooth it over.
- Size the work with the `scaffolding` skill when it is installed. The size
decides the delivery shape and how much spec the work earns.
- Ask the human only what the repository cannot answer, in a merge-request
comment, one focused question at a time. Keep `status::draft` until they
agree.
## Template
```markdown
## Problem Statement
## Solution
## Delivery shape
## User Stories
## Implementation Decisions
## Testing Decisions
## Out of Scope
## Further Notes
```
### Problem Statement
The problem from the user's side: who hits it, what they cannot do, what it
costs. Evidence first — a report, a failing job, a measured number. Not the
architecture that will fix it.
### Solution
The outcome from the user's side, in a short paragraph. Say what becomes
possible. Leave the mechanism to Implementation Decisions.
### Delivery shape
```markdown
- Size: tiny | medium | large
- Shape: single-task | epic+tasks | milestones
- Rationale: one sentence
```
The human can correct this before the work starts. Everything after a spec
merge follows it.
### User Stories
A numbered list, each in the form "As an <actor>, I want <feature>, so that
<benefit>". Scale the count to the size: about two to five for tiny work,
enough to cover a medium feature without padding, full coverage for agreed
large scope. Do not invent stories for metadata, README, accessibility, or
polish unless the brief asked for them.
A story is an outcome, not a task. "As an operator, I want the relay to refuse
an unsigned hook, so a forged event cannot start a session" belongs here. "As
a developer, I want a `verifyToken` helper" does not.
### Implementation Decisions
The decisions already made: modules to build or change, their interfaces,
schema and API contracts, interactions, technical clarifications. No file
paths and no code snippets — they go stale before the work starts.
One exception: when a prototype produced a shape that prose cannot carry — a
state machine, a reducer, a schema, a type — inline the decision-rich part and
say it came from a prototype.
### Testing Decisions
What makes a good test here, which modules get one, and the seam each test
uses. Prefer an existing seam over a new one, and the highest seam available;
fewer seams across the codebase is better. State the prior art the tests should
follow.
This is not a list of test cases. It says where the behaviour is observed, not
which assertions to write.
### Out of Scope
Required. Name what a reader would reasonably expect to be included and is
not, so the boundary is visible before anyone builds past it.
### Further Notes
Only what the sections above cannot hold: a rejected alternative and why, a
constraint from outside the repository, a question that must be answered
before a plan is written.
## Rules
- Never name a file, a function, or a line as the place to change. If you must
name a file for evidence, link it and say what it does today.
- Never break the work into tasks. Sizing decides the shape; the epic plan
decides the tasks.
- Never write acceptance criteria here. The user stories carry the outcomes;
acceptance criteria belong to the plans that deliver them.
- Whenever you name a file, link it: relative to the document, so the reader
can open it.
## Example
```markdown
## Problem Statement
A spec becomes four epics and a dozen merge requests, and nothing shows that as
one object. The operator reads GitLab project by project and works out by hand
which agent is working, which is stuck, and which waits for a person.
## Solution
One console on the relay: the items that need a human, a spec run that owns its
epics and tasks as one execution, and one page per merge request for
conversation, diff review, and agent control.
## Delivery shape
- Size: large
- Shape: milestones
- Rationale: three surfaces that can ship separately, each useful on its own.
## User Stories
1. As an operator, I want one inbox of items that need a human, so I stop
scanning every project.
2. As an operator, I want a spec's epics and tasks shown as one execution, so I
can see how far the work has got.
3. As an operator, I want to start and stop an agent from its merge request, so
a stuck session does not need a terminal.
```
## Self-check
1. Does the Problem Statement cite observed evidence, not a theory?
2. Could a reader who has never seen the ticket understand the outcome?
3. Does any section name a file, a function, or a test case?
4. Is Out of Scope non-empty?
5. Does the Delivery shape follow from the work, not from ambition?