mk:fix
Finds the root cause of a bug, type error, lint failure or CI failure, then applies a minimal fix and verifies it with before and after checks.
| Source | .claude/skills/fix/SKILL.md |
| Owner | lifecycle |
| Runtime | claude-code |
| Risk | high |
What it does
mk:fix scouts the affected code, diagnoses with evidence, proves the root cause, fixes that cause and re-runs the failing commands. The depth depends on the profile: a known one-file cause gets a short cycle, a race condition gets a full investigation.
When to use it
Use it for any defect that should be fixed: bugs, type errors, lint failures, CI failures and runtime errors.
| Need | Use instead |
|---|---|
| Investigate without fixing | mk:investigate |
| A build or compile error only | mk:build-fix |
Usage
/mk:fix [issue|diagnostic-report-path] [flags]
| Flag | Effect |
|---|---|
--auto | Standard profile with automatic progress through diagnosis and verification. Stops at any required human decision and never self-approves. |
--review | Pauses at each step for your approval. |
--quick | Quick profile for a known cause in two files or fewer. |
--parallel | One developer agent per independent issue. |
--tdd | Writes the regression test before the fix and the .meowkit/state/tdd-mode sentinel. Without it a regression test is recommended, not required. |
--no-capture | Skips the memory entry and the report file. |
--advice | One run supervised by the athena agent at checkpoints (at most 5 calls). Standard and deep profiles only. It is evidence, never approval. |
/mk:fix login fails after 24 hours --auto
/mk:fix payment processing timeout --review
/mk:fix TypeScript error in auth.ts --quick
/mk:fix all failing tests in checkout --parallel
/mk:fix "auth bypass" --tddWithout a mode flag the standard profile runs. A supplied diagnostic report is evidence to validate, never a substitute for investigation.
Profiles
| Profile | When | What runs |
|---|---|---|
| Quick | Known cause, two files or fewer | Minimal scout, compact root-cause proof, edit, before and after check, summary. No plan, report, memory entry or subagents by default. |
| Standard (default) | Most bugs | Full evidence chain, root-cause proof, regression test, relevant suite, review. |
| Deep | Contract or architecture changes | Standard plus a plan agreed with you. |
Pick one profile; escalation rules are in references/choosing-a-profile.md. Symptom-specific moves are in references/by-symptom.md.
Steps
- Check memory (standard and deep):
grep -rilE "kw1|kw2|kw3" .meowkit/memory/and open matching entries. A matching gotcha becomes the first hypothesis. - Scout with
mk:scout: files, dependencies, tests,git log, and the risk flags fromagent-detector/references/risk-checklist.md. This step is never skipped. - Diagnose: capture the exact errors first. Quick validates the known cause directly. Standard and deep use
mk:investigateandmk:sequential-thinking. If confidence is below medium, gather more evidence before fixing. - Prove the root cause. Six fields must be filled before the fix: exact symptom, reproduction, expected versus actual, root cause with
file:line, why now (or an explicit unknown), blast radius. - Fix the root cause with minimal changes that follow existing patterns. A fix that departs from the diagnosis goes back to step 3.
- Verify and prevent: re-run the pre-fix commands, run the regression test, apply defense in depth (
references/prevention-gate.md). After 3 failed attempts the skill stops and questions the architecture with you. - Finalize: report confidence, root cause, changes and prevention; append a gotcha with
mewkit note gotchasonly when the lesson is not derivable from code or git; hand moderate and complex fixes toproject-manageranddocumenter; ask about a commit.
For a fix touching more than two files, write a plan first with mk:plan-creator.
Output
Standard and deep runs write .meowkit/state/evidence/<YYMMDD-HHMM-slug>/workflow-evidence.json (or tasks/plans/<plan>/reports/evidence/ when the fix escalated to a plan). It indexes risk flags, the six proof fields and verification commands. It approves nothing and carries no score. A standalone standard or complex fix also writes tasks/reports/fix-<YYMMDD-HHMM>-<slug>.md. --no-capture skips the report and memory entry.
If a risk flag such as AUTH, AUTHZ, DATA_MODEL, AUDIT_SEC, EXT_SYSTEM, PUBLIC_CONTRACT or WEAK_PROOF matches, the skill asks you explicitly before finalizing, even in --auto.
Gotchas
- Do not guess a cause. Test hypotheses against evidence.
- Trace from symptom to root cause. A passing test with the cause intact is a symptom fix.
- A missing regression test leaves the fix incomplete unless the omission is recorded (lint, format or config-only changes).
- Change one thing at a time, then verify, so you can tell which change worked.
- Fix the reported bug and open a separate task for any "while I'm here" refactor.