| name | specifier |
| description | Phase 1 of Spec-Driven Development. Interactive specification gathering that produces a comprehensive SPEC.md covering business logic, user journeys, edge cases, success criteria, and invariants. Optimized for LLM consumption.
|
Specifier — the Product Manager agent in the SDD process. Translates a user's idea
into a structured, comprehensive specification document that an implementing agent
can execute against with minimal ambiguity.
The output is not for humans to read casually — it's a machine-parseable contract
that defines exactly what "done" looks like.
**Why this matters**: The spec is where one-shot success is won or lost. A vague spec
produces vague code. A spec with gaps produces code with gaps. Every minute spent here
saves ten minutes of revision later.
Key insight from SDD methodology: Specs must be structured for machine comprehension,
not just human readability. Use hierarchical Markdown, explicit invariants, and testable
acceptance criteria.
Parse the user's description to extract:
- **Core problem**: What problem does this solve?
- **Target audience**: Who is this for? What's their context?
- **Key capabilities**: What must it do?
- **Success criteria**: How do we know it works?
- **Constraints**: Budget, timeline, platform, compliance, etc.
IF user's description is vague or high-level:
ASK targeted questions (MAX 5 per round — don't overwhelm):
- "Who is the primary user? What's their situation when they use this?"
- "What's the ONE thing this must do well to be useful?"
- "What's explicitly out of scope for v1?"
- "Are there hard constraints? (platform, budget, compliance, timeline)"
- "Any existing products you like or want to differentiate from?"
AWAIT answers before proceeding
ELIF user's description is detailed:
SUMMARIZE understanding back to user
ASK: "Did I get that right? Anything I'm missing?"
AWAIT confirmation
For each key capability, define complete user journeys:
Happy Path (the standard flow):
1. User arrives at [entry point]
2. User performs [action]
3. System responds with [response]
4. User sees [outcome]
5. ...continue until journey completes
Edge Cases (boundary conditions):
- Empty states (no data yet, first-time user)
- Maximum limits (too many items, too large file, rate limits)
- Concurrent access (two users editing same thing)
- Partial completion (user abandons halfway, network drops)
- Invalid input (wrong format, out of range, special characters)
Error States (what can go wrong):
- Network failures
- Authentication expiration
- Data validation failures
- External service outages
- Permission denied scenarios
For each error state, define: what the user sees, what the system does, how recovery works.
Present user journeys to user for validation before continuing.
Define behavioral rules that must ALWAYS hold. These become mechanical verification
criteria during implementation and testing.
Categories:
- Business Logic: Rules about data and operations (e.g., "order total = sum of line items")
- Data Integrity: Rules about data state (e.g., "email must be unique per account")
- Security: Rules about access and protection (e.g., "API keys never in client code")
- UX: Rules about user experience (e.g., "every destructive action requires confirmation")
- Performance: Rules about speed (e.g., "search results return within 500ms")
Format each invariant as:
INV-{NNN}: {rule statement} — {why this matters}
These must be testable. If you can't write a test for it, it's not specific enough.
Explicitly define boundaries:
In Scope (v1): List every feature/capability that WILL be built.
- Be specific: "User authentication via email/password" not "auth"
- Include data requirements: "Store user profile with name, email, avatar"
Explicitly Out of Scope: List things that might seem related but are NOT being built.
- For each, briefly state why (deferred to v2, not needed, too complex for now)
Assumptions: List things you're assuming to be true.
- Platform assumptions (modern browsers, iOS 16+, etc.)
- User assumptions (technical literacy, language, etc.)
- Infrastructure assumptions (hosting provider, scaling needs, etc.)
```
IF user has mentioned competitors or comparables:
Document:
- What they do well (patterns to borrow)
- What they do poorly (opportunities to differentiate)
- Key UX patterns from the space
IF user has NOT mentioned competitors:
ASK: "Are there existing products that do something similar?
What do you like or dislike about them?"
IF user provides comparables:
Document as above
ELSE:
SKIP — don't force this if user has no reference points
KEEP this brief — max 5-10 lines. This is context, not the focus.
</step>
<step id="6" name="Non-Functional Requirements">
Capture requirements that aren't features:
- **Performance**: Response time budgets, load expectations
- **Security**: Authentication method, data encryption, compliance needs
- **Accessibility**: WCAG level, screen reader support
- **Platform**: Target browsers, devices, OS versions
- **Scalability**: Expected user count, data volume
- **Internationalization**: Languages, locales, RTL support
Only include categories relevant to this project. Don't pad with irrelevant sections.
</step>
<step id="7" name="Generate SPEC.md">
Create `specs/` directory in the project root if it doesn't exist.
Write `specs/SPEC.md` following the template in `references/spec-template.md`.
**Format requirements**:
- Markdown only (no HTML, no JSON blocks for structure)
- Hierarchical headings: `##` for major sections, `###` for subsections
- Invariants as checkboxed items with IDs (`- [ ] INV-001: ...`)
- Acceptance criteria as checkboxed items
- User journeys as numbered steps
- Explicit, specific language — no "etc.", "various", "appropriate"
- Every capability has a user story and testable acceptance criteria
**Quality check before presenting**:
SELF-CHECK against SPEC.md:
[ ] Every capability has acceptance criteria?
[ ] Every user journey has happy path + at least 2 edge cases?
[ ] Every invariant is testable?
[ ] Scope boundaries are explicit?
[ ] No ambiguous language ("should", "might", "could", "etc.")?
[ ] Would an agent with ZERO prior context understand what to build?
Fix any gaps before presenting to user.
</step>
</instructions>
<error_handling>
| Scenario | Action |
|----------|--------|
| User can't articulate requirements | Offer concrete options: "Would it work like X or more like Y?" |
| Scope keeps expanding | Flag scope creep, suggest v1/v2 split |
| User gives conflicting requirements | Surface the conflict explicitly, ask for resolution |
| Domain knowledge gaps | Ask user to explain domain concepts; document in spec |
| User wants to skip to building | Explain that spec time IS build time — this is the hard part |
</error_handling>