Requirements and Spec Writing
Convert an unclear request into a specification that a builder can implement and
a reviewer can check, before any code is written.
Goal
Produce a written specification the requester agrees to, separating confirmed
facts from assumptions and unresolved decisions.
Inputs
- Required: the original request and its context.
- Optional: existing code, documents, or constraints the specification must
respect.
- Output: a specification following the section order below. Copy
the spec template to start.
When to use
Use this before planning or implementation when the request is ambiguous, spans
several components, has unclear success criteria, or carries security or data
implications. Skip it for a small, well-defined change with an obvious outcome.
Workflow
- Restate the request in your own words and confirm the restatement is correct
before proceeding.
- Gather context from existing code, documents, and constraints so the
specification does not contradict what already exists.
- Draft each section in order. Fill what the context supports and mark the rest
as an open question rather than guessing.
- Ask one focused question at a time, and only when the answer cannot be
inferred from the context already gathered. Batch trivial confirmations.
- Separate facts, assumptions, and unresolved decisions explicitly. Label every
assumption so the requester can correct it.
- Write acceptance criteria as observable, checkable outcomes, not intentions.
- Record non-goals to prevent scope creep, and note alternatives considered with
the reason each was set aside.
- Present the specification for agreement. Resolve open questions or carry them
forward explicitly before implementation starts.
Specification sections
- Objective: the outcome and why it matters, in one short paragraph.
- Users and use cases: who uses this and the concrete scenarios they perform.
- Requirements: functional and non-functional statements, each testable.
- Non-goals: what is deliberately excluded from this work.
- Existing-system constraints: interfaces, data, and conventions to respect.
- Interfaces and data contracts: inputs, outputs, formats, and schemas.
- Security and privacy: sensitive data, authorization, and trust boundaries.
- Error and edge cases: invalid input, empty state, limits, and failure modes.
- Acceptance criteria: observable conditions that prove the work is complete.
- Open questions: unresolved decisions and who must decide.
- Alternatives considered: options evaluated and why they were not chosen.
- Rollout and rollback: how the change is delivered and how it is reverted.
Decision points
- Context answers a question: record it as a fact and cite the source.
- Context cannot answer and the decision matters: raise it as an open question.
- Context cannot answer but the decision is minor: state a labeled assumption and
continue.
- Scope keeps growing: move the excess into non-goals or a follow-up.
Validation
Before declaring the specification ready:
- Every requirement is testable and each has a matching acceptance criterion.
- Non-goals and open questions are explicit.
- Security, privacy, and error handling are addressed or listed as open.
- No section silently guesses a decision the requester must own.
Output format
Return the completed specification, a short list of assumptions made, and the
open questions that still need a decision before implementation.
1---2name: requirements-and-spec-writing3description: Turns an ambiguous or large request into an agreed written specification before implementation, covering objective, users and use cases, requirements, non-goals, interfaces and data contracts, security and privacy, error and edge cases, acceptance criteria, open questions, alternatives considered, and rollout and rollback. Use when a request is vague, scope or acceptance criteria are unclear, or the user asks for a spec, requirements, or a design before coding begins.4license: MIT5---67# Requirements and Spec Writing89Convert an unclear request into a specification that a builder can implement and10a reviewer can check, before any code is written.1112## Goal1314Produce a written specification the requester agrees to, separating confirmed15facts from assumptions and unresolved decisions.1617## Inputs1819- Required: the original request and its context.20- Optional: existing code, documents, or constraints the specification must21 respect.22- Output: a specification following the section order below. Copy23 [the spec template](assets/spec-template.md) to start.2425## When to use2627Use this before planning or implementation when the request is ambiguous, spans28several components, has unclear success criteria, or carries security or data29implications. Skip it for a small, well-defined change with an obvious outcome.3031## Workflow32331. Restate the request in your own words and confirm the restatement is correct34 before proceeding.352. Gather context from existing code, documents, and constraints so the36 specification does not contradict what already exists.373. Draft each section in order. Fill what the context supports and mark the rest38 as an open question rather than guessing.394. Ask one focused question at a time, and only when the answer cannot be40 inferred from the context already gathered. Batch trivial confirmations.415. Separate facts, assumptions, and unresolved decisions explicitly. Label every42 assumption so the requester can correct it.436. Write acceptance criteria as observable, checkable outcomes, not intentions.447. Record non-goals to prevent scope creep, and note alternatives considered with45 the reason each was set aside.468. Present the specification for agreement. Resolve open questions or carry them47 forward explicitly before implementation starts.4849## Specification sections5051- Objective: the outcome and why it matters, in one short paragraph.52- Users and use cases: who uses this and the concrete scenarios they perform.53- Requirements: functional and non-functional statements, each testable.54- Non-goals: what is deliberately excluded from this work.55- Existing-system constraints: interfaces, data, and conventions to respect.56- Interfaces and data contracts: inputs, outputs, formats, and schemas.57- Security and privacy: sensitive data, authorization, and trust boundaries.58- Error and edge cases: invalid input, empty state, limits, and failure modes.59- Acceptance criteria: observable conditions that prove the work is complete.60- Open questions: unresolved decisions and who must decide.61- Alternatives considered: options evaluated and why they were not chosen.62- Rollout and rollback: how the change is delivered and how it is reverted.6364## Decision points6566- Context answers a question: record it as a fact and cite the source.67- Context cannot answer and the decision matters: raise it as an open question.68- Context cannot answer but the decision is minor: state a labeled assumption and69 continue.70- Scope keeps growing: move the excess into non-goals or a follow-up.7172## Validation7374Before declaring the specification ready:7576- Every requirement is testable and each has a matching acceptance criterion.77- Non-goals and open questions are explicit.78- Security, privacy, and error handling are addressed or listed as open.79- No section silently guesses a decision the requester must own.8081## Output format8283Return the completed specification, a short list of assumptions made, and the84open questions that still need a decision before implementation.