@allthingsclaude/blueprints 0.2.0 → 0.3.0-beta.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 (46) hide show
  1. package/README.md +8 -5
  2. package/content/agents/audit.md +39 -24
  3. package/content/agents/bootstrap.md +4 -4
  4. package/content/agents/cleanup.md +153 -0
  5. package/content/agents/debug.md +198 -0
  6. package/content/agents/{optimize.md → dry.md} +36 -15
  7. package/content/agents/finalize.md +18 -4
  8. package/content/agents/handoff.md +10 -4
  9. package/content/agents/implement.md +27 -7
  10. package/content/agents/parallelize.md +20 -3
  11. package/content/agents/plan.md +28 -4
  12. package/content/agents/refactor.md +208 -0
  13. package/content/agents/research-codebase.md +1 -1
  14. package/content/agents/research-docs.md +1 -1
  15. package/content/agents/research-web.md +1 -1
  16. package/content/agents/storyboard.md +10 -4
  17. package/content/agents/test.md +181 -0
  18. package/content/commands/audit.md +14 -25
  19. package/content/commands/bootstrap.md +2 -2
  20. package/content/commands/cleanup.md +11 -300
  21. package/content/commands/debug.md +8 -250
  22. package/content/commands/dry.md +46 -0
  23. package/content/commands/finalize.md +2 -2
  24. package/content/commands/flush.md +9 -13
  25. package/content/commands/handoff.md +1 -1
  26. package/content/commands/implement.md +4 -4
  27. package/content/commands/kickoff.md +6 -3
  28. package/content/commands/parallelize.md +1 -1
  29. package/content/commands/pickup.md +1 -1
  30. package/content/commands/plan.md +2 -2
  31. package/content/commands/refactor.md +20 -379
  32. package/content/commands/research.md +1 -1
  33. package/content/commands/storyboard.md +3 -3
  34. package/content/commands/test.md +14 -200
  35. package/dist/cli.js +38 -6
  36. package/dist/cli.js.map +1 -1
  37. package/dist/index.d.ts +1 -1
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +1 -1
  40. package/dist/index.js.map +1 -1
  41. package/dist/installer.d.ts +15 -3
  42. package/dist/installer.d.ts.map +1 -1
  43. package/dist/installer.js +82 -9
  44. package/dist/installer.js.map +1 -1
  45. package/package.json +5 -1
  46. package/content/commands/optimize.md +0 -338
@@ -27,28 +27,17 @@ $ARGUMENTS
27
27
 
28
28
  ## Launching Code Auditor
29
29
 
30
- Initiating comprehensive code review to check for:
31
-
32
- - 🔴 **Critical Issues** (security, breaking changes, data loss)
33
- - 🟡 **Important Issues** (DRY violations, type safety, error handling)
34
- - 🔵 **Suggestions** (best practices, code clarity, performance)
35
-
36
- The auditor will:
37
- - ✅ Review all staged and unstaged changes
38
- - Check for security vulnerabilities (XSS, SQL injection, etc.)
39
- - Identify DRY violations and code duplication
40
- - Verify TypeScript type safety
41
- - Validate error handling
42
- - ✅ Check consistency with project patterns (CLAUDE.md)
43
- - Flag performance issues
44
- - ✅ Verify multi-tenant isolation (site-specific)
45
- - ✅ Provide specific, actionable recommendations
46
- - ✅ Give final verdict: safe to commit or issues to fix
47
-
48
- **After the audit completes**, the agent will ask:
49
-
50
- 1. **Just review** (default) - Show the audit report only
51
- 2. **Auto-fix** - Attempt to automatically fix important and critical issues
52
- 3. **Create fix plan** - Generate a PLAN_AUDIT_FIXES.md with systematic fixes
53
-
54
- Use the Task tool to launch the audit agent (subagent_type="general-purpose") which will autonomously analyze your code changes, generate a comprehensive audit report, and optionally fix issues.
30
+ The audit agent will:
31
+ - Detect your toolchain and project conventions
32
+ - Review all staged and unstaged changes
33
+ - Check for security vulnerabilities, breaking changes, and data loss risks
34
+ - Identify DRY violations, type safety issues, and error handling gaps
35
+ - Verify consistency with project patterns (CLAUDE.md)
36
+ - Provide a structured report with severity levels and specific fixes
37
+
38
+ **After the audit**, the agent will offer:
39
+ 1. **Just review** Show the audit report only
40
+ 2. **Auto-fix** Attempt to fix critical and important issues
41
+ 3. **Create fix plan** — Generate `tasks/plans/PLAN_AUDIT_FIXES.md`
42
+
43
+ Use the Task tool to launch the audit agent (subagent_type="audit") which will autonomously analyze your code changes, generate a comprehensive audit report, and optionally fix issues.
@@ -26,7 +26,7 @@ $ARGUMENTS
26
26
  ## Generating Plan & Bootstrap Script
