Refining Requirements
Turn unclear or vague requests into precise, codebase-grounded, testable thin-slice technical requirements.
The output is a requirements document, not an implementation plan. However, requirements must be concrete enough that
an implementor can derive an implementation plan from them without guessing. Weak assumptions and underestimated risks are
unacceptable—call them out or resolve them.
What belongs in requirements vs. implementation plan
| Requirements (this skill) |
Implementation plan (separate step) |
| What the system must do and why |
How to build it (file changes, task order) |
| References to existing types, interfaces, method signatures |
Actual code diffs and new file scaffolds |
| Pseudo-code or data-flow sketches clarifying behavior |
Step-by-step implementation instructions |
| Constraints, invariants, edge cases |
Detailed test plans with exact assertions |
| Acceptance criteria (black-box, testable) |
CI commands, deployment steps |
Workflow
1 Parse the user intent
Extract:
- Primary user goal (what "success" looks like)
- Inputs/outputs
- Ambiguous terms and implied constraints
- Hidden subproblems or coupled concerns
2 Decide whether this is one task or multiple tasks
Assess if the request mixes multiple high-level concepts. If yes, split into units:
- Independent units: can be implemented and verified separately (prefer this split)
- Sequential units: require an earlier prerequisite slice
Outcome of this step MUST be:
- A named list of units
- A recommended ordering
- A chosen thin slice initial requirements: the smallest useful unit that is testable end-to-end
Rules:
- Prefer the smallest slice that provides user-visible or measurable value.
- Do not "boil the ocean".
- Anything not required for the initial requirements goes to the "Next (Deferred)" section.
3 Challenge and validate the initial requirements
- Are the initial requirements solving the right problem, for the right user?
- Are terms unambiguous (add glossary if needed)?
- Are there contradictions or missing states (edge cases, error states)?
- Is the request actually a prerequisite problem (e.g., missing abstraction, missing data model)?
- Are constraints real or assumed? Flag weak assumptions explicitly.
4 Ground in codebase reality
- Identify the existing types, interfaces, and modules that the feature touches.
- Reference concrete method signatures and data structures—not vague module names.
- Note architectural constraints (layer boundaries, dependency direction) that shape what is achievable.
- Surface risks: missing abstractions, type gaps, invariants that may break.
5 Ask targeted questions (only those that unblock the initial requirements)
Use AskUserQuestion tool to ask the smallest set of questions that materially affects:
- behavior, scope boundaries, acceptance criteria, or feasibility
Do NOT ask questions that only affect deferred scope; put those in the "Next (Deferred)" section as "Open questions".
6 Synthesize artifact
Produce one artifact:
docs/dev-specs/{Y-m-d-requirements-name}.md — containing the technical requirements and optional deferred scope.
This document serves as the input for a future implementation plan.
Principles
- Thin-slice first: define the smallest end-to-end unit that can be tested unambiguously.
- Separate "now" vs "later": requirements must not be polluted with follow-ups or nice-to-haves.
- Be blunt: explicitly state what is unclear or inconsistent.
- Assume nothing: if a term has multiple interpretations, define it or ask.
- One default path: present alternatives only when requirements truly differ.
- Grounded, not vague: every requirement must be traceable to existing code constructs or clearly mark what is new.
Do not leave the implementor guessing which module, type, or interface is involved.
- No weak assumptions: if something "should probably work", verify it or flag it as a risk. Underestimated risks
poison downstream plans.
- Focus: Keep the conversation and artifacts anchored to the chosen initial requirements. Do not expand scope or
switch to adjacent concepts unless they are required to clarify, make feasible, or verify the initial requirements.
Capture tangents as deferred items in the "Next (Deferred)" section and return to the initial requirements.
Output Template
{Y-m-d-requirements-name}.md
# [Feature Name]
## Requirements
### Problem Statement
- ...
### Glossary
- ...
### Expected Behavior
Describe behavior as observable outcomes.
- Primary flow:
- Alternate flows:
- Error/invalid states:
### Scope
...
#### Includes
- ...
### Integration Points & Constraints
Relevant types and interfaces, affected modules and their boundaries, architectural constraints, a brief data-flow sketch or
pseudo-code if it clarifies behavior, and any risks or unknowns.
- ...
### Acceptance Criteria
Write as testable conditions (black-box where possible).
- AC1: ...
- AC2: ...
#### Excludes (deferred) `optional`
- ...
### Open Questions
- Q1: ...
- Q2: ...
IMPORTANT ensure that the artifact you produced is present in the correct directory. No need to display it in the
output.
Operating Constraints
- No empty sections. Include only sections with content. Omit a heading, list, or subsection entirely when it
would contain zero items — do not include empty lists, placeholder subsections, or negative statements like
"none", "N/A", or "no open questions".
1---2name: refining-requirements3description: Transforms vague feature ideas into precise, codebase-grounded technical requirements. Use when requirements are ambiguous/incomplete, the user struggles to describe behavior, terminology is unclear, or multiple concepts are mixed. Output is a requirements spec—NOT an implementation plan. Reports omit empty sections — no placeholder headings, empty tables, or negative statements like "no issues found".4---56# Refining Requirements78Turn unclear or vague requests into precise, codebase-grounded, testable _thin-slice_ **technical requirements**.910The output is a **requirements document**, not an implementation plan. However, requirements must be concrete enough that11an implementor can derive an implementation plan from them without guessing. Weak assumptions and underestimated risks are12unacceptable—call them out or resolve them.1314## What belongs in requirements vs. implementation plan1516| Requirements (this skill) | Implementation plan (separate step) |17| ----------------------------------------------------------- | ---------------------------------------------- |18| _What_ the system must do and _why_ | _How_ to build it (file changes, task order) |19| References to existing types, interfaces, method signatures | Actual code diffs and new file scaffolds |20| Pseudo-code or data-flow sketches clarifying behavior | Step-by-step implementation instructions |21| Constraints, invariants, edge cases | Detailed test plans with exact assertions |22| Acceptance criteria (black-box, testable) | CI commands, deployment steps |2324## Workflow2526### 1 Parse the user intent2728Extract:2930- Primary user goal (what "success" looks like)31- Inputs/outputs32- Ambiguous terms and implied constraints33- Hidden subproblems or coupled concerns3435### 2 Decide whether this is one task or multiple tasks3637Assess if the request mixes multiple high-level concepts. If yes, split into units:3839- **Independent units**: can be implemented and verified separately (prefer this split)40- **Sequential units**: require an earlier prerequisite slice4142Outcome of this step MUST be:4344- A named list of units45- A recommended ordering46- A chosen **thin slice** initial requirements: the _smallest useful_ unit that is testable end-to-end4748Rules:4950- Prefer the smallest slice that provides user-visible or measurable value.51- Do not "boil the ocean".52- Anything not required for the initial requirements goes to the "Next (Deferred)" section.5354### 3 Challenge and validate the initial requirements5556- Are the initial requirements solving the right problem, for the right user?57- Are terms unambiguous (add glossary if needed)?58- Are there contradictions or missing states (edge cases, error states)?59- Is the request actually a prerequisite problem (e.g., missing abstraction, missing data model)?60- Are constraints real or assumed? Flag weak assumptions explicitly.6162### 4 Ground in codebase reality6364- Identify the existing types, interfaces, and modules that the feature touches.65- Reference concrete method signatures and data structures—not vague module names.66- Note architectural constraints (layer boundaries, dependency direction) that shape what is achievable.67- Surface risks: missing abstractions, type gaps, invariants that may break.6869### 5 Ask targeted questions (only those that unblock the initial requirements)7071Use AskUserQuestion tool to ask the smallest set of questions that materially affects:7273- behavior, scope boundaries, acceptance criteria, or feasibility7475Do NOT ask questions that only affect deferred scope; put those in the "Next (Deferred)" section as "Open questions".7677### 6 Synthesize artifact7879Produce one artifact:80811. `docs/dev-specs/{Y-m-d-requirements-name}.md` — containing the technical requirements and optional deferred scope.82 This document serves as the **input** for a future implementation plan.8384## Principles8586- **Thin-slice first**: define the smallest end-to-end unit that can be tested unambiguously.87- **Separate "now" vs "later"**: requirements must not be polluted with follow-ups or nice-to-haves.88- **Be blunt**: explicitly state what is unclear or inconsistent.89- **Assume nothing**: if a term has multiple interpretations, define it or ask.90- **One default path**: present alternatives only when requirements truly differ.91- **Grounded, not vague**: every requirement must be traceable to existing code constructs or clearly mark what is new.92 Do not leave the implementor guessing which module, type, or interface is involved.93- **No weak assumptions**: if something "should probably work", verify it or flag it as a risk. Underestimated risks94 poison downstream plans.95- **Focus**: Keep the conversation and artifacts anchored to the chosen initial requirements. Do not expand scope or96 switch to adjacent concepts unless they are required to clarify, make feasible, or verify the initial requirements.97 Capture tangents as deferred items in the "Next (Deferred)" section and return to the initial requirements.9899## Output Template100101### {Y-m-d-requirements-name}.md102103```md104# [Feature Name]105106## Requirements107108### Problem Statement109110- ...111112### Glossary113114- ...115116### Expected Behavior117118Describe behavior as observable outcomes.119120- Primary flow:121- Alternate flows:122- Error/invalid states:123124### Scope125126...127128#### Includes129130- ...131132### Integration Points & Constraints133134Relevant types and interfaces, affected modules and their boundaries, architectural constraints, a brief data-flow sketch or 135pseudo-code if it clarifies behavior, and any risks or unknowns.136137- ...138139### Acceptance Criteria140141Write as testable conditions (black-box where possible).142143- AC1: ...144- AC2: ...145146#### Excludes (deferred) `optional`147148- ...149150### Open Questions151152- Q1: ...153- Q2: ...154```155156**IMPORTANT** ensure that the artifact you produced is present in the correct directory. No need to display it in the157output.158159## Operating Constraints160161- **No empty sections.** Include only sections with content. Omit a heading, list, or subsection entirely when it162 would contain zero items — do not include empty lists, placeholder subsections, or negative statements like163 "none", "N/A", or "no open questions".