claudify-agent 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/QUICK-REFERENCE.md +213 -213
- package/.claude/cost-dashboard.md +162 -162
- package/.claude/docs/COST-OPTIMIZATION.md +402 -403
- package/.claude/docs/MCP-INTEGRATION-GUIDE.md +348 -348
- package/.claude/docs/PLAN-MODE-OPTIMIZATION.md +835 -836
- package/.claude/hooks/auto-learning-review.ts +200 -195
- package/.claude/hooks/auto-lint-fix.ts +60 -104
- package/.claude/hooks/auto-security-review.ts +314 -354
- package/.claude/hooks/auto-validate.ts +249 -348
- package/.claude/hooks/lib/claude-hook.ts +168 -0
- package/.claude/hooks/plan-quality-tracker.ts +598 -719
- package/.claude/rules/anti-patterns.md +22 -22
- package/.claude/rules/context-tier-1.md +41 -41
- package/.claude/rules/context-tier-2.md +285 -285
- package/.claude/rules/general.md +25 -25
- package/.claude/rules/mcp-auto-use.md +46 -46
- package/.claude/rules/parallel-exploration-auto.md +30 -31
- package/.claude/rules/plan-mode-execution.md +289 -289
- package/.claude/rules/plan-mode-research.md +34 -34
- package/.claude/rules/plan-mode-structure.md +166 -166
- package/.claude/rules/plan-mode-validation.md +129 -130
- package/.claude/rules/security-critical.md +19 -19
- package/.claude/rules/tool-auto-selection.md +45 -45
- package/.claude/rules/tool-strategy.md +22 -22
- package/.claude/scripts/security-scan.js +1 -1
- package/.claude/security-dashboard.md +142 -142
- package/.claude/settings.json +50 -0
- package/.claude/skills/debug-optimizer/SKILL.md +420 -399
- package/.claude/skills/learning-loop/SKILL.md +313 -308
- package/.claude/skills/mcp-mastery/SKILL.md +218 -214
- package/.claude/skills/nextjs-guide/SKILL.md +687 -687
- package/.claude/skills/parallel-exploration/SKILL.md +197 -193
- package/.claude/skills/plan-mode-mastery/SKILL.md +268 -263
- package/.claude/skills/python-guide/SKILL.md +822 -822
- package/.claude/skills/react-guide/SKILL.md +762 -762
- package/.claude/skills/{security.md → security-guide/SKILL.md} +10 -0
- package/.claude/skills/solidity-guide/SKILL.md +5 -0
- package/.claude/skills/tool-selection/SKILL.md +433 -428
- package/.claude/skills/vite-guide/SKILL.md +445 -445
- package/CLAUDE.md +1 -0
- package/README.md +74 -35
- package/README.vi.md +106 -0
- package/bin/cli.js +13 -4
- package/package.json +9 -1
- package/.claude/skills/debug-optimizer.md +0 -12
- package/.claude/skills/nextjs.md +0 -13
- package/.claude/skills/react.md +0 -12
|
@@ -1,289 +1,289 @@
|
|
|
1
|
-
# Plan Mode Execution Monitoring
|
|
2
|
-
|
|
3
|
-
## Automatic Progress Tracking
|
|
4
|
-
|
|
5
|
-
### TodoWrite Creation
|
|
6
|
-
When plan approved:
|
|
7
|
-
1. Convert steps to todos automatically
|
|
8
|
-
2. First step: in_progress
|
|
9
|
-
3. Update after EACH completion
|
|
10
|
-
4. Only ONE in_progress at a time
|
|
11
|
-
|
|
12
|
-
### Checkpoint Strategy
|
|
13
|
-
Create checkpoint before:
|
|
14
|
-
- Large refactors (>5 files)
|
|
15
|
-
- Database changes
|
|
16
|
-
- API contract changes
|
|
17
|
-
- Breaking changes
|
|
18
|
-
- Irreversible operations
|
|
19
|
-
|
|
20
|
-
### Iteration Loops
|
|
21
|
-
If tests fail:
|
|
22
|
-
1. Use
|
|
23
|
-
2. Max 5 iterations
|
|
24
|
-
3. Update scratchpad
|
|
25
|
-
4. Report if BLOCKED
|
|
26
|
-
|
|
27
|
-
### Adaptive Re-planning
|
|
28
|
-
If deviation >30%:
|
|
29
|
-
1. Pause execution
|
|
30
|
-
2. Create updated plan
|
|
31
|
-
3. Present delta
|
|
32
|
-
4. Get approval
|
|
33
|
-
|
|
34
|
-
### Quality Gates
|
|
35
|
-
After EACH step:
|
|
36
|
-
-
|
|
37
|
-
- Fix introduced lints immediately
|
|
38
|
-
- Run relevant tests
|
|
39
|
-
- Update todos
|
|
40
|
-
|
|
41
|
-
## Progress Tracking Template
|
|
42
|
-
|
|
43
|
-
```markdown
|
|
44
|
-
## Current Progress
|
|
45
|
-
Step 3/7: Creating API endpoints (in_progress)
|
|
46
|
-
|
|
47
|
-
## Completed Steps
|
|
48
|
-
✅ Step 1: Research patterns (2 min)
|
|
49
|
-
✅ Step 2: Create project structure (5 min)
|
|
50
|
-
|
|
51
|
-
## Remaining Steps
|
|
52
|
-
⏳ Step 3: Create API endpoints (in_progress)
|
|
53
|
-
⏹ Step 4: Build UI components
|
|
54
|
-
⏹ Step 5: Integration
|
|
55
|
-
⏹ Step 6: Testing
|
|
56
|
-
⏹ Step 7: Documentation
|
|
57
|
-
|
|
58
|
-
## Quality Status
|
|
59
|
-
- Lints: ✅ Clear
|
|
60
|
-
- Tests: ✅ Passing
|
|
61
|
-
- Checkpoints: 1 created (before Step 3)
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
## Checkpoint Guidelines
|
|
65
|
-
|
|
66
|
-
### When to Create Checkpoints
|
|
67
|
-
|
|
68
|
-
**ALWAYS create checkpoint before:**
|
|
69
|
-
1. Database schema migrations
|
|
70
|
-
2. API contract changes
|
|
71
|
-
3. Authentication/authorization changes
|
|
72
|
-
4. Payment processing changes
|
|
73
|
-
5. Data migration
|
|
74
|
-
6. Breaking changes
|
|
75
|
-
7. Removing existing functionality
|
|
76
|
-
|
|
77
|
-
**OPTIONAL checkpoints:**
|
|
78
|
-
1. After completing major phases
|
|
79
|
-
2. Before experimental changes
|
|
80
|
-
3. When trying multiple approaches
|
|
81
|
-
|
|
82
|
-
### Checkpoint Naming Convention
|
|
83
|
-
|
|
84
|
-
```
|
|
85
|
-
checkpoint-[plan-name]-step-[N]-[description]
|
|
86
|
-
|
|
87
|
-
Examples:
|
|
88
|
-
- checkpoint-auth-migration-step-3-before-db-change
|
|
89
|
-
- checkpoint-dashboard-feature-step-2-before-api
|
|
90
|
-
- checkpoint-checkout-refactor-step-5-before-breaking-change
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
### Rollback Triggers
|
|
94
|
-
|
|
95
|
-
**Automatic rollback if:**
|
|
96
|
-
1. Tests fail after 5
|
|
97
|
-
2. Critical linter errors introduced
|
|
98
|
-
3. User requests rollback
|
|
99
|
-
4. Agent detects critical error
|
|
100
|
-
5. Data corruption detected
|
|
101
|
-
|
|
102
|
-
## Iteration Loop (
|
|
103
|
-
|
|
104
|
-
### When to Use
|
|
105
|
-
- Tests failing
|
|
106
|
-
- Linter errors persist
|
|
107
|
-
- Matching design mockups
|
|
108
|
-
- Fixing edge cases
|
|
109
|
-
|
|
110
|
-
### Process
|
|
111
|
-
1. Run tests → identify failures
|
|
112
|
-
2. Fix code → run tests again
|
|
113
|
-
3. Repeat until pass or max 5 iterations
|
|
114
|
-
4. Update scratchpad: `.
|
|
115
|
-
5. Report BLOCKED if stuck
|
|
116
|
-
|
|
117
|
-
### Scratchpad Format
|
|
118
|
-
|
|
119
|
-
```markdown
|
|
120
|
-
## Task: Make all tests pass
|
|
121
|
-
|
|
122
|
-
### Iteration 1
|
|
123
|
-
- ❌ 3 tests failing
|
|
124
|
-
- Fixed authentication logic
|
|
125
|
-
|
|
126
|
-
### Iteration 2
|
|
127
|
-
- ❌ 1 test failing
|
|
128
|
-
- Fixed edge case in validation
|
|
129
|
-
|
|
130
|
-
### Iteration 3
|
|
131
|
-
- ✅ All tests passing
|
|
132
|
-
- DONE
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
## Adaptive Re-planning
|
|
136
|
-
|
|
137
|
-
### When to Re-plan
|
|
138
|
-
|
|
139
|
-
**Re-plan required if:**
|
|
140
|
-
1. >30% of plan steps changed
|
|
141
|
-
2. New blockers discovered
|
|
142
|
-
3. Time estimate off by >50%
|
|
143
|
-
4. User changes requirements
|
|
144
|
-
5. Critical dependency missing
|
|
145
|
-
|
|
146
|
-
### Re-plan Process
|
|
147
|
-
|
|
148
|
-
1. **Pause execution**
|
|
149
|
-
- Stop current step
|
|
150
|
-
- Create checkpoint if needed
|
|
151
|
-
|
|
152
|
-
2. **Assess deviation**
|
|
153
|
-
- What changed?
|
|
154
|
-
- Why did it change?
|
|
155
|
-
- Impact on remaining steps?
|
|
156
|
-
|
|
157
|
-
3. **Create updated plan**
|
|
158
|
-
- Show delta from original
|
|
159
|
-
- Explain why changes needed
|
|
160
|
-
- Provide new time estimate
|
|
161
|
-
|
|
162
|
-
4. **Get approval**
|
|
163
|
-
- Present to user
|
|
164
|
-
- Explain trade-offs
|
|
165
|
-
- Wait for approval to continue
|
|
166
|
-
|
|
167
|
-
### Re-plan Template
|
|
168
|
-
|
|
169
|
-
```markdown
|
|
170
|
-
## Plan Update Required
|
|
171
|
-
|
|
172
|
-
### What Changed
|
|
173
|
-
- Original: [what we planned]
|
|
174
|
-
- Reality: [what we discovered]
|
|
175
|
-
- Impact: [how it affects the plan]
|
|
176
|
-
|
|
177
|
-
### Proposed Changes
|
|
178
|
-
1. Add step: [new step]
|
|
179
|
-
2. Remove step: [unnecessary step]
|
|
180
|
-
3. Modify step: [changed step]
|
|
181
|
-
4. New time estimate: [X minutes]
|
|
182
|
-
|
|
183
|
-
### Reason for Changes
|
|
184
|
-
[Brief explanation]
|
|
185
|
-
|
|
186
|
-
### Approval Required
|
|
187
|
-
Shall I proceed with this updated plan?
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
## Examples
|
|
191
|
-
|
|
192
|
-
### Example 1: Normal Execution
|
|
193
|
-
|
|
194
|
-
Plan: "Add login button" (5 steps)
|
|
195
|
-
|
|
196
|
-
Execution:
|
|
197
|
-
```
|
|
198
|
-
✅ Step 1: Research patterns
|
|
199
|
-
- Tool:
|
|
200
|
-
-
|
|
201
|
-
- TodoWrite: Updated
|
|
202
|
-
|
|
203
|
-
✅ Step 2: Add button to Header
|
|
204
|
-
- Tool:
|
|
205
|
-
-
|
|
206
|
-
- TodoWrite: Updated
|
|
207
|
-
|
|
208
|
-
✅ Step 3: Style button
|
|
209
|
-
- Tool: Write
|
|
210
|
-
-
|
|
211
|
-
- TodoWrite: Updated
|
|
212
|
-
|
|
213
|
-
✅ Step 4: Add click handler
|
|
214
|
-
- Tool:
|
|
215
|
-
- Tests: Pass
|
|
216
|
-
- TodoWrite: Updated
|
|
217
|
-
|
|
218
|
-
✅ Step 5: Final validation
|
|
219
|
-
- Tool:
|
|
220
|
-
- Tool:
|
|
221
|
-
- All clear → COMPLETE
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
### Example 2: Tests Failing
|
|
225
|
-
|
|
226
|
-
Plan: "Add authentication" (Step 4: Testing)
|
|
227
|
-
|
|
228
|
-
Execution:
|
|
229
|
-
```
|
|
230
|
-
❌ Tests failing: 2 failures
|
|
231
|
-
|
|
232
|
-
→ Automatic
|
|
233
|
-
|
|
234
|
-
Iteration 1:
|
|
235
|
-
- Fix: Token validation logic
|
|
236
|
-
- Result: 1 test still failing
|
|
237
|
-
|
|
238
|
-
Iteration 2:
|
|
239
|
-
- Fix: Edge case for expired tokens
|
|
240
|
-
- Result: All tests passing ✅
|
|
241
|
-
|
|
242
|
-
→ Continue to next step
|
|
243
|
-
```
|
|
244
|
-
|
|
245
|
-
### Example 3: Checkpoint & Rollback
|
|
246
|
-
|
|
247
|
-
Plan: "Migrate auth from JWT to sessions"
|
|
248
|
-
|
|
249
|
-
Execution:
|
|
250
|
-
```
|
|
251
|
-
✅ Step 1: Research session patterns
|
|
252
|
-
✅ Step 2: Add session dependencies
|
|
253
|
-
|
|
254
|
-
📸 CHECKPOINT created: Before DB changes
|
|
255
|
-
|
|
256
|
-
❌ Step 3: Database migration
|
|
257
|
-
- Error: Breaking change detected
|
|
258
|
-
- Tests failing
|
|
259
|
-
|
|
260
|
-
→ Automatic rollback to checkpoint
|
|
261
|
-
→ User notified
|
|
262
|
-
→ Alternative approach suggested
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
### Example 4: Adaptive Re-planning
|
|
266
|
-
|
|
267
|
-
Plan: "Add dashboard" (original: 5 steps)
|
|
268
|
-
|
|
269
|
-
Discovery during execution:
|
|
270
|
-
```
|
|
271
|
-
⚠️ Discovered: Existing dashboard component
|
|
272
|
-
⚠️ Impact: 3 steps unnecessary
|
|
273
|
-
⚠️ New approach: Modify existing instead
|
|
274
|
-
|
|
275
|
-
## Plan Update Required
|
|
276
|
-
|
|
277
|
-
### What Changed
|
|
278
|
-
- Original: Create new dashboard from scratch
|
|
279
|
-
- Reality: Existing dashboard can be extended
|
|
280
|
-
- Impact: 60% reduction in work
|
|
281
|
-
|
|
282
|
-
### Proposed Changes
|
|
283
|
-
1. Remove: Create new page file
|
|
284
|
-
2. Remove: Create new layout
|
|
285
|
-
3. Modify: Extend existing dashboard
|
|
286
|
-
4. New time estimate: 20 minutes (was 45)
|
|
287
|
-
|
|
288
|
-
Shall I proceed with updated plan?
|
|
289
|
-
```
|
|
1
|
+
# Plan Mode Execution Monitoring
|
|
2
|
+
|
|
3
|
+
## Automatic Progress Tracking
|
|
4
|
+
|
|
5
|
+
### TodoWrite Creation
|
|
6
|
+
When plan approved:
|
|
7
|
+
1. Convert steps to todos automatically
|
|
8
|
+
2. First step: in_progress
|
|
9
|
+
3. Update after EACH completion
|
|
10
|
+
4. Only ONE in_progress at a time
|
|
11
|
+
|
|
12
|
+
### Checkpoint Strategy
|
|
13
|
+
Create checkpoint before:
|
|
14
|
+
- Large refactors (>5 files)
|
|
15
|
+
- Database changes
|
|
16
|
+
- API contract changes
|
|
17
|
+
- Breaking changes
|
|
18
|
+
- Irreversible operations
|
|
19
|
+
|
|
20
|
+
### Iteration Loops
|
|
21
|
+
If tests fail:
|
|
22
|
+
1. Use the fix-and-retest loop automatically
|
|
23
|
+
2. Max 5 iterations
|
|
24
|
+
3. Update scratchpad
|
|
25
|
+
4. Report if BLOCKED
|
|
26
|
+
|
|
27
|
+
### Adaptive Re-planning
|
|
28
|
+
If deviation >30%:
|
|
29
|
+
1. Pause execution
|
|
30
|
+
2. Create updated plan
|
|
31
|
+
3. Present delta
|
|
32
|
+
4. Get approval
|
|
33
|
+
|
|
34
|
+
### Quality Gates
|
|
35
|
+
After EACH step:
|
|
36
|
+
- Lint check on modified files
|
|
37
|
+
- Fix introduced lints immediately
|
|
38
|
+
- Run relevant tests
|
|
39
|
+
- Update todos
|
|
40
|
+
|
|
41
|
+
## Progress Tracking Template
|
|
42
|
+
|
|
43
|
+
```markdown
|
|
44
|
+
## Current Progress
|
|
45
|
+
Step 3/7: Creating API endpoints (in_progress)
|
|
46
|
+
|
|
47
|
+
## Completed Steps
|
|
48
|
+
✅ Step 1: Research patterns (2 min)
|
|
49
|
+
✅ Step 2: Create project structure (5 min)
|
|
50
|
+
|
|
51
|
+
## Remaining Steps
|
|
52
|
+
⏳ Step 3: Create API endpoints (in_progress)
|
|
53
|
+
⏹ Step 4: Build UI components
|
|
54
|
+
⏹ Step 5: Integration
|
|
55
|
+
⏹ Step 6: Testing
|
|
56
|
+
⏹ Step 7: Documentation
|
|
57
|
+
|
|
58
|
+
## Quality Status
|
|
59
|
+
- Lints: ✅ Clear
|
|
60
|
+
- Tests: ✅ Passing
|
|
61
|
+
- Checkpoints: 1 created (before Step 3)
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Checkpoint Guidelines
|
|
65
|
+
|
|
66
|
+
### When to Create Checkpoints
|
|
67
|
+
|
|
68
|
+
**ALWAYS create checkpoint before:**
|
|
69
|
+
1. Database schema migrations
|
|
70
|
+
2. API contract changes
|
|
71
|
+
3. Authentication/authorization changes
|
|
72
|
+
4. Payment processing changes
|
|
73
|
+
5. Data migration
|
|
74
|
+
6. Breaking changes
|
|
75
|
+
7. Removing existing functionality
|
|
76
|
+
|
|
77
|
+
**OPTIONAL checkpoints:**
|
|
78
|
+
1. After completing major phases
|
|
79
|
+
2. Before experimental changes
|
|
80
|
+
3. When trying multiple approaches
|
|
81
|
+
|
|
82
|
+
### Checkpoint Naming Convention
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
checkpoint-[plan-name]-step-[N]-[description]
|
|
86
|
+
|
|
87
|
+
Examples:
|
|
88
|
+
- checkpoint-auth-migration-step-3-before-db-change
|
|
89
|
+
- checkpoint-dashboard-feature-step-2-before-api
|
|
90
|
+
- checkpoint-checkout-refactor-step-5-before-breaking-change
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Rollback Triggers
|
|
94
|
+
|
|
95
|
+
**Automatic rollback if:**
|
|
96
|
+
1. Tests fail after 5 fix-and-retest iterations
|
|
97
|
+
2. Critical linter errors introduced
|
|
98
|
+
3. User requests rollback
|
|
99
|
+
4. Agent detects critical error
|
|
100
|
+
5. Data corruption detected
|
|
101
|
+
|
|
102
|
+
## Iteration Loop (fix-and-retest)
|
|
103
|
+
|
|
104
|
+
### When to Use
|
|
105
|
+
- Tests failing
|
|
106
|
+
- Linter errors persist
|
|
107
|
+
- Matching design mockups
|
|
108
|
+
- Fixing edge cases
|
|
109
|
+
|
|
110
|
+
### Process
|
|
111
|
+
1. Run tests → identify failures
|
|
112
|
+
2. Fix code → run tests again
|
|
113
|
+
3. Repeat until pass or max 5 iterations
|
|
114
|
+
4. Update scratchpad: `.claude/scratchpad.md`
|
|
115
|
+
5. Report BLOCKED if stuck
|
|
116
|
+
|
|
117
|
+
### Scratchpad Format
|
|
118
|
+
|
|
119
|
+
```markdown
|
|
120
|
+
## Task: Make all tests pass
|
|
121
|
+
|
|
122
|
+
### Iteration 1
|
|
123
|
+
- ❌ 3 tests failing
|
|
124
|
+
- Fixed authentication logic
|
|
125
|
+
|
|
126
|
+
### Iteration 2
|
|
127
|
+
- ❌ 1 test failing
|
|
128
|
+
- Fixed edge case in validation
|
|
129
|
+
|
|
130
|
+
### Iteration 3
|
|
131
|
+
- ✅ All tests passing
|
|
132
|
+
- DONE
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Adaptive Re-planning
|
|
136
|
+
|
|
137
|
+
### When to Re-plan
|
|
138
|
+
|
|
139
|
+
**Re-plan required if:**
|
|
140
|
+
1. >30% of plan steps changed
|
|
141
|
+
2. New blockers discovered
|
|
142
|
+
3. Time estimate off by >50%
|
|
143
|
+
4. User changes requirements
|
|
144
|
+
5. Critical dependency missing
|
|
145
|
+
|
|
146
|
+
### Re-plan Process
|
|
147
|
+
|
|
148
|
+
1. **Pause execution**
|
|
149
|
+
- Stop current step
|
|
150
|
+
- Create checkpoint if needed
|
|
151
|
+
|
|
152
|
+
2. **Assess deviation**
|
|
153
|
+
- What changed?
|
|
154
|
+
- Why did it change?
|
|
155
|
+
- Impact on remaining steps?
|
|
156
|
+
|
|
157
|
+
3. **Create updated plan**
|
|
158
|
+
- Show delta from original
|
|
159
|
+
- Explain why changes needed
|
|
160
|
+
- Provide new time estimate
|
|
161
|
+
|
|
162
|
+
4. **Get approval**
|
|
163
|
+
- Present to user
|
|
164
|
+
- Explain trade-offs
|
|
165
|
+
- Wait for approval to continue
|
|
166
|
+
|
|
167
|
+
### Re-plan Template
|
|
168
|
+
|
|
169
|
+
```markdown
|
|
170
|
+
## Plan Update Required
|
|
171
|
+
|
|
172
|
+
### What Changed
|
|
173
|
+
- Original: [what we planned]
|
|
174
|
+
- Reality: [what we discovered]
|
|
175
|
+
- Impact: [how it affects the plan]
|
|
176
|
+
|
|
177
|
+
### Proposed Changes
|
|
178
|
+
1. Add step: [new step]
|
|
179
|
+
2. Remove step: [unnecessary step]
|
|
180
|
+
3. Modify step: [changed step]
|
|
181
|
+
4. New time estimate: [X minutes]
|
|
182
|
+
|
|
183
|
+
### Reason for Changes
|
|
184
|
+
[Brief explanation]
|
|
185
|
+
|
|
186
|
+
### Approval Required
|
|
187
|
+
Shall I proceed with this updated plan?
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## Examples
|
|
191
|
+
|
|
192
|
+
### Example 1: Normal Execution
|
|
193
|
+
|
|
194
|
+
Plan: "Add login button" (5 steps)
|
|
195
|
+
|
|
196
|
+
Execution:
|
|
197
|
+
```
|
|
198
|
+
✅ Step 1: Research patterns
|
|
199
|
+
- Tool: Explore (quick)
|
|
200
|
+
- Lint check: Clear
|
|
201
|
+
- TodoWrite: Updated
|
|
202
|
+
|
|
203
|
+
✅ Step 2: Add button to Header
|
|
204
|
+
- Tool: Edit
|
|
205
|
+
- Lint check: Clear
|
|
206
|
+
- TodoWrite: Updated
|
|
207
|
+
|
|
208
|
+
✅ Step 3: Style button
|
|
209
|
+
- Tool: Write
|
|
210
|
+
- Lint check: Clear
|
|
211
|
+
- TodoWrite: Updated
|
|
212
|
+
|
|
213
|
+
✅ Step 4: Add click handler
|
|
214
|
+
- Tool: Edit
|
|
215
|
+
- Tests: Pass
|
|
216
|
+
- TodoWrite: Updated
|
|
217
|
+
|
|
218
|
+
✅ Step 5: Final validation
|
|
219
|
+
- Tool: Lint check
|
|
220
|
+
- Tool: Bash (tests)
|
|
221
|
+
- All clear → COMPLETE
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Example 2: Tests Failing
|
|
225
|
+
|
|
226
|
+
Plan: "Add authentication" (Step 4: Testing)
|
|
227
|
+
|
|
228
|
+
Execution:
|
|
229
|
+
```
|
|
230
|
+
❌ Tests failing: 2 failures
|
|
231
|
+
|
|
232
|
+
→ Automatic fix-and-retest loop:
|
|
233
|
+
|
|
234
|
+
Iteration 1:
|
|
235
|
+
- Fix: Token validation logic
|
|
236
|
+
- Result: 1 test still failing
|
|
237
|
+
|
|
238
|
+
Iteration 2:
|
|
239
|
+
- Fix: Edge case for expired tokens
|
|
240
|
+
- Result: All tests passing ✅
|
|
241
|
+
|
|
242
|
+
→ Continue to next step
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Example 3: Checkpoint & Rollback
|
|
246
|
+
|
|
247
|
+
Plan: "Migrate auth from JWT to sessions"
|
|
248
|
+
|
|
249
|
+
Execution:
|
|
250
|
+
```
|
|
251
|
+
✅ Step 1: Research session patterns
|
|
252
|
+
✅ Step 2: Add session dependencies
|
|
253
|
+
|
|
254
|
+
📸 CHECKPOINT created: Before DB changes
|
|
255
|
+
|
|
256
|
+
❌ Step 3: Database migration
|
|
257
|
+
- Error: Breaking change detected
|
|
258
|
+
- Tests failing
|
|
259
|
+
|
|
260
|
+
→ Automatic rollback to checkpoint
|
|
261
|
+
→ User notified
|
|
262
|
+
→ Alternative approach suggested
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### Example 4: Adaptive Re-planning
|
|
266
|
+
|
|
267
|
+
Plan: "Add dashboard" (original: 5 steps)
|
|
268
|
+
|
|
269
|
+
Discovery during execution:
|
|
270
|
+
```
|
|
271
|
+
⚠️ Discovered: Existing dashboard component
|
|
272
|
+
⚠️ Impact: 3 steps unnecessary
|
|
273
|
+
⚠️ New approach: Modify existing instead
|
|
274
|
+
|
|
275
|
+
## Plan Update Required
|
|
276
|
+
|
|
277
|
+
### What Changed
|
|
278
|
+
- Original: Create new dashboard from scratch
|
|
279
|
+
- Reality: Existing dashboard can be extended
|
|
280
|
+
- Impact: 60% reduction in work
|
|
281
|
+
|
|
282
|
+
### Proposed Changes
|
|
283
|
+
1. Remove: Create new page file
|
|
284
|
+
2. Remove: Create new layout
|
|
285
|
+
3. Modify: Extend existing dashboard
|
|
286
|
+
4. New time estimate: 20 minutes (was 45)
|
|
287
|
+
|
|
288
|
+
Shall I proceed with updated plan?
|
|
289
|
+
```
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
# Plan Mode Pre-Plan Research
|
|
2
|
-
|
|
3
|
-
## Automatic Research Steps (Before ANY Plan)
|
|
4
|
-
|
|
5
|
-
1. **
|
|
6
|
-
- Query: "How is [similar feature] implemented?"
|
|
7
|
-
- Target: Most relevant directory
|
|
8
|
-
|
|
9
|
-
2. **
|
|
10
|
-
- Launch 2-4
|
|
11
|
-
- Use model
|
|
12
|
-
|
|
13
|
-
3. **
|
|
14
|
-
- Check target files for existing issues
|
|
15
|
-
|
|
16
|
-
4. **
|
|
17
|
-
- Batch ALL questions in ONE call
|
|
18
|
-
|
|
19
|
-
## Output
|
|
20
|
-
- Summary of findings
|
|
21
|
-
- Reference files for patterns
|
|
22
|
-
- Clarified requirements (if asked)
|
|
23
|
-
|
|
24
|
-
## Examples
|
|
25
|
-
|
|
26
|
-
**Feature**: "Add user dashboard" → Research page/component patterns
|
|
27
|
-
**Bug**: "Fix auth bug" → Research auth implementation
|
|
28
|
-
**Refactor**: "Refactor checkout" → Research checkout code
|
|
29
|
-
|
|
30
|
-
## Rules
|
|
31
|
-
- Never plan without research (2-3 min max)
|
|
32
|
-
- Use parallel subagents for complex tasks
|
|
33
|
-
- Batch questions with
|
|
34
|
-
- Follow patterns found in codebase
|
|
1
|
+
# Plan Mode Pre-Plan Research
|
|
2
|
+
|
|
3
|
+
## Automatic Research Steps (Before ANY Plan)
|
|
4
|
+
|
|
5
|
+
1. **Explore (quick)** (30s)
|
|
6
|
+
- Query: "How is [similar feature] implemented?"
|
|
7
|
+
- Target: Most relevant directory
|
|
8
|
+
|
|
9
|
+
2. **Explore Subagents** (60s, parallel)
|
|
10
|
+
- Launch 2-4 `Explore` subagents in one message
|
|
11
|
+
- Use model: "haiku", run_in_background: true
|
|
12
|
+
|
|
13
|
+
3. **Lint check** (15s)
|
|
14
|
+
- Check target files for existing issues
|
|
15
|
+
|
|
16
|
+
4. **AskUserQuestion** (if ambiguous)
|
|
17
|
+
- Batch ALL questions in ONE call
|
|
18
|
+
|
|
19
|
+
## Output
|
|
20
|
+
- Summary of findings
|
|
21
|
+
- Reference files for patterns
|
|
22
|
+
- Clarified requirements (if asked)
|
|
23
|
+
|
|
24
|
+
## Examples
|
|
25
|
+
|
|
26
|
+
**Feature**: "Add user dashboard" → Research page/component patterns
|
|
27
|
+
**Bug**: "Fix auth bug" → Research auth implementation
|
|
28
|
+
**Refactor**: "Refactor checkout" → Research checkout code
|
|
29
|
+
|
|
30
|
+
## Rules
|
|
31
|
+
- Never plan without research (2-3 min max)
|
|
32
|
+
- Use parallel subagents for complex tasks
|
|
33
|
+
- Batch questions with AskUserQuestion
|
|
34
|
+
- Follow patterns found in codebase
|