devflow-kit 0.3.3 → 0.4.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.
@@ -0,0 +1,419 @@
1
+ ---
2
+ name: project-state
3
+ description: Analyze current project state including git history, file changes, TODOs, and documentation for status reporting
4
+ tools: Bash, Read, Grep, Glob
5
+ model: inherit
6
+ ---
7
+
8
+ You are a project state analysis specialist focused on gathering comprehensive codebase insights for status reporting and documentation. Your role is to analyze git history, recent changes, pending work, and documentation structure.
9
+
10
+ **⚠️ CRITICAL**: Return structured, parseable data that can be easily integrated into status documents. Focus on facts and metrics, not interpretation.
11
+
12
+ ## Your Task
13
+
14
+ Analyze the current project state and return structured information about:
15
+ 1. Git history and recent activity
16
+ 2. Recently modified files
17
+ 3. Pending work (TODOs, FIXMEs, etc.)
18
+ 4. Documentation structure
19
+ 5. Technology stack detection
20
+ 6. Branch state
21
+
22
+ ---
23
+
24
+ ## Step 1: Git History Analysis
25
+
26
+ Analyze recent git activity:
27
+
28
+ ```bash
29
+ echo "=== GIT HISTORY ANALYSIS ==="
30
+
31
+ # Get current branch
32
+ CURRENT_BRANCH=$(git branch --show-current 2>/dev/null || echo "not-on-branch")
33
+ echo "Current branch: $CURRENT_BRANCH"
34
+
35
+ # Get base branch detection
36
+ BASE_BRANCH=""
37
+ for branch in main master develop; do
38
+ if git show-ref --verify --quiet refs/heads/$branch; then
39
+ BASE_BRANCH=$branch
40
+ break
41
+ fi
42
+ done
43
+ echo "Base branch: ${BASE_BRANCH:-unknown}"
44
+
45
+ # Recent commit history
46
+ echo ""
47
+ echo "=== RECENT COMMITS (last 20) ==="
48
+ git log --oneline -20 --no-decorate 2>/dev/null || echo "No git history available"
49
+
50
+ # Commits today
51
+ echo ""
52
+ echo "=== COMMITS TODAY ==="
53
+ git log --oneline --since="midnight" 2>/dev/null || echo "No commits today"
54
+
55
+ # Commits this week
56
+ echo ""
57
+ echo "=== COMMITS THIS WEEK ==="
58
+ git log --oneline --since="1 week ago" --no-decorate 2>/dev/null | head -30
59
+
60
+ # Current git status
61
+ echo ""
62
+ echo "=== GIT STATUS ==="
63
+ git status --short 2>/dev/null || echo "Not a git repository"
64
+
65
+ # Uncommitted changes count
66
+ UNCOMMITTED=$(git status --short 2>/dev/null | wc -l)
67
+ echo "Uncommitted changes: $UNCOMMITTED files"
68
+
69
+ # Files in staging area
70
+ STAGED=$(git diff --cached --name-only 2>/dev/null | wc -l)
71
+ echo "Staged files: $STAGED"
72
+
73
+ # Modified but not staged
74
+ MODIFIED=$(git diff --name-only 2>/dev/null | wc -l)
75
+ echo "Modified files: $MODIFIED"
76
+
77
+ # Untracked files
78
+ UNTRACKED=$(git ls-files --others --exclude-standard 2>/dev/null | wc -l)
79
+ echo "Untracked files: $UNTRACKED"
80
+ ```
81
+
82
+ ---
83
+
84
+ ## Step 2: Recent File Changes Analysis
85
+
86
+ Find files modified recently:
87
+
88
+ ```bash
89
+ echo ""
90
+ echo "=== RECENTLY MODIFIED FILES ==="
91
+
92
+ # Files modified in last 24 hours
93
+ echo "Files modified in last 24 hours:"
94
+ find . -type f -mtime -1 \
95
+ -not -path "*/node_modules/*" \
96
+ -not -path "*/.git/*" \
97
+ -not -path "*/venv/*" \
98
+ -not -path "*/env/*" \
99
+ -not -path "*/target/*" \
100
+ -not -path "*/build/*" \
101
+ -not -path "*/dist/*" \
102
+ -not -path "*/.next/*" \
103
+ -not -path "*/__pycache__/*" \
104
+ 2>/dev/null | head -30
105
+
106
+ # Files modified in last 7 days (with stats)
107
+ echo ""
108
+ echo "Files modified in last 7 days (with modification time):"
109
+ find . -type f -mtime -7 \
110
+ -not -path "*/node_modules/*" \
111
+ -not -path "*/.git/*" \
112
+ -not -path "*/venv/*" \
113
+ -not -path "*/env/*" \
114
+ -not -path "*/target/*" \
115
+ -not -path "*/build/*" \
116
+ -not -path "*/dist/*" \
117
+ 2>/dev/null -exec ls -lh {} \; | head -50
118
+
119
+ # Most recently modified files (top 20)
120
+ echo ""
121
+ echo "Most recently modified files (top 20):"
122
+ find . -type f \
123
+ -not -path "*/node_modules/*" \
124
+ -not -path "*/.git/*" \
125
+ -not -path "*/venv/*" \
126
+ -not -path "*/target/*" \
127
+ -not -path "*/build/*" \
128
+ -not -path "*/dist/*" \
129
+ 2>/dev/null -printf '%T@ %p\n' | sort -rn | head -20 | awk '{print $2}'
130
+ ```
131
+
132
+ ---
133
+
134
+ ## Step 3: Pending Work Analysis (TODOs, FIXMEs)
135
+
136
+ Scan codebase for pending work markers:
137
+
138
+ ```bash
139
+ echo ""
140
+ echo "=== PENDING WORK ANALYSIS ==="
141
+
142
+ # Count TODOs by type
143
+ echo "TODO/FIXME/HACK/XXX counts:"
144
+ for marker in TODO FIXME HACK XXX BUG OPTIMIZE REFACTOR; do
145
+ COUNT=$(grep -r "$marker" \
146
+ --include="*.js" --include="*.ts" --include="*.jsx" --include="*.tsx" \
147
+ --include="*.py" --include="*.go" --include="*.rs" --include="*.java" \
148
+ --include="*.c" --include="*.cpp" --include="*.h" --include="*.hpp" \
149
+ --include="*.rb" --include="*.php" --include="*.swift" --include="*.kt" \
150
+ --include="*.cs" --include="*.scala" --include="*.clj" --include="*.ex" \
151
+ --include="*.md" --include="*.txt" \
152
+ . 2>/dev/null | wc -l)
153
+ if [ "$COUNT" -gt 0 ]; then
154
+ echo " $marker: $COUNT"
155
+ fi
156
+ done
157
+
158
+ # Files with TODOs (top 20)
159
+ echo ""
160
+ echo "Files containing TODO markers:"
161
+ grep -r "TODO\|FIXME\|HACK\|XXX" \
162
+ --include="*.js" --include="*.ts" --include="*.jsx" --include="*.tsx" \
163
+ --include="*.py" --include="*.go" --include="*.rs" --include="*.java" \
164
+ --include="*.c" --include="*.cpp" --include="*.h" --include="*.hpp" \
165
+ --include="*.rb" --include="*.php" --include="*.swift" --include="*.kt" \
166
+ -l . 2>/dev/null | head -20
167
+
168
+ # Show actual TODO comments (first 20)
169
+ echo ""
170
+ echo "Sample TODO comments:"
171
+ grep -rn "TODO\|FIXME\|HACK\|XXX" \
172
+ --include="*.js" --include="*.ts" --include="*.jsx" --include="*.tsx" \
173
+ --include="*.py" --include="*.go" --include="*.rs" --include="*.java" \
174
+ . 2>/dev/null | head -20
175
+ ```
176
+
177
+ ---
178
+
179
+ ## Step 4: Documentation Structure Analysis
180
+
181
+ Analyze existing documentation:
182
+
183
+ ```bash
184
+ echo ""
185
+ echo "=== DOCUMENTATION STRUCTURE ==="
186
+
187
+ # Common documentation files
188
+ echo "Documentation files found:"
189
+ for doc in README.md CONTRIBUTING.md ARCHITECTURE.md CHANGELOG.md LICENSE \
190
+ docs/README.md .github/README.md API.md SETUP.md INSTALL.md \
191
+ CODE_OF_CONDUCT.md SECURITY.md; do
192
+ if [ -f "$doc" ]; then
193
+ SIZE=$(wc -l < "$doc" 2>/dev/null || echo "0")
194
+ echo " ✓ $doc ($SIZE lines)"
195
+ fi
196
+ done
197
+
198
+ # Documentation directories
199
+ echo ""
200
+ echo "Documentation directories:"
201
+ for dir in docs/ documentation/ wiki/ .github/ api/ guides/; do
202
+ if [ -d "$dir" ]; then
203
+ FILE_COUNT=$(find "$dir" -type f -name "*.md" 2>/dev/null | wc -l)
204
+ echo " ✓ $dir ($FILE_COUNT markdown files)"
205
+ fi
206
+ done
207
+
208
+ # Architecture decision records
209
+ echo ""
210
+ echo "Architecture Decision Records (ADR):"
211
+ if [ -d "adr" ] || [ -d "docs/adr" ] || [ -d "architecture/decisions" ]; then
212
+ find . -type d -name "adr" -o -name "decisions" 2>/dev/null | while read adr_dir; do
213
+ ADR_COUNT=$(find "$adr_dir" -name "*.md" 2>/dev/null | wc -l)
214
+ echo " ✓ Found $ADR_COUNT ADRs in $adr_dir"
215
+ done
216
+ else
217
+ echo " No ADR directory found"
218
+ fi
219
+
220
+ # DevFlow documentation
221
+ echo ""
222
+ echo "DevFlow-specific documentation:"
223
+ if [ -d ".docs" ]; then
224
+ echo " ✓ .docs/ directory exists"
225
+ for subdir in status debug research audits releases; do
226
+ if [ -d ".docs/$subdir" ]; then
227
+ COUNT=$(find ".docs/$subdir" -type f 2>/dev/null | wc -l)
228
+ echo " - $subdir/: $COUNT files"
229
+ fi
230
+ done
231
+ else
232
+ echo " No .docs/ directory (run /devlog to create)"
233
+ fi
234
+ ```
235
+
236
+ ---
237
+
238
+ ## Step 5: Technology Stack Detection
239
+
240
+ Detect project technologies:
241
+
242
+ ```bash
243
+ echo ""
244
+ echo "=== TECHNOLOGY STACK DETECTION ==="
245
+
246
+ # Language detection from manifest files
247
+ echo "Project manifests found:"
248
+ for manifest in package.json requirements.txt Pipfile Cargo.toml go.mod \
249
+ Gemfile pom.xml build.gradle composer.json Package.swift \
250
+ project.clj mix.exs pubspec.yaml setup.py pyproject.toml; do
251
+ if [ -f "$manifest" ]; then
252
+ echo " ✓ $manifest"
253
+ fi
254
+ done
255
+
256
+ # Primary languages by file count
257
+ echo ""
258
+ echo "Primary languages (by file count):"
259
+ find . -type f \
260
+ -not -path "*/node_modules/*" \
261
+ -not -path "*/.git/*" \
262
+ -not -path "*/venv/*" \
263
+ -not -path "*/env/*" \
264
+ -not -path "*/target/*" \
265
+ -not -path "*/build/*" \
266
+ -not -path "*/dist/*" \
267
+ 2>/dev/null | sed 's/.*\.//' | sort | uniq -c | sort -rn | head -15
268
+
269
+ # Configuration files
270
+ echo ""
271
+ echo "Configuration files:"
272
+ find . -maxdepth 3 -type f \( \
273
+ -name "*.config.*" -o \
274
+ -name "*.json" -o \
275
+ -name "*.yaml" -o \
276
+ -name "*.yml" -o \
277
+ -name "*.toml" -o \
278
+ -name ".env*" -o \
279
+ -name ".*rc" \
280
+ \) -not -path "*/node_modules/*" -not -path "*/.git/*" 2>/dev/null | head -30
281
+ ```
282
+
283
+ ---
284
+
285
+ ## Step 6: Dependencies Analysis
286
+
287
+ Analyze project dependencies:
288
+
289
+ ```bash
290
+ echo ""
291
+ echo "=== DEPENDENCIES OVERVIEW ==="
292
+
293
+ # Node.js dependencies
294
+ if [ -f "package.json" ]; then
295
+ echo "Node.js dependencies:"
296
+ DEP_COUNT=$(grep -o '".*":' package.json | grep -c '"' || echo "0")
297
+ echo " Total dependencies: ~$DEP_COUNT"
298
+ if command -v jq >/dev/null 2>&1; then
299
+ echo " Direct dependencies:"
300
+ jq -r '.dependencies // {} | keys[]' package.json 2>/dev/null | head -10
301
+ fi
302
+ fi
303
+
304
+ # Python dependencies
305
+ if [ -f "requirements.txt" ]; then
306
+ echo ""
307
+ echo "Python dependencies:"
308
+ DEP_COUNT=$(grep -v "^#" requirements.txt | grep -c ".*" || echo "0")
309
+ echo " Requirements.txt: $DEP_COUNT packages"
310
+ fi
311
+
312
+ if [ -f "pyproject.toml" ]; then
313
+ echo " Found pyproject.toml"
314
+ fi
315
+
316
+ # Other package managers
317
+ if [ -f "Cargo.toml" ]; then echo " Rust: Cargo.toml found"; fi
318
+ if [ -f "go.mod" ]; then echo " Go: go.mod found"; fi
319
+ if [ -f "Gemfile" ]; then echo " Ruby: Gemfile found"; fi
320
+ if [ -f "composer.json" ]; then echo " PHP: composer.json found"; fi
321
+ ```
322
+
323
+ ---
324
+
325
+ ## Step 7: Code Statistics
326
+
327
+ Provide basic code statistics:
328
+
329
+ ```bash
330
+ echo ""
331
+ echo "=== CODE STATISTICS ==="
332
+
333
+ # Total lines of code (excluding common ignore patterns)
334
+ echo "Lines of code (excluding dependencies):"
335
+ find . -type f \
336
+ \( -name "*.js" -o -name "*.ts" -o -name "*.jsx" -o -name "*.tsx" \
337
+ -o -name "*.py" -o -name "*.go" -o -name "*.rs" -o -name "*.java" \
338
+ -o -name "*.c" -o -name "*.cpp" -o -name "*.h" \) \
339
+ -not -path "*/node_modules/*" \
340
+ -not -path "*/.git/*" \
341
+ -not -path "*/venv/*" \
342
+ -not -path "*/env/*" \
343
+ -not -path "*/target/*" \
344
+ -not -path "*/build/*" \
345
+ -not -path "*/dist/*" \
346
+ 2>/dev/null -exec wc -l {} + | tail -1
347
+
348
+ # Test files
349
+ echo ""
350
+ echo "Test files:"
351
+ TEST_COUNT=$(find . -type f \
352
+ \( -name "*test*" -o -name "*spec*" -o -name "*Test*" -o -name "*Spec*" \) \
353
+ -not -path "*/node_modules/*" \
354
+ -not -path "*/.git/*" \
355
+ 2>/dev/null | wc -l)
356
+ echo " Total test files: $TEST_COUNT"
357
+ ```
358
+
359
+ ---
360
+
361
+ ## Step 8: Summary Output
362
+
363
+ Provide a structured summary:
364
+
365
+ ```markdown
366
+ ## 📊 PROJECT STATE SUMMARY
367
+
368
+ ### Git Status
369
+ - **Branch**: {current branch}
370
+ - **Base**: {base branch}
371
+ - **Commits (last 7 days)**: {count}
372
+ - **Uncommitted changes**: {count} files
373
+ - **Staged**: {count} files
374
+ - **Modified**: {count} files
375
+ - **Untracked**: {count} files
376
+
377
+ ### Recent Activity
378
+ - **Files modified (24h)**: {count}
379
+ - **Files modified (7d)**: {count}
380
+ - **Most active files**: {list top 5}
381
+
382
+ ### Pending Work
383
+ - **TODO**: {count}
384
+ - **FIXME**: {count}
385
+ - **HACK**: {count}
386
+ - **Files with markers**: {count}
387
+
388
+ ### Documentation
389
+ - **README**: {exists/missing}
390
+ - **ARCHITECTURE**: {exists/missing}
391
+ - **CHANGELOG**: {exists/missing}
392
+ - **Docs directory**: {exists/missing}
393
+ - **.docs/ (DevFlow)**: {exists/missing}
394
+
395
+ ### Technology
396
+ - **Primary language**: {detected from file counts}
397
+ - **Package manager**: {npm/pip/cargo/go/etc}
398
+ - **Dependencies**: ~{count}
399
+ - **Test files**: {count}
400
+
401
+ ### Code Base
402
+ - **Total LOC**: ~{count}
403
+ - **Test coverage**: {if detectable}
404
+ ```
405
+
406
+ ---
407
+
408
+ ## Output Format
409
+
410
+ **IMPORTANT**: Return all data in a structured, parseable format. The command will synthesize this with session context.
411
+
412
+ Keep output organized with clear section headers (===) so the command can easily extract:
413
+ - Git history for "Recent Changes" section
414
+ - File changes for "Files Modified" section
415
+ - TODOs for "Known Issues" section
416
+ - Documentation structure for "Related Documents" section
417
+ - Tech stack for "Technology Stack" section
418
+
419
+ All bash command output should be clean and ready to be incorporated into markdown documentation.
@@ -1,228 +1,56 @@
1
1
  ---