27
27
 
28
28
  Launching the bootstrap agent to analyze our brainstorming conversation and generate:
29
- 1. `.claude/temp/PLAN_{NAME}.md` (via `/plan` command)
29
+ 1. `tasks/plans/PLAN_{NAME}.md` (via `/plan` command)
30
30
  2. `./bootstrap.sh` (executable setup script)
31
31
 
32
32
  The agent will:
@@ -43,4 +43,4 @@ The agent will:
43
43
  - Git initialization
44
44
  - Error handling and progress indicators
45
45
 
46
- Use the Task tool to launch the bootstrap agent (subagent_type="general-purpose") which will autonomously generate both the plan and bootstrap script.
46
+ Use the Task tool to launch the bootstrap agent (subagent_type="bootstrap") which will autonomously generate both the plan and bootstrap script.
@@ -4,9 +4,9 @@ argument-hint: [optional: "imports" | "dead-code" | "types" | "todos" | focus ar
4
4
  author: "@markoradak"
5
5
  ---
6
6
 
7
- # Code Cleanup Assistant
7
+ # Code Cleanup
8
8
 
9
- I'll help identify and clean up dead code, unused imports, and technical debt in your codebase.
9
+ I'll scan your codebase for dead code, unused imports, and technical debt.
10
10
 
11
11
  ## Current State
12
12
 
@@ -15,7 +15,7 @@ I'll help identify and clean up dead code, unused imports, and technical debt in
15
15
  **Branch**: !`git branch --show-current`
16
16
 
17
17
  **Files to Analyze**:
18
- !`find src -name "*.ts" -o -name "*.tsx" 2>/dev/null | wc -l` TypeScript files
18
+ !`find . -maxdepth 5 -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" 2>/dev/null | grep -v node_modules | wc -l` source files
19
19
 
20
20
  ---
21
21
 
@@ -25,302 +25,13 @@ $ARGUMENTS
25
25
 
26
26
  ---
27
27
 
28
- ## Cleanup Workflow
28
+ ## Launching Cleanup Agent
29
29
 
30
- Based on the arguments, I'll focus on specific cleanup tasks:
30
+ The cleanup agent will:
31
+ - Detect your toolchain (package manager, available scripts)
32
+ - Scan for unused imports, dead code, `any` types, stale TODOs, console statements, and commented-out code
33
+ - Generate a structured report with file:line references
34
+ - Offer auto-fix for safe changes (with your approval)
35
+ - Validate that nothing breaks after cleanup
31
36
 
32
- ### If "imports" or no argument:
33
- - Find and remove unused imports
34
- - Organize import order
35
- - Remove duplicate imports
36
-
37
- ### If "dead-code":
38
- - Find unreferenced exports
39
- - Identify unused functions/components
40
- - Detect unreachable code
41
-
42
- ### If "types":
43
- - Audit `any` usage
44
- - Find implicit any
45
- - Identify redundant type assertions
46
-
47
- ### If "todos":
48
- - Inventory all TODO/FIXME/HACK comments
49
- - Categorize by priority
50
- - Suggest which to address or remove
51
-
52
- ### If specific file/folder provided:
53
- - Deep cleanup of that area only
54
-
55
- ---
56
-
57
- ## Cleanup Categories
58
-
59
- ### 1. Unused Imports
60
-
61
- **Detection**:
62
- ```bash
63
- # ESLint can find these
64
- pnpm eslint src --rule '@typescript-eslint/no-unused-vars: error' --format compact 2>&1 | grep "no-unused-vars"
65
-
66
- # Or check specific file
67
- grep -E "^import" path/to/file.ts
68
- ```
69
-
70
- **Cleanup Strategy**:
71
- - Remove imports not referenced in the file
72
- - Remove type-only imports if types aren't used
73
- - Consolidate multiple imports from same module
74
-
75
- ### 2. Dead Code
76
-
77
- **Detection Patterns**:
78
-
79
- **Unreferenced Exports**:
80
- ```bash
81
- # Find all exports
82
- grep -rn "export " src/ --include="*.ts" --include="*.tsx"
83
-
84
- # Check if each is imported anywhere
85
- grep -rn "import.*{.*ExportName" src/
86
- ```
87
-
88
- **Unused Functions**:
89
- - Functions defined but never called
90
- - Event handlers attached to removed elements
91
- - Utility functions from old features
92
-
93
- **Unreachable Code**:
94
- - Code after return/throw statements
95
- - Conditions that can never be true
96
- - Catch blocks for errors that can't occur
97
-
98
- ### 3. Type Cleanup
99
-
100
- **`any` Audit**:
101
- ```bash
102
- # Find explicit any
103
- grep -rn ": any" src/ --include="*.ts" --include="*.tsx"
104
-
105
- # Find any in function parameters
106
- grep -rn "(.*any.*)" src/ --include="*.ts"
107
- ```
108
-
109
- **Categories**:
110
- - **Justified**: External library types, truly dynamic data
111
- - **Lazy**: Should be properly typed
112
- - **Accidental**: Implicit any from missing types
113
-
114
- ### 4. TODO/FIXME Inventory
115
-
116
- **Detection**:
117
- ```bash
118
- # Find all TODOs
119
- grep -rn "TODO\|FIXME\|HACK\|XXX" src/ --include="*.ts" --include="*.tsx"
120
- ```
121
-
122
- **Categories**:
123
- - **Stale**: Old TODOs that are no longer relevant
124
- - **Completed**: Work is done but comment remains
125
- - **Valid**: Still needs to be done
126
- - **Won't Do**: Decided against implementing
127
-
128
- ### 5. Console Statements
129
-
130
- **Detection**:
131
- ```bash
132
- # Find console.log/warn/error
133
- grep -rn "console\." src/ --include="*.ts" --include="*.tsx"
134
- ```
135
-
136
- **Categories**:
137
- - **Debug**: Should be removed
138
- - **Intentional**: Error logging, should use proper logger
139
- - **Temporary**: Left from debugging session
140
-
141
- ### 6. Commented Code
142
-
143
- **Detection**:
144
- - Large blocks of commented-out code
145
- - Commented function definitions
146
- - "Old" or "backup" comments
147
-
148
- **Policy**:
149
- - If it's in git history, delete it
150
- - If it might be needed, create a branch
151
- - Never commit commented-out code
152
-
153
- ---
154
-
155
- ## Cleanup Report Format
156
-
157
- ```markdown
158
- # Cleanup Report
159
-
160
- **Scanned**: [X] files in [path]
161
- **Date**: [timestamp]
162
- **Focus**: [area or "all"]
163
-
164
- ---
165
-
166
- ## Summary
167
-
168
- | Category | Found | Auto-fixable | Manual Review |
169
- |----------|-------|--------------|---------------|
170
- | Unused Imports | X | X | 0 |
171
- | Dead Code | X | 0 | X |
172
- | `any` Types | X | 0 | X |
173
- | TODOs | X | N/A | X |
174
- | Console Statements | X | X | 0 |
175
- | Commented Code | X | X | 0 |
176
-
177
- **Estimated Impact**: -[X] lines of code
178
-
179
- ---
180
-
181
- ## Unused Imports
182
-
183
- ### `src/components/Example.tsx`
184
-
185
- **Remove**:
186
- ```typescript
187
- // Line 3: unused
188
- import { unusedFunction } from '@/lib/utils'
189
-
190
- // Line 5: only 'used' is used, remove 'unused'
191
- import { used, unused } from '@/lib/helpers'
192
- ```
193
-
194
- **After**:
195
- ```typescript
196
- import { used } from '@/lib/helpers'
197
- ```
198
-
199
- ---
200
-
201
- ## Dead Code
202
-
203
- ### Unreferenced Exports
204
-
205
- | Export | File | Last Modified | Recommendation |
206
- |--------|------|---------------|----------------|
207
- | `oldHelper` | `src/lib/utils.ts:45` | 3 months ago | Remove |
208
- | `deprecatedFn` | `src/lib/api.ts:123` | 6 months ago | Remove |
209
-
210
- ### Unused Functions
211
-
212
- **`src/lib/helpers.ts:78`** - `formatOldDate()`
213
- - Not imported anywhere
214
- - Last modified: [date]
215
- - **Recommendation**: Remove
216
-
217
- ---
218
-
219
- ## Type Issues
220
-
221
- ### `any` Usage
222
-
223
- | Location | Context | Recommendation |
224
- |----------|---------|----------------|
225
- | `src/api/route.ts:23` | API response | Type as `ApiResponse` |
226
- | `src/utils/parse.ts:45` | JSON parse | Use `unknown` + validation |
227
- | `src/lib/external.ts:12` | 3rd party | Justified - add comment |
228
-
229
- ---
230
-
231
- ## TODO Inventory
232
-
233
- ### Stale (Remove)
234
-
235
- - `src/old.ts:45`: "TODO: refactor this" (file deleted 2 months ago)
236
- - `src/api.ts:23`: "FIXME: temporary" (been there 6 months)
237
-
238
- ### Valid (Keep/Address)
239
-
240
- - `src/auth.ts:89`: "TODO: add rate limiting" - Still needed
241
- - `src/db.ts:34`: "FIXME: optimize query" - Performance issue
242
-
243
- ### Completed (Remove)
244
-
245
- - `src/user.ts:56`: "TODO: add validation" - Validation exists
246
-
247
- ---
248
-
249
- ## Console Statements
250
-
251
- | Location | Type | Action |
252
- |----------|------|--------|
253
- | `src/debug.ts:12` | `console.log` | Remove (debug) |
254
- | `src/api.ts:45` | `console.error` | Replace with logger |
255
-
256
- ---
257
-
258
- ## Commented Code
259
-
260
- | Location | Lines | Age | Action |
261
- |----------|-------|-----|--------|
262
- | `src/old.tsx:34-56` | 22 | 4 months | Remove |
263
- | `src/utils.ts:78-89` | 11 | 2 months | Remove |
264
-
265
- ---
266
-
267
- ## Recommended Actions
268
-
269
- ### Auto-fix (Safe)
270
-
271
- These can be automatically cleaned up:
272
-
273
- 1. [ ] Remove unused imports
274
- 2. [ ] Remove console.log statements
275
- 3. [ ] Remove commented-out code
276
-
277
- Run: "Would you like me to auto-fix these?"
278
-
279
- ### Manual Review Required
280
-
281
- These need human decision:
282
-
283
- 1. [ ] Review dead code exports before removal
284
- 2. [ ] Decide on TODO items
285
- 3. [ ] Type the `any` usages appropriately
286
-
287
- ---
288
-
289
- ## Next Steps
290
-
291
- 1. Review this report
292
- 2. Approve auto-fixes
293
- 3. Address manual review items
294
- 4. Run `pnpm typecheck && pnpm lint` to verify
295
- 5. Commit cleanup: `git commit -m "chore: code cleanup"`
296
- ```
297
-
298
- ---
299
-
300
- ## Auto-Fix Capabilities
301
-
302
- When user approves, I can automatically:
303
-
304
- - **Remove unused imports**: Edit files to remove
305
- - **Remove console statements**: Edit to remove (except console.error in catch blocks)
306
- - **Remove commented code**: Edit to remove blocks
307
- - **Organize imports**: Sort and group imports
308
-
309
- I will NOT automatically:
310
- - Remove functions (might have dynamic usage)
311
- - Change `any` types (needs proper typing)
312
- - Remove TODOs (needs human decision)
313
- - Remove exports (might be used externally)
314
-
315
- ---
316
-
317
- ## Safety Guidelines
318
-
319
- 1. **Always validate after cleanup**: Run typecheck and lint
320
- 2. **Review before committing**: Show git diff
321
- 3. **Don't break functionality**: When in doubt, leave it
322
- 4. **Track what was removed**: Clear commit message
323
-
324
- ---
325
-
326
- Begin cleanup analysis based on the focus area provided. Use Grep to find patterns, Read to analyze context, and Edit to apply fixes (with user approval).
37
+ Use the Task tool to launch the cleanup agent (subagent_type="cleanup") with the focus area and any additional context from arguments.
@@ -28,256 +28,14 @@ $ARGUMENTS
28
28
 
29
29
  ---
30
30
 
31
- ## Debugging Methodology
31
+ ## Launching Debug Agent
32
32
 
33
- I'll follow a systematic approach to diagnose this issue:
33
+ The debug agent will follow a systematic 4-phase methodology:
34
+ 1. **Reproduce & Understand** — Clarify the issue, gather context
35
+ 2. **Isolate the Problem** — Narrow scope, trace data flow
36
+ 3. **Root Cause Analysis** — Identify candidates, verify hypothesis
37
+ 4. **Resolution** — Develop fix, suggest prevention
34
38
 
35
- ### Phase 1: Reproduce & Understand
39
+ It will produce a structured diagnosis report with root cause, investigation trail, recommended fixes, and verification steps.
36
40
 
37
- 1. **Clarify the Issue**
38
- - What is the expected behavior?
39
- - What is the actual behavior?
40
- - When did this start happening?
41
- - Is it reproducible consistently?
42
-
43
- 2. **Gather Context**
44
- - Check error messages and stack traces
45
- - Review relevant logs
46
- - Identify affected files/components
47
-
48
- ### Phase 2: Isolate the Problem
49
-
50
- 3. **Narrow Down the Scope**
51
- - Which layer is the issue in? (UI, API, DB, external service)
52
- - Is it environment-specific? (dev, prod, test)
53
- - Does it affect all users/data or specific cases?
54
-
55
- 4. **Trace Data Flow**
56
- - Follow the execution path
57
- - Check input/output at each step
58
- - Identify where behavior diverges from expected
59
-
60
- ### Phase 3: Root Cause Analysis
61
-
62
- 5. **Identify Candidates**
63
- - Recent code changes (git blame, git log)
64
- - Configuration changes
65
- - Dependency updates
66
- - External factors (API changes, data issues)
67
-
68
- 6. **Verify Hypothesis**
69
- - Test each candidate systematically
70
- - Use console.log/debugger strategically
71
- - Check edge cases and boundary conditions
72
-
73
- ### Phase 4: Resolution
74
-
75
- 7. **Develop Fix**
76
- - Address root cause, not symptoms
77
- - Consider side effects
78
- - Validate fix doesn't break other things
79
-
80
- 8. **Prevent Recurrence**
81
- - Add test coverage
82
- - Improve error handling
83
- - Update documentation if needed
84
-
85
- ---
86
-
87
- ## Diagnostic Commands
88
-
89
- ### Error Analysis
90
- ```bash
91
- # Search for error patterns in logs
92
- grep -r "error" .next/server/ 2>/dev/null | tail -20
93
-
94
- # Check recent console output
95
- # (User should provide if available)
96
-
97
- # TypeScript errors
98
- pnpm typecheck 2>&1 | head -50
99
- ```
100
-
101
- ### Code Investigation
102
- ```bash
103
- # Find where something is defined
104
- grep -rn "functionName" src/
105
-
106
- # Check recent changes to a file
107
- git log -p --follow -5 -- path/to/file.ts
108
-
109
- # Find all usages of a function/component
110
- grep -rn "ComponentName" src/
111
- ```
112
-
113
- ### Runtime Investigation
114
- ```bash
115
- # Check if dev server is running
116
- lsof -i :3000 2>/dev/null || echo "Port 3000 not in use"
117
-
118
- # Check environment
119
- env | grep -E "^(DATABASE|NEXT|NODE)" | head -10
120
- ```
121
-
122
- ### Database Investigation
123
- ```bash
124
- # Check Prisma schema
125
- cat prisma/schema.prisma | grep -A5 "model"
126
-
127
- # Verify database connection
128
- pnpm prisma db pull --print 2>&1 | head -20
129
- ```
130
-
131
- ---
132
-
133
- ## Common Issue Patterns
134
-
135
- ### TypeScript Errors
136
- - **"Cannot find module"**: Check imports, paths, tsconfig
137
- - **"Type X is not assignable"**: Verify types match at boundaries
138
- - **"Property does not exist"**: Check object shape, optional chaining
139
-
140
- ### React/Next.js Issues
141
- - **Hydration mismatch**: Server/client rendering differences
142
- - **"use client" missing**: Server component using client features
143
- - **Stale data**: Cache invalidation, revalidation issues
144
-
145
- ### API/tRPC Issues
146
- - **401/403**: Authentication/authorization check
147
- - **500**: Server-side error, check logs
148
- - **Network error**: CORS, URL configuration
149
-
150
- ### Database Issues
151
- - **Connection refused**: Check DATABASE_URL, server running
152
- - **Unique constraint**: Duplicate data, check upsert logic
153
- - **Foreign key violation**: Related record doesn't exist
154
-
155
- ### Build Issues
156
- - **Module not found**: Check dependencies, imports
157
- - **Out of memory**: Increase Node memory, check for loops
158
- - **Type errors**: Run `pnpm typecheck` for details
159
-
160
- ---
161
-
162
- ## Output Format
163
-
164
- After investigation, provide a structured diagnosis:
165
-
166
- ```markdown
167
- # Diagnosis Report
168
-
169
- **Issue**: [One-line summary]
170
- **Severity**: [Critical/High/Medium/Low]
171
- **Category**: [TypeScript/Runtime/Database/Network/Configuration]
172
-
173
- ---
174
-
175
- ## Summary
176
-
177
- [2-3 sentence overview of what's happening and why]
178
-
179
- ---
180
-
181
- ## Root Cause
182
-
183
- **Location**: `path/to/file.ts:123`
184
-
185
- **Problem**: [Detailed explanation of the root cause]
186
-
187
- **Evidence**:
188
- - [Finding 1 that supports this diagnosis]
189
- - [Finding 2]
190
- - [Relevant code snippet or error message]
191
-
192
- ---
193
-
194
- ## Investigation Trail
195
-
196
- 1. **Checked**: [What was investigated]
197
- - **Finding**: [What was found]
198
-
199
- 2. **Checked**: [Next investigation step]
200
- - **Finding**: [Result]
201
-
202
- 3. **Conclusion**: [How findings led to root cause]
203
-
204
- ---
205
-
206
- ## Recommended Fix
207
-
208
- ### Option 1: [Primary fix] (Recommended)
209
-
210
- **File**: `path/to/file.ts:123`
211
-
212
- **Current Code**:
213
- ```typescript
214
- // problematic code
215
- ```
216
-
217
- **Fixed Code**:
218
- ```typescript
219
- // corrected code
220
- ```
221
-
222
- **Why This Works**: [Explanation]
223
-
224
- ### Option 2: [Alternative fix]
225
-
226
- [If there's a reasonable alternative approach]
227
-
228
- ---
229
-
230
- ## Verification Steps
231
-
232
- 1. [ ] Apply the fix
233
- 2. [ ] Run `pnpm typecheck` - should pass
234
- 3. [ ] Run `pnpm lint` - should pass
235
- 4. [ ] Test the specific scenario that was failing
236
- 5. [ ] Run related tests: `pnpm test [pattern]`
237
-
238
- ---
239
-
240
- ## Prevention
241
-
242
- - [ ] Add test case for this scenario
243
- - [ ] Consider adding validation at [location]
244
- - [ ] Update documentation if behavior was unclear
245
-
246
- ---
247
-
248
- ## Related Files
249
-
250
- - `path/to/related.ts` - [Why relevant]
251
- - `path/to/another.ts` - [Why relevant]
252
- ```
253
-
254
- ---
255
-
256
- ## Investigation Strategies by Issue Type
257
-
258
- ### "It was working before"
259
- 1. Check `git log` for recent changes
260
- 2. Use `git bisect` to find breaking commit
261
- 3. Review dependency updates in package.json
262
-
263
- ### "It works locally but not in production"
264
- 1. Compare environment variables
265
- 2. Check build output differences
266
- 3. Review deployment logs
267
- 4. Verify database state
268
-
269
- ### "It works sometimes"
270
- 1. Look for race conditions
271
- 2. Check for timing-dependent logic
272
- 3. Review caching behavior
273
- 4. Check for data-dependent paths
274
-
275
- ### "The error message doesn't make sense"
276
- 1. Find where the error is thrown
277
- 2. Check what condition triggers it
278
- 3. Add logging to trace the path
279
- 4. Look for error transformation/wrapping
280
-
281
- ---
282
-
283
- Begin systematic investigation based on the issue description provided. Use Read to examine files, Grep to search for patterns, and Bash for diagnostics. Ask clarifying questions if the issue description is insufficient.
41
+ Use the Task tool to launch the debug agent (subagent_type="debug") with the issue description and any additional context from arguments.
@@ -0,0 +1,46 @@
1
+ ---
2
+ description: Eliminate DRY violations without changing behavior
3
+ argument-hint: [optional: file/folder path, "functions" | "components" | "hooks" | "types" | "constants"]
4
+ author: "@markoradak"
5
+ ---
6
+
7
+ # DRY Optimization
8
+
9
+ I'll find and eliminate DRY violations across your codebase while guaranteeing identical behavior.
10
+
11
+ ## Current State
12
+
13
+ **Working Directory**: !`pwd`
14
+
15
+ **Branch**: !`git branch --show-current`
16
+
17
+ **Status**:
18
+ !`git status --short`
19
+
20
+ **Files to Analyze**:
21
+ !`find . -maxdepth 5 -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" 2>/dev/null | grep -v node_modules | wc -l` source files
22
+
23
+ ---
24
+
25
+ ## Focus Area
26
+
27
+ $ARGUMENTS
28
+
29
+ ---
30
+
31
+ ## Launching DRY Agent
32
+
33
+ The DRY agent will:
34
+ - Detect your toolchain and capture a baseline (typecheck, lint, tests, build)
35
+ - Scan for exact, structural, and logical duplications
36
+ - Present a prioritized report with line counts and savings estimates
37
+ - Apply optimizations one at a time (with your approval)
38
+ - Validate after each change — revert immediately on failure
39
+ - Guarantee zero behavior change
40
+
41
+ **Scoping options**:
42
+ - No argument → Full source scan
43
+ - `functions` / `components` / `hooks` / `types` / `constants` → Category-specific scan
44
+ - File/folder path → Scoped deep scan
45
+
46
+ Use the Task tool to launch the DRY agent (subagent_type="dry") which will capture the baseline, scan for DRY violations, present a prioritized report, and — with user approval — apply optimizations one at a time with validation after each change.