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.
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,213 +1,213 @@
1
- # Quick Reference
2
-
3
- **For**: Cursor Agent Optimization
4
- **Updated**: March 30, 2026
5
-
6
- ---
7
-
8
- ## Commands
9
-
10
- ### Learning Loop
11
- ```
12
- /learning-loop-weekly - Weekly performance review
13
- /learning-loop-patterns - Detected anti-patterns
14
- /learning-loop-suggest - Improvement suggestions
15
- /learning-loop-analyze - Full pattern analysis
16
- ```
17
-
18
- ### Plan Mode
19
- ```
20
- /plan-mode-full - Complete optimized workflow
21
- /plan-mode-quick - Standard plan mode (no research)
22
- /plan-mode-validate - Validate existing plan
23
- ```
24
-
25
- ---
26
-
27
- ## Files to Check
28
-
29
- ### Metrics & Dashboards
30
- | File | Purpose |
31
- |------|---------|
32
- | `.cursor/plan-metrics.json` | Recent plan metrics (accuracy, cost, efficiency) |
33
- | `.cursor/weekly-learning-report.md` | Weekly insights & patterns |
34
- | `.cursor/cost-dashboard.md` | Cost tracking & ROI |
35
- | `.cursor/security-dashboard.md` | Security trends & vulnerabilities |
36
-
37
- ### Configuration
38
- | File | Purpose |
39
- |------|---------|
40
- | `.cursor/hooks.config.json` | Hook configuration & thresholds |
41
- | `.cursor/hooks.json` | Hook triggers & commands |
42
- | `AGENTS.md` | Repository context (root level) |
43
-
44
- ### Rules & Skills
45
- | File | Purpose |
46
- |------|---------|
47
- | `.cursor/rules/general.md` | Essential rules (always loaded) |
48
- | `.cursor/rules/mcp-auto-use.md` | MCP server triggers |
49
- | `.cursor/rules/parallel-exploration-auto.md` | Subagent triggers |
50
- | `.cursor/skills/tool-selection/SKILL.md` | Tool decision trees |
51
- | `.cursor/skills/parallel-exploration/SKILL.md` | Subagent patterns |
52
- | `.cursor/skills/learning-loop/SKILL.md` | Learning loop workflow |
53
-
54
- ---
55
-
56
- ## Thresholds & Targets
57
-
58
- ### Performance Targets
59
- | Metric | Target | Status Check |
60
- |--------|--------|--------------|
61
- | Plan Accuracy | >80% | `.cursor/plan-metrics.json` |
62
- | Tool Efficiency | >70% | Efficiency score |
63
- | Avg Iterations | <2.0 | Loop count |
64
- | Security Coverage | 100% | Scans per change |
65
-
66
- ### Cost Targets
67
- | Task Type | Budget | Alert Threshold |
68
- |-----------|--------|----------------|
69
- | Simple Fix | 3,000 tokens | >5,000 |
70
- | Feature Implementation | 15,000 tokens | >20,000 |
71
- | Complex Refactor | 20,000 tokens | >25,000 |
72
- | Daily Total | - | >100,000 |
73
- | Weekly Average | 10,000/plan | >15,000/plan |
74
-
75
- ### MCP Usage
76
- | Server | Target Usage | When to Use |
77
- |--------|--------------|-------------|
78
- | user-context7 | High (liberal) | Library/framework questions |
79
- | user-ESLint | Auto (every change) | After EVERY code change |
80
- | user-github | Moderate | Git/GitHub operations |
81
- | cursor-ide-browser | Low (sparingly) | Visual verification only |
82
-
83
- ---
84
-
85
- ## Anti-Patterns (Auto-Detected)
86
-
87
- ### Critical (Fix Immediately)
88
- 1. **Planning Without Research**
89
- - Detection: No SemanticSearch in last 3 plans
90
- - Fix: Always research 2-3 min before planning
91
-
92
- 2. **Repeated Execution Failures**
93
- - Detection: 2+ plans with <60% accuracy
94
- - Fix: Add validation subagent, create checkpoints
95
-
96
- ### High Priority (Fix This Week)
97
- 3. **Over-Engineering**
98
- - Detection: Avg tool efficiency <50% over 3 plans
99
- - Fix: Follow tool escalation (Tier 1 → Tier 4)
100
-
101
- 4. **Skipping Validation**
102
- - Detection: No ReadLints/tests in 3 plans
103
- - Fix: Enable auto-validate hook
104
-
105
- ### Medium Priority (Fix Next Week)
106
- 5. **MCP Overuse**
107
- - Detection: High MCP usage + low accuracy
108
- - Fix: Use MCP only when essential
109
-
110
- 6. **Context Bloat**
111
- - Detection: Rules >20 lines, low efficiency
112
- - Fix: Apply minimalism, use references
113
-
114
- ---
115
-
116
- ## Tool Escalation Protocol
117
-
118
- **Rule**: Start cheap, escalate only if needed
119
-
120
- ### Tier 1 (Always Try First) - Cheapest
121
- - **Read**: Single file access (500 tokens)
122
- - **Glob**: Pattern matching (200 tokens)
123
- - **Grep**: Exact text search (300 tokens)
124
- - **Shell**: Command execution (100 tokens)
125
-
126
- ### Tier 2 (If Tier 1 Insufficient) - Moderate
127
- - **SemanticSearch**: Conceptual search (1,500 tokens)
128
- - **StrReplace**: Small edits <50 lines (500 tokens)
129
- - **Write**: New files (1,000 tokens)
130
-
131
- ### Tier 3 (If Tier 2 Inadequate) - Higher
132
- - **Task**: Complex exploration (3,000 tokens)
133
- - **ReadLints**: Quality checks (800 tokens)
134
- - **WebSearch/WebFetch**: External info (2,000+ tokens)
135
-
136
- ### Tier 4 (Last Resort) - Most Expensive
137
- - **Parallel Subagents**: Multi-angle (3,000 each)
138
- - **Browser MCP**: Visual verification (5,000+)
139
- - **Complex Workflows**: Multi-step automation
140
-
141
- ---
142
-
143
- ## Pre-Commit Checklist
144
-
145
- Before committing ANY code:
146
-
147
- - [ ] **Security review passed** (auto-run after changes)
148
- - [ ] **Lint clean** (auto-fixed by hook)
149
- - [ ] **Tests passing** (auto-run)
150
- - [ ] **Type check passed** (TypeScript)
151
- - [ ] **Cost within budget** (check `.cursor/cost-dashboard.md`)
152
- - [ ] **No anti-patterns detected** (check `.cursor/weekly-learning-report.md`)
153
-
154
- ---
155
-
156
- ## Best Practices
157
-
158
- ### Research Phase (2-3 min)
159
- 1. SemanticSearch for existing patterns
160
- 2. Launch parallel subagents if complex
161
- 3. ReadLints for code health
162
- 4. Batch questions with AskQuestion
163
-
164
- ### Planning Phase (1-2 min)
165
- 1. Follow enhanced plan structure
166
- 2. Include tool strategy section
167
- 3. Add risk mitigation
168
- 4. Define checkpoints
169
-
170
- ### Execution Phase
171
- 1. Create TodoWrite automatically
172
- 2. Update after each step
173
- 3. Run validation after changes
174
- 4. Report blockers early
175
-
176
- ### Review Phase
177
- 1. Check plan accuracy
178
- 2. Review cost metrics
179
- 3. Update dashboards
180
- 4. Document learnings
181
-
182
- ---
183
-
184
- ## Troubleshooting
185
-
186
- ### Plan Accuracy <70%
187
- **Cause**: Insufficient research
188
- **Fix**: Spend 2-3 min on SemanticSearch, launch subagents
189
-
190
- ### Tool Efficiency <60%
191
- **Cause**: Using expensive tools unnecessarily
192
- **Fix**: Follow escalation protocol, start with Tier 1
193
-
194
- ### Too Many Iterations (>3)
195
- **Cause**: Poor feasibility validation
196
- **Fix**: Add validation subagent, create checkpoints
197
-
198
- ### MCP Success Rate <50%
199
- **Cause**: Wrong tool for task
200
- **Fix**: Review MCP usage, use built-in tools instead
201
-
202
- ---
203
-
204
- ## Related Documentation
205
-
206
- - `AGENT-INSTRUCTION-BEST-PRACTICES.md` - Core research
207
- - `.cursor/docs/COST-OPTIMIZATION.md` - Cost tracking guide
208
- - `.cursor/docs/PLAN-MODE-OPTIMIZATION.md` - Plan mode workflow
209
- - `.cursor/OPTIMIZATION-COMPLETE.md` - Implementation summary
210
-
211
- ---
212
-
213
- *Quick reference for daily use. For detailed guides, see documentation above.*
1
+ # Quick Reference
2
+
3
+ **For**: Claude Code Agent Optimization
4
+ **Updated**: March 30, 2026
5
+
6
+ ---
7
+
8
+ ## Commands
9
+
10
+ ### Learning Loop
11
+ ```
12
+ /learning-loop-weekly - Weekly performance review
13
+ /learning-loop-patterns - Detected anti-patterns
14
+ /learning-loop-suggest - Improvement suggestions
15
+ /learning-loop-analyze - Full pattern analysis
16
+ ```
17
+
18
+ ### Plan Mode
19
+ ```
20
+ /plan-mode-full - Complete optimized workflow
21
+ /plan-mode-quick - Standard plan mode (no research)
22
+ /plan-mode-validate - Validate existing plan
23
+ ```
24
+
25
+ ---
26
+
27
+ ## Files to Check
28
+
29
+ ### Metrics & Dashboards
30
+ | File | Purpose |
31
+ |------|---------|
32
+ | `.claude/plan-metrics.json` | Recent plan metrics (accuracy, cost, efficiency) |
33
+ | `.claude/weekly-learning-report.md` | Weekly insights & patterns |
34
+ | `.claude/cost-dashboard.md` | Cost tracking & ROI |
35
+ | `.claude/security-dashboard.md` | Security trends & vulnerabilities |
36
+
37
+ ### Configuration
38
+ | File | Purpose |
39
+ |------|---------|
40
+ | `.claude/hooks.config.json` | Hook configuration & thresholds |
41
+ | `.claude/settings.json` | Hook triggers & commands |
42
+ | `AGENTS.md` | Repository context (root level) |
43
+
44
+ ### Rules & Skills
45
+ | File | Purpose |
46
+ |------|---------|
47
+ | `.claude/rules/general.md` | Essential rules (always loaded) |
48
+ | `.claude/rules/mcp-auto-use.md` | MCP server triggers |
49
+ | `.claude/rules/parallel-exploration-auto.md` | Subagent triggers |
50
+ | `.claude/skills/tool-selection/SKILL.md` | Tool decision trees |
51
+ | `.claude/skills/parallel-exploration/SKILL.md` | Subagent patterns |
52
+ | `.claude/skills/learning-loop/SKILL.md` | Learning loop workflow |
53
+
54
+ ---
55
+
56
+ ## Thresholds & Targets
57
+
58
+ ### Performance Targets
59
+ | Metric | Target | Status Check |
60
+ |--------|--------|--------------|
61
+ | Plan Accuracy | >80% | `.claude/plan-metrics.json` |
62
+ | Tool Efficiency | >70% | Efficiency score |
63
+ | Avg Iterations | <2.0 | Loop count |
64
+ | Security Coverage | 100% | Scans per change |
65
+
66
+ ### Cost Targets
67
+ | Task Type | Budget | Alert Threshold |
68
+ |-----------|--------|----------------|
69
+ | Simple Fix | 3,000 tokens | >5,000 |
70
+ | Feature Implementation | 15,000 tokens | >20,000 |
71
+ | Complex Refactor | 20,000 tokens | >25,000 |
72
+ | Daily Total | - | >100,000 |
73
+ | Weekly Average | 10,000/plan | >15,000/plan |
74
+
75
+ ### MCP Usage
76
+ | Server | Target Usage | When to Use |
77
+ |--------|--------------|-------------|
78
+ | context7 | High (liberal) | Library/framework questions |
79
+ | eslint | Auto (every change) | After EVERY code change |
80
+ | github | Moderate | Git/GitHub operations |
81
+ | claude-in-chrome | Low (sparingly) | Visual verification only |
82
+
83
+ ---
84
+
85
+ ## Anti-Patterns (Auto-Detected)
86
+
87
+ ### Critical (Fix Immediately)
88
+ 1. **Planning Without Research**
89
+ - Detection: No Explore (quick) in last 3 plans
90
+ - Fix: Always research 2-3 min before planning
91
+
92
+ 2. **Repeated Execution Failures**
93
+ - Detection: 2+ plans with <60% accuracy
94
+ - Fix: Add validation subagent, create checkpoints
95
+
96
+ ### High Priority (Fix This Week)
97
+ 3. **Over-Engineering**
98
+ - Detection: Avg tool efficiency <50% over 3 plans
99
+ - Fix: Follow tool escalation (Tier 1 → Tier 4)
100
+
101
+ 4. **Skipping Validation**
102
+ - Detection: No Lint check/tests in 3 plans
103
+ - Fix: Enable auto-validate hook
104
+
105
+ ### Medium Priority (Fix Next Week)
106
+ 5. **MCP Overuse**
107
+ - Detection: High MCP usage + low accuracy
108
+ - Fix: Use MCP only when essential
109
+
110
+ 6. **Context Bloat**
111
+ - Detection: Rules >20 lines, low efficiency
112
+ - Fix: Apply minimalism, use references
113
+
114
+ ---
115
+
116
+ ## Tool Escalation Protocol
117
+
118
+ **Rule**: Start cheap, escalate only if needed
119
+
120
+ ### Tier 1 (Always Try First) - Cheapest
121
+ - **Read**: Single file access (500 tokens)
122
+ - **Glob**: Pattern matching (200 tokens)
123
+ - **Grep**: Exact text search (300 tokens)
124
+ - **Bash**: Command execution (100 tokens)
125
+
126
+ ### Tier 2 (If Tier 1 Insufficient) - Moderate
127
+ - **Explore (quick)**: Conceptual search (1,500 tokens)
128
+ - **Edit**: Small edits <50 lines (500 tokens)
129
+ - **Write**: New files (1,000 tokens)
130
+
131
+ ### Tier 3 (If Tier 2 Inadequate) - Higher
132
+ - **Agent**: Complex exploration (3,000 tokens)
133
+ - **Lint check**: Quality checks (800 tokens)
134
+ - **WebSearch/WebFetch**: External info (2,000+ tokens)
135
+
136
+ ### Tier 4 (Last Resort) - Most Expensive
137
+ - **Parallel Subagents**: Multi-angle (3,000 each)
138
+ - **Browser MCP**: Visual verification (5,000+)
139
+ - **Complex Workflows**: Multi-step automation
140
+
141
+ ---
142
+
143
+ ## Pre-Commit Checklist
144
+
145
+ Before committing ANY code:
146
+
147
+ - [ ] **Security review passed** (auto-run after changes)
148
+ - [ ] **Lint clean** (auto-fixed by hook)
149
+ - [ ] **Tests passing** (auto-run)
150
+ - [ ] **Type check passed** (TypeScript)
151
+ - [ ] **Cost within budget** (check `.claude/cost-dashboard.md`)
152
+ - [ ] **No anti-patterns detected** (check `.claude/weekly-learning-report.md`)
153
+
154
+ ---
155
+
156
+ ## Best Practices
157
+
158
+ ### Research Phase (2-3 min)
159
+ 1. Explore (quick) for existing patterns
160
+ 2. Launch parallel subagents if complex
161
+ 3. Lint check for code health
162
+ 4. Batch questions with AskUserQuestion
163
+
164
+ ### Planning Phase (1-2 min)
165
+ 1. Follow enhanced plan structure
166
+ 2. Include tool strategy section
167
+ 3. Add risk mitigation
168
+ 4. Define checkpoints
169
+
170
+ ### Execution Phase
171
+ 1. Create TodoWrite automatically
172
+ 2. Update after each step
173
+ 3. Run validation after changes
174
+ 4. Report blockers early
175
+
176
+ ### Review Phase
177
+ 1. Check plan accuracy
178
+ 2. Review cost metrics
179
+ 3. Update dashboards
180
+ 4. Document learnings
181
+
182
+ ---
183
+
184
+ ## Troubleshooting
185
+
186
+ ### Plan Accuracy <70%
187
+ **Cause**: Insufficient research
188
+ **Fix**: Spend 2-3 min on Explore (quick), launch subagents
189
+
190
+ ### Tool Efficiency <60%
191
+ **Cause**: Using expensive tools unnecessarily
192
+ **Fix**: Follow escalation protocol, start with Tier 1
193
+
194
+ ### Too Many Iterations (>3)
195
+ **Cause**: Poor feasibility validation
196
+ **Fix**: Add validation subagent, create checkpoints
197
+
198
+ ### MCP Success Rate <50%
199
+ **Cause**: Wrong tool for task
200
+ **Fix**: Review MCP usage, use built-in tools instead
201
+
202
+ ---
203
+
204
+ ## Related Documentation
205
+
206
+ - `AGENT-INSTRUCTION-BEST-PRACTICES.md` - Core research
207
+ - `.claude/docs/COST-OPTIMIZATION.md` - Cost tracking guide
208
+ - `.claude/docs/PLAN-MODE-OPTIMIZATION.md` - Plan mode workflow
209
+ - `.claude/settings.json` - Hook wiring (PostToolUse / Stop / SessionStart)
210
+
211
+ ---
212
+
213
+ *Quick reference for daily use. For detailed guides, see documentation above.*