11---
22description : Guided bug fixing and debugging with systematic root cause analysis
3- argument-hint : [--lang=java|spring|typescript|nestjs|react|general] [issue-description or error-message]
3+ argument-hint : [ --lang=java|spring|typescript|nestjs|react|general ] [ issue-description or error-message ]
44allowed-tools : Task, Read, Write, Edit, Bash, Grep, Glob, TodoWrite, AskUserQuestion
55model : inherit
66---
77
88# Fix & Debugging
99
10- You are helping a developer fix a bug or debug an issue. Follow a systematic approach: understand the problem, trace the root cause, design a minimal fix, then implement and verify.
10+ You are helping a developer fix a bug or debug an issue. Follow a systematic approach: understand the problem, trace the
11+ root cause, design a minimal fix, then implement and verify.
1112
1213## Language/Framework Selection
1314
1415Parse $ARGUMENTS to detect the optional ` --lang ` parameter:
16+
1517- ` --lang=spring ` or ` --lang=java ` : Use Java/Spring Boot specialized agents
1618- ` --lang=typescript ` or ` --lang=ts ` : Use TypeScript specialized agents
1719- ` --lang=nestjs ` : Use NestJS specialized agents
@@ -20,11 +22,11 @@ Parse $ARGUMENTS to detect the optional `--lang` parameter:
2022
2123** Agent Mapping by Language:**
2224
23- | Phase | General (default) | Java/Spring Boot (` --lang=spring ` or ` --lang=java ` ) | TypeScript (` --lang=typescript ` or ` --lang=ts ` ) | NestJS (` --lang=nestjs ` ) | React (` --lang=react ` ) |
24- | -------| -------------------| -----------------------------------------------------| ------------------------------------------------| --------------------------| ------------------------|
25- | Debugger | ` developer-kit:general- debugger ` | ` developer-kit:general- debugger ` | ` developer-kit:general- debugger ` | ` developer-kit:general- debugger ` | ` developer-kit:general- debugger ` |
26- | Architect | ` developer-kit:general-software- architect ` | ` developer-kit:java-software-architect-review ` | ` developer-kit:typescript-software-architect-review ` | ` developer-kit:typescript-software-architect-review ` | ` developer-kit:typescript-software-architect-review ` |
27- | Code Review | ` developer-kit:general- code-reviewer ` | ` developer-kit:spring-boot-code-review-expert ` | ` developer-kit:general- code-reviewer ` | ` developer-kit:nestjs-code-review-expert ` | ` developer-kit:general- code-reviewer ` |
25+ | Phase | General (default) | Java/Spring Boot (` --lang=spring ` or ` --lang=java ` ) | TypeScript (` --lang=typescript ` or ` --lang=ts ` ) | NestJS (` --lang=nestjs ` ) | React (` --lang=react ` ) |
26+ | ------------- | ------------------------------- | -----------------------------------------------------| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------ ------------------------|
27+ | Debugger | ` developer-kit:debugger ` | ` developer-kit:debugger ` | ` developer-kit:debugger ` | ` developer-kit:debugger ` | ` developer-kit:debugger ` |
28+ | Architect | ` developer-kit:architect ` | ` developer-kit:java-software-architect-review ` | ` developer-kit:typescript-software-architect-review ` | ` developer-kit:typescript-software-architect-review ` | ` developer-kit:typescript-software-architect-review ` |
29+ | Code Review | ` developer-kit:code-reviewer ` | ` developer-kit:spring-boot-code-review-expert ` | ` developer-kit:code-reviewer ` | ` developer-kit:nestjs-code-review-expert ` | ` developer-kit:code-reviewer ` |
2830
2931## Current Context
3032
@@ -39,7 +41,9 @@ Parse $ARGUMENTS to detect the optional `--lang` parameter:
3941- ** Minimal changes** : Fix only what's broken, avoid scope creep
4042- ** Verify completely** : Confirm the fix works and doesn't break other things
4143- ** Use TodoWrite** : Track all progress throughout
42- - ** Structured user interaction** : Use the AskUserQuestion tool in all phases where you need to ask structured questions to the user (Phase 1: Problem Capture, Phase 3: Root Cause Analysis, Phase 4: Fix Design, Phase 7: Verification). Always use AskUserQuestion for clarifications, confirmations, and decisions rather than plain text questions.
44+ - ** Structured user interaction** : Use the AskUserQuestion tool in all phases where you need to ask structured questions
45+ to the user (Phase 1: Problem Capture, Phase 3: Root Cause Analysis, Phase 4: Fix Design, Phase 7: Verification).
46+ Always use AskUserQuestion for clarifications, confirmations, and decisions rather than plain text questions.
4347- ** No time estimates** : DO NOT provide or request time estimates or implementation timelines at any phase
4448
4549---
@@ -51,18 +55,19 @@ Parse $ARGUMENTS to detect the optional `--lang` parameter:
5155** Initial issue** : $ARGUMENTS
5256
5357** Actions** :
58+
54591 . Create todo list with all phases
55602 . Gather problem details:
56- - What is the exact error message or unexpected behavior?
57- - When did this start happening?
58- - Can you reproduce it consistently?
59- - What are the reproduction steps?
60- - Any recent changes that might be related?
61+ - What is the exact error message or unexpected behavior?
62+ - When did this start happening?
63+ - Can you reproduce it consistently?
64+ - What are the reproduction steps?
65+ - Any recent changes that might be related?
61663 . ** Use the AskUserQuestion tool to gather all missing information in a clear, organized format** :
62- - Error messages, logs, or stack traces
63- - Steps to reproduce
64- - Expected vs actual behavior
65- - Environment details (local, staging, production)
67+ - Error messages, logs, or stack traces
68+ - Steps to reproduce
69+ - Expected vs actual behavior
70+ - Environment details (local, staging, production)
66714 . ** Wait for user answers before proceeding to evidence collection**
6772
6873---
@@ -72,12 +77,14 @@ Parse $ARGUMENTS to detect the optional `--lang` parameter:
7277** Goal** : Gather all relevant information about the failure
7378
7479** Actions** :
80+
75811 . Use the Task tool to launch 2-3 general-debugger subagents in parallel with different focuses:
76- - Analyze stack traces and error messages
77- - Trace execution paths related to the failure
78- - Check recent git changes that might have introduced the bug
82+ - Analyze stack traces and error messages
83+ - Trace execution paths related to the failure
84+ - Check recent git changes that might have introduced the bug
7985
8086 ** Example Task tool usage** :
87+
8188```
8289Task(
8390 description: "Analyze error and trace execution path",
@@ -87,10 +94,11 @@ Task(
8794```
8895
8996** Example agent prompts** :
90- - "Analyze this stack trace: [ trace] . Identify the root cause and exact failure point"
91- - "Trace the execution flow for [ feature/function] and identify where it deviates from expected behavior"
92- - "Check recent git changes (last 5-10 commits) for changes that could have caused [ issue] "
93- - "Analyze the data flow for [ operation] and identify where data becomes corrupted/invalid"
97+
98+ - "Analyze this stack trace: [ trace] . Identify the root cause and exact failure point"
99+ - "Trace the execution flow for [ feature/function] and identify where it deviates from expected behavior"
100+ - "Check recent git changes (last 5-10 commits) for changes that could have caused [ issue] "
101+ - "Analyze the data flow for [ operation] and identify where data becomes corrupted/invalid"
94102
951032 . Once agents return, read all identified critical files
961043 . Compile evidence summary with key findings
@@ -104,15 +112,16 @@ Task(
104112** CRITICAL** : Do not proceed to fixing until root cause is confirmed.
105113
106114** Actions** :
115+
1071161 . Use the Task tool to launch 2 general-debugger subagents with analysis focus:
108- - Deep dive into the most likely failure point
109- - Verify hypothesis with code analysis
117+ - Deep dive into the most likely failure point
118+ - Verify hypothesis with code analysis
110119
1111202 . Synthesize findings into root cause statement:
112- - ** What** : Exact condition causing the failure
113- - ** Where** : File and line where the bug originates
114- - ** Why** : Underlying reason this happens
115- - ** When** : Conditions that trigger the bug
121+ - ** What** : Exact condition causing the failure
122+ - ** Where** : File and line where the bug originates
123+ - ** Why** : Underlying reason this happens
124+ - ** When** : Conditions that trigger the bug
116125
1171263 . ** Use the AskUserQuestion tool to confirm root cause with user before proceeding**
1181274 . ** Wait for user confirmation before moving to Fix Design**
@@ -126,20 +135,21 @@ Task(
126135** DO NOT PROCEED WITHOUT ROOT CAUSE CONFIRMATION**
127136
128137** Actions** :
138+
1291391 . Use the Task tool to launch 2-3 general-software-architect subagents in parallel with different approaches:
130- - Minimal surgical fix (smallest possible change)
131- - Defensive fix (adds guards and validation)
132- - Comprehensive fix (addresses similar issues elsewhere)
140+ - Minimal surgical fix (smallest possible change)
141+ - Defensive fix (adds guards and validation)
142+ - Comprehensive fix (addresses similar issues elsewhere)
133143
1341442 . Review approaches considering:
135- - Risk of regression
136- - Side effects on other code
137- - Test coverage implications
145+ - Risk of regression
146+ - Side effects on other code
147+ - Test coverage implications
138148
1391493 . Present to user:
140- - Brief summary of each approach
141- - Trade-offs and risks
142- - ** Your recommendation with reasoning**
150+ - Brief summary of each approach
151+ - Trade-offs and risks
152+ - ** Your recommendation with reasoning**
143153
1441544 . ** Use the AskUserQuestion tool to ask user which approach they prefer**
1451555 . ** Wait for user response before proceeding to implementation**
@@ -153,6 +163,7 @@ Task(
153163** DO NOT START WITHOUT USER APPROVAL**
154164
155165** Actions** :
166+
1561671 . Wait for explicit user approval
1571682 . Re-read all affected files to ensure current state
1581693 . Implement fix following chosen approach
@@ -167,26 +178,27 @@ Task(
167178** Goal** : Ensure the code compiles and all tests pass
168179
169180** Actions** :
181+
1701821 . ** Compile/Build** the project:
171- - Run the appropriate build command for the project
172- - Maven: ` mvn compile ` or ` mvn package -DskipTests `
173- - Gradle: ` ./gradlew build -x test ` or ` ./gradlew compileJava `
174- - npm: ` npm run build `
175- - Other: Use project-specific build command
183+ - Run the appropriate build command for the project
184+ - Maven: ` mvn compile ` or ` mvn package -DskipTests `
185+ - Gradle: ` ./gradlew build -x test ` or ` ./gradlew compileJava `
186+ - npm: ` npm run build `
187+ - Other: Use project-specific build command
176188
1771892 . ** Fix any compilation errors** before proceeding
178190
1791913 . ** Run tests** :
180- - Run unit tests for affected components first
181- - Run full test suite if quick tests pass
182- - Maven: ` mvn test ` or ` mvn verify `
183- - Gradle: ` ./gradlew test `
184- - npm: ` npm test `
192+ - Run unit tests for affected components first
193+ - Run full test suite if quick tests pass
194+ - Maven: ` mvn test ` or ` mvn verify `
195+ - Gradle: ` ./gradlew test `
196+ - npm: ` npm test `
185197
1861984 . ** If tests fail** :
187- - Analyze failure: Is it related to our fix or pre-existing?
188- - If related to fix: Return to Phase 5 and adjust
189- - If pre-existing: Document and proceed (not our scope)
199+ - Analyze failure: Is it related to our fix or pre-existing?
200+ - If related to fix: Return to Phase 5 and adjust
201+ - If pre-existing: Document and proceed (not our scope)
190202
1912035 . ** Confirm all green** before proceeding to verification
192204
@@ -197,22 +209,23 @@ Task(
197209** Goal** : Confirm the fix is correct and doesn't introduce regressions
198210
199211** Actions** :
212+
2002131 . Use the Task tool to launch 2 general-code-reviewer subagents:
201- - Review fix for correctness and potential regressions
202- - Check for similar issues that might need the same fix
214+ - Review fix for correctness and potential regressions
215+ - Check for similar issues that might need the same fix
203216
2042172 . ** Use the AskUserQuestion tool to confirm with user** :
205- - Does the fix resolve the original issue?
206- - Any unexpected behavior observed?
207- - Should we add tests to prevent regression?
218+ - Does the fix resolve the original issue?
219+ - Any unexpected behavior observed?
220+ - Should we add tests to prevent regression?
208221
2092223 . ** Wait for user feedback before finalizing**
210223
2112243 . If regression tests needed:
212- - Propose test cases that would catch this bug
213- - ** Use AskUserQuestion to ask if user wants to implement the tests**
214- - Implement tests if user approves
215- - Run tests again to confirm new tests pass
225+ - Propose test cases that would catch this bug
226+ - ** Use AskUserQuestion to ask if user wants to implement the tests**
227+ - Implement tests if user approves
228+ - Run tests again to confirm new tests pass
216229
217230---
218231
@@ -221,14 +234,15 @@ Task(
221234** Goal** : Document what was fixed and learned
222235
223236** Actions** :
237+
2242381 . Mark all todos complete
2252392 . Summarize:
226- - ** Problem** : What was broken
227- - ** Root Cause** : Why it was broken
228- - ** Fix** : What was changed
229- - ** Files Modified** : List of changes
230- - ** Tests Added** : If any
231- - ** Prevention** : How to avoid similar issues
240+ - ** Problem** : What was broken
241+ - ** Root Cause** : Why it was broken
242+ - ** Fix** : What was changed
243+ - ** Files Modified** : List of changes
244+ - ** Tests Added** : If any
245+ - ** Prevention** : How to avoid similar issues
232246
233247---
234248
@@ -272,43 +286,51 @@ This command leverages specialized sub-agents using the Task tool.
272286** Agent Selection** : Based on the ` --lang ` parameter, select the appropriate agents:
273287
274288### General Agents (default, or ` --lang=general ` )
275- - ** Debugger** : ` developer-kit:general-debugger `
276- - ** Software Architect** : ` developer-kit:general-software-architect `
277- - ** Code Reviewer** : ` developer-kit:general-code-reviewer `
289+
290+ - ** Debugger** : ` developer-kit:debugger `
291+ - ** Software Architect** : ` developer-kit:architect `
292+ - ** Code Reviewer** : ` developer-kit:code-reviewer `
278293
279294### Java/Spring Boot Agents (` --lang=spring ` or ` --lang=java ` )
280- - ** Debugger** : ` developer-kit:general-debugger `
295+
296+ - ** Debugger** : ` developer-kit:debugger `
281297- ** Software Architect** : ` developer-kit:java-software-architect-review `
282298- ** Code Reviewer** : ` developer-kit:spring-boot-code-review-expert `
283299
284300### TypeScript Agents (` --lang=typescript ` or ` --lang=ts ` )
285- - ** Debugger** : ` developer-kit:general-debugger `
301+
302+ - ** Debugger** : ` developer-kit:debugger `
286303- ** Software Architect** : ` developer-kit:typescript-software-architect-review `
287- - ** Code Reviewer** : ` developer-kit:general- code-reviewer `
304+ - ** Code Reviewer** : ` developer-kit:code-reviewer `
288305
289306### NestJS Agents (` --lang=nestjs ` )
290- - ** Debugger** : ` developer-kit:general-debugger `
307+
308+ - ** Debugger** : ` developer-kit:debugger `
291309- ** Software Architect** : ` developer-kit:typescript-software-architect-review `
292310- ** Code Reviewer** : ` developer-kit:nestjs-code-review-expert `
293311
294312### React Agents (` --lang=react ` )
295- - ** Debugger** : ` developer-kit:general-debugger `
313+
314+ - ** Debugger** : ` developer-kit:debugger `
296315- ** Software Architect** : ` developer-kit:typescript-software-architect-review `
297- - ** Code Reviewer** : ` developer-kit:general- code-reviewer `
316+ - ** Code Reviewer** : ` developer-kit:code-reviewer `
298317
299318** Fallback** : If specialized agents are not available, fall back to ` general-purpose ` agent.
300319
3013201 . ** general-debugger** - Analyzes errors, traces execution, finds root cause
302- 2 . ** general-software-architect** / ** java-software-architect-review** / ** typescript-software-architect-review** - Designs fix approaches with trade-offs
303- 3 . ** general-code-reviewer** / ** spring-boot-code-review-expert** / ** nestjs-code-review-expert** - Reviews fix for quality and regressions
321+ 2 . ** general-software-architect** / ** java-software-architect-review** / ** typescript-software-architect-review** -
322+ Designs fix approaches with trade-offs
323+ 3 . ** general-code-reviewer** / ** spring-boot-code-review-expert** / ** nestjs-code-review-expert** - Reviews fix for
324+ quality and regressions
304325
305326### Usage Pattern
327+
306328``` javascript
307329// General agents (default)
308330Task (
309331 description: " Brief task description" ,
310332 prompt: " Detailed prompt for the sub-agent" ,
311- subagent_type: " developer-kit:general- debugger"
333+ subagent_type: " developer-kit:debugger"
312334)
313335
314336// Java/Spring Boot agents (when --lang=spring or --lang=java)
@@ -341,6 +363,7 @@ Task(
341363```
342364
343365### Important Notes
366+
344367- Sub-agents are automatically discovered from ` /Users/giuseppe/project/GT/developer-kit/agents/ `
345368- Each sub-agent operates with its own context window
346369- Multiple sub-agents can be launched in parallel for different perspectives
@@ -370,11 +393,13 @@ Update the status as you progress through each phase.
370393For simple issues, you can skip some phases:
371394
372395** When to use quick mode** :
396+
373397- Error message clearly points to the issue
374398- Recent, obvious change caused the bug
375399- Simple typo or configuration error
376400
377401** Quick mode flow** :
402+
3784031 . Phase 1: Problem Capture (simplified)
3794042 . Phase 3: Root Cause Analysis (focused)
3804053 . Phase 5: Implementation
@@ -385,4 +410,5 @@ Tell the user: "This appears to be a straightforward issue. Would you like to pr
385410
386411---
387412
388- ** Note** : This command follows a systematic debugging approach to ensure bugs are fixed correctly the first time, with minimal risk of regression.
413+ ** Note** : This command follows a systematic debugging approach to ensure bugs are fixed correctly the first time, with
414+ minimal risk of regression.
0 commit comments