Debugging
Before choosing project-specific backup locations or environment assumptions, read skill-local guidance only when .kilocode/skills/coding-debug/AGENTS.md is confirmed to exist; otherwise use root AGENTS.md.
Workflow
Constraint: Execute sequentially. Skip nothing.
1: Get ready
Use coding-lifecycle skill, Entrypoint: Start coding work.
2: Systematic debugging process
- Incorporate testing into the debugging work according to the verification strategy established by
coding-lifecycle.
- Use
app-standards to accomplish the task to the best of your abilities.
Steps:
- You must complete each step below in order before continuing to the next, unless explicitly overridden by the user.
- Read error messages carefully.
- Do not skip past errors or warnings; they often contain the exact cause.
- Read stack traces completely.
- Note line numbers, file paths, error messages, and error codes.
- Reproduce consistently.
- Determine precise reproduction steps (URL, inputs, environment, auth state).
- Confirm whether the issue happens every time:
- If consistent: document exact steps.
- If intermittent: gather more observations; do not guess.
- Gather context to understand related code and recent changes.
- Ask yourself:
- What changed that could cause this?
- Which modules, routes, or DB tables participate in this path?
- Are there config or environment differences?
- Form hypotheses.
- Brainstorm 5–7 plausible causes; narrow to the 1–3 most likely.
- Add targeted logging or instrumentation to validate assumptions.
- Prefer minimal, reversible instrumentation changes.
- Confirm diagnosis:
- Use logging plus reproduction to prove or disprove each hypothesis.
- Summarize findings for the user before implementing permanent fixes when appropriate.
- Create backup:
- Save the current state of files you will modify under the project-approved backup location with a timestamp.
- Form a fix plan based on confirmed or most likely hypotheses.
- Prioritize by risk/impact: address high-impact, low-risk changes first.
- Break complex fixes into small, independent steps.
- Identify exact files, functions, and lines you plan to modify.
- Define verification steps for each change (tests, manual checks, logs).
- Consider side effects: note other flows that may be impacted.
- Plan rollback:
- Know how to revert to previous state quickly if a fix fails.
- Implement the fix systematically.
- Create a backup before each file modification under the project-approved backup location.
- Make ONE logical change at a time; do not bundle unrelated fixes.
- If the verification strategy calls for tests, test after each change.
- If a change does not help:
- Revert immediately.
- Update your notes and return to the hypothesis step above.
- If still unclear after several attempts:
- Reassess hypotheses.
- Consider higher-level issues (architecture, data model, or configuration).
- Escalate or involve whichever other mode is best if the required changes are clearly architectural or very large in scope.
If stuck in a loop:
- Try one completely different approach (algorithm, architecture, or module choice).
- Check using
learning skill for prior solutions or patterns.
- Try two more novel solutions.
- If still stuck:
- Prepare two new, clearly different approach ideas.
- Present them to the user along with the option: "Abandon this task and return to
plan flow."
- Wait for user direction.
3: Finish
Use coding-lifecycle skill, Entrypoint: Finish coding work.
1---2name: coding-debug3description: Troubleshooting issues, investigating errors, diagnosing problems, systematic debugging, analyzing stack traces, and identifying root causes before applying fixes. Load with read_file on .kilocode/skills/coding-debug/SKILL.md (ignore the absolute path in the location tag).4---56# Debugging78Before choosing project-specific backup locations or environment assumptions, read skill-local guidance only when `.kilocode/skills/coding-debug/AGENTS.md` is confirmed to exist; otherwise use root `AGENTS.md`.910## Workflow11**Constraint**: Execute sequentially. Skip nothing.1213### 1: Get ready14Use `coding-lifecycle` skill, Entrypoint: Start coding work.1516### 2: Systematic debugging process17- Incorporate testing into the debugging work according to the verification strategy established by `coding-lifecycle`.18- Use `app-standards` to accomplish the task to the best of your abilities.19**Steps**:20- **You must complete each step below in order before continuing to the next**, unless explicitly overridden by the user.211) **Read error messages carefully**.22 - Do not skip past errors or warnings; they often contain the exact cause.23 - Read stack traces completely.24 - Note line numbers, file paths, error messages, and error codes.252) **Reproduce consistently**.26 - Determine precise reproduction steps (URL, inputs, environment, auth state).27 - Confirm whether the issue happens every time:28 - If consistent: document exact steps.29 - If intermittent: gather more observations; do not guess.303) **Gather context to understand related code and recent changes**.31 - Ask yourself:32 - What changed that could cause this?33 - Which modules, routes, or DB tables participate in this path?34 - Are there config or environment differences?354) **Form hypotheses**.36 - Brainstorm 5–7 plausible causes; narrow to the 1–3 most likely.37 - Add targeted logging or instrumentation to validate assumptions.38 - Prefer minimal, reversible instrumentation changes.39 - Confirm diagnosis:40 - Use logging plus reproduction to prove or disprove each hypothesis.41 - Summarize findings for the user before implementing permanent fixes when appropriate.42 - Create backup:43 - Save the current state of files you will modify under the project-approved backup location with a timestamp.445) **Form a fix plan based on confirmed or most likely hypotheses**.45 - Prioritize by risk/impact: address high-impact, low-risk changes first.46 - Break complex fixes into small, independent steps.47 - Identify exact files, functions, and lines you plan to modify.48 - Define verification steps for each change (tests, manual checks, logs).49 - Consider side effects: note other flows that may be impacted.50 - Plan rollback:51 - Know how to revert to previous state quickly if a fix fails.526) **Implement the fix systematically**.53 - Create a backup before each file modification under the project-approved backup location.54 - Make ONE logical change at a time; do not bundle unrelated fixes.55 - If the verification strategy calls for tests, test after each change.56 - If a change does not help:57 - Revert immediately.58 - Update your notes and return to the hypothesis step above.597) **If still unclear after several attempts**:60 - Reassess hypotheses.61 - Consider higher-level issues (architecture, data model, or configuration).62 - Escalate or involve whichever other mode is best if the required changes are clearly architectural or very large in scope.6364**If stuck in a loop**:651) Try one completely different approach (algorithm, architecture, or module choice).662) Check using `learning` skill for prior solutions or patterns.673) Try two more novel solutions.684) If still stuck:69 - Prepare two new, clearly different approach ideas.70 - Present them to the user along with the option: "Abandon this task and return to `plan` flow."71 - Wait for user direction.7273### 3: Finish74Use `coding-lifecycle` skill, Entrypoint: Finish coding work.