| name | Define Core |
| description | Shared workflow phases and patterns for requirements definition commands. Use this skill when implementing /define or /define-full commands to ensure consistent workflow structure, agent delegation, and requirements documentation patterns. |
| version | 2.0.0 |
Provide shared workflow phases, agent definitions, and patterns that are common to all requirements definition commands (define, define-full). This skill eliminates duplication and ensures consistency across requirements definition workflows.
core-patterns
requirements-definition
fact-check
serena-usage
context7-usage
Read requirements, related prompts, and existing specifications
Search for requirement patterns and terminology consistency
Initialize Serena and check existing patterns
Activate Serena project with activate_project
Serena activate_project
Project activated
Check list_memories for relevant patterns
Serena list_memories
Available memory list
Load applicable memories with read_memory
Serena read_memory
Relevant patterns loaded
Understand the user's request and identify technical constraints
Parse user request to extract core requirements
Text analysis
Initial requirements list
Identify technical constraints from request context
Codebase knowledge
Constraint list
Determine design decisions requiring user input
Requirements analysis
Question candidates list
Assess technical feasibility at high level
Technical knowledge
Initial feasibility assessment
Gather evidence from codebase and analyze architecture impact
Delegate to explore agent: find relevant files and existing patterns
Sub-agent delegation
File paths, patterns, code samples
Delegate to design agent: evaluate architecture consistency and dependencies
Sub-agent delegation
Architecture analysis, dependency graph
Delegate to database agent: analyze database design (if applicable)
Sub-agent delegation
Schema analysis, query patterns
Delegate to general-purpose agent: analyze requirements and estimate effort
Sub-agent delegation
Effort estimation, risk analysis
Use fact-check skill patterns: verify external documentation and standard references via Context7
Context7 MCP, WebSearch
Verification report, flagged claims
<reflection_checkpoint id="investigation_complete" after="investigate">
Have all relevant files and patterns been identified?
Is the scope clearly understood?
Are there any technical blockers identified?
<below_threshold>Expand investigation scope or ask user</below_threshold>
</reflection_checkpoint>
Resolve ambiguities through structured user interaction
Score questions by: design branching, irreversibility, investigation impossibility, effort impact (1-5 each)
Question scoring algorithm
Prioritized question list
Classify questions: spec confirmation, design choice, constraint, scope, priority
Question taxonomy
Categorized questions
Use AskUserQuestion tool for all user interactions (2-4 structured options per question)
AskUserQuestion
User responses
For follow-up clarifications, continue using AskUserQuestion tool rather than plain text
AskUserQuestion
Additional user responses
Present high-score questions first; do not proceed without clear answers
Priority ordering
Confirmed requirements
Validate user decisions against technical evidence
Verify constraints from answers using agent findings
Cross-reference analysis
Validated constraints
Check implementations related to chosen approach
Code analysis
Implementation validation
Create comprehensive requirements documentation and task breakdown
Create comprehensive requirements document
Requirements template
Complete requirements specification
Break down tasks for /execute handoff
Task decomposition
Phased task list with dependencies
Gate on unresolved Outstanding Issues before terminating; let the user choose how to dispose of them rather than silently documenting and ending
Evaluate the Outstanding Issues section of the FINAL requirements document. For commands that produce a single document (/define), this is the document from the document phase. SUPPRESSION RULE: when this workflow is inherited as a NON-terminal phase (e.g. /define-full declares it as the `core_workflow` phase that precedes collect_feedback/regenerate), this finalize phase MUST NOT fire at the end of that inherited phase; it is suppressed there and re-invoked EXACTLY ONCE by the consuming command's own terminal step (e.g. /define-full's DEFF-B007 after the regenerate phase), evaluating that command's final document.
Document inspection
Outstanding Issues count (0 means the section reads "none")
If the count is 0 ("none"), skip the gate entirely and finish normally — do not prompt. If the count is >= 1 (any non-empty Outstanding Issues), invoke the disposition gate in step 3.
Conditional branch
Gate fired or skipped
Invoke AskUserQuestion with exactly three options for how to dispose of the remaining Outstanding Issues:
"Resolve now (Recommended)" — re-enter the clarify phase, ask the outstanding questions via AskUserQuestion, and patch the requirements document with the answers;
"Defer to /execute" — keep the issues documented as-is and carry them explicitly into the execute_handoff so the downstream implementer inherits them;
"Stop & revise scope" — halt without finalizing the /execute handoff; leave the already-produced (read-only) document visible so the user can revise their request.
AskUserQuestion
User-selected disposition
Act on the selected disposition. For "Resolve now", apply the answers, then re-evaluate the Outstanding Issues section. This resolution loop is BOUNDED: re-present the gate at most once more, after which only "Defer to /execute" and "Stop & revise scope" remain. Never loop unbounded. The clarify-phase "block until answered" rule (DC-P002) is SATISFIED, not bypassed, by offering Defer/Stop on the bounded re-check — choosing a disposition IS a valid resolution of an issue that cannot be answered.
Bounded resolution loop
Updated document, deferred handoff, or terminal stop
Architecture consistency, dependency analysis, API design
Database design and optimization
Requirements analysis, estimation, dependency analysis
Finding relevant files and existing patterns
Cross-validation and consensus verification
<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>
Scope overview
Target file paths
Explicit edit prohibition
Sub-agents must use AskUserQuestion tool for any user interactions
One-sentence request, background, expected outcomes
Existing system, tech stack
FR-001 format (mandatory/optional)
Performance, security, maintainability
Design policies, impact scope, decisions
0-100
0-100
Unit, integration, acceptance criteria
Unresolved questions; "none" must be explicitly stated when there are none (the finalize gate's skip-branch keys off this "none" sentinel)
Task dependencies visualization
Files, overview, dependencies per phase
Decisions, references, constraints
<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>
Never modify, create, or delete files
Never implement code; requirements definition only
Clearly identify technically impossible requests
Prioritize technical validity over user preferences
Technical evidence over speculation
Use requirements-definition skill for methodology
Delegate investigations to sub-agents
Ask questions without limit until requirements are clear
Investigate and question before concluding
Always include a (Recommended) option when presenting choices via AskUserQuestion
When the final requirements document has non-empty Outstanding Issues, do not silently end — run the finalize gate (core_finalize) so the user chooses to resolve, defer, or stop
Before requirements documentation
Investigate existing codebase patterns
Codebase analysis in output
For design decisions
Use AskUserQuestion tool with structured options
User responses recorded
After the final requirements document is produced, when its Outstanding Issues section is non-empty (>= 1 item, not "none")
Run the finalize gate (core_finalize): invoke AskUserQuestion offering "Resolve now (Recommended)" / "Defer to /execute" / "Stop & revise scope", then act on the choice. Bounded to at most one additional resolution pass.
Disposition gate recorded in output whenever Outstanding Issues >= 1; gate skipped when "none"
Always
Modifying or creating code files
Block operation, this is read-only command
Always
Proceeding without answering critical questions
Block operation, require clarification first
<error_escalation inherits="core-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>
Keep all operations read-only
Delegate detailed investigation to sub-agents
Use AskUserQuestion tool for structured user interactions
Present questions before making assumptions
Implementing or modifying code
Justifying user requests over technical validity
Proceeding without clear answers to critical questions
Using plain text output for questions instead of AskUserQuestion tool
<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>
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
Full workflow via <phase name="core_workflow" inherits="define-core#workflow" />
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>