From mk
Systematic four-phase debugging skill (investigate, analyze, hypothesize, implement) that enforces root cause identification before any fixes. Auto-activates on bugs, errors, or unexpected behavior.
How this skill is triggered — by the user, by Claude, or both
Slash command
/mk:investigateWhen to use
Use when debugging with systematic root-cause investigation (four phases). NOT for applying fixes without investigation (see mk:fix).
This skill is limited to the following tools:
Editbash ${CLAUDE_SKILL_DIR}/bin/check-freeze.shWritebash ${CLAUDE_SKILL_DIR}/bin/check-freeze.shThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
<!-- Split for progressive disclosure (checklist #11, #14): 497 → ~65 lines -->
bin/check-freeze.shreferences/debugging-methodology.mdreferences/log-analysis.mdreferences/performance-diagnostics.mdreferences/preamble.mdreferences/rca-anti-patterns.mdreferences/rca-method-selection.mdreferences/reporting-standards.mdreferences/root-cause-tracing.mdreferences/shared-protocols.mdreferences/system-investigation.mdscripts/find-polluter.shPath convention: Commands below assume cwd is
$CLAUDE_PROJECT_DIR(project root). Prefix paths with"$CLAUDE_PROJECT_DIR/"when invoking from subdirectories.
Iron Law: NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST.
.claude/memory/fixes.md, .claude/memory/architecture-decisions.md.claude/memory/fixes.md via direct Edit (diagnosis records only — ##note: is a user-typed keyboard shortcut that does NOT fire from agent output; the fix itself is persisted by mk:fix). See .claude/skills/memory/references/capture-architecture.md.Investigation precedes planning for bug fixes:
mk:plan-creator --type bugfix if fix affects > 2 filesSkip: Investigation itself doesn't need a plan — it produces the input for planning.
references/preamble.md and execute the startup bash blockreferences/debugging-methodology.md and follow Phase 1-3. For recurring patterns or complex failures, load references/rca-method-selection.md for methodology selection. Load references/rca-anti-patterns.md to avoid common RCA mistakes.mk:freeze <target-dir> first to restrict edits to the affected module. The check-freeze.sh hook is installed but without an explicit mk:freeze invocation it is a no-op (all edits allowed).references/shared-protocols.md for completion status + telemetryLoad only when executing the corresponding step — not upfront.
| Reference | When to load | Content |
|---|---|---|
| preamble.md | Step 1 — skill startup | Session init, env detection, upgrade check |
| debugging-methodology.md | Steps 2-6 — investigation + fix | 5-phase debugging: investigate → analyze → hypothesize → implement → verify |
| shared-protocols.md | Step 7 — completion | AskUserQuestion format, completion status, telemetry, contributor mode |
| Bug type | Load reference | What it adds |
|---|---|---|
| Deep stack trace errors | references/root-cause-tracing.md | Backward trace: symptom → cause → ROOT CAUSE |
| Server/CI/DB incidents | references/system-investigation.md | 5-step system investigation methodology |
| CI/CD failures, log correlation | references/log-analysis.md | Filter → timeline → pattern → cross-source |
| Performance issues | references/performance-diagnostics.md | Quantify → layer isolation → bottleneck |
| Post-fix validation | references/reporting-standards.md | Enhanced DEBUG REPORT with timeline + recommendations |
| Test pollution | Run scripts/find-polluter.sh <file> <test-pattern> | Bisection to find which test creates unwanted state |
| Defense-in-depth | See mk:fix/references/prevention-gate.md | 4-layer validation (DRY — shared with mk:fix) |
PreToolUse hook on Edit/Write that delegates to mk:freeze to scope edits to the investigation target. Deactivation follows freeze's semantics — end the session or start a new one to clear it.mk:web-to-markdownWhen investigation requires fetching an arbitrary external URL (e.g. a vendor error page,
a remote log endpoint, a referenced issue URL), this skill delegates to
mk:web-to-markdown via the --wtm-accept-risk flag.
--wtm-accept-risk: mk:web-to-markdown refuses cross-skill delegation.
External URL resolution falls back to Context7 / chub / WebSearch only.--wtm-accept-risk: delegation proceeds through all security layers
(SSRF guard, injection scanner, DATA boundary, secret scrub). The flag is a conscious
trust-boundary crossing — the caller acknowledges the target URL may contain prompt
injection and that the skill's defenses are best-effort..claude/skills/.venv/bin/python3 .claude/skills/web-to-markdown/scripts/fetch_as_markdown.py "<url>" --wtm-accept-risk --caller mk:investigatenpx claudepluginhub ngocsangyem/meowkit --plugin mkPerforms systematic root cause investigation for errors, stack traces, unexpected behavior, and bugs using investigate-analyze-hypothesize-fix workflow with red flags and 3-strike rule.
Enforces structured root cause analysis with module freeze and evidence-based hypothesis. Use when encountering any bug, error, or unexpected behavior.
Enforces hypothesis-driven root cause analysis before any fix. Activates on errors, test failures, and unexpected behavior to ensure no fix without evidence.