Fix a Bug
Fix a bug with /mk:fix: find the root cause first, apply a minimal fix, verify it, and record a lesson when there is one.
/mk:fix is the debugging pipeline. It does not edit code first. It finds the root cause, fixes that cause with the smallest diff, and checks the fix against the failing behavior.
/mk:fix login fails after 24 hoursWithout a mode flag it uses the standard profile. A typo or lint error can take the quick profile, and a cross-module race can take deep.
Choose a mode
| Bug | Command | What happens |
|---|---|---|
| Typo, config or lint error with a known cause in two files or fewer | /mk:fix "typo in README" --quick | Minimal scout, compact root-cause proof, edit, before and after check |
| Logic bug in one module | /mk:fix "session token not refreshed" | Scout, investigate, diagnose, fix, verify |
| Cross-module or intermittent bug | /mk:fix "race condition in payment queue" | Standard plus a plan agreed with you when a contract or the architecture changes |
| Several independent failures | /mk:fix "failing tests in checkout" --parallel | One developer agent per issue |
| Bug on a sensitive path | /mk:fix "payment timeout" --review | Pauses at each step for you |
| You want the regression test first | /mk:fix "auth bypass" --tdd | Writes the failing regression test before the fix |
--auto runs the standard profile without pausing for progress. It stops where a human decision is required and never approves for you.
Steps
- Mode selection. Standard unless the quick profile's boundary is already proven.
- Check memory (standard and deep). One grep of
.meowkit/memory/for the bug class. A matching gotcha becomes the first hypothesis. - Scout with
mk:scout. Mandatory, even in quick mode. - Diagnose. Standard and deep use
mk:investigate, thenmk:sequential-thinkingto test hypotheses against evidence. The output is a root cause with an evidence chain and a confidence level. - Root-cause proof. Six fields must be filled before the fix: exact symptom, reproduction evidence, expected against actual, root cause with
file:line, why it appears now, and blast radius. - Fix the root cause, not the symptom.
- Verify and prevent. Re-run the commands that failed before, add a regression test, and consider guards such as input validation.
- Finalize. Report the confidence, cause, changes and files. Write one memory entry only when the lesson is one the next session could not derive from the code or git history.
Stops
- No fix before the scout and diagnose steps are done.
- A confidence below medium means gathering more evidence first.
- After three failed fix attempts the skill stops and questions the architecture with you. After an escalation like this, the
journal-writeragent can record what was tried.
These are rules of the skill. No hook enforces them.
What helps along the way
| Concern | What covers it |
|---|---|
| Root cause before a fix | mk:investigate |
| Keeping edits in scope | mk:freeze can lock edits to named directories while a debug session runs |
| Proof the bug existed and the fix closes it | The regression test |
| New security problems in edited files | post-write.cjs scans every file write |
| Verified, not asserted | The reviewer checks test output |
After the fix
When the fix teaches something non-derivable, it goes into .meowkit/memory/gotchas.md through mewkit note. The next similar bug finds it in the memory check. A bug class that keeps coming back is a candidate for a rule in CLAUDE.md. Quick runs never write memory, and --no-capture skips the write.
Don't use /mk:fix for
- New features. Use
/mk:cook. - Architecture decisions. Use
/mk:partyor/mk:plan-creator. - Finding out why something is broken without fixing it. Use
/mk:investigate.
Next steps
- Debug effectively for choosing between fix, investigate and sequential-thinking
- Build a feature for the feature pipeline
- The workflow