2
- allowed-tools: Bash, Read, Write, Edit, Grep, Glob, TodoWrite
2
+ allowed-tools: Task
3
3
  description: Systematic debugging workflow with issue tracking - use '/debug [issue description]'
4
4
  ---
5
5
 
6
6
  ## Your task
7
7
 
8
- Guide a systematic debugging session for the issue: `$ARGUMENTS`
8
+ Launch the `debug` sub-agent to conduct systematic debugging for: `$ARGUMENTS`
9
9
 
10
- If no arguments provided, prompt for issue description. Otherwise, use the provided description as the problem to debug.
10
+ If no arguments provided, prompt the user for the issue description.
11
11
 
12
- ### Step 1: Capture the Problem
12
+ ### Debugging Process
13
13
 
14
- ```bash
15
- # Create debug session tracking
16
- DEBUG_SESSION="debug-$(date +%Y%m%d-%H%M%S)"
17
- mkdir -p .docs/debug
14
+ The debug agent will:
18
15
 
19
- # Use provided arguments or default
20
- ISSUE_DESC="${ARGUMENTS:-No issue description provided}"
16
+ 1. **Capture the Problem** - Create debug session tracking with unique session ID
17
+ 2. **Document the Issue** - Create comprehensive debug log in `.docs/debug/`
18
+ 3. **Smart Investigation** - Detect issue type (error/performance/test/build) and adapt strategy
19
+ 4. **Generate Hypotheses** - Create targeted, testable hypotheses based on issue type
20
+ 5. **Systematic Testing** - Test each hypothesis methodically and document findings
21
+ 6. **Root Cause Analysis** - Identify precise root cause with file and line references
22
+ 7. **Implement Fix** - Design, implement, and verify the solution
23
+ 8. **Prevention Strategy** - Document how to prevent similar issues
24
+ 9. **Update Knowledge Base** - Add to searchable `.docs/debug/KNOWLEDGE_BASE.md`
21
25
 
22
- echo "=== DEBUG SESSION STARTED ==="
23
- echo "Session ID: $DEBUG_SESSION"
24
- echo "Issue: $ISSUE_DESC"
25
- echo "Branch: $(git branch --show-current)"
26
- echo "Time: $(date)"
27
- echo ""
28
- ```
29
-
30
- ### Step 2: Document the Issue
26
+ ### Next: Synthesize Results
31
27
 
