Feature Development
Core Principles
- Ask clarifying questions: Identify ambiguities, edge cases, and underspecified behaviors. Ask specific, concrete questions. Wait for answers before proceeding. Ask early — after codebase exploration, before architecture design.
- Read files identified by agents: Ask agents to return 5–10 key files to read. After agents complete, read those files to build deep context before proceeding.
- Use TodoWrite: Track all progress throughout
Phase 1: Discovery
Initial request: $ARGUMENTS
Actions:
- Create todo list with all phases
- If feature unclear, ask user for:
- What problem are they solving?
- What should the feature do?
- Any constraints or requirements?
- Summarize understanding and confirm with user
Phase 2: Codebase Exploration
Actions:
- Launch 2-3 code-explorer agents in parallel, each targeting a different aspect (similar features, overall architecture, UI/testing patterns). Ask each agent to return 5-10 key files to read.
See more prompt variants in references/agent-prompts.md.runSubagent({ agentName: "code-explorer", description: "Explore similar features", prompt: "Find features similar to [feature] in this codebase. Trace through their implementation and return 5-10 key files to read." }) - Read all files identified by agents to build deep understanding
- Present comprehensive summary of findings and patterns discovered
Phase 3: Clarifying Questions
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 using this format:
1. [Scope] Should this feature support X, or only Y? 2. [Integration] Does this need to integrate with the existing Z module, or be standalone? 3. [Error handling] What should happen when A fails — silent fallback or explicit error? 4. [Auth] Should this endpoint require authentication? - Wait for answers before proceeding to architecture design
If the user says "whatever you think is best", provide your recommendation and get explicit confirmation.
Phase 4: Architecture Design
Actions:
- Launch 2-3 code-architect agents in parallel with different focuses: minimal changes, clean architecture, pragmatic balance.
See more prompt variants in references/agent-prompts.md.runSubagent({ agentName: "code-architect", description: "Design pragmatic approach", prompt: "Design a pragmatic implementation of [feature] in this codebase. Reuse existing patterns where natural, introduce new abstractions only when they clearly improve clarity, and list the files to create or modify." }) - Review all approaches and form your opinion on which fits best (consider: scope size, urgency, complexity, team context)
- Present to user using this format:
| | Option A — Minimal | Option B — Clean | Option C — Pragmatic | |---|---|---|---| | Files changed | 1 existing file | 3 new files | 2 files (1 new) | | Reuses existing | Yes | No | Partially | | Risk | Low | Medium | Low | | Maintainability | Medium | High | High | Recommendation: Option C because [reasoning]. - Ask user which approach they prefer
Phase 5: Implementation
Actions:
- Wait for explicit user approval before starting
- Read all relevant files identified in previous phases
- Implement following chosen architecture
- Update todos as you progress
Phase 6: Quality Review
Actions:
- Launch 3 code-reviewer agents in parallel with different focuses: simplicity/DRY/elegance, bugs/functional correctness, project conventions/abstractions
- Consolidate findings and identify highest severity issues that you recommend fixing
- Present findings to user and ask what they want to do (fix now, fix later, or proceed as-is)
- Address issues based on user decision
Phase 7: Summary
Actions:
- Mark all todos complete
- Summarize:
- What was built
- Key decisions made
- Files modified
- Suggested next steps