claudify-agent 0.0.0-stage → 1.0.0

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 (48) hide show
  1. package/.claude/QUICK-REFERENCE.md +213 -0
  2. package/.claude/cost-dashboard.md +162 -0
  3. package/.claude/docs/COST-OPTIMIZATION.md +403 -0
  4. package/.claude/docs/MCP-INTEGRATION-GUIDE.md +348 -0
  5. package/.claude/docs/PLAN-MODE-OPTIMIZATION.md +836 -0
  6. package/.claude/hooks/auto-learning-review.ts +195 -0
  7. package/.claude/hooks/auto-lint-fix.ts +104 -0
  8. package/.claude/hooks/auto-security-review.ts +354 -0
  9. package/.claude/hooks/auto-validate.ts +348 -0
  10. package/.claude/hooks/plan-quality-tracker.ts +719 -0
  11. package/.claude/rules/anti-patterns.md +22 -0
  12. package/.claude/rules/context-tier-1.md +41 -0
  13. package/.claude/rules/context-tier-2.md +285 -0
  14. package/.claude/rules/general.md +25 -0
  15. package/.claude/rules/mcp-auto-use.md +46 -0
  16. package/.claude/rules/parallel-exploration-auto.md +31 -0
  17. package/.claude/rules/plan-mode-execution.md +289 -0
  18. package/.claude/rules/plan-mode-research.md +34 -0
  19. package/.claude/rules/plan-mode-structure.md +166 -0
  20. package/.claude/rules/plan-mode-validation.md +130 -0
  21. package/.claude/rules/security-critical.md +19 -0
  22. package/.claude/rules/tool-auto-selection.md +45 -0
  23. package/.claude/rules/tool-strategy.md +22 -0
  24. package/.claude/scripts/auto-validate.js +69 -0
  25. package/.claude/scripts/security-scan.js +45 -0
  26. package/.claude/security-dashboard.md +142 -0
  27. package/.claude/skills/backend-concurrency/SKILL.md +203 -0
  28. package/.claude/skills/debug-optimizer/SKILL.md +399 -0
  29. package/.claude/skills/debug-optimizer.md +12 -0
  30. package/.claude/skills/golang-guide/SKILL.md +177 -0
  31. package/.claude/skills/learning-loop/SKILL.md +308 -0
  32. package/.claude/skills/mcp-mastery/SKILL.md +214 -0
  33. package/.claude/skills/nestjs-guide/SKILL.md +197 -0
  34. package/.claude/skills/nextjs-guide/SKILL.md +687 -0
  35. package/.claude/skills/nextjs.md +13 -0
  36. package/.claude/skills/parallel-exploration/SKILL.md +193 -0
  37. package/.claude/skills/plan-mode-mastery/SKILL.md +263 -0
  38. package/.claude/skills/python-guide/SKILL.md +822 -0
  39. package/.claude/skills/react-guide/SKILL.md +762 -0
  40. package/.claude/skills/react.md +12 -0
  41. package/.claude/skills/security.md +18 -0
  42. package/.claude/skills/solidity-guide/SKILL.md +32 -0
  43. package/.claude/skills/tool-selection/SKILL.md +428 -0
  44. package/.claude/skills/vite-guide/SKILL.md +445 -0
  45. package/CLAUDE.md +49 -0
  46. package/README.md +65 -2
  47. package/bin/cli.js +50 -0
  48. package/package.json +44 -4
