claudify-agent 1.0.0 → 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.
Files changed (47) hide show
  1. package/.claude/QUICK-REFERENCE.md +213 -213
  2. package/.claude/cost-dashboard.md +162 -162
  3. package/.claude/docs/COST-OPTIMIZATION.md +402 -403
  4. package/.claude/docs/MCP-INTEGRATION-GUIDE.md +348 -348
  5. package/.claude/docs/PLAN-MODE-OPTIMIZATION.md +835 -836
  6. package/.claude/hooks/auto-learning-review.ts +200 -195
  7. package/.claude/hooks/auto-lint-fix.ts +60 -104
  8. package/.claude/hooks/auto-security-review.ts +314 -354
  9. package/.claude/hooks/auto-validate.ts +249 -348
  10. package/.claude/hooks/lib/claude-hook.ts +168 -0
  11. package/.claude/hooks/plan-quality-tracker.ts +598 -719
  12. package/.claude/rules/anti-patterns.md +22 -22
  13. package/.claude/rules/context-tier-1.md +41 -41
  14. package/.claude/rules/context-tier-2.md +285 -285
  15. package/.claude/rules/general.md +25 -25
  16. package/.claude/rules/mcp-auto-use.md +46 -46
  17. package/.claude/rules/parallel-exploration-auto.md +30 -31
  18. package/.claude/rules/plan-mode-execution.md +289 -289
  19. package/.claude/rules/plan-mode-research.md +34 -34
  20. package/.claude/rules/plan-mode-structure.md +166 -166
  21. package/.claude/rules/plan-mode-validation.md +129 -130
  22. package/.claude/rules/security-critical.md +19 -19
  23. package/.claude/rules/tool-auto-selection.md +45 -45
  24. package/.claude/rules/tool-strategy.md +22 -22
  25. package/.claude/scripts/security-scan.js +1 -1
  26. package/.claude/security-dashboard.md +142 -142
  27. package/.claude/settings.json +50 -0
  28. package/.claude/skills/debug-optimizer/SKILL.md +420 -399
  29. package/.claude/skills/learning-loop/SKILL.md +313 -308
  30. package/.claude/skills/mcp-mastery/SKILL.md +218 -214
  31. package/.claude/skills/nextjs-guide/SKILL.md +687 -687
  32. package/.claude/skills/parallel-exploration/SKILL.md +197 -193
  33. package/.claude/skills/plan-mode-mastery/SKILL.md +268 -263
  34. package/.claude/skills/python-guide/SKILL.md +822 -822
  35. package/.claude/skills/react-guide/SKILL.md +762 -762
  36. package/.claude/skills/{security.md → security-guide/SKILL.md} +10 -0
  37. package/.claude/skills/solidity-guide/SKILL.md +5 -0
  38. package/.claude/skills/tool-selection/SKILL.md +433 -428
  39. package/.claude/skills/vite-guide/SKILL.md +445 -445
  40. package/CLAUDE.md +1 -0
  41. package/README.md +74 -35
  42. package/README.vi.md +106 -0
  43. package/bin/cli.js +13 -4
  44. package/package.json +9 -1
  45. package/.claude/skills/debug-optimizer.md +0 -12
  46. package/.claude/skills/nextjs.md +0 -13
  47. package/.claude/skills/react.md +0 -12
