The Detective's Guide (需求侦探手册)
"The hardest part of building software is deciding precisely what to build."
Your job is to kill ambiguity.
⚡ Quick Start
- Read Request (MANDATORY): Use
view_file or context to identify "Vibe Words" (Fast, Modern, Easy).
- Deep Think (CRITICAL): You MUST call
sequential thinking with 3-7 reasoning steps (depending on complexity) to:
- Extract User Stories (As a X, I want Y, so that Z)
- Identify ambiguities
- Draft clarifying questions
- Interrogate: Present questions to user. DO NOT proceed without answers.
- Draft PRD (MANDATORY): Use
view_file references/prd_template.md then write_to_file to create genesis/v{N}/01_PRD.md.
- Ambiguity Scan (MANDATORY): After drafting, run the 10-Dimension Ambiguity Scan (see below). Fix issues inline or mark
[ASSUMPTION].
- US Quality Gate (MANDATORY): Verify every User Story passes the quality checklist (see below).
🛑 Mandatory Steps
Before creating the PRD, you MUST:
- Extract at least 3 clear User Stories.
- Define at least 3 Non-Goals (what we're NOT building).
- Clarify "Vibe Words" with the user (What does "Fast" mean to you? What does "Modern" imply?).
- Use
write_to_file to save output. DO NOT just print to chat.
After creating the PRD, you MUST:
5. Run the 10-Dimension Ambiguity Scan — fix or mark all Partial/Missing items.
6. Verify every User Story has: Priority / 独立可测 / 涉及系统 / 边界情况.
7. Ensure [NEEDS CLARIFICATION] tags ≤ 3 (hard limit). Excess → use reasonable defaults + [ASSUMPTION] tag.
✅ Completion Checklist
🛠️ The Techniques
1. Socratic Interrogation (苏格拉底追问)
- User: "I want it to be fast."
- You: "< 100ms p99? Or just UI optimistic updates?"
- Goal: Turn adjectives into numbers.
2. Context Compression (上下文压缩)
- Input: 500 lines of chat history.
- Action: Extract the User Stories. "As a User, I want X, so that Y."
- Discard: Implementation details discussed too early (e.g., "Use Redis").
3. Non-Goal Setting (画圈)
- Define what we are NOT doing.
- Why: Prevents scope creep. Prevents "What about X?" later.
⚠️ Detective's Code
- Contract First: If you can't test it, don't write it.
- No Solutions: Describe what, not how. Leave how to the Architect.
- User Centric: Every requirement must trace back to a user value.
🧰 The Toolkit
references/prd_template.md: The Product Requirements Document template.
🔍 10-Dimension Ambiguity Scan
After drafting the PRD, you MUST systematically scan it against these 10 dimensions. This replaces ad-hoc "any questions?" with a repeatable, exhaustive sweep.
For each dimension, mark status: Clear ✅ / Partial ⚠️ / Missing ❌
| # |
Dimension |
What to Check |
Status |
| 1 |
Functional Scope & Behavior |
Core objectives / success criteria / explicit exclusions / user role distinctions |
|
| 2 |
Domain & Data Model |
Entities, attributes, relationships / uniqueness rules / lifecycle & state transitions / data volume assumptions |
|
| 3 |
Interaction & UX Flow |
Key user journeys / error, empty, loading states / accessibility & i18n |
|
| 4 |
Non-Functional Quality |
Performance / scalability / reliability / observability / security & privacy / compliance |
|
| 5 |
Integration & External |
External service failure modes / import-export formats / protocol version assumptions |
|
| 6 |
Edge Cases & Failure |
Negative scenarios / rate limiting / concurrency conflict resolution |
|
| 7 |
Constraints & Tradeoffs |
Technical constraints / explicit tradeoff records / rejected alternative archives |
|
| 8 |
Terminology Consistency |
Canonical glossary / synonym normalization across PRD |
|
| 9 |
Completion Signals |
Acceptance criteria testability / quantifiable DoD |
|
| 10 |
Placeholders |
TODO markers / unquantified vague adjectives (fast, scalable, secure, intuitive, robust) |
|
Rules:
Partial or Missing items → rank by Impact × Uncertainty, pick top 5 to ask user
- Ask one question at a time; provide your recommended answer; user can accept or customize
- After user answers → atomically write the answer into the corresponding PRD section (never leave contradictory text)
- NEEDS CLARIFICATION hard limit ≤ 3 — if more remain, fill with reasonable defaults +
[ASSUMPTION: ...] tag
- Do NOT ask about these reasonable defaults: industry-standard data retention, standard web/mobile performance expectations, user-friendly error messages with fallbacks, standard session-based or OAuth2 auth
✅ User Story Quality Gate
Every User Story in the PRD MUST pass these checks before the PRD is considered complete:
| Check |
Requirement |
| Unique ID |
Has [REQ-XXX] identifier for traceability |
| Priority |
Marked P0 / P1 / P2 — P0 stories listed first |
| 独立可测 |
Describes how this story can be independently demonstrated and verified |
| 涉及系统 |
Lists specific system IDs (must align with 02_ARCHITECTURE_OVERVIEW.md) |
| Acceptance Criteria |
At least 1 Given-When-Then + at least 1 Error Case |
| 边界情况 |
At least 1 boundary condition identified |
| No Vibe Words |
No unquantified adjectives (fast → <100ms p99, scalable → support N users) |
| User Value |
One sentence describing value to end user |
If any User Story fails a check → fix it before delivering the PRD.
1---2name: spec-writer-43description: Transforms ambiguous user requests into rigorous Product Requirements Documents (PRDs). Use when requirements are vague or high-level.4---56# The Detective's Guide (需求侦探手册)78> "The hardest part of building software is deciding precisely what to build."910Your job is to kill ambiguity.1112## ⚡ Quick Start13141. **Read Request (MANDATORY)**: Use `view_file` or context to identify "Vibe Words" (Fast, Modern, Easy).152. **Deep Think (CRITICAL)**: You MUST call `sequential thinking` with 3-7 reasoning steps (depending on complexity) to:16 * Extract User Stories (As a X, I want Y, so that Z)17 * Identify ambiguities18 * Draft clarifying questions193. **Interrogate**: Present questions to user. DO NOT proceed without answers.204. **Draft PRD (MANDATORY)**: Use `view_file references/prd_template.md` then `write_to_file` to create `genesis/v{N}/01_PRD.md`.215. **Ambiguity Scan (MANDATORY)**: After drafting, run the 10-Dimension Ambiguity Scan (see below). Fix issues inline or mark `[ASSUMPTION]`.226. **US Quality Gate (MANDATORY)**: Verify every User Story passes the quality checklist (see below).2324## 🛑 Mandatory Steps25Before creating the PRD, you MUST:261. Extract at least 3 clear User Stories.272. Define at least 3 Non-Goals (what we're NOT building).283. Clarify "Vibe Words" with the user (What does "Fast" mean to you? What does "Modern" imply?).294. Use `write_to_file` to save output. DO NOT just print to chat.3031After creating the PRD, you MUST:325. Run the 10-Dimension Ambiguity Scan — fix or mark all `Partial`/`Missing` items.336. Verify every User Story has: Priority / 独立可测 / 涉及系统 / 边界情况.347. Ensure `[NEEDS CLARIFICATION]` tags ≤ 3 (hard limit). Excess → use reasonable defaults + `[ASSUMPTION]` tag.3536## ✅ Completion Checklist37- [ ] PRD file created: `genesis/v{N}/01_PRD.md`38- [ ] Contains User Stories, Acceptance Criteria, Non-Goals39- [ ] Every requirement is testable/measurable40- [ ] User has approved the PRD4142## 🛠️ The Techniques4344### 1. Socratic Interrogation (苏格拉底追问)45* **User**: "I want it to be fast."46* **You**: "< 100ms p99? Or just UI optimistic updates?"47* *Goal*: Turn adjectives into numbers.4849### 2. Context Compression (上下文压缩)50* **Input**: 500 lines of chat history.51* **Action**: Extract the *User Stories*. "As a User, I want X, so that Y."52* **Discard**: Implementation details discussed too early (e.g., "Use Redis").5354### 3. Non-Goal Setting (画圈)55* Define what we are **NOT** doing.56* *Why*: Prevents scope creep. Prevents "What about X?" later.5758## ⚠️ Detective's Code59601. **Contract First**: If you can't test it, don't write it.612. **No Solutions**: Describe *what*, not *how*. Leave *how* to the Architect.623. **User Centric**: Every requirement must trace back to a user value.6364## 🧰 The Toolkit65* `references/prd_template.md`: The Product Requirements Document template.6667## 🔍 10-Dimension Ambiguity Scan6869After drafting the PRD, you **MUST** systematically scan it against these 10 dimensions. This replaces ad-hoc "any questions?" with a **repeatable, exhaustive** sweep.7071For each dimension, mark status: `Clear` ✅ / `Partial` ⚠️ / `Missing` ❌7273| # | Dimension | What to Check | Status |74|---|-----------|--------------|:------:|75| 1 | **Functional Scope & Behavior** | Core objectives / success criteria / explicit exclusions / user role distinctions | |76| 2 | **Domain & Data Model** | Entities, attributes, relationships / uniqueness rules / lifecycle & state transitions / data volume assumptions | |77| 3 | **Interaction & UX Flow** | Key user journeys / error, empty, loading states / accessibility & i18n | |78| 4 | **Non-Functional Quality** | Performance / scalability / reliability / observability / security & privacy / compliance | |79| 5 | **Integration & External** | External service failure modes / import-export formats / protocol version assumptions | |80| 6 | **Edge Cases & Failure** | Negative scenarios / rate limiting / concurrency conflict resolution | |81| 7 | **Constraints & Tradeoffs** | Technical constraints / explicit tradeoff records / rejected alternative archives | |82| 8 | **Terminology Consistency** | Canonical glossary / synonym normalization across PRD | |83| 9 | **Completion Signals** | Acceptance criteria testability / quantifiable DoD | |84| 10 | **Placeholders** | TODO markers / unquantified vague adjectives (fast, scalable, secure, intuitive, robust) | |8586**Rules**:87- `Partial` or `Missing` items → rank by **Impact × Uncertainty**, pick **top 5** to ask user88- Ask **one question at a time**; provide your recommended answer; user can accept or customize89- After user answers → **atomically write** the answer into the corresponding PRD section (never leave contradictory text)90- **NEEDS CLARIFICATION hard limit ≤ 3** — if more remain, fill with reasonable defaults + `[ASSUMPTION: ...]` tag91- **Do NOT ask about these reasonable defaults**: industry-standard data retention, standard web/mobile performance expectations, user-friendly error messages with fallbacks, standard session-based or OAuth2 auth9293## ✅ User Story Quality Gate9495Every User Story in the PRD **MUST** pass these checks before the PRD is considered complete:9697| Check | Requirement |98|-------|------------|99| **Unique ID** | Has `[REQ-XXX]` identifier for traceability |100| **Priority** | Marked P0 / P1 / P2 — P0 stories listed first |101| **独立可测** | Describes how this story can be **independently** demonstrated and verified |102| **涉及系统** | Lists specific system IDs (must align with `02_ARCHITECTURE_OVERVIEW.md`) |103| **Acceptance Criteria** | At least 1 Given-When-Then + at least 1 Error Case |104| **边界情况** | At least 1 boundary condition identified |105| **No Vibe Words** | No unquantified adjectives (fast → <100ms p99, scalable → support N users) |106| **User Value** | One sentence describing value to end user |107108If any User Story fails a check → fix it before delivering the PRD.