@@ -0,0 +1,193 @@
1
+ # SKILL.md: Parallel Exploration
2
+
3
+ ## Description
4
+ Automatically launch multiple subagents in parallel for broad codebase exploration, reducing discovery time by 60-70%.
5
+
6
+ ## When to Use
7
+ - Complex feature implementation (>5 files)
8
+ - Large refactors
9
+ - Bug investigation (root cause unknown)
10
+ - New codebase unfamiliarity
11
+ - Multi-part tasks
12
+
13
+ ## Automatic Triggers
14
+
15
+ **Launch parallel subagents when**:
16
+ - User request mentions >3 different areas
17
+ - Task complexity: High (requires >10 steps)
18
+ - Codebase unfamiliarity detected
19
+ - Investigation phase taking >5 minutes
20
+
21
+ ## Parallel Exploration Patterns
22
+
23
+ ### Pattern 1: Feature Implementation
24
+
25
+ ```
26
+ User: "Add user dashboard"
27
+
28
+ Parallel Subagents (model="fast", run_in_background=true):
29
+ 1. "Find dashboard-like pages and layouts"
30
+ 2. "Find API route patterns for data fetching"
31
+ 3. "Find component structures for widgets"
32
+ 4. "Find existing chart/visualization libraries"
33
+
34
+ Duration: 60s parallel (vs 240s sequential)
35
+ Output: Consolidated findings → Plan creation
36
+ ```
37
+
38
+ ### Pattern 2: Bug Investigation
39
+
40
+ ```
41
+ User: "Checkout randomly fails"
42
+
43
+ Parallel Subagents:
44
+ 1. "Find checkout flow code (UI → API → DB)"
45
+ 2. "Find error handling in payment processing"
46
+ 3. "Find recent changes to checkout files"
47
+ 4. "Find similar issues/fixes in codebase"
48
+
49
+ Duration: 90s parallel
50
+ Output: Root cause hypothesis + fix locations
51
+ ```
52
+
53
+ ### Pattern 3: Large Refactor
54
+
55
+ ```
56
+ User: "Migrate from JWT to sessions"
57
+
58
+ Parallel Subagents:
59
+ 1. "Find all JWT validation code"
60
+ 2. "Find all token generation code"
61
+ 3. "Find all authentication middleware"
62
+ 4. "Find all tests using JWT"
63
+
64
+ Duration: 120s parallel
65
+ Output: Complete migration map + risk assessment
66
+ ```
67
+
68
+ ## Subagent Configuration
69
+
70
+ ```typescript
71
+ // Optimal configuration for parallel exploration
72
+ Task:
73
+ description="Explore [specific area]"
74
+ prompt="Find [specific pattern/code] in [target directory]"
75
+ subagent_type="explore"
76
+ model="fast" // Cost optimization
77
+ readonly=true // Safety
78
+ run_in_background=true // Non-blocking
79
+ ```
80
+
81
+ ## Cost Optimization
82
+
83
+ **Subagent Cost Hierarchy**:
84
+ ```
85
+ explore (fast model): $ (Use for discovery)
86
+ generalPurpose (fast): $$ (Use for analysis)
87
+ generalPurpose (capable): $$$ (Use for complex reasoning)
88
+ browser-use: $$$$ (Use only when browser needed)
89
+ ```
90
+
91
+ **Mandatory Cost Rules**:
92
+ 1. **ALWAYS** use `model="fast"` for exploration subagents (90% of cases)
93
+ 2. **ONLY** use capable model for:
94
+ - Complex reasoning tasks
95
+ - Multi-step analysis
96
+ - Security-critical reviews
97
+ 3. **DOCUMENT** model choice in plan (justify if not "fast")
98
+ 4. Use `readonly=true` unless modification needed
99
+ 5. Use `run_in_background=true` for non-blocking
100
+ 6. Limit to 4 parallel subagents max (diminishing returns)
101
+ 7. Time-box to 120s max per subagent
102
+
103
+ **Cost Impact**: Using `model="fast"` reduces exploration costs by 50-70%
104
+
105
+ ## Consolidation Strategy
106
+
107
+ **After parallel exploration completes**:
108
+
109
+ 1. **Aggregate findings** from all subagents
110
+ 2. **Identify overlaps** (multiple agents found same thing)
111
+ 3. **Resolve conflicts** (contradictory findings)
112
+ 4. **Create unified map** of codebase areas
113
+ 5. **Generate plan** using consolidated knowledge
114
+
115
+ **Example Consolidation**:
116
+ ```markdown
117
+ ## Exploration Results (4 subagents, 60s parallel)
118
+
119
+ ### Consensus Findings (found by multiple agents)
120
+ - Page structure: `app/[feature]/page.tsx` pattern
121
+ - API routes: `app/api/[resource]/route.ts`
122
+ - Components: `components/[feature]/` directory
123
+
124
+ ### Unique Findings
125
+ - Agent 1: Found layout pattern in `app/layout.tsx`
126
+ - Agent 2: Found data fetching in `lib/fetcher.ts`
127
+ - Agent 3: Found component examples in `components/`
128
+ - Agent 4: Found chart library: Recharts in use
129
+
130
+ ### Next Steps
131
+ - Follow `@app/profile/page.tsx` for page structure
132
+ - Use `@lib/fetcher.ts` for API calls
133
+ - Reference `@components/Card.tsx` for component pattern
134
+ ```
135
+
136
+ ## Examples
137
+
138
+ ### Example 1: New Feature
139
+
140
+ User: "Add activity feed to user profile"
141
+
142
+ Automatic parallel exploration:
143
+ ```
144
+ Subagent 1: "Find profile page structure"
145
+ Subagent 2: "Find feed/activity patterns"
146
+ Subagent 3: "Find API patterns for real-time data"
147
+ Subagent 4: "Find websocket/pubsub usage"
148
+
149
+ Result: Complete implementation map in 60s
150
+ ```
151
+
152
+ ### Example 2: Complex Bug
153
+
154
+ User: "User sessions expire prematurely"
155
+
156
+ Automatic parallel exploration:
157
+ ```
158
+ Subagent 1: "Find session management code"
159
+ Subagent 2: "Find session expiration logic"
160
+ Subagent 3: "Find recent changes to auth files"
161
+ Subagent 4: "Find session-related tests"
162
+
163
+ Result: Root cause identified in 90s
164
+ ```
165
+
166
+ ### Example 3: Large Refactor
167
+
168
+ User: "Migrate from REST to GraphQL"
169
+
170
+ Automatic parallel exploration:
171
+ ```
172
+ Subagent 1: "Find all REST API calls"
173
+ Subagent 2: "Find data fetching patterns"
174
+ Subagent 3: "Find existing GraphQL usage"
175
+ Subagent 4: "Find mutation operations"
176
+
177
+ Result: Complete migration strategy in 120s
178
+ ```
179
+
180
+ ## Anti-Patterns
181
+
182
+ ❌ **Don't**:
183
+ - Launch >4 parallel subagents (chaos)
184
+ - Use capable model for simple exploration (waste)
185
+ - Run subagents sequentially (defeats purpose)
186
+ - Forget to consolidate findings (confusion)
187
+
188
+ ✅ **Do**:
189
+ - Use `model="fast"` for exploration
190
+ - Launch 2-4 subagents in parallel
191
+ - Time-box to 120s max
192
+ - Consolidate findings before planning
193
+ - Reference specific files found
@@ -0,0 +1,263 @@
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