--- description: >- You MUST use this skill before writing any design or code when the requirement is vague, ambiguous, or too broad. Use when the "what" is unclear — the requirement needs scoping, feasibility assessment, or decomposition before anyone touches code. Stronger signals: "unclear requirements", "break this down", "is this feasible", "help me design", "what do we need to build", vague one-sentence feature requests, open-ended asks like "build me X". Skip this skill and go directly to sextant:add-feature only when the requirement is already concrete, scoped, and unambiguous. --- !../principles/SKILL_BODY.md !../tool-gitnexus/SKILL_BODY.md --- # Requirements Analysis and Refinement Workflow ## Core Principle Requirements are the source of code — when the source is vague, downstream must be chaotic. The goal of requirements refinement is not to produce perfect documentation, but to **eliminate ambiguity, discover contradictions, and complete boundary conditions before writing code**, so that "need to come back and ask" during development approaches zero. --- ## When to Trigger This Workflow > **Guard:** Enter this workflow when 🔴 red ambiguities exist (gaps that would invalidate or fundamentally redirect implementation), **or** when the user explicitly requests requirements decomposition or feasibility assessment ("break this down", "is this feasible", "help me plan"). If the requirement is clear and no decomposition is requested, skip directly to `sextant:add-feature`. | Trigger Signal | Description | |---------------|-------------| | Feature requirement has 🔴 red ambiguities (undefined scope, conflicting behavior, unclear ownership) | "Support multiple formats" — which formats? async or sync? who calls this? | | Requirement description has obvious undefined behavior or missing error paths | Success case described but failure case absent | | User asks to evaluate feasibility before committing to implementation | "Can this be done? How complex is it?" | | User asks to break down a vague idea into actionable tasks | "Help me break down this requirement" | | Requirement gaps discovered mid-development that block progress | "This scenario wasn't considered before" | --- ## Complete Execution Workflow ### Step 1: Parse the Original Requirement Translate the user's natural language requirement into a structured description. ``` ─── Requirement Elements Checklist ────────────────── Target user: Core action: Expected result: Trigger condition: Success criteria: ───────────────────────────────────────────────────── ``` **If the user's description is only one sentence, first complete the above five elements before continuing.** **Example:** > User says: "Add an export feature to the system" After parsing: ``` Target user: System admin? Regular user? All roles? (→ needs confirmation) Core action: Export what data? Complete or filtered? Expected result: What format? CSV? Excel? PDF? (→ needs confirmation) Trigger condition: Which page to trigger from? Success criteria: Which fields? Performance requirements for large data volumes? ``` ### Step 2: Identify Ambiguities and Gaps **Eight common requirement gap types:** | Gap Type | Typical Manifestation | Follow-up Direction | |----------|----------------------|---------------------| | **Scope undefined** | "Support multiple formats" | Which specific formats? Priority? How many in the first version? | | **Boundary undefined** | "Support batch operations" | What's the batch limit? What happens when exceeded? | | **Error path missing** | Only success scenario described | What happens when the operation fails? What does the user see? | | **Permissions unclear** | "Users can export" | All users? Or specific roles? | | **Performance unconstrained** | "Support large data volumes" | How large? Response time requirements? Async needed? | | **Data source unclear** | "Display user information" | Where does the info come from? Real-time or cached? Which fields? | | **Interaction details missing** | "Add search feature" | Instant or click-to-search? Fuzzy or exact match? | | **Backward compatibility not considered** | "Rework old interface" | Can old clients continue to work? Is a transition period needed? | ``` ─── Requirement Gap List ──────────────────────────── 🔴 Must clarify (gap affects architecture/technical solution choices): 1. 🟡 Recommended clarification (gap doesn't affect main flow, but affects boundary behavior): 1. 🟢 Reasonable default available (can proceed with default; low adjustment cost): 1. ───────────────────────────────────────────────────── ``` **Don't throw 20 questions at once.** By priority, resolve 🔴 issues first. 🟡 and 🟢 issues can come with default assumptions for the user to confirm or correct. ### Step 3: Evaluate Feasibility Against Existing Architecture **Questions to answer:** - Does the existing architecture already have **similar functionality**? Can it be reused? - Which **modules need to be modified**? How large is the impact scope? - Are **new data structures** needed (database tables, DTOs, config items)? - Does it involve **public interface changes**? Backward compatibility requirements? - Are there **technical constraints** (performance bottlenecks, third-party API limitations)? 🔗 When GitNexus is available, use `query` / `context` / `impact` MCP tools for architecture feasibility assessment. ``` ─── Architecture Feasibility Assessment ───────────── Feasibility conclusion: ✅ Can implement directly / ⚠️ Implementable but with risks / ❌ Requires architecture adjustment Existing similar functionality: Yes (, can reuse/extend) / No (need to build new) Modules involved: Impact scope: Technical risks: Recommended implementation path: Prerequisites (must complete before starting development): - ───────────────────────────────────────────────────── ``` ### Step 4: Break Down into Executable Tasks **Decomposition principles:** - **Each task has a clear completion standard** — not "build the export feature," but "implement CSV export including XX fields" - **Each task can be independently verified** — can be tested alone after completion - **Tasks sorted by dependency order** — data layer before logic layer, logic layer before entry layer - **Appropriate task granularity** — too large can't track progress; too small creates management overhead ``` ─── Decomposition Strategy (choose by requirement type) ─ By layer (for new features): Task 1: Data layer — create tables/Models/Repositories Task 2: Logic layer — implement Services/Handlers Task 3: Entry layer — expose API/UI Task 4: Tests — unit tests + integration tests By scenario (for multi-scenario features): Task 1: Core scenario (MVP) Task 2: Scenario A extension Task 3: Error handling By risk (for high-uncertainty requirements): Task 1: Technical validation (Spike) Task 2: Minimum viable version (MVP) Task 3: Completion — boundaries, error handling, performance ───────────────────────────────────────────────────── ``` ``` ─── Task Breakdown List ───────────────────────────── Requirement: Task 1: Description: Completion standard: Dependencies: None / Depends on Task N Estimated files involved: ───────────────────────────────────────────────────── ``` ### Step 5: Form Requirements Confirmation Document ``` Requirements Confirmation Document ═════════════════════════════════════════════════════ Requirement overview: [Feature Description] Target user: Core flow: Success criteria: [Boundaries and Constraints] Data scope: Performance requirements: Permission control: Backward compatibility: [Error Handling] Scenario 1: [Technical Solution Summary] Implementation path: Modules involved: Key decisions: [Task Breakdown] [Items Pending Confirmation] ═════════════════════════════════════════════════════ ``` **The confirmation document must receive explicit user confirmation before entering the development workflow.** > For a complete sprint plan with dependency-ordered tasks, skill assignments, and impact radius scores, link `sextant:plan` after the confirmation document is signed off. --- ## Handling Requirement Changes ``` ─── Requirement Change Assessment ─────────────────── Change content: Change reason: Impact analysis: Completed work that needs to be reworked: Not-yet-started work that needs to be adjusted: Newly added work: Cost assessment: Rework cost: Delay risk: Recommended options: A. Execute the change, accept B. Defer to next version C. Compromise: ───────────────────────────────────────────────────── ``` --- ## Forbidden Actions - **Accept vague requirements unconditionally**: User says "build an XX" and you directly start writing code - **Make business decisions for the user**: Technical solutions are yours to suggest; business boundaries are for the user to decide - **Over-gilding requirements**: User only wants basic functionality but you've designed a complete platform — follow YAGNI - **Ignore error paths**: Only refine the happy path; avoid discussing "what if it fails" - **One-time perfect requirements**: Trying to resolve all ambiguity in one conversation — confirm by priority in batches --- ## Reply Format End every requirements-refinement response with this block (omit a field only if it genuinely has nothing to report): Requirements Summary: | # | Item | Detail | |---|------|--------| | [1] | Conclusion | | | [2] | Deliverables | | | [3] | Risks / Assumptions | <🟡 gaps with default assumptions adopted; unverified technical constraints> | | [4] | Verification | | | [5] | Needs your input | <🔴 gaps still pending answer; 🟡 default assumptions awaiting acceptance> |