|
| 1 | +Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec. |
| 2 | + |
| 3 | +## User Input |
| 4 | + |
| 5 | +```text |
| 6 | +$ARGUMENTS |
| 7 | +``` |
| 8 | + |
| 9 | +You **MUST** consider the user input before proceeding (if not empty). |
| 10 | + |
| 11 | +## Outline |
| 12 | + |
| 13 | +Goal: Detect and reduce ambiguity or missing decision points in the active feature specification and record the clarifications directly in the spec file. |
| 14 | + |
| 15 | +This clarification workflow runs BEFORE `/speckit-plan`. If the user explicitly states they are skipping clarification, warn that downstream rework risk increases. |
| 16 | + |
| 17 | +1. Run the prerequisites script from repo root once: |
| 18 | + ```bash |
| 19 | + bash .specify/scripts/bash/check-prerequisites.sh --json --paths-only |
| 20 | + ``` |
| 21 | + Parse: `FEATURE_DIR`, `FEATURE_SPEC`. If JSON parsing fails, abort and instruct user to re-run `/speckit-specify`. |
| 22 | + |
| 23 | +2. Load the current spec file. Perform a structured ambiguity & coverage scan using this taxonomy (mark each: Clear / Partial / Missing): |
| 24 | + |
| 25 | + - Functional Scope & Behavior (core goals, out-of-scope, user roles) |
| 26 | + - Domain & Data Model (entities, attributes, relationships, lifecycle, scale) |
| 27 | + - Interaction & UX Flow (critical journeys, error/empty/loading states, accessibility) |
| 28 | + - Non-Functional Quality Attributes (performance, scalability, reliability, observability, security, compliance) |
| 29 | + - Integration & External Dependencies (services/APIs, failure modes, formats) |
| 30 | + - Edge Cases & Failure Handling (negative scenarios, rate limiting, conflicts) |
| 31 | + - Constraints & Tradeoffs (technical constraints, rejected alternatives) |
| 32 | + - Terminology & Consistency (canonical terms, avoided synonyms) |
| 33 | + - Completion Signals (acceptance criteria testability, Definition of Done) |
| 34 | + - Misc / Placeholders (TODOs, vague adjectives lacking quantification) |
| 35 | + |
| 36 | +3. Generate a prioritized queue of max 5 clarification questions. Each must be answerable with multiple-choice (2-5 options) or short answer (<=5 words). Only include questions whose answers materially impact architecture, data modeling, task decomposition, test design, UX, operational readiness, or compliance. |
| 37 | + |
| 38 | +4. **Sequential questioning** — present ONE question at a time: |
| 39 | + - For multiple-choice: Present **Recommended** option prominently with reasoning, then all options as a table. User can reply with letter, "yes"/"recommended", or own answer. |
| 40 | + - For short-answer: Present **Suggested** answer with reasoning. User can accept or provide own. |
| 41 | + - Stop when: all critical ambiguities resolved, user signals "done", or 5 questions asked. |
| 42 | + |
| 43 | +5. **After EACH accepted answer**, update the spec: |
| 44 | + - Ensure `## Clarifications` section exists (create after overview if missing) |
| 45 | + - Add `### Session YYYY-MM-DD` subheading |
| 46 | + - Append bullet: `- Q: <question> → A: <answer>` |
| 47 | + - Apply clarification to the appropriate spec section(s) |
| 48 | + - Save the spec file after each integration |
| 49 | + |
| 50 | +6. Validate after each write: no duplicates, no contradictions, no lingering placeholders, consistent terminology. |
| 51 | + |
| 52 | +7. Report completion: questions asked/answered, path to updated spec, sections touched, coverage summary table (Resolved/Deferred/Clear/Outstanding), suggested next command. |
| 53 | + |
| 54 | +If no meaningful ambiguities found, respond: "No critical ambiguities detected" and suggest proceeding to `/speckit-plan`. |
| 55 | + |
| 56 | +Context for prioritization: $ARGUMENTS |
0 commit comments