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.
- package/.claude/QUICK-REFERENCE.md +213 -0
- package/.claude/cost-dashboard.md +162 -0
- package/.claude/docs/COST-OPTIMIZATION.md +403 -0
- package/.claude/docs/MCP-INTEGRATION-GUIDE.md +348 -0
- package/.claude/docs/PLAN-MODE-OPTIMIZATION.md +836 -0
- package/.claude/hooks/auto-learning-review.ts +195 -0
- package/.claude/hooks/auto-lint-fix.ts +104 -0
- package/.claude/hooks/auto-security-review.ts +354 -0
- package/.claude/hooks/auto-validate.ts +348 -0
- package/.claude/hooks/plan-quality-tracker.ts +719 -0
- package/.claude/rules/anti-patterns.md +22 -0
- package/.claude/rules/context-tier-1.md +41 -0
- package/.claude/rules/context-tier-2.md +285 -0
- package/.claude/rules/general.md +25 -0
- package/.claude/rules/mcp-auto-use.md +46 -0
- package/.claude/rules/parallel-exploration-auto.md +31 -0
- package/.claude/rules/plan-mode-execution.md +289 -0
- package/.claude/rules/plan-mode-research.md +34 -0
- package/.claude/rules/plan-mode-structure.md +166 -0
- package/.claude/rules/plan-mode-validation.md +130 -0
- package/.claude/rules/security-critical.md +19 -0
- package/.claude/rules/tool-auto-selection.md +45 -0
- package/.claude/rules/tool-strategy.md +22 -0
- package/.claude/scripts/auto-validate.js +69 -0
- package/.claude/scripts/security-scan.js +45 -0
- package/.claude/security-dashboard.md +142 -0
- package/.claude/skills/backend-concurrency/SKILL.md +203 -0
- package/.claude/skills/debug-optimizer/SKILL.md +399 -0
- package/.claude/skills/debug-optimizer.md +12 -0
- package/.claude/skills/golang-guide/SKILL.md +177 -0
- package/.claude/skills/learning-loop/SKILL.md +308 -0
- package/.claude/skills/mcp-mastery/SKILL.md +214 -0
- package/.claude/skills/nestjs-guide/SKILL.md +197 -0
- package/.claude/skills/nextjs-guide/SKILL.md +687 -0
- package/.claude/skills/nextjs.md +13 -0
- package/.claude/skills/parallel-exploration/SKILL.md +193 -0
- package/.claude/skills/plan-mode-mastery/SKILL.md +263 -0
- package/.claude/skills/python-guide/SKILL.md +822 -0
- package/.claude/skills/react-guide/SKILL.md +762 -0
- package/.claude/skills/react.md +12 -0
- package/.claude/skills/security.md +18 -0
- package/.claude/skills/solidity-guide/SKILL.md +32 -0
- package/.claude/skills/tool-selection/SKILL.md +428 -0
- package/.claude/skills/vite-guide/SKILL.md +445 -0
- package/CLAUDE.md +49 -0
- package/README.md +65 -2
- package/bin/cli.js +50 -0
- package/package.json +44 -4
|
@@ -0,0 +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.*
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# Cost Dashboard
|
|
2
|
+
|
|
3
|
+
**Last Updated**: Auto-generated after each plan execution
|
|
4
|
+
**Tracking Status**: ✅ Enabled
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Recent Plans (Last 10)
|
|
9
|
+
|
|
10
|
+
| # | Date | Type | Cost (tokens) | Efficiency | Accuracy | Status |
|
|
11
|
+
|---|------|------|---------------|------------|----------|--------|
|
|
12
|
+
| 1 | - | - | - | - | - | Pending first plan |
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Cost Trends
|
|
17
|
+
|
|
18
|
+
### This Week
|
|
19
|
+
- **Total Plans**: 0
|
|
20
|
+
- **Total Cost**: 0 tokens
|
|
21
|
+
- **Average Cost/Plan**: 0 tokens
|
|
22
|
+
- **Target**: <8,000 tokens/plan
|
|
23
|
+
|
|
24
|
+
### Cost Distribution
|
|
25
|
+
- **Tier 1 Tools** (Read/Glob/Grep): 0% (target: >60%)
|
|
26
|
+
- **Tier 2 Tools** (SemanticSearch/Write): 0%
|
|
27
|
+
- **Tier 3 Tools** (Task/ReadLints): 0%
|
|
28
|
+
- **Tier 4 Tools** (MCP/Browser): 0% (target: <30%)
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Budget Tracking
|
|
33
|
+
|
|
34
|
+
| Task Type | Budget | Actual | Variance | Status |
|
|
35
|
+
|-----------|--------|--------|----------|--------|
|
|
36
|
+
| Simple Fix | 3,000 | 0 | 0 | ✅ On budget |
|
|
37
|
+
| Feature Implementation | 15,000 | 0 | 0 | ✅ On budget |
|
|
38
|
+
| Complex Refactor | 20,000 | 0 | 0 | ✅ On budget |
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Most Expensive Plans (Top 5)
|
|
43
|
+
|
|
44
|
+
| Rank | Date | Type | Cost | Reason |
|
|
45
|
+
|------|------|------|------|--------|
|
|
46
|
+
| 1 | - | - | - | - |
|
|
47
|
+
| 2 | - | - | - | - |
|
|
48
|
+
| 3 | - | - | - | - |
|
|
49
|
+
| 4 | - | - | - | - |
|
|
50
|
+
| 5 | - | - | - | - |
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Optimization Wins
|
|
55
|
+
|
|
56
|
+
### This Week
|
|
57
|
+
- **Token Savings**: 0 tokens (vs baseline)
|
|
58
|
+
- **Efficiency Improvement**: 0% (vs baseline)
|
|
59
|
+
- **Best Optimized Plan**: None yet
|
|
60
|
+
|
|
61
|
+
### Successful Patterns
|
|
62
|
+
1. **Tool Escalation**: Start with Tier 1, escalate only if needed
|
|
63
|
+
2. **Research-First**: 2-3 min research prevents wasted iterations
|
|
64
|
+
3. **MCP Optimization**: Use MCP only when essential
|
|
65
|
+
4. **Fast Model**: Use `model="fast"` for 90% of subagents
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Cost Alerts
|
|
70
|
+
|
|
71
|
+
### Alert Thresholds
|
|
72
|
+
- **Single Plan**: >20,000 tokens ⚠️
|
|
73
|
+
- **Daily Total**: >100,000 tokens ⚠️
|
|
74
|
+
- **Weekly Average**: >10,000 tokens/plan ⚠️
|
|
75
|
+
|
|
76
|
+
### Recent Alerts
|
|
77
|
+
- No alerts triggered yet
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## ROI Calculation
|
|
82
|
+
|
|
83
|
+
### Time Saved
|
|
84
|
+
- **Estimated Time Saved**: 0 hours (vs manual implementation)
|
|
85
|
+
- **Developer Rate**: $50/hour (assumed)
|
|
86
|
+
- **Time Savings Value**: $0
|
|
87
|
+
|
|
88
|
+
### Token Cost
|
|
89
|
+
- **Total Token Cost**: $0 (estimated)
|
|
90
|
+
- **Net Savings**: $0
|
|
91
|
+
|
|
92
|
+
### Payback Period
|
|
93
|
+
- **Implementation Time**: 3 hours
|
|
94
|
+
- **Payback**: <1 week (projected)
|
|
95
|
+
- **Annual ROI**: $6,000+ per developer (projected)
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Efficiency Score
|
|
100
|
+
|
|
101
|
+
**Current Score**: 75/100 (Baseline)
|
|
102
|
+
|
|
103
|
+
**Calculation**:
|
|
104
|
+
```
|
|
105
|
+
Efficiency = (Tier1_Usage × 1.0 + Tier2_Usage × 0.8 + Tier3_Usage × 0.6 + Tier4_Usage × 0.4) / Total_Usage × 100
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Targets**:
|
|
109
|
+
- **Excellent**: >85%
|
|
110
|
+
- **Good**: >70%
|
|
111
|
+
- **Needs Work**: <60%
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Cost Optimization Checklist
|
|
116
|
+
|
|
117
|
+
### Before Starting Task
|
|
118
|
+
- [ ] Define clear success criteria
|
|
119
|
+
- [ ] Estimate complexity (simple/medium/complex)
|
|
120
|
+
- [ ] Identify cheapest tool sequence
|
|
121
|
+
- [ ] Set cost budget based on task type
|
|
122
|
+
|
|
123
|
+
### During Execution
|
|
124
|
+
- [ ] Follow tool escalation protocol (Tier 1 → Tier 4)
|
|
125
|
+
- [ ] Use Tier 1 tools first (Read/Glob/Grep)
|
|
126
|
+
- [ ] Avoid MCP unless essential
|
|
127
|
+
- [ ] Track tool usage mentally
|
|
128
|
+
|
|
129
|
+
### After Completion
|
|
130
|
+
- [ ] Review actual cost vs estimate
|
|
131
|
+
- [ ] Check efficiency score (target: >70%)
|
|
132
|
+
- [ ] Identify optimization opportunities
|
|
133
|
+
- [ ] Log learnings for future reference
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## Related Documentation
|
|
138
|
+
|
|
139
|
+
- `.cursor/docs/COST-OPTIMIZATION.md` - Complete cost optimization guide
|
|
140
|
+
- `.cursor/hooks.config.json` - Cost tracking configuration
|
|
141
|
+
- `.cursor/skills/tool-selection/SKILL.md` - Tool selection decision trees
|
|
142
|
+
- `AGENT-INSTRUCTION-BEST-PRACTICES.md` - Research backing (ETH Zurich cost findings)
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Maintenance
|
|
147
|
+
|
|
148
|
+
### Weekly Review
|
|
149
|
+
- [ ] Review cost metrics and trends
|
|
150
|
+
- [ ] Identify most expensive plans
|
|
151
|
+
- [ ] Document optimization wins
|
|
152
|
+
- [ ] Adjust thresholds if needed
|
|
153
|
+
|
|
154
|
+
### Monthly Review
|
|
155
|
+
- [ ] Analyze cost trends
|
|
156
|
+
- [ ] Update benchmarks
|
|
157
|
+
- [ ] Refine optimization strategies
|
|
158
|
+
- [ ] Calculate actual ROI
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
*This dashboard is automatically updated by the plan-quality-tracker hook*
|