Fix Bug
SkillDev toolsUse when a bug is in play: a test fails, CI is red, an API returns the wrong result, a stack trace appears, or the user says it is broken or fix this. Don't use for a new feature with no failure, for types-only work, or for docs.
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the Fix Bug skill
What this skill tells your AI
The instructions your AI receives, as published by alemtuzlak/skills in skills/fix-bug/SKILL.md and read by ahel’s review.
Find the root cause. Do not patch a symptom. App or library does not change this.
This skill loads prove-it only after a green fix, and only if the user picks it or already asked to prove. It does not overwrite CopilotKit debug skills.
When To Use
Load when a failure is in play: failing test, red CI, unexpected result, stack trace, or the user says it is broken / fix this.
Skip greenfield features with no failure. Skip docs and types-only edits.
Hard Gates
- No fix until the cause is pinned from logs. No “try a few things.”
- At least three hypotheses on the hot path, different places (our function, caller, dependency).
- Debug logs before and after every hypothesized path. If a third-party package in play has a debug mode, turn it on for this hunt.
- When the cause is pinned: delete every log this skill added, and turn third-party debug off. Then write the failing test. Then fix. Logs must not land in the fix.
- Do not skip, delete, or disable the failing test to go green. Do not swallow the error (
|| true, empty catch). Do not raise a timeout to hide a race. - Fix the root cause, plus the same pattern in that file / nearby module. No extra refactor.
- Do not load
prove-itunless the user picks it, or already asked to prove this fix. A green suite is not proof. Default is skip.
Hot path
From the failing test (or the user action) down the stack to the error line, plus the functions that call and are called there.
Start there. Eliminate. Narrow. Widen only if every hypothesis on that path is dead.
Procedures
Procedure 1: Read
- Read the full error, stack, or CI log. Every line.
- Read the failing test body if there is one.
- Read the diff that likely introduced it, if one exists.
- Do not edit yet.
Procedure 2: Hypotheses
- Map the hot path (files and functions).
- Write at least three hypotheses: “The error is caused by X because Y.” They must span the hot path (not three guesses at one line).
- If you cannot write three, you have not read enough. Return to Procedure 1.
Procedure 3: Instrument
- For each third-party package named in a hypothesis: check its docs for a debug flag or env. If it exists, turn it on.
- Add temporary logs before and after each hypothesized branch (input in, output out). Use the repo’s existing logger or
console. Do not add a logging package. - Reproduce once. Read the logs. Cross off hypotheses the logs kill.
- If all three are dead, widen the hot path one step (the next caller or the next dependency). New hypotheses. New logs. Eliminate again.
- When one cause is pinned: delete all logs this skill added. Turn third-party debug off. Confirm the working tree has none of those logs left.
Procedure 4: Failing test, then fix
- Write a test that fails because of this bug (red). Independent expected value. Do not skip this step.
- Run it. It must fail for the reason you named.
- Fix only the root cause. Also fix copies of the same mistake in that file / nearby module.
- Run that test (green). Then run the existing tests for this package / this file’s suite.
- If a new failure appears, treat it as a new bug. Start at Procedure 1. Do not ship the first fix on top of a new break.
Procedure 5: Optional prove-it
- After the suite for this package is green and logs are gone, ask once. Options: load
prove-it, or skip. Default skip. - Wait. Do not load
prove-ituntil they pick. - If they already asked to prove this fix in this conversation, skip the ask. Load
prove-it. - If skip: say the fix is not proved as a user path. Do not treat the green suite as proof. Procedure 6.
- If they pick
prove-it: loadprove-itand follow it. Then Procedure 6. - Do not click through the app, curl the API, or write a proof report inside this skill. That work belongs to
prove-it.
Procedure 6: Stop
After skip, or after prove-it returns, stop.
Decision Tree
- Failure in play → Procedure 1 → 2 → 3 → 4 → 5 → 6.
- Cannot reproduce → stop. Say not reproduced. Ask for steps. Do not guess-fix.
- Logs kill every hot-path hypothesis → widen, Procedure 2 again.
- Test still red after the fix → wrong cause. Revert the fix. Back to Procedure 2.
- Same pattern in the next function → fix it in this same change (Hard gate 6).
- Suite green, no prove ask yet → Procedure 5 (ask, default skip).
- User already asked to prove this fix → load
prove-it, then Procedure 6.
Red Flags
| Signal | What it means | Do instead |
|---|---|---|
| One hypothesis, then a patch | Guess | Procedure 2. Three on the hot path. |
| Fix with no logs | No elimination | Procedure 3. |
Debug console.log still in the diff | Logs not nuked | Procedure 3 step 5. Then the test. |
Third-party DEBUG=* left on | Hunt flag shipped | Turn it off with the logs. |
.skip / delete the failing test | Symptom | Fix the code. |
|| true / empty catch | Swallow | Explain or fix the cause. |
| Longer timeout | Hidden race | Fix the race. |
| Refactor while fixing | Drive-by | Root cause + same pattern only. |
| Whole-monorepo test run | Unasked | This package / this suite. |
| “Works on my machine” | Different env | Same command / same conditions as the failure. |
Loading prove-it with no ask | Unasked proof | Procedure 5. Default skip. |
| Mini browser pass inside this skill | Duplicate of prove-it | Load prove-it after they pick it. |
| “Tests passed, so it is proved” | Green suite treated as proof | Procedure 5. Skip means not proved. |
Error Handling
- Not reproduced: say so. List what you ran. Do not invent a fix.
- No debug mode on the dependency: skip that step. Still log our code on the hot path.
- Logs are huge: log only the hypothesized branches, not every line in the file.
- Failing test cannot be written yet (no harness): a one-file script that asserts the bug is the stand-in. Still red, then fix, then green.
- Fix makes a different test fail: Procedure 1 on that failure. Do not push the first fix until the cascade is resolved.
prove-itis missing on this agent: say so. Offer skip. Do not invent a second prove procedure here.- They pick
prove-it, then skip inside it: the fix is not proved. Procedure 6.
This skill does not place helpers or write docs. Proof is Procedure 5 only.
Signals
- GitHub stars
- 39
- Forks
- 1
- Last commit
- Aug 2026
Advanced
- Catalog kind
- skill
- Gateway key
fix-bug- Source
- github.com/alemtuzlak/skills