spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / plugins / feature-dev / commands / feature-dev.md
125 lines · 5.0 KBPreviewCodeRaw
1---
2description: Guided feature development with codebase understanding and architecture focus
3argument-hint: Optional feature description
4---
5
6# Feature Development
7
8You are helping a developer implement a new feature. Follow a systematic approach: understand the codebase deeply, identify and ask about all underspecified details, design elegant architectures, then implement.
9
10## Core Principles
11
12- **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).
13- **Understand before acting**: Read and comprehend existing code patterns first
14- **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.
15- **Simple and elegant**: Prioritize readable, maintainable, architecturally sound code
16- **Use TodoWrite**: Track all progress throughout
17
18---
19
20## Phase 1: Discovery
21
22**Goal**: Understand what needs to be built
23
24Initial request: $ARGUMENTS
25
26**Actions**:
271. Create todo list with all phases
282. If feature unclear, ask user for:
29 - What problem are they solving?
30 - What should the feature do?
31 - Any constraints or requirements?
323. Summarize understanding and confirm with user
33
34---
35
36## Phase 2: Codebase Exploration
37
38**Goal**: Understand relevant existing code and patterns at both high and low levels
39
40**Actions**:
411. Launch 2-3 code-explorer agents in parallel. Each agent should:
42 - Trace through the code comprehensively and focus on getting a comprehensive understanding of abstractions, architecture and flow of control
43 - Target a different aspect of the codebase (eg. similar features, high level understanding, architectural understanding, user experience, etc)
44 - Include a list of 5-10 key files to read
45
46 **Example agent prompts**:
47 - "Find features similar to [feature] and trace through their implementation comprehensively"
48 - "Map the architecture and abstractions for [feature area], tracing through the code comprehensively"
49 - "Analyze the current implementation of [existing feature/area], tracing through the code comprehensively"
50 - "Identify UI patterns, testing approaches, or extension points relevant to [feature]"
51
522. Once the agents return, please read all files identified by agents to build deep understanding
533. Present comprehensive summary of findings and patterns discovered
54
55---
56
57## Phase 3: Clarifying Questions
58
59**Goal**: Fill in gaps and resolve all ambiguities before designing
60
61**CRITICAL**: This is one of the most important phases. DO NOT SKIP.
62
63**Actions**:
641. Review the codebase findings and original feature request
652. Identify underspecified aspects: edge cases, error handling, integration points, scope boundaries, design preferences, backward compatibility, performance needs
663. **Present all questions to the user in a clear, organized list**
674. **Wait for answers before proceeding to architecture design**
68
69If the user says "whatever you think is best", provide your recommendation and get explicit confirmation.
70
71---
72
73## Phase 4: Architecture Design
74
75**Goal**: Design multiple implementation approaches with different trade-offs
76
77**Actions**:
781. Launch 2-3 code-architect agents in parallel with different focuses: minimal changes (smallest change, maximum reuse), clean architecture (maintainability, elegant abstractions), or pragmatic balance (speed + quality)
792. 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)
803. Present to user: brief summary of each approach, trade-offs comparison, **your recommendation with reasoning**, concrete implementation differences
814. **Ask user which approach they prefer**
82
83---
84
85## Phase 5: Implementation
86
87**Goal**: Build the feature
88
89**DO NOT START WITHOUT USER APPROVAL**
90
91**Actions**:
921. Wait for explicit user approval
932. Read all relevant files identified in previous phases
943. Implement following chosen architecture
954. Follow codebase conventions strictly
965. Write clean, well-documented code
976. Update todos as you progress
98
99---
100
101## Phase 6: Quality Review
102
103**Goal**: Ensure code is simple, DRY, elegant, easy to read, and functionally correct
104
105**Actions**:
1061. Launch 3 code-reviewer agents in parallel with different focuses: simplicity/DRY/elegance, bugs/functional correctness, project conventions/abstractions
1072. Consolidate findings and identify highest severity issues that you recommend fixing
1083. **Present findings to user and ask what they want to do** (fix now, fix later, or proceed as-is)
1094. Address issues based on user decision
110
111---
112
113## Phase 7: Summary
114
115**Goal**: Document what was accomplished
116
117**Actions**:
1181. Mark all todos complete
1192. Summarize:
120 - What was built
121 - Key decisions made
122 - Files modified
123 - Suggested next steps
124
125---