一键导入
debug
Fix bugs, crashes, errors, or failing tests. Use when "it's broken", "getting an error", "test is failing", or the cause isn't obvious.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Fix bugs, crashes, errors, or failing tests. Use when "it's broken", "getting an error", "test is failing", or the cause isn't obvious.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Fully autonomous bug hunting pipeline — discover bugs in a scoped area using parallel subagents, independently triage each finding, fix confirmed issues with subagents, then audit all fixes against repo constraints and target platforms. Runs end-to-end without user interaction.
Answer questions about how 'mi' works, write new tools, or modify the harness. Use for "how do you work", "write a tool", "add a tool", "create a tool", "extend yourself", "edit yourself", "what tools do you have", or any introspection/modification of the running agent.
Scan the codebase and classify every fact by lifecycle stage — tag @draft, @spec, or @implemented based on what the code actually shows. Add missing facts, fix inaccurate ones, remove obsolete ones. Use when asked to discover facts, bootstrap or update a fact sheet, scan the codebase for truths, sync facts to match the code, or audit the fact sheet for accuracy.
Operate on @spec facts — implement them in code, then tag @implemented. Use when asked to implement facts, implement the spec, build from the fact sheet, make facts true, or work through unimplemented requirements.
Operate on @draft facts — collaboratively refine them into precise, actionable @spec facts. Resolve ambiguities, fill gaps, eliminate contradictions, and sharpen labels until every fact is ready to implement. Use when asked to refine facts, clarify the spec, review facts for quality, or "work on facts" with the user.
Manage .facts files — atomic, validatable truth statements about a project. Install, check, list, add, edit, remove, and lint facts via the CLI. ALWAYS read this skill when the user mentions facts in any capacity.
| name | debug |
| description | Fix bugs, crashes, errors, or failing tests. Use when "it's broken", "getting an error", "test is failing", or the cause isn't obvious. |
Do not propose a fix before step 1 completes. A bug you cannot reproduce is a bug you cannot fix.
Reproduce. Write a minimal repro before touching the suspected code. Either:
/tmp/mi-repro-<slug>.sh (or .py, etc.) that exits non-zero on the bug, orObserve. Capture actual vs expected side-by-side. Collect stack traces, logs, and intermediate state (print/console.log, set -x, a debugger, or structured logging). Write observations to /tmp/mi-debug-notes.md if the trail is long. Use this format:
repro: python cli.py export --col foo
expected: CSV with column "foo" written to stdout
actual: ValueError: 'foo' not in index (traceback line 42 cli.py)
Do not theorize yet. Record only what you observe.
Hypothesize. State one explanation explicitly: "I believe X because Y." One at a time. If you have several, pick the cheapest to test first. Write it down before you test it.
Test the hypothesis. Change exactly one variable, re-run the repro, record the result. If the hypothesis is wrong, revert the change before trying the next one — do not stack speculative edits.
If the fix requires new code rather than a surgical change, call skill("tdd") and follow its red/green/refactor loop before proceeding to verification. Do not proceed without loading it.
Verify the fix. The repro now passes AND nothing else broke. Before declaring done, call skill("verify") and follow its body for the broader check (lint, typecheck, full test suite). Do not proceed without loading it. Keep the repro script or test committed where useful — it's a regression guard.
Add tests if requested. If the original prompt included "add tests" or "write tests", the fix is confirmed — now call skill("tdd") and follow its body to structure the test-writing phase. Do not write tests inline without loading it.
Writing or rewriting multi-line files. Do not use echo "...\n..." (no real newlines without -e) and do not use sed to insert multi-line blocks (sed runs idempotency is hard to control and duplicates lines on retry). Use one of these instead:
cat > file.py <<'EOF'\n...\nEOFpython3 -c "open('file.py','w').write('''...\n...\n''')"If the file already exists and you are patching one line, sed -i 's/old/new/' is fine. For anything involving indented blocks, write the whole file fresh.
Red flags — stop and ask the user:
If you cannot reproduce after a reasonable effort, stop and say so. Request more information (exact command, environment, inputs, version). Do not guess-patch an unreproduced bug.