8.8 KiB
description, argument-hint
| description | argument-hint |
|---|---|
| Plan the feature development based on the feature specification. | Plan specifics suggestions |
Plan Feature Development
Guided feature development with codebase understanding and architecture focus.
You are helping a developer implement a new feature based on SDD: Specification Driven Development. Follow a systematic approach: understand the codebase deeply, identify and ask about all underspecified details, design elegant architectures.
User Input
$ARGUMENTS
You MUST consider the user input before proceeding (if not empty).
Core Principles
- Ask clarifying questions: Identify all ambiguities, edge cases, and underspecified behaviors. Ask specific, concrete questions rather than making assumptions. Wait for user answers before proceeding with implementation. Ask questions early (after understanding the codebase, before designing architecture).
- Understand before acting: Read and comprehend existing code patterns first
- Read files identified by agents: When launching agents, ask them to return lists of the most important files to read. After agents complete, read those files to build detailed context before proceeding.
- Simple and elegant: Prioritize readable, maintainable, architecturally sound code
- Use TodoWrite: Track all progress throughout
Outline
-
Setup: Get the current git branch, if it written in format
feature/<number-padded-to-3-digits>-<kebab-case-title>, part afterfeature/is defined as FEATURE_NAME. Consuquently, FEATURE_DIR is defined asspecs/FEATURE_NAME, FEATURE_SPEC is defined asspecs/FEATURE_NAME/spec.md, IMPL_PLAN is defined asspecs/FEATURE_NAME/plan.md, SPECS_DIR is defined asspecs/. -
Load context: Read FEATURE_SPEC and
specs/constitution.md. -
Copy
specs/templates/plan-template.mdtoFEATURE_DIR/plan.mdusingcpcommand, in future refered asPLAN_FILE. -
Continue with stage 2
Stage 2: Research & Codebase Exploration
Goal: Understand relevant existing code and patterns at both high and low levels. Research unknown areas, libraries, frameworks, and missing dependencies.
Follow the structure in {PLAN_FILE} template to:
- Fill Technical Context (mark unknowns as "NEEDS CLARIFICATION")
- Fill Constitution Check section from constitution
- Evaluate gates (ERROR if violations unjustified)
Actions
Technical Context:
-
Extract unknowns from Technical Context above:
- For each NEEDS CLARIFICATION → research task
- For each dependency → best practices task
- For each integration → patterns task
-
Launch
researcheragent to perform created tasks:For each unknown in Technical Context: Task: "Research {unknown} for {feature context}" For each technology choice: Task: "Find best practices for {tech} in {domain}" -
Consolidate findings in
research.mdusing format:- Decision: [what was chosen]
- Rationale: [why chosen]
- Alternatives considered: [what else evaluated]
Codebase Exploration:
-
For code explaration launch 2-3
code-exploreragents in parallel. Each agent should:- Trace through the code comprehensively and focus on getting a comprehensive understanding of abstractions, architecture and flow of control
- Target a different aspect of the codebase (eg. similar features, high level understanding, architectural understanding, user experience, etc)
- Include a list of 5-10 key files to read
Example agent prompts:
- "Find features similar to [feature] and trace through their implementation comprehensively"
- "Map the architecture and abstractions for [feature area], tracing through the code comprehensively"
- "Analyze the current implementation of [existing feature/area], tracing through the code comprehensively"
- "Identify UI patterns, testing approaches, or extension points relevant to [feature]"
-
Once the agents return, please read all files identified by agents to build deep understanding
-
Update research report in
FEATURE_DIR/research.mdfile with all findings and set links to relevant files. -
Present comprehensive summary of findings and patterns discovered to user.
Stage 3: Clarifying Questions
Goal: Fill in gaps and resolve all ambiguities before designing
CRITICAL: This is one of the most important stages. DO NOT SKIP.
Actions:
- Review the codebase findings and original feature request
- Identify underspecified aspects: edge cases, error handling, integration points, scope boundaries, design preferences, backward compatibility, performance needs
- Present all questions to the user in a clear, organized list
- Wait for answers before proceeding to architecture design
If the user says "whatever you think is best", provide your recommendation and set it as a assumed decision in research.md file.
Output
research.md with all NEEDS CLARIFICATION resolved and links to relevant files.
Stage 4: Architecture Design
Prerequisites: research.md complete
Goal: Design multiple implementation approaches with different trade-offs.
Actions
-
Launch 2-3
software-architectagents in parallel with different focuses: minimal changes (smallest change, maximum reuse), clean architecture (maintainability, elegant abstractions), or pragmatic balance (speed + quality). Use provided prompt exactly, while prefiling required variables:Perform software architecture plan design. **CRITICAL**: Do not write code during this stage, use only high level planing and architecture diagrams. User Input: {provide user input here if it exists} ## Steps - **Load context**: Read `specs/constitution.md`, {FEATURE_SPEC}, {FEATURE_DIR}/research.md. - Write the architecture design to {FEATURE_DIR}/design.{focus-name}.md file, while focusing on following aspect: {focus description}. -
Review all approaches and form your opinion on which fits best for this specific task (consider: small fix vs large feature, urgency, complexity, team context)
-
Present to user: brief summary of each approach, trade-offs comparison, your recommendation with reasoning, concrete implementation differences.
-
Ask user which approach they prefer
Stage 5: Plan
Launch new software-architect agent to make final design doc, based on appraoch choosen by user in previous stage. Use provided prompt exactly, while prefiling required variables:
Perform software architecture plan design.
**Goal**: Plan the implementation based on approach choosen by the user and clarify all unclear or uncertain areas.
**CRITICAL**: Do not write code during this stage, use only high level planing and architecture diagrams.
User Input: {provide user input here}
## Steps
1. **Load context**: Read `specs/constitution.md`, {FEATURE_SPEC}, {FEATURE_DIR}/research.md.
2. Read design files: {list of design files generated by previous agents}.
3. Write the final design doc to {FEATURE_DIR}/design.md file, based on appraoch choosen by the user.
4. Write implementation plan by filling `FEATURE_DIR/plan.md` template.
5. **Extract entities from feature spec** → `FEATURE_DIR/data-model.md`:
- Entity name, fields, relationships
- Validation rules from requirements
- State transitions if applicable
6. **Generate API contracts** from functional requirements if it applicable:
- For each user action → endpoint
- Use standard REST/GraphQL patterns
- Output OpenAPI/GraphQL schema to `FEATURE_DIR/contract.md`
7. Output implementation plan summary.
Stage 6: Review Implementation Plan
Actions
-
Once Stage 5 is complete, launch new
software-architectagent to review implementation plan. Use provided prompt exactly, while prefiling required variables:Review implementation plan. **Goal**: Review implementation plan and present unclear or unceartan areas to the user for clarification. **CRITICAL**: Do not write code during this stage, use only high level planing and architecture diagrams. User Input: {provide user input here} ## Steps 1. **Load context**: Read `specs/constitution.md`, {FEATURE_SPEC}, {FEATURE_DIR}/research.md. 2. Review implementation plan in {FEATURE_DIR}/plan.md file, identify unclear or unceartan areas. 3. Resolve high confidence issues by yourself. 4. Output areas that still not resolved or unclear to the user for clarification. -
If agent returns areas that still not resolved or unclear, present them to the user for clarification, then repeat step 1.
-
Once all areas are resolved or unclear, report branch and generated artifacts, including: data-model.md, contract.md, plan.md, etc.
Key rules
- Use absolute paths
- ERROR on gate failures or unresolved clarifications