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,166 +1,166 @@
|
|
|
1
|
-
# Plan Mode Plan Structure
|
|
2
|
-
|
|
3
|
-
## Required Plan Sections
|
|
4
|
-
|
|
5
|
-
Every plan MUST include:
|
|
6
|
-
|
|
7
|
-
1. **Summary** (1-2 sentences)
|
|
8
|
-
- What will be done
|
|
9
|
-
- Why it's needed
|
|
10
|
-
|
|
11
|
-
2. **Files to Create/Modify**
|
|
12
|
-
- Path and purpose
|
|
13
|
-
- Reference pattern: "Follow @[file]"
|
|
14
|
-
- Tools: "Use [tool] for [operation]"
|
|
15
|
-
|
|
16
|
-
3. **Implementation Steps**
|
|
17
|
-
- Sequential ordering
|
|
18
|
-
- Tool for each step
|
|
19
|
-
- Success metric: "Tests pass", "Lints clear"
|
|
20
|
-
|
|
21
|
-
4. **Tool Strategy**
|
|
22
|
-
- Exploration tools
|
|
23
|
-
- Implementation tools
|
|
24
|
-
- Validation tools
|
|
25
|
-
- Question strategy
|
|
26
|
-
|
|
27
|
-
5. **Testing Strategy**
|
|
28
|
-
- Test types
|
|
29
|
-
- Test files to create/modify
|
|
30
|
-
- Commands to run
|
|
31
|
-
|
|
32
|
-
6. **Risk Mitigation**
|
|
33
|
-
- High-risk steps flagged
|
|
34
|
-
- Fallback strategies
|
|
35
|
-
- Checkpoint locations
|
|
36
|
-
|
|
37
|
-
7. **Estimated Time**
|
|
38
|
-
- Based on complexity
|
|
39
|
-
- Includes buffer (20%)
|
|
40
|
-
|
|
41
|
-
## Plan Quality Gates
|
|
42
|
-
|
|
43
|
-
- [ ] All steps verifiable
|
|
44
|
-
- [ ] Tools specified
|
|
45
|
-
- [ ] Patterns referenced
|
|
46
|
-
- [ ] Risks identified
|
|
47
|
-
- [ ] Tests included
|
|
48
|
-
|
|
49
|
-
## Enhanced Plan Structure Template
|
|
50
|
-
|
|
51
|
-
```markdown
|
|
52
|
-
## Files to Create/Modify
|
|
53
|
-
- `path/to/file.ts` - Purpose
|
|
54
|
-
- Pattern: Follow @[reference file]
|
|
55
|
-
- Tools: Use
|
|
56
|
-
|
|
57
|
-
## Implementation Steps
|
|
58
|
-
1. [Step]
|
|
59
|
-
- Tool:
|
|
60
|
-
- Tool:
|
|
61
|
-
- Tool:
|
|
62
|
-
- Success: [Verifiable metric]
|
|
63
|
-
|
|
64
|
-
## Tool Strategy
|
|
65
|
-
- Exploration:
|
|
66
|
-
- Implementation: Read/Write/
|
|
67
|
-
- Validation:
|
|
68
|
-
- Questions:
|
|
69
|
-
|
|
70
|
-
## Risk Mitigation
|
|
71
|
-
- If [X] fails → Fallback: [Y]
|
|
72
|
-
- If tests fail → Use
|
|
73
|
-
- If stuck →
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
## Examples
|
|
77
|
-
|
|
78
|
-
### Example 1: Simple Feature
|
|
79
|
-
User: "Add login button"
|
|
80
|
-
|
|
81
|
-
Plan structure:
|
|
82
|
-
```markdown
|
|
83
|
-
## Summary
|
|
84
|
-
Add login button to header navigation following existing button patterns.
|
|
85
|
-
|
|
86
|
-
## Files to Modify
|
|
87
|
-
- `components/Header.tsx` - Add login button to nav
|
|
88
|
-
- Pattern: Follow @components/Button.tsx
|
|
89
|
-
- Tools:
|
|
90
|
-
|
|
91
|
-
## Implementation Steps
|
|
92
|
-
1. Find existing button patterns
|
|
93
|
-
- Tool:
|
|
94
|
-
- Success: Pattern identified
|
|
95
|
-
|
|
96
|
-
2. Add login button to Header
|
|
97
|
-
- Tool:
|
|
98
|
-
- Success: Button renders correctly
|
|
99
|
-
|
|
100
|
-
3. Verify no linting errors
|
|
101
|
-
- Tool:
|
|
102
|
-
- Success: Zero new lints
|
|
103
|
-
|
|
104
|
-
## Tool Strategy
|
|
105
|
-
- Exploration:
|
|
106
|
-
- Implementation:
|
|
107
|
-
- Validation:
|
|
108
|
-
|
|
109
|
-
## Estimated Time: 10 minutes
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
### Example 2: Complex Feature
|
|
113
|
-
User: "Add user dashboard"
|
|
114
|
-
|
|
115
|
-
Plan structure:
|
|
116
|
-
```markdown
|
|
117
|
-
## Summary
|
|
118
|
-
Create user dashboard with stats, activity feed, and settings panel.
|
|
119
|
-
|
|
120
|
-
## Files to Create
|
|
121
|
-
- `app/dashboard/page.tsx` - Main dashboard page
|
|
122
|
-
- Pattern: Follow @app/profile/page.tsx
|
|
123
|
-
- Tools: Write for new file
|
|
124
|
-
- `components/dashboard/StatsCard.tsx` - Stats component
|
|
125
|
-
- Pattern: Follow @components/Card.tsx
|
|
126
|
-
- Tools: Write for new file
|
|
127
|
-
- `app/api/dashboard/stats/route.ts` - Stats API
|
|
128
|
-
- Pattern: Follow @app/api/users/route.ts
|
|
129
|
-
- Tools: Write for new file
|
|
130
|
-
|
|
131
|
-
## Implementation Steps
|
|
132
|
-
1. Research existing patterns (3 min)
|
|
133
|
-
- Tool:
|
|
134
|
-
- Tool:
|
|
135
|
-
- Success: Patterns identified
|
|
136
|
-
|
|
137
|
-
2. Create API endpoint (5 min)
|
|
138
|
-
- Tool: Write
|
|
139
|
-
- Success: Endpoint created, tests pass
|
|
140
|
-
|
|
141
|
-
3. Build dashboard page (10 min)
|
|
142
|
-
- Tool: Write
|
|
143
|
-
- Success: Page renders
|
|
144
|
-
|
|
145
|
-
4. Create UI components (15 min)
|
|
146
|
-
- Tool: Write for each component
|
|
147
|
-
- Success: Components render
|
|
148
|
-
|
|
149
|
-
5. Integration testing (5 min)
|
|
150
|
-
- Tool:
|
|
151
|
-
- Tool:
|
|
152
|
-
- Success: All tests pass, zero lints
|
|
153
|
-
|
|
154
|
-
## Tool Strategy
|
|
155
|
-
- Exploration:
|
|
156
|
-
- Implementation: Write,
|
|
157
|
-
- Validation:
|
|
158
|
-
- Questions:
|
|
159
|
-
|
|
160
|
-
## Risk Mitigation
|
|
161
|
-
- If API fails → Fallback: Mock data initially
|
|
162
|
-
- If tests fail → Use
|
|
163
|
-
- Checkpoint before: Integration step
|
|
164
|
-
|
|
165
|
-
## Estimated Time: 45 minutes
|
|
166
|
-
```
|
|
1
|
+
# Plan Mode Plan Structure
|
|
2
|
+
|
|
3
|
+
## Required Plan Sections
|
|
4
|
+
|
|
5
|
+
Every plan MUST include:
|
|
6
|
+
|
|
7
|
+
1. **Summary** (1-2 sentences)
|
|
8
|
+
- What will be done
|
|
9
|
+
- Why it's needed
|
|
10
|
+
|
|
11
|
+
2. **Files to Create/Modify**
|
|
12
|
+
- Path and purpose
|
|
13
|
+
- Reference pattern: "Follow @[file]"
|
|
14
|
+
- Tools: "Use [tool] for [operation]"
|
|
15
|
+
|
|
16
|
+
3. **Implementation Steps**
|
|
17
|
+
- Sequential ordering
|
|
18
|
+
- Tool for each step
|
|
19
|
+
- Success metric: "Tests pass", "Lints clear"
|
|
20
|
+
|
|
21
|
+
4. **Tool Strategy**
|
|
22
|
+
- Exploration tools
|
|
23
|
+
- Implementation tools
|
|
24
|
+
- Validation tools
|
|
25
|
+
- Question strategy
|
|
26
|
+
|
|
27
|
+
5. **Testing Strategy**
|
|
28
|
+
- Test types
|
|
29
|
+
- Test files to create/modify
|
|
30
|
+
- Commands to run
|
|
31
|
+
|
|
32
|
+
6. **Risk Mitigation**
|
|
33
|
+
- High-risk steps flagged
|
|
34
|
+
- Fallback strategies
|
|
35
|
+
- Checkpoint locations
|
|
36
|
+
|
|
37
|
+
7. **Estimated Time**
|
|
38
|
+
- Based on complexity
|
|
39
|
+
- Includes buffer (20%)
|
|
40
|
+
|
|
41
|
+
## Plan Quality Gates
|
|
42
|
+
|
|
43
|
+
- [ ] All steps verifiable
|
|
44
|
+
- [ ] Tools specified
|
|
45
|
+
- [ ] Patterns referenced
|
|
46
|
+
- [ ] Risks identified
|
|
47
|
+
- [ ] Tests included
|
|
48
|
+
|
|
49
|
+
## Enhanced Plan Structure Template
|
|
50
|
+
|
|
51
|
+
```markdown
|
|
52
|
+
## Files to Create/Modify
|
|
53
|
+
- `path/to/file.ts` - Purpose
|
|
54
|
+
- Pattern: Follow @[reference file]
|
|
55
|
+
- Tools: Use Edit for edits, Bash for testing
|
|
56
|
+
|
|
57
|
+
## Implementation Steps
|
|
58
|
+
1. [Step]
|
|
59
|
+
- Tool: Explore (quick) to find [X]
|
|
60
|
+
- Tool: Agent subagent to explore [Y]
|
|
61
|
+
- Tool: Lint check to verify [Z]
|
|
62
|
+
- Success: [Verifiable metric]
|
|
63
|
+
|
|
64
|
+
## Tool Strategy
|
|
65
|
+
- Exploration: Explore (quick) + Agent (Explore)
|
|
66
|
+
- Implementation: Read/Write/Edit
|
|
67
|
+
- Validation: Lint check + Bash (tests)
|
|
68
|
+
- Questions: AskUserQuestion for [specific decisions]
|
|
69
|
+
|
|
70
|
+
## Risk Mitigation
|
|
71
|
+
- If [X] fails → Fallback: [Y]
|
|
72
|
+
- If tests fail → Use the fix-and-retest loop (max 5 iterations)
|
|
73
|
+
- If stuck → AskUserQuestion with options
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Examples
|
|
77
|
+
|
|
78
|
+
### Example 1: Simple Feature
|
|
79
|
+
User: "Add login button"
|
|
80
|
+
|
|
81
|
+
Plan structure:
|
|
82
|
+
```markdown
|
|
83
|
+
## Summary
|
|
84
|
+
Add login button to header navigation following existing button patterns.
|
|
85
|
+
|
|
86
|
+
## Files to Modify
|
|
87
|
+
- `components/Header.tsx` - Add login button to nav
|
|
88
|
+
- Pattern: Follow @components/Button.tsx
|
|
89
|
+
- Tools: Edit for edit, Lint check for validation
|
|
90
|
+
|
|
91
|
+
## Implementation Steps
|
|
92
|
+
1. Find existing button patterns
|
|
93
|
+
- Tool: Explore (quick): "How are buttons styled?"
|
|
94
|
+
- Success: Pattern identified
|
|
95
|
+
|
|
96
|
+
2. Add login button to Header
|
|
97
|
+
- Tool: Edit
|
|
98
|
+
- Success: Button renders correctly
|
|
99
|
+
|
|
100
|
+
3. Verify no linting errors
|
|
101
|
+
- Tool: Lint check
|
|
102
|
+
- Success: Zero new lints
|
|
103
|
+
|
|
104
|
+
## Tool Strategy
|
|
105
|
+
- Exploration: Explore (quick) for button patterns
|
|
106
|
+
- Implementation: Edit
|
|
107
|
+
- Validation: Lint check
|
|
108
|
+
|
|
109
|
+
## Estimated Time: 10 minutes
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Example 2: Complex Feature
|
|
113
|
+
User: "Add user dashboard"
|
|
114
|
+
|
|
115
|
+
Plan structure:
|
|
116
|
+
```markdown
|
|
117
|
+
## Summary
|
|
118
|
+
Create user dashboard with stats, activity feed, and settings panel.
|
|
119
|
+
|
|
120
|
+
## Files to Create
|
|
121
|
+
- `app/dashboard/page.tsx` - Main dashboard page
|
|
122
|
+
- Pattern: Follow @app/profile/page.tsx
|
|
123
|
+
- Tools: Write for new file
|
|
124
|
+
- `components/dashboard/StatsCard.tsx` - Stats component
|
|
125
|
+
- Pattern: Follow @components/Card.tsx
|
|
126
|
+
- Tools: Write for new file
|
|
127
|
+
- `app/api/dashboard/stats/route.ts` - Stats API
|
|
128
|
+
- Pattern: Follow @app/api/users/route.ts
|
|
129
|
+
- Tools: Write for new file
|
|
130
|
+
|
|
131
|
+
## Implementation Steps
|
|
132
|
+
1. Research existing patterns (3 min)
|
|
133
|
+
- Tool: Agent (Explore): "Find page patterns"
|
|
134
|
+
- Tool: Agent (Explore): "Find component patterns"
|
|
135
|
+
- Success: Patterns identified
|
|
136
|
+
|
|
137
|
+
2. Create API endpoint (5 min)
|
|
138
|
+
- Tool: Write
|
|
139
|
+
- Success: Endpoint created, tests pass
|
|
140
|
+
|
|
141
|
+
3. Build dashboard page (10 min)
|
|
142
|
+
- Tool: Write
|
|
143
|
+
- Success: Page renders
|
|
144
|
+
|
|
145
|
+
4. Create UI components (15 min)
|
|
146
|
+
- Tool: Write for each component
|
|
147
|
+
- Success: Components render
|
|
148
|
+
|
|
149
|
+
5. Integration testing (5 min)
|
|
150
|
+
- Tool: Bash: npm run test
|
|
151
|
+
- Tool: Lint check
|
|
152
|
+
- Success: All tests pass, zero lints
|
|
153
|
+
|
|
154
|
+
## Tool Strategy
|
|
155
|
+
- Exploration: Agent (Explore) x2 in parallel
|
|
156
|
+
- Implementation: Write, Edit
|
|
157
|
+
- Validation: Bash (tests), Lint check
|
|
158
|
+
- Questions: AskUserQuestion for dashboard widget priorities
|
|
159
|
+
|
|
160
|
+
## Risk Mitigation
|
|
161
|
+
- If API fails → Fallback: Mock data initially
|
|
162
|
+
- If tests fail → Use the fix-and-retest loop (max 5 iterations)
|
|
163
|
+
- Checkpoint before: Integration step
|
|
164
|
+
|
|
165
|
+
## Estimated Time: 45 minutes
|
|
166
|
+
```
|
|
@@ -1,130 +1,129 @@
|
|
|
1
|
-
# Plan Mode Plan Validation
|
|
2
|
-
|
|
3
|
-
## Automatic Validation Steps
|
|
4
|
-
|
|
5
|
-
Before presenting plan to user:
|
|
6
|
-
|
|
7
|
-
1. **Feasibility Check**
|
|
8
|
-
-
|
|
9
|
-
- Check file accessibility
|
|
10
|
-
- Verify tool availability
|
|
11
|
-
- Estimate time accuracy
|
|
12
|
-
|
|
13
|
-
2. **Dependency Analysis**
|
|
14
|
-
- Step ordering correct
|
|
15
|
-
- No missing prerequisites
|
|
16
|
-
- Parallel opportunities identified
|
|
17
|
-
|
|
18
|
-
3. **Risk Assessment**
|
|
19
|
-
- High-risk steps flagged
|
|
20
|
-
- Fallback strategies defined
|
|
21
|
-
- Checkpoint locations set
|
|
22
|
-
|
|
23
|
-
4. **Tool Availability**
|
|
24
|
-
- MCP servers running
|
|
25
|
-
- Permissions verified
|
|
26
|
-
- Alternative tools identified
|
|
27
|
-
|
|
28
|
-
## Validation Output
|
|
29
|
-
|
|
30
|
-
If PASS: Present plan to user
|
|
31
|
-
If FAIL:
|
|
32
|
-
- List specific issues
|
|
33
|
-
- Suggest fixes
|
|
34
|
-
- Auto-correct if possible
|
|
35
|
-
- Re-validate
|
|
36
|
-
|
|
37
|
-
## Validation Checklist
|
|
38
|
-
|
|
39
|
-
### Feasibility Check
|
|
40
|
-
- [ ] All required files accessible
|
|
41
|
-
- [ ] No circular dependencies
|
|
42
|
-
- [ ] Estimated time realistic (based on complexity)
|
|
43
|
-
- [ ] Tools available for all steps
|
|
44
|
-
|
|
45
|
-
### Dependency Analysis
|
|
46
|
-
- [ ] Step ordering correct
|
|
47
|
-
- [ ] No missing prerequisites
|
|
48
|
-
- [ ] Parallel opportunities identified
|
|
49
|
-
|
|
50
|
-
### Risk Assessment
|
|
51
|
-
- [ ] High-risk steps flagged
|
|
52
|
-
- [ ] Fallback strategies defined
|
|
53
|
-
- [ ] Rollback plan (Checkpoints) identified
|
|
54
|
-
|
|
55
|
-
### Tool Availability
|
|
56
|
-
- [ ] Required MCP servers running
|
|
57
|
-
- [ ] Permissions verified
|
|
58
|
-
- [ ] Alternative tools identified
|
|
59
|
-
|
|
60
|
-
## Validation Subagent Pattern
|
|
61
|
-
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
description="Validate implementation plan"
|
|
65
|
-
prompt="Review this plan for feasibility:
|
|
66
|
-
|
|
67
|
-
## Plan to Validate
|
|
68
|
-
[Plan content]
|
|
69
|
-
|
|
70
|
-
## Validation Checklist
|
|
71
|
-
1. Check if all referenced files exist
|
|
72
|
-
2. Verify tool availability
|
|
73
|
-
3. Estimate actual time based on complexity
|
|
74
|
-
4. Identify potential blockers
|
|
75
|
-
5. Suggest improvements
|
|
76
|
-
|
|
77
|
-
## Output Format
|
|
78
|
-
Pass/Fail: [Your verdict]
|
|
79
|
-
Issues: [List specific problems]
|
|
80
|
-
Suggestions: [Concrete improvements]
|
|
81
|
-
Confidence: [High/Medium/Low]"
|
|
82
|
-
subagent_type="
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
- ✅
|
|
94
|
-
- ✅
|
|
95
|
-
- ✅
|
|
96
|
-
- ✅
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
-
|
|
107
|
-
- ⚠️
|
|
108
|
-
-
|
|
109
|
-
- ✅
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
- ❌
|
|
120
|
-
- ❌
|
|
121
|
-
- ❌ Missing:
|
|
122
|
-
- ❌
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
5. Re-validate
|
|
1
|
+
# Plan Mode Plan Validation
|
|
2
|
+
|
|
3
|
+
## Automatic Validation Steps
|
|
4
|
+
|
|
5
|
+
Before presenting plan to user:
|
|
6
|
+
|
|
7
|
+
1. **Feasibility Check**
|
|
8
|
+
- Agent subagent: "Validate this plan"
|
|
9
|
+
- Check file accessibility
|
|
10
|
+
- Verify tool availability
|
|
11
|
+
- Estimate time accuracy
|
|
12
|
+
|
|
13
|
+
2. **Dependency Analysis**
|
|
14
|
+
- Step ordering correct
|
|
15
|
+
- No missing prerequisites
|
|
16
|
+
- Parallel opportunities identified
|
|
17
|
+
|
|
18
|
+
3. **Risk Assessment**
|
|
19
|
+
- High-risk steps flagged
|
|
20
|
+
- Fallback strategies defined
|
|
21
|
+
- Checkpoint locations set
|
|
22
|
+
|
|
23
|
+
4. **Tool Availability**
|
|
24
|
+
- MCP servers running
|
|
25
|
+
- Permissions verified
|
|
26
|
+
- Alternative tools identified
|
|
27
|
+
|
|
28
|
+
## Validation Output
|
|
29
|
+
|
|
30
|
+
If PASS: Present plan to user
|
|
31
|
+
If FAIL:
|
|
32
|
+
- List specific issues
|
|
33
|
+
- Suggest fixes
|
|
34
|
+
- Auto-correct if possible
|
|
35
|
+
- Re-validate
|
|
36
|
+
|
|
37
|
+
## Validation Checklist
|
|
38
|
+
|
|
39
|
+
### Feasibility Check
|
|
40
|
+
- [ ] All required files accessible
|
|
41
|
+
- [ ] No circular dependencies
|
|
42
|
+
- [ ] Estimated time realistic (based on complexity)
|
|
43
|
+
- [ ] Tools available for all steps
|
|
44
|
+
|
|
45
|
+
### Dependency Analysis
|
|
46
|
+
- [ ] Step ordering correct
|
|
47
|
+
- [ ] No missing prerequisites
|
|
48
|
+
- [ ] Parallel opportunities identified
|
|
49
|
+
|
|
50
|
+
### Risk Assessment
|
|
51
|
+
- [ ] High-risk steps flagged
|
|
52
|
+
- [ ] Fallback strategies defined
|
|
53
|
+
- [ ] Rollback plan (Checkpoints) identified
|
|
54
|
+
|
|
55
|
+
### Tool Availability
|
|
56
|
+
- [ ] Required MCP servers running
|
|
57
|
+
- [ ] Permissions verified
|
|
58
|
+
- [ ] Alternative tools identified
|
|
59
|
+
|
|
60
|
+
## Validation Subagent Pattern
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
Agent:
|
|
64
|
+
description="Validate implementation plan"
|
|
65
|
+
prompt="Review this plan for feasibility:
|
|
66
|
+
|
|
67
|
+
## Plan to Validate
|
|
68
|
+
[Plan content]
|
|
69
|
+
|
|
70
|
+
## Validation Checklist
|
|
71
|
+
1. Check if all referenced files exist
|
|
72
|
+
2. Verify tool availability
|
|
73
|
+
3. Estimate actual time based on complexity
|
|
74
|
+
4. Identify potential blockers
|
|
75
|
+
5. Suggest improvements
|
|
76
|
+
|
|
77
|
+
## Output Format
|
|
78
|
+
Pass/Fail: [Your verdict]
|
|
79
|
+
Issues: [List specific problems]
|
|
80
|
+
Suggestions: [Concrete improvements]
|
|
81
|
+
Confidence: [High/Medium/Low]"
|
|
82
|
+
subagent_type="Plan" // read-only architect agent
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Examples
|
|
86
|
+
|
|
87
|
+
### Example 1: Simple Plan Validation
|
|
88
|
+
|
|
89
|
+
Plan: "Add login button to header"
|
|
90
|
+
|
|
91
|
+
Validation checks:
|
|
92
|
+
- ✅ File exists: components/Header.tsx
|
|
93
|
+
- ✅ Tool available: Edit
|
|
94
|
+
- ✅ Time realistic: 10 minutes
|
|
95
|
+
- ✅ No dependencies
|
|
96
|
+
- ✅ Low risk
|
|
97
|
+
|
|
98
|
+
Result: PASS → Present to user
|
|
99
|
+
|
|
100
|
+
### Example 2: Complex Plan Validation
|
|
101
|
+
|
|
102
|
+
Plan: "Migrate authentication from JWT to sessions"
|
|
103
|
+
|
|
104
|
+
Validation checks:
|
|
105
|
+
- ✅ Files accessible: src/auth/, app/api/auth/
|
|
106
|
+
- ⚠️ Risk: Breaking change (checkpoint needed)
|
|
107
|
+
- ⚠️ Time: 2 hours might be optimistic → suggest 3 hours
|
|
108
|
+
- ✅ Tools available: Read, Write, Bash, Lint check
|
|
109
|
+
- ✅ Fallback: Keep JWT code until tests pass
|
|
110
|
+
|
|
111
|
+
Result: PASS with warnings → Present with caveats
|
|
112
|
+
|
|
113
|
+
### Example 3: Failed Validation
|
|
114
|
+
|
|
115
|
+
Plan: "Rewrite entire backend in Rust"
|
|
116
|
+
|
|
117
|
+
Validation checks:
|
|
118
|
+
- ❌ Time unrealistic: 1 week → needs 2-3 months
|
|
119
|
+
- ❌ Risk: Critical system rewrite
|
|
120
|
+
- ❌ Missing: Testing strategy
|
|
121
|
+
- ❌ Missing: Rollback plan
|
|
122
|
+
- ❌ Dependencies: Team training needed
|
|
123
|
+
|
|
124
|
+
Result: FAIL → Suggest phased approach:
|
|
125
|
+
1. Start with non-critical service
|
|
126
|
+
2. Add testing strategy
|
|
127
|
+
3. Create rollback plan
|
|
128
|
+
4. Revise time estimate
|
|
129
|
+
5. Re-validate
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
# Security-Critical Operations
|
|
2
|
-
|
|
3
|
-
## Triggers
|
|
4
|
-
Keywords: "auth", "security", "password", "token", "encrypt", "API key", "secret", "credential"
|
|
5
|
-
|
|
6
|
-
## Critical Rules
|
|
7
|
-
- Never hardcode credentials - use environment variables
|
|
8
|
-
- Always validate and sanitize user input
|
|
9
|
-
- Use parameterized queries (no SQL injection)
|
|
10
|
-
- Hash passwords with bcrypt/argon2
|
|
11
|
-
- Use strong crypto (SHA-256+, AES-256)
|
|
12
|
-
|
|
13
|
-
## Security Checklist
|
|
14
|
-
See `.
|
|
15
|
-
|
|
16
|
-
## Examples
|
|
17
|
-
- Auth pattern: `@src/auth/validateToken.ts`
|
|
18
|
-
- Password hashing: `@src/lib/password.ts`
|
|
19
|
-
- Input validation: `@src/validators/userSchema.ts`
|
|
1
|
+
# Security-Critical Operations
|
|
2
|
+
|
|
3
|
+
## Triggers
|
|
4
|
+
Keywords: "auth", "security", "password", "token", "encrypt", "API key", "secret", "credential"
|
|
5
|
+
|
|
6
|
+
## Critical Rules
|
|
7
|
+
- Never hardcode credentials - use environment variables
|
|
8
|
+
- Always validate and sanitize user input
|
|
9
|
+
- Use parameterized queries (no SQL injection)
|
|
10
|
+
- Hash passwords with bcrypt/argon2
|
|
11
|
+
- Use strong crypto (SHA-256+, AES-256)
|
|
12
|
+
|
|
13
|
+
## Security Checklist
|
|
14
|
+
See `.claude/security-report.md` for OWASP Top 10 checklist
|
|
15
|
+
|
|
16
|
+
## Examples
|
|
17
|
+
- Auth pattern: `@src/auth/validateToken.ts`
|
|
18
|
+
- Password hashing: `@src/lib/password.ts`
|
|
19
|
+
- Input validation: `@src/validators/userSchema.ts`
|