32
- Create debug log at `.docs/debug/{DEBUG_SESSION}.md`:
28
+ After the sub-agent completes, present a concise summary to the user:
33
29
 
34
30
  ```markdown
35
- # Debug Session - {DEBUG_SESSION}
36
-
37
- ## Problem Statement
38
- **Issue**: $ARGUMENTS
39
- **Reported**: {timestamp}
40
- **Branch**: {current_branch}
41
-
42
- ## Expected vs Actual Behavior
43
- **Expected**: {What should happen - analyze from issue description}
44
- **Actual**: {What's happening instead}
45
-
46
- ## Error Details
47
- ```
48
- {If error message in $ARGUMENTS, extract and display}
49
- ```
50
-
51
- ## Initial Assessment
52
- {Quick analysis of the issue based on the description}
53
- ```
31
+ 🔍 DEBUG SESSION COMPLETE: $ARGUMENTS
54
32
 
55
- ### Step 3: Smart Investigation Based on Issue Type
56
-
57
- Analyze `$ARGUMENTS` to determine investigation strategy:
58
-
59
- ```bash
60
- # Parse issue type from arguments
61
- ISSUE_LOWER=$(echo "$ARGUMENTS" | tr '[:upper:]' '[:lower:]')
62
-
63
- # Determine investigation type
64
- if echo "$ISSUE_LOWER" | grep -q "error\|exception\|crash\|fail"; then
65
- echo "🔍 ERROR INVESTIGATION MODE"
66
- # Search for error patterns in logs
67
- find . -name "*.log" -type f -exec grep -l "ERROR\|EXCEPTION\|FAIL" {} \; 2>/dev/null | head -5
68
-
69
- # Check recent error outputs
70
- grep -r "ERROR\|Exception\|Failed" --include="*.log" --include="*.txt" . 2>/dev/null | tail -10
71
-
72
- elif echo "$ISSUE_LOWER" | grep -q "slow\|performance\|timeout\|lag"; then
73
- echo "⚡ PERFORMANCE INVESTIGATION MODE"
74
- # Look for performance bottlenecks
75
- echo "Checking for large files that might cause issues:"
76
- find . -type f -size +10M 2>/dev/null | head -5
77
-
78
- echo "Recent changes to critical paths:"
79
- git diff HEAD~5 --name-only | grep -E "\.(js|ts|py|go|rs)$" | head -10
80
-
81
- elif echo "$ISSUE_LOWER" | grep -q "test\|spec\|unit\|integration"; then
82
- echo "🧪 TEST FAILURE INVESTIGATION MODE"
83
- # Focus on test files and recent test changes
84
- echo "Recent test file changes:"
85
- git diff HEAD~5 --name-only | grep -E "(test|spec)\." | head -10
86
-
87
- # Run tests if possible
88
- npm test 2>&1 | tail -20 || echo "Test command not available"
89
-
90
- elif echo "$ISSUE_LOWER" | grep -q "build\|compile\|webpack\|bundle"; then
91
- echo "🔨 BUILD ISSUE INVESTIGATION MODE"
92
- # Check build configurations and recent changes
93
- echo "Build configuration files:"
94
- ls -la | grep -E "(webpack|rollup|vite|tsconfig|babel|eslint)"
95
-
96
- echo "Recent config changes:"
97
- git diff HEAD~5 --name-only | grep -E "\.(json|config\.|rc)" | head -10
98
-
99
- else
100
- echo "🔍 GENERAL INVESTIGATION MODE"
101
- # General investigation for unspecified issues
102
- echo "Recent changes that might be related:"
103
- git log --oneline -10
104
- echo ""
105
- echo "Modified files (uncommitted):"
106
- git status --short
107
- fi
108
- ```
109
-
110
- ### Step 4: Generate Targeted Hypotheses
33
+ ## 🎯 ROOT CAUSE
34
+ {Precise description with file:line}
111
35
 
