plugins/khuym/skills/debugging/SKILL.md
Use when blocked workers, test failures, build errors, runtime crashes, or integration issues need systematic root-cause debugging. Reads history/learnings/critical-patterns.md to avoid re-solving known issues. Writes debug notes that compounding can later capture.
npx skillsauth add hoangnb24/skills debuggingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
If .khuym/onboarding.json is missing or stale for the current repo, stop and invoke khuym:using-khuym before continuing.
Resolve blockers and failures systematically. Do not guess. Triage first, reproduce second, diagnose third, fix fourth.
Classify the issue before you investigate it.
| Type | Signals | |---|---| | Build failure | compiler error, type error, missing module, bundler failure | | Test failure | assertion mismatch, timeout, snapshot diff, flake | | Runtime error | crash, uncaught exception, undefined behavior | | Integration failure | HTTP 4xx/5xx, auth failure, env mismatch, schema mismatch | | Worker blocker | circular bead dependency, conflicting reservations, no safe execution path |
Output a one-line classification:
[TYPE] in [component]: [symptom]
Check history/learnings/critical-patterns.md first. If a matching pattern already exists, start from that fix path.
If not, rerun the exact failing command and capture the exact output.
Examples:
npm run build 2>&1 | tee /tmp/debug-output.txt
pytest tests/specific_test.py -v 2>&1 | tee /tmp/debug-output.txt
Run it twice. If it is intermittent, treat it as a flaky failure rather than a deterministic one.
Work through these checks in order.
Use the failing output to identify the smallest relevant slice. Do not read the entire repo.
git log --oneline -20
git blame <file> -L <line>,<line>
git diff HEAD~3 -- <file>
br show <bead-id>
Ask whether the code drifted from the bead, or the bead itself is wrong.
Read the relevant CONTEXT.md entries and confirm the implementation did not violate a locked decision.
node .codex/khuym_reservations.mjs list --active-only --json
Look for:
Also inspect .khuym/state.json for the active worker list.
If this debugging pass was spawned from swarming, use the parent-thread context and the saved worker status in .khuym/state.json as the coordination surface. Do not assume an external inbox exists.
Do not proceed until you can write:
Root cause:
<file>:<line>—<what is wrong and why>
If you cannot write that sentence, you do not have the root cause yet.
If the fix is obvious and low risk:
If the fix is cross-cutting or changes the intended behavior:
br create "Fix: <root cause summary>" -t task --blocks <original-bead-id>
Then implement against that new bead.
If a locked decision was violated:
CONTEXT.mdIf the failure is caused by leaked or stale reservations:
Use:
node .codex/khuym_reservations.mjs release --agent "<codex-name>" --bead "<bead-id>" --json
node .codex/khuym_reservations.mjs sweep --json
The original failing command must pass cleanly. If it still fails, return to diagnosis.
If you are inside a swarm, return the debugging result to the parent thread using a clear status heading:
[DONE] if the fix is complete and verified[BLOCKED] if the problem needs a decision, another worker release, or a broader redesignAt minimum include:
If you are working directly for the user, give the same information in the final response.
If this exposed a new reusable failure pattern, write a debug note for compounding so the lesson can be promoted later.
If the failure matched an existing pattern from critical-patterns.md, verify whether that guidance still works. If not, flag it for compounding.
When a worker is stuck rather than code-broken:
bv --robot-insights 2>/dev/null | jq '.Cycles'
node .codex/khuym_reservations.mjs list --active-only --json
If it is only waiting, return [BLOCKED] with the dependency or reservation holder and stop.
If it is a real dead-end, return [BLOCKED] with concrete options for the parent or user.
Do not spin.
critical-patterns.md| Situation | First action |
|---|---|
| Build fails | rerun the exact build command |
| Test fails | rerun the exact test and capture assertion output |
| Runtime crash | read the stack trace and find the first line in your code |
| Integration error | check env/config, then the real response body |
| Worker stuck | inspect bv plus local reservations |
| Recurring issue | check history/learnings/critical-patterns.md first |
tools
Use when the user asks to commit everything, smart commit, group commits, organize staged or unstaged changes, create logical commits, push current work, or preserve a clean commit stack from an existing working tree.
development
Use when starting or resuming any Khuym project session, choosing the next Khuym skill, running go mode, checking onboarding/scout state, or enforcing workflow gates. Bootstrap meta-skill for routing across the Khuym agentic development ecosystem.
development
Use when the user wants to turn a rough idea, vague task, feature wish, bug-fix intent, or Codex /goal objective into a clear verifiable goal prompt. Use when the user mentions goal mode, /goal, set_goal, long-running autonomous Codex work, or asks to be interviewed/grilled before creating a goal.
tools
Use when Codex should turn a concept, topic, tutorial, lesson, algorithm, system, workflow, or abstract idea into a playable browser game that teaches through interaction. Use for planning or implementing educational web games with the Game Studio plugin, including concept-to-mechanic translation, gameplay loop design, learning progression, and browser-game QA.