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,399 +1,420 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
✓
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
-
|
|
167
|
-
-
|
|
168
|
-
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
-
|
|
197
|
-
-
|
|
198
|
-
-
|
|
199
|
-
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
-
|
|
228
|
-
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
-
|
|
248
|
-
-
|
|
249
|
-
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
-
|
|
328
|
-
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
-
|
|
349
|
-
-
|
|
350
|
-
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
###
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
**
|
|
1
|
+
---
|
|
2
|
+
name: debug-optimizer
|
|
3
|
+
description: Coordinate tools, MCP servers, subagents and validation hooks for debugging and multi-step tasks. Use when investigating a bug, a failing test, or a task spanning many files.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# SKILL.md: Debug Optimizer
|
|
7
|
+
|
|
8
|
+
## Description
|
|
9
|
+
Automatic optimization of debugging and multi-step workflows for maximum efficiency. Coordinates tools, MCPs, skills, hooks, and rules.
|
|
10
|
+
|
|
11
|
+
## When to Use (Automatic Activation)
|
|
12
|
+
**This skill activates AUTOMATICALLY for debugging and multi-step tasks.**
|
|
13
|
+
|
|
14
|
+
**Purpose**: Coordinate all optimization mechanisms to minimize task completion time and token usage while maximizing quality.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Root Cause Debugging Protocol
|
|
19
|
+
|
|
20
|
+
1. **Reproduce & Isolate:** Recreate the exact failure with a minimal reproduction or a single targeted test.
|
|
21
|
+
2. **Inspect & Trace:** Read actual runtime logs, stack traces, and variable state instead of guessing.
|
|
22
|
+
3. **Hypothesize & Form Minimal Fix:** Identify the root mechanism of the failure. Make the smallest diff that fully fixes it.
|
|
23
|
+
4. **Regression Prevention:** Add a targeted regression test proving the bug is gone and adjacent modules still work.
|
|
24
|
+
|
|
25
|
+
**Never**:
|
|
26
|
+
- ❌ Wrap code in `try-catch` without handling or logging the error
|
|
27
|
+
- ❌ Silence TypeScript errors with `@ts-ignore` or `as any`
|
|
28
|
+
- ❌ Write sprawling test fixtures when a focused unit test suffices
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Automatic Optimizations
|
|
33
|
+
|
|
34
|
+
### 1. Tool Selection Optimization
|
|
35
|
+
**Automatic Triggers**:
|
|
36
|
+
```
|
|
37
|
+
Task analysis → Select optimal tools based on:
|
|
38
|
+
- Task type (exploration, implementation, validation)
|
|
39
|
+
- Complexity (number of files, steps)
|
|
40
|
+
- Required precision (exact vs conceptual)
|
|
41
|
+
- Cost hierarchy (Tier 1 → Tier 4)
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Optimization Rules**:
|
|
45
|
+
```
|
|
46
|
+
✓ ALWAYS start with Tier 1 tools (Read, Glob, Grep)
|
|
47
|
+
✓ Escalate one tier at a time only if needed
|
|
48
|
+
✓ NEVER use expensive tools when cheap tools work
|
|
49
|
+
✓ Track tool effectiveness for future optimization
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
### 2. MCP Server Optimization
|
|
55
|
+
**Automatic Triggers**:
|
|
56
|
+
```
|
|
57
|
+
File patterns + Keywords + Task type → Select optimal MCPs:
|
|
58
|
+
- components/**, "UI" → claude-in-chrome
|
|
59
|
+
- __tests__/**, "E2E" → playwright
|
|
60
|
+
- "PR", "issue" → github
|
|
61
|
+
- "lint" → eslint
|
|
62
|
+
- "docs", "how to" → context7
|
|
63
|
+
- "performance" → chrome-devtools
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**Optimization Rules**:
|
|
67
|
+
```
|
|
68
|
+
✓ ALWAYS run eslint after code changes (cheap, high value)
|
|
69
|
+
✓ ALWAYS fetch context7 before library implementation (prevents errors)
|
|
70
|
+
✓ Use claude-in-chrome ONLY when visual verification essential
|
|
71
|
+
✓ Chain MCPs automatically for complex workflows
|
|
72
|
+
✓ Track MCP usage and cost for optimization
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
### 3. Parallel Subagent Optimization
|
|
78
|
+
**Automatic Triggers**:
|
|
79
|
+
```
|
|
80
|
+
Task complexity analysis → Launch parallel subagents:
|
|
81
|
+
- >3 areas mentioned → Launch 4 subagents
|
|
82
|
+
- >10 steps → Launch 3 subagents
|
|
83
|
+
- Bug investigation → Launch 4 subagents
|
|
84
|
+
- Large refactor (>5 files) → Launch 4 subagents
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**Configuration** (Automatic):
|
|
88
|
+
```yaml
|
|
89
|
+
model: "haiku" # Cost optimization
|
|
90
|
+
run_in_background: true # Non-blocking
|
|
91
|
+
timeout: 120s # Time-box per subagent
|
|
92
|
+
max_parallel: 4 # Diminishing returns after 4
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
### 4. Context Engineering Optimization
|
|
98
|
+
**Automatic Triggers**:
|
|
99
|
+
```
|
|
100
|
+
Task keywords + File patterns → Load relevant Tier 2 context:
|
|
101
|
+
- "test" → Testing context
|
|
102
|
+
- "API" → API development context
|
|
103
|
+
- "UI", "component" → UI/Styling context
|
|
104
|
+
- "performance" → Performance context
|
|
105
|
+
- "database" → Database context
|
|
106
|
+
- "security" → Security context
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**Optimization Rules**:
|
|
110
|
+
```
|
|
111
|
+
✓ Load ONLY relevant context (avoid over-specification)
|
|
112
|
+
✓ Use Tier 1 (minimal) + Tier 2 (task-specific) injection
|
|
113
|
+
✓ Prune context after task completion
|
|
114
|
+
✓ Agent discovers details via search tools (not context)
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
### 5. Hook-Based Validation Optimization
|
|
120
|
+
**Automatic Triggers**:
|
|
121
|
+
```
|
|
122
|
+
After each Edit/Write (PostToolUse hook):
|
|
123
|
+
- auto-lint-fix → Fix lint issues in the edited file
|
|
124
|
+
|
|
125
|
+
When Claude finishes a response (Stop hook):
|
|
126
|
+
- auto-validate → Unified validation (lint + typecheck + tests + MCP)
|
|
127
|
+
- auto-security-review → Scan written code for vulnerabilities
|
|
128
|
+
- plan-quality-tracker → Track metrics and provide feedback
|
|
129
|
+
|
|
130
|
+
At session start (SessionStart hook):
|
|
131
|
+
- auto-learning-review → Weekly learning report from plan metrics
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
**Validation Pipeline** (Automatic):
|
|
135
|
+
```
|
|
136
|
+
1. Edit/Write → PostToolUse hook → auto-lint-fix (ESLint --fix on that file)
|
|
137
|
+
2. Claude tries to stop → Stop hook → auto-validate:
|
|
138
|
+
- Lint check
|
|
139
|
+
- Typecheck
|
|
140
|
+
- Run tests
|
|
141
|
+
- Validate MCP tools
|
|
142
|
+
3. Failures block the stop and are sent back to Claude to fix
|
|
143
|
+
4. Report results to user
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Debug-Specific Workflows
|
|
149
|
+
|
|
150
|
+
### Workflow 1: Feature Implementation (Optimized)
|
|
151
|
+
```
|
|
152
|
+
User: "Add user authentication with JWT"
|
|
153
|
+
|
|
154
|
+
Automatic Optimizations:
|
|
155
|
+
1. **Parallel Exploration** (4 subagents, 60s):
|
|
156
|
+
- Find auth patterns
|
|
157
|
+
- Find JWT libraries
|
|
158
|
+
- Find existing auth code
|
|
159
|
+
- Find auth tests
|
|
160
|
+
|
|
161
|
+
2. **Context Loading** (Tier 2):
|
|
162
|
+
- Security context
|
|
163
|
+
- API context
|
|
164
|
+
|
|
165
|
+
3. **MCP Chain**:
|
|
166
|
+
- context7: Fetch JWT library docs
|
|
167
|
+
- Implement feature
|
|
168
|
+
- eslint: Auto-lint
|
|
169
|
+
- github: Create PR
|
|
170
|
+
|
|
171
|
+
4. **Validation Hooks**:
|
|
172
|
+
- auto-lint-fix: Fix issues
|
|
173
|
+
- auto-validate: Unified validation (includes MCP validation + tests)
|
|
174
|
+
|
|
175
|
+
Time: 5-7 minutes (vs 15-20 manual)
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
### Workflow 2: Bug Fix (Optimized)
|
|
181
|
+
```
|
|
182
|
+
User: "Fix checkout bug #456"
|
|
183
|
+
|
|
184
|
+
Automatic Optimizations:
|
|
185
|
+
1. **Parallel Exploration** (4 subagents, 90s):
|
|
186
|
+
- Find checkout code
|
|
187
|
+
- Find payment code
|
|
188
|
+
- Find recent changes
|
|
189
|
+
- Find similar issues
|
|
190
|
+
|
|
191
|
+
2. **Context Loading** (Tier 2):
|
|
192
|
+
- API context (if API-related)
|
|
193
|
+
- Database context (if DB-related)
|
|
194
|
+
|
|
195
|
+
3. **MCP Chain**:
|
|
196
|
+
- github: Fetch issue #456
|
|
197
|
+
- context7: Check payment docs (if needed)
|
|
198
|
+
- Implement fix
|
|
199
|
+
- eslint: Auto-lint
|
|
200
|
+
- github: Create PR
|
|
201
|
+
|
|
202
|
+
4. **Validation Hooks**:
|
|
203
|
+
- auto-lint-fix: Fix issues
|
|
204
|
+
- auto-validate: Unified validation (includes MCP validation + tests)
|
|
205
|
+
|
|
206
|
+
Time: 3-5 minutes (vs 10-15 manual)
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
### Workflow 3: Large Refactor (Optimized)
|
|
212
|
+
```
|
|
213
|
+
User: "Migrate from Prisma to Drizzle"
|
|
214
|
+
|
|
215
|
+
Automatic Optimizations:
|
|
216
|
+
1. **Parallel Exploration** (4 subagents, 120s):
|
|
217
|
+
- Find all Prisma usage
|
|
218
|
+
- Find all queries
|
|
219
|
+
- Find all migrations
|
|
220
|
+
- Find all tests
|
|
221
|
+
|
|
222
|
+
2. **Context Loading** (Tier 2):
|
|
223
|
+
- Database context
|
|
224
|
+
- Testing context
|
|
225
|
+
|
|
226
|
+
3. **MCP Chain**:
|
|
227
|
+
- context7: Fetch Drizzle docs
|
|
228
|
+
- Implement migration (incremental)
|
|
229
|
+
- eslint: Auto-lint after each change
|
|
230
|
+
- auto-validate: Run tests after each change
|
|
231
|
+
|
|
232
|
+
4. **Validation Hooks** (after each step):
|
|
233
|
+
- auto-lint-fix: Fix issues
|
|
234
|
+
- auto-validate: Run unified validation (includes tests)
|
|
235
|
+
|
|
236
|
+
Time: 20-30 minutes (vs 60-90 manual)
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## Error Pattern Recognition
|
|
242
|
+
|
|
243
|
+
### Automatic Error Detection
|
|
244
|
+
```
|
|
245
|
+
Monitor for error patterns:
|
|
246
|
+
- ESLint errors → Trigger auto-lint-fix
|
|
247
|
+
- Test failures → auto-validate blocks the stop and feeds failures back
|
|
248
|
+
- Build errors → Fetch build docs via context7
|
|
249
|
+
- Runtime errors → Trigger browser debugging
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### Automatic Recovery
|
|
253
|
+
```
|
|
254
|
+
Error detected → Automatic response:
|
|
255
|
+
1. Identify error type
|
|
256
|
+
2. Fetch relevant docs (context7)
|
|
257
|
+
3. Implement fix
|
|
258
|
+
4. Validate (lint + tests)
|
|
259
|
+
5. If still failing → Escalate to human
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## Performance Metrics (Automatic Tracking)
|
|
265
|
+
|
|
266
|
+
### Track Per Task
|
|
267
|
+
```
|
|
268
|
+
- Task completion time
|
|
269
|
+
- Token consumption
|
|
270
|
+
- Tool calls count
|
|
271
|
+
- MCP calls count
|
|
272
|
+
- Validation gate pass rate
|
|
273
|
+
- User satisfaction (manual rating)
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### Weekly Optimization Review
|
|
277
|
+
```
|
|
278
|
+
Analyze metrics:
|
|
279
|
+
- Which optimizations saved most time?
|
|
280
|
+
- Which tools/MCPs most effective?
|
|
281
|
+
- Where are bottlenecks?
|
|
282
|
+
- What can be further automated?
|
|
283
|
+
- Adjust rules and triggers accordingly
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
## Cost Optimization (Enforced)
|
|
289
|
+
|
|
290
|
+
### Token Budget Allocation
|
|
291
|
+
```
|
|
292
|
+
Tier 1 tools (Read, Glob, Grep): 40% of budget
|
|
293
|
+
Tier 2 tools (Explore (quick), Edit): 30% of budget
|
|
294
|
+
Tier 3 tools (Agent, Bash, Lint check): 20% of budget
|
|
295
|
+
Tier 4 tools (Parallel subagents, Browser MCP): 10% of budget
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
### Automatic Cost Control
|
|
299
|
+
```
|
|
300
|
+
If task exceeds budget:
|
|
301
|
+
1. Warn user
|
|
302
|
+
2. Suggest scope reduction
|
|
303
|
+
3. Offer to continue with approval
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
## Examples
|
|
309
|
+
|
|
310
|
+
### Example 1: Add Dark Mode (Optimized)
|
|
311
|
+
User: "Add dark mode toggle to settings page"
|
|
312
|
+
|
|
313
|
+
**Automatic Optimizations**:
|
|
314
|
+
```
|
|
315
|
+
1. Parallel subagents (2, 45s):
|
|
316
|
+
- "Find settings page structure"
|
|
317
|
+
- "Find Tailwind dark mode examples"
|
|
318
|
+
|
|
319
|
+
2. Context loaded: UI/Styling
|
|
320
|
+
|
|
321
|
+
3. MCP chain:
|
|
322
|
+
- context7: Tailwind dark mode docs
|
|
323
|
+
- claude-in-chrome: Verify UI
|
|
324
|
+
- eslint: Auto-lint
|
|
325
|
+
|
|
326
|
+
4. Hooks:
|
|
327
|
+
- auto-lint-fix: ✅ Passed
|
|
328
|
+
- auto-validate: ✅ All validations passed
|
|
329
|
+
|
|
330
|
+
Result: 4 minutes, 100% quality gates pass
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
### Example 2: Performance Audit (Optimized)
|
|
336
|
+
User: "Audit and improve dashboard performance"
|
|
337
|
+
|
|
338
|
+
**Automatic Optimizations**:
|
|
339
|
+
```
|
|
340
|
+
1. Parallel subagents (3, 90s):
|
|
341
|
+
- "Find dashboard code"
|
|
342
|
+
- "Find performance bottlenecks"
|
|
343
|
+
- "Find optimization patterns"
|
|
344
|
+
|
|
345
|
+
2. Context loaded: Performance
|
|
346
|
+
|
|
347
|
+
3. MCP chain:
|
|
348
|
+
- chrome-devtools: Lighthouse audit
|
|
349
|
+
- chrome-devtools: CPU profiling
|
|
350
|
+
- context7: React optimization docs
|
|
351
|
+
- Implement optimizations
|
|
352
|
+
- chrome-devtools: Re-audit
|
|
353
|
+
|
|
354
|
+
4. Hooks:
|
|
355
|
+
- auto-validate: ✅ All validations passed (MCP + tests)
|
|
356
|
+
|
|
357
|
+
Result: 8 minutes, Lighthouse score 92 (from 67)
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
---
|
|
361
|
+
|
|
362
|
+
### Example 3: Security Review (Optimized)
|
|
363
|
+
User: "Review authentication for vulnerabilities"
|
|
364
|
+
|
|
365
|
+
**Automatic Optimizations**:
|
|
366
|
+
```
|
|
367
|
+
1. Parallel subagents (4, 90s):
|
|
368
|
+
- "Find auth code"
|
|
369
|
+
- "Find token validation"
|
|
370
|
+
- "Find password handling"
|
|
371
|
+
- "Find input validation"
|
|
372
|
+
|
|
373
|
+
2. Context loaded: Security
|
|
374
|
+
|
|
375
|
+
3. MCP chain:
|
|
376
|
+
- context7: OWASP auth guidelines
|
|
377
|
+
- Implement security fixes
|
|
378
|
+
- eslint: Auto-lint
|
|
379
|
+
- auto-security-review: Scan written code
|
|
380
|
+
|
|
381
|
+
4. Hooks:
|
|
382
|
+
- auto-lint-fix: ✅ Fixed 3 issues
|
|
383
|
+
- auto-validate: ✅ All tests pass
|
|
384
|
+
|
|
385
|
+
Result: 6 minutes, 5 vulnerabilities fixed
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
---
|
|
389
|
+
|
|
390
|
+
## Anti-Patterns (Automatically Avoided)
|
|
391
|
+
|
|
392
|
+
### ❌ Over-Automation
|
|
393
|
+
**Prevention**: Start with minimal automation, add only when pain points observed
|
|
394
|
+
|
|
395
|
+
### ❌ Context Bloat
|
|
396
|
+
**Prevention**: Enforce 20-line max per context file, use references over content
|
|
397
|
+
|
|
398
|
+
### ❌ MCP Cost Explosion
|
|
399
|
+
**Prevention**: Cost-awareness rules, prefer cheaper tools first, track usage
|
|
400
|
+
|
|
401
|
+
### ❌ Hook Failures Blocking Progress
|
|
402
|
+
**Prevention**: Hooks exit gracefully, agent continues if hooks fail
|
|
403
|
+
|
|
404
|
+
---
|
|
405
|
+
|
|
406
|
+
## Integration with Other Skills
|
|
407
|
+
|
|
408
|
+
### Works with:
|
|
409
|
+
- **mcp-mastery**: Coordinates MCP selection
|
|
410
|
+
- **tool-selection**: Optimizes tool choices
|
|
411
|
+
- **parallel-exploration**: Launches subagents efficiently
|
|
412
|
+
|
|
413
|
+
### Coordinates with:
|
|
414
|
+
- **Rules**: Enforces tool-auto-selection, parallel-exploration-auto, context tiers
|
|
415
|
+
- **Hooks**: Triggers validation pipeline
|
|
416
|
+
- **MCPs**: Chains multiple servers for complex workflows
|
|
417
|
+
|
|
418
|
+
---
|
|
419
|
+
|
|
420
|
+
**Note**: This skill activates automatically for debugging and multi-step tasks. No manual intervention needed. All optimizations applied transparently to maximize efficiency.
|