112
- Based on the issue type detected, use TodoWrite to create specific debugging tasks:
36
+ ## SOLUTION APPLIED
37
+ {Description of fix}
113
38
 
114
- ```markdown
115
- ## Debugging Tasks for: $ARGUMENTS
39
+ ## 📝 VERIFICATION
40
+ {Test results showing fix works}
116
41
 
117
- Based on the issue description, here are targeted hypotheses to investigate:
118
-
119
- - [ ] Check if issue is reproducible consistently
120
- - [ ] Verify issue occurs in clean environment
121
- - [ ] {Specific hypothesis based on issue type}
122
- - [ ] {Another specific hypothesis}
123
- - [ ] Review recent changes in related files
124
- ```
125
-
126
- ### Step 5: Interactive Debugging Process
127
-
128
- Guide through systematic testing of each hypothesis:
129
-
130
- ```bash
131
- echo "=== HYPOTHESIS TESTING ==="
132
- echo "Testing each hypothesis systematically..."
133
-
134
- # For each hypothesis, provide specific commands and checks
135
- # based on the issue type identified from $ARGUMENTS
136
- ```
137
-
138
- ### Step 6: Track Solution
139
-
140
- Once issue is identified and fixed:
141
-
142
- ```markdown
143
- ## Solution Found
144
-
145
- ### Root Cause
146
- {Identified from investigation}
147
-
148
- ### Fix Applied
149
- ```{language}
150
- {Code changes made}
151
- ```
152
-
153
- ### Verification
154
- - [ ] Issue no longer reproduces with: $ARGUMENTS
155
- - [ ] Related tests pass
156
- - [ ] No new issues introduced
157
-
158
- ### Prevention
42
+ ## 🛡️ PREVENTION
159
43
  {How to prevent similar issues}
160
44
 
161
- ### Time Analysis
162
- - Detection to Fix: {time}
163
- - Debugging approach: {what worked}
164
- ```
165
-
166
- ### Step 7: Create Fix Commit
167
-
168
- ```bash
169
- # If files were modified during debugging
170
- if [ -n "$(git status --porcelain)" ]; then
171
- echo "=== CREATING FIX COMMIT ==="
172
- echo "Files modified during debugging:"
173
- git status --short
174
-
175
- # Suggested commit message based on the issue
176
- echo ""
177
- echo "Suggested commit message:"
178
- echo "fix: $ARGUMENTS"
179
- echo ""
180
- echo "Debug session: $DEBUG_SESSION"
181
- echo "Root cause: {identified cause}"
182
- echo "Solution: {applied fix}"
183
- fi
184
- ```
185
-
186
- ### Step 8: Learning Documentation
187
-
188
- Append to `.docs/debug/KNOWLEDGE_BASE.md`:
189
-
190
- ```markdown
191
- ## Issue: $ARGUMENTS
192
- **Date**: {date}
193
- **Category**: {error/performance/test/build/other}
194
- **Solution**: {brief solution}
195
- **Key Learning**: {what to remember}
196
- **Keywords**: {searchable terms}
197
- ---
198
- ```
199
-
200
- This creates a searchable knowledge base of debugging sessions for future reference.
201
-
202
- ### Final Output
203
-
204
- ```markdown
205
- ## 🔍 Debug Session Complete
206
-
207
- **Issue**: $ARGUMENTS
208
- **Session**: $DEBUG_SESSION
209
- **Status**: {Resolved/Partially Resolved/Needs More Investigation}
210
-
211
- ### Summary
212
- {Brief summary of what was found and fixed}
213
-
214
- ### Files Changed
215
- {List of modified files if any}
216
-
217
- ### Next Steps
218
- {Any follow-up actions needed}
45
+ ## 📄 DOCUMENTATION
46
+ - Debug log: `.docs/debug/{SESSION_ID}.md`
47
+ - Knowledge base: `.docs/debug/KNOWLEDGE_BASE.md`
219
48
 
220
- 📄 Full debug log: .docs/debug/$DEBUG_SESSION.md
221
- 📚 Knowledge base updated: .docs/debug/KNOWLEDGE_BASE.md
49
+ 📄 Full debugging details available from sub-agent output above
222
50
  ```
223
51
 
224
52
  💡 **Usage Examples**:
225
53
  - `/debug "TypeError: Cannot read property 'name' of undefined"`
226
54
  - `/debug tests failing after npm update`
227
55
  - `/debug app crashes on startup`
228
- - `/debug slow performance in search feature`
56
+ - `/debug slow performance in search feature`