<companion_skills> These carry guidance this workflow depends on. None of them arrives on its own — load the ones a given run needs with the Skill tool, in the prepare phase, before the step that uses them. Question design and requirement formatting; load it whenever this workflow runs Load before any memory or symbol operation Load when a claim needs verification against an external source Load when a library's current API or version behavior is in question Load when the shared escalation, decision-criteria, or enforcement structures are needed </companion_skills>
<reflection_checkpoint id="investigation_complete" after="investigate"> Answer each check with a concrete artifact. A bare "yes" does not clear the gate. Name the files and existing patterns the requirement will build on. State the scope boundary — what is explicitly out of scope for this requirement. Name any technical blocker found, or state that none was found and what was checked. <on_unmet>Widen the investigation, or ask the user if only they can supply the missing item. Do not write a requirement around an unexamined area.</on_unmet> </reflection_checkpoint>
<execution_graph id="core_execution_graph"> <parallel_group id="investigation" depends_on="none"> explore design database </parallel_group> <sequential_step id="analysis" depends_on="investigation"> general-purpose </sequential_step> </execution_graph>
<best_practices> Always initialize Serena and check memories before starting requirements definition Investigate existing codebase patterns before documenting any requirements Use AskUserQuestion tool with structured options (2-4 choices) for all user interactions Always include a (Recommended) option when presenting choices Score questions using 4-criteria system (design branching, irreversibility, investigation impossibility, effort impact) Delegate investigation tasks to specialized agents in parallel Verify external documentation claims via Context7 and fact-check patterns Classify questions by type (spec confirmation, design choice, constraint, scope, priority) Document all assumptions explicitly when requirements are unclear </best_practices>
<anti_patterns> Modifying or creating code files during requirements definition Keep all operations read-only; this is a requirements-only phase Documenting requirements without investigating existing codebase Always investigate existing patterns and code before defining requirements Using plain text output for questions instead of AskUserQuestion tool Use AskUserQuestion tool with 2-4 structured options for all user interactions Proceeding with assumptions when critical questions are unanswered Block progress until clear answers to critical questions are obtained </anti_patterns>
<error_escalation> Minor ambiguity in non-critical feature detail Unclear requirement or ambiguous scope Technically infeasible request or breaking change Request violates security policy or data integrity </error_escalation>
<related_skills> Core methodology for specification (question scoring, requirement formatting) Evidence gathering for feasibility assessment Check existing patterns and memories via Serena MCP External source verification using Context7 and WebSearch Handoff methodology after requirements are defined </related_skills>
<related_agents> Locate existing requirement patterns and similar feature implementations Evaluate architecture consistency and dependency impact during requirements definition Cross-validate requirements for completeness, consistency, and feasibility </related_agents>
<usage_in_commands> Each command loads this skill with the Skill tool in its prepare phase and then applies the sections below. What a command applies is a decision it makes at run time, not a composition performed for it by markup. All phases (prepare, analyze, investigate, clarify, verify, document, finalize) All agents Core execution graph All delegation requirements All rules and enforcement finalize gate runs immediately after document, since /define produces a single document The full workflow, loaded in the prepare phase and followed phase by phase All agents plus plan agent Core execution graph as base, extended with collect_feedback and regenerate phases All delegation requirements All rules and enforcement, plus feedback-specific behaviors finalize gate is DEFERRED until after the regenerate phase and evaluates the final document's remaining issues; "Resolve now" patches the final document without triggering a second feedback/regenerate cycle (preserves the maximum-one-iteration rule) </usage_in_commands>