@@ -1,263 +1,268 @@
1
- # SKILL.md: Plan Mode Mastery
2
-
3
- ## Description
4
- Comprehensive plan mode workflow with automatic research, validation, and execution monitoring.
5
-
6
- ## When to Use
7
- - User requests Plan Mode
8
- - Large feature implementation
9
- - Complex refactoring
10
- - Ambiguous requirements
11
- - Multi-step tasks
12
-
13
- ## Capabilities
14
- - Automatic pre-plan research
15
- - Tool-aware plan creation
16
- - Feasibility validation
17
- - Progress monitoring
18
- - Adaptive re-planning
19
- - Iteration loops
20
-
21
- ## Commands
22
- /plan-mode-full: Complete optimized workflow
23
- /plan-mode-quick: Standard plan mode (no research)
24
- /plan-mode-validate: Validate existing plan
25
-
26
- ## Workflows
27
-
28
- ### Full Plan Mode Workflow
29
-
30
- 1. **Pre-Plan Research** (2-3 minutes)
31
- - SemanticSearch for patterns
32
- - Parallel subagent exploration
33
- - ReadLints check
34
- - AskQuestion (batch) if needed
35
-
36
- 2. **Plan Creation** (1-2 minutes)
37
- - Enhanced structure with tools
38
- - Risk assessment
39
- - Checkpoint strategy
40
- - Time estimation
41
-
42
- 3. **Plan Validation** (1 minute)
43
- - Feasibility subagent
44
- - Tool availability check
45
- - Dependency analysis
46
-
47
- 4. **Execution Monitoring**
48
- - TodoWrite tracking
49
- - Automatic checkpoints
50
- - Iteration loops
51
- - Adaptive re-planning
52
-
53
- ## Tool Integration
54
-
55
- ### Research Phase Tools
56
- - **SemanticSearch**: Find existing patterns
57
- - **Task (explore)**: Parallel codebase exploration
58
- - **ReadLints**: Check code health
59
- - **AskQuestion**: Batch clarifications
60
-
61
- ### Planning Phase Tools
62
- - **CreatePlan**: Structured plan creation
63
- - **TodoWrite**: Progress tracking setup
64
- - **Checkpoints**: Strategic rollback points
65
-
66
- ### Execution Phase Tools
67
- - **Read/Write/StrReplace**: Implementation
68
- - **Shell**: Run tests and commands
69
- - **ReadLints**: Quality validation
70
- - **Task (subagents)**: Parallel work
71
-
72
- ### Monitoring Tools
73
- - **TodoWrite**: Real-time progress
74
- - **/grind**: Iteration loops
75
- - **AskQuestion**: Blocker resolution
76
-
77
- ## Examples
78
-
79
- ### Example 1: Feature Implementation
80
-
81
- User: "Add user dashboard"
82
-
83
- Agent invokes /plan-mode-full:
84
-
85
- **Research Phase**:
86
- - SemanticSearch: "How are pages structured?"
87
- - Task (parallel):
88
- - "Find dashboard-like features"
89
- - "Find API route patterns"
90
- - "Find component patterns"
91
- - ReadLints: Check current health
92
- - AskQuestion: "Which widgets for MVP?" (batched)
93
-
94
- **Plan Phase**:
95
- Creates enhanced plan with:
96
- - Files to create/modify with patterns
97
- - Tool strategy for each step
98
- - Risk mitigation (checkpoint before API changes)
99
- - Time estimate: 45 minutes
100
-
101
- **Validation Phase**:
102
- - Task: "Validate plan feasibility"
103
- - Check: All files accessible
104
- - Verify: Tool availability
105
- - Result: PASS
106
-
107
- **Execution Phase**:
108
- - TodoWrite: Track 7 steps
109
- - Checkpoint: Before API changes
110
- - /grind loop: Fix test failures
111
- - Progress updates: After each step
112
-
113
- ### Example 2: Complex Refactor
114
-
115
- User: "Refactor authentication system"
116
-
117
- **Research Phase**:
118
- - SemanticSearch: "How is auth implemented?"
119
- - Task (parallel x4):
120
- - "Find JWT validation logic"
121
- - "Find session management"
122
- - "Find OAuth integrations"
123
- - "Find password hashing"
124
- - ReadLints: Check all auth files
125
- - AskQuestion: "Target auth method?"
126
-
127
- **Plan Phase**:
128
- - Summary: Migrate from JWT to sessions
129
- - Files: 8 files to modify
130
- - Steps: 12 steps with checkpoints
131
- - Risks: Breaking change, data migration
132
- - Time: 3 hours
133
-
134
- **Validation Phase**:
135
- - Task: Validate complexity
136
- - Warning: High risk, suggest phased approach
137
- - Result: PASS with warnings
138
-
139
- **Execution Phase**:
140
- - TodoWrite: 12 steps tracked
141
- - Checkpoints: 3 (before breaking changes)
142
- - Adaptive re-plan: Discovered legacy code
143
- - /grind: Fixed auth edge cases
144
-
145
- ### Example 3: Bug Fix
146
-
147
- User: "Fix authentication bug #123"
148
-
149
- **Research Phase**:
150
- - SemanticSearch: "How does auth flow work?"
151
- - Task: "Investigate bug #123"
152
- - ReadLints: Check auth files
153
- - Result: Token expiration issue found
154
-
155
- **Plan Phase**:
156
- - Summary: Fix JWT expiration handling
157
- - Files: 2 files to modify
158
- - Steps: 4 steps
159
- - Time: 20 minutes
160
-
161
- **Validation Phase**:
162
- - Quick validation (simple fix)
163
- - Result: PASS
164
-
165
- **Execution Phase**:
166
- - TodoWrite: 4 steps
167
- - StrReplace: Fix expiration logic
168
- - Shell: Run auth tests
169
- - ReadLints: Verify quality
170
- - Complete: Bug fixed
171
-
172
- ## Best Practices
173
-
174
- ### 1. Always Research First
175
- - Never plan blind
176
- - Spend 2-3 min on research
177
- - Find patterns before coding
178
- - Ask questions in batches
179
-
180
- ### 2. Validate Before Presenting
181
- - Use validation subagent
182
- - Check file accessibility
183
- - Verify time estimates
184
- - Flag risks explicitly
185
-
186
- ### 3. Track Progress Religiously
187
- - Update todos immediately
188
- - One task in_progress at a time
189
- - Create checkpoints strategically
190
- - Report blockers early
191
-
192
- ### 4. Iterate When Stuck
193
- - Use /grind for tests (max 5 iterations)
194
- - Update scratchpad
195
- - AskQuestion if blocked
196
- - Re-plan if >30% deviation
197
-
198
- ### 5. Time-Box Research
199
- - Max 3 minutes for research
200
- - "Good enough" threshold
201
- - Progressive disclosure
202
- - Optimize for speed
203
-
204
- ## Anti-Patterns
205
-
206
- ### ❌ Planning Without Research
207
- Bad: "I'll create a plan immediately"
208
- Good: "Let me research existing patterns first"
209
-
210
- ### ❌ Vague Plans
211
- Bad: "Implement authentication"
212
- Good: "Add JWT validation to /api/login following @src/auth/validateToken.ts pattern"
213
-
214
- ### ❌ No Validation
215
- Bad: Present plan without checking
216
- Good: Validate feasibility before presenting
217
-
218
- ### ❌ Skipping Progress Tracking
219
- Bad: Work without updating todos
220
- Good: Update TodoWrite after each step
221
-
222
- ### ❌ No Checkpoints
223
- Bad: Risky changes without rollback
224
- Good: Checkpoint before breaking changes
225
-
226
- ## Troubleshooting
227
-
228
- ### Research Taking Too Long
229
- **Problem**: >5 minutes in research phase
230
-
231
- **Solutions**:
232
- - Time-box to 3 minutes max
233
- - Use model="fast" for subagents
234
- - Narrow target_directories
235
- - Accept "good enough" patterns
236
-
237
- ### Validation Failing Repeatedly
238
- **Problem**: Plan fails validation multiple times
239
-
240
- **Solutions**:
241
- - Simplify the plan
242
- - Break into smaller phases
243
- - Add more fallback strategies
244
- - Revise time estimates
245
-
246
- ### Tests Not Passing
247
- **Problem**: /grind loop failing after 5 iterations
248
-
249
- **Solutions**:
250
- - Report BLOCKED with details
251
- - AskQuestion for guidance
252
- - Re-plan approach
253
- - Check for missing dependencies
254
-
255
- ### Plan Deviation
256
- **Problem**: Execution diverging >30% from plan
257
-
258
- **Solutions**:
259
- - Pause immediately
260
- - Create checkpoint
261
- - Assess what changed
262
- - Present updated plan
263
- - Get approval before continuing
1
+ ---
2
+ name: plan-mode-mastery
3
+ description: Research, structure, validate and execute implementation plans in Plan Mode. Use when planning a non-trivial feature, refactor or migration.
4
+ ---
5
+
6
+ # SKILL.md: Plan Mode Mastery
7
+
8
+ ## Description
9
+ Comprehensive plan mode workflow with automatic research, validation, and execution monitoring.
10
+
11
+ ## When to Use
12
+ - User requests Plan Mode
13
+ - Large feature implementation
14
+ - Complex refactoring
15
+ - Ambiguous requirements
16
+ - Multi-step tasks
17
+
18
+ ## Capabilities
19
+ - Automatic pre-plan research
20
+ - Tool-aware plan creation
21
+ - Feasibility validation
22
+ - Progress monitoring
23
+ - Adaptive re-planning
24
+ - Iteration loops
25
+
26
+ ## Commands
27
+ /plan-mode-full: Complete optimized workflow
28
+ /plan-mode-quick: Standard plan mode (no research)
29
+ /plan-mode-validate: Validate existing plan
30
+
31
+ ## Workflows
32
+
33
+ ### Full Plan Mode Workflow
34
+
35
+ 1. **Pre-Plan Research** (2-3 minutes)
36
+ - Explore (quick) for patterns
37
+ - Parallel subagent exploration
38
+ - Lint check check
39
+ - AskUserQuestion (batch) if needed
40
+
41
+ 2. **Plan Creation** (1-2 minutes)
42
+ - Enhanced structure with tools
43
+ - Risk assessment
44
+ - Checkpoint strategy
45
+ - Time estimation
46
+
47
+ 3. **Plan Validation** (1 minute)
48
+ - Feasibility subagent
49
+ - Tool availability check
50
+ - Dependency analysis
51
+
52
+ 4. **Execution Monitoring**
53
+ - TodoWrite tracking
54
+ - Automatic checkpoints
55
+ - Iteration loops
56
+ - Adaptive re-planning
57
+
58
+ ## Tool Integration
59
+
60
+ ### Research Phase Tools
61
+ - **Explore (quick)**: Find existing patterns
62
+ - **Agent (Explore)**: Parallel codebase exploration
63
+ - **Lint check**: Check code health
64
+ - **AskUserQuestion**: Batch clarifications
65
+
66
+ ### Planning Phase Tools
67
+ - **CreatePlan**: Structured plan creation
68
+ - **TodoWrite**: Progress tracking setup
69
+ - **Checkpoints**: Strategic rollback points
70
+
71
+ ### Execution Phase Tools
72
+ - **Read/Write/Edit**: Implementation
73
+ - **Bash**: Run tests and commands
74
+ - **Lint check**: Quality validation
75
+ - **Agent (subagents)**: Parallel work
76
+
77
+ ### Monitoring Tools
78
+ - **TodoWrite**: Real-time progress
79
+ - **Fix-and-retest loop**: Iteration loops
80
+ - **AskUserQuestion**: Blocker resolution
81
+
82
+ ## Examples
83
+
84
+ ### Example 1: Feature Implementation
85
+
86
+ User: "Add user dashboard"
87
+
88
+ Agent invokes /plan-mode-full:
89
+
90
+ **Research Phase**:
91
+ - Explore (quick): "How are pages structured?"
92
+ - Agent (parallel):
93
+ - "Find dashboard-like features"
94
+ - "Find API route patterns"
95
+ - "Find component patterns"
96
+ - Lint check: Check current health
97
+ - AskUserQuestion: "Which widgets for MVP?" (batched)
98
+
99
+ **Plan Phase**:
100
+ Creates enhanced plan with:
101
+ - Files to create/modify with patterns
102
+ - Tool strategy for each step
103
+ - Risk mitigation (checkpoint before API changes)
104
+ - Time estimate: 45 minutes
105
+
106
+ **Validation Phase**:
107
+ - Agent: "Validate plan feasibility"
108
+ - Check: All files accessible
109
+ - Verify: Tool availability
110
+ - Result: PASS
111
+
112
+ **Execution Phase**:
113
+ - TodoWrite: Track 7 steps
114
+ - Checkpoint: Before API changes
115
+ - fix-and-retest loop: Fix test failures
116
+ - Progress updates: After each step
117
+
118
+ ### Example 2: Complex Refactor
119
+
120
+ User: "Refactor authentication system"
121
+
122
+ **Research Phase**:
123
+ - Explore (quick): "How is auth implemented?"
124
+ - Agent (parallel x4):
125
+ - "Find JWT validation logic"
126
+ - "Find session management"
127
+ - "Find OAuth integrations"
128
+ - "Find password hashing"
129
+ - Lint check: Check all auth files
130
+ - AskUserQuestion: "Target auth method?"
131
+
132
+ **Plan Phase**:
133
+ - Summary: Migrate from JWT to sessions
134
+ - Files: 8 files to modify
135
+ - Steps: 12 steps with checkpoints
136
+ - Risks: Breaking change, data migration
137
+ - Time: 3 hours
138
+
139
+ **Validation Phase**:
140
+ - Agent: Validate complexity
141
+ - Warning: High risk, suggest phased approach
142
+ - Result: PASS with warnings
143
+
144
+ **Execution Phase**:
145
+ - TodoWrite: 12 steps tracked
146
+ - Checkpoints: 3 (before breaking changes)
147
+ - Adaptive re-plan: Discovered legacy code
148
+ - fix-and-retest: Fixed auth edge cases
149
+
150
+ ### Example 3: Bug Fix
151
+
152
+ User: "Fix authentication bug #123"
153
+
154
+ **Research Phase**:
155
+ - Explore (quick): "How does auth flow work?"
156
+ - Agent: "Investigate bug #123"
157
+ - Lint check: Check auth files
158
+ - Result: Token expiration issue found
159
+
160
+ **Plan Phase**:
161
+ - Summary: Fix JWT expiration handling
162
+ - Files: 2 files to modify
163
+ - Steps: 4 steps
164
+ - Time: 20 minutes
165
+
166
+ **Validation Phase**:
167
+ - Quick validation (simple fix)
168
+ - Result: PASS
169
+
170
+ **Execution Phase**:
171
+ - TodoWrite: 4 steps
172
+ - Edit: Fix expiration logic
173
+ - Bash: Run auth tests
174
+ - Lint check: Verify quality
175
+ - Complete: Bug fixed
176
+
177
+ ## Best Practices
178
+
179
+ ### 1. Always Research First
180
+ - Never plan blind
181
+ - Spend 2-3 min on research
182
+ - Find patterns before coding
183
+ - Ask questions in batches
184
+
185
+ ### 2. Validate Before Presenting
186
+ - Use validation subagent
187
+ - Check file accessibility
188
+ - Verify time estimates
189
+ - Flag risks explicitly
190
+
191
+ ### 3. Track Progress Religiously
192
+ - Update todos immediately
193
+ - One task in_progress at a time
194
+ - Create checkpoints strategically
195
+ - Report blockers early
196
+
197
+ ### 4. Iterate When Stuck
198
+ - Use the fix-and-retest loop for tests (max 5 iterations)
199
+ - Update scratchpad
200
+ - AskUserQuestion if blocked
201
+ - Re-plan if >30% deviation
202
+
203
+ ### 5. Time-Box Research
204
+ - Max 3 minutes for research
205
+ - "Good enough" threshold
206
+ - Progressive disclosure
207
+ - Optimize for speed
208
+
209
+ ## Anti-Patterns
210
+
211
+ ### ❌ Planning Without Research
212
+ Bad: "I'll create a plan immediately"
213
+ Good: "Let me research existing patterns first"
214
+
215
+ ### ❌ Vague Plans
216
+ Bad: "Implement authentication"
217
+ Good: "Add JWT validation to /api/login following @src/auth/validateToken.ts pattern"
218
+
219
+ ### ❌ No Validation
220
+ Bad: Present plan without checking
221
+ Good: Validate feasibility before presenting
222
+
223
+ ### ❌ Skipping Progress Tracking
224
+ Bad: Work without updating todos
225
+ Good: Update TodoWrite after each step
226
+
227
+ ### ❌ No Checkpoints
228
+ Bad: Risky changes without rollback
229
+ Good: Checkpoint before breaking changes
230
+
231
+ ## Troubleshooting
232
+
233
+ ### Research Taking Too Long
234
+ **Problem**: >5 minutes in research phase
235
+
236
+ **Solutions**:
237
+ - Time-box to 3 minutes max
238
+ - Use model="haiku" for subagents
239
+ - Narrow target_directories
240
+ - Accept "good enough" patterns
241
+
242
+ ### Validation Failing Repeatedly
243
+ **Problem**: Plan fails validation multiple times
244
+
245
+ **Solutions**:
246
+ - Simplify the plan
247
+ - Break into smaller phases
248
+ - Add more fallback strategies
249
+ - Revise time estimates
250
+
251
+ ### Tests Not Passing
252
+ **Problem**: fix-and-retest loop failing after 5 iterations
253
+
254
+ **Solutions**:
255
+ - Report BLOCKED with details
256
+ - AskUserQuestion for guidance
257
+ - Re-plan approach
258
+ - Check for missing dependencies
259
+
260
+ ### Plan Deviation
261
+ **Problem**: Execution diverging >30% from plan
262
+
263
+ **Solutions**:
264
+ - Pause immediately
265
+ - Create checkpoint
266
+ - Assess what changed
267
+ - Present updated plan
268
+ - Get approval before continuing