/mycelium-extra:diagnose-resultfrom mycelium-extra
Find why an analysis result looks wrong, unstable or slow, or why a step fails, with a feedback loop, ranked hypotheses and one probe each.
Ships in mycelium-extra. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
A loop for a result that looks wrong, surprising or unstable, and for a step that fails or got slow. Build a tight check first. Everything after it only uses that check. Adapted from Matt Pocock's diagnosing-bugs skill (MIT).
You usually have no gold standard. The signal is then a saved figure you have opened, or a difference between two states you can name. Both count, if you can run them again.
unsupported: no inspected figure. A figure you only looked at in a viewer does not count; save it.donor_03). If redacted output cannot settle the question, say so and ask.[DEBUG-a4f2] in log lines and debug-a4f2_ in file names. Write probe files and scratch reruns to a scratch folder outside outputs/<stem>/ and outside the gated paths, for example scratch/<prefix>/ in the analysis folder. A step overwrites its own outputs/<stem>/, so a debug file there is lost on the next run. Cleanup is then one grep..living/. Never edit gated code (analysis/**, nbs/**) without an approved plan. Probes that need code go in a scratch copy, or in a script outside the gated paths.Before anything else, restate the problem in your own words: the expected state, the observed state, and where they differ. Do this before you read the user's guess at the cause. A stated guess narrows the search to wherever it points. Then check the guess as one hypothesis in Phase 3, not as the starting point.
This is the skill. A loop is one command that gives the same verdict each run and can go red on this symptom. Spend most of the effort here. references/loops.md lists the kinds of loop for analyses and how to tighten them.
Pick the first that fits:
Reruns of an analysis step are runs. They need an approved plan, or an exploratory run the user allowed (allow explore, see docs/commands.md). Ask first. Before any rerun, copy the output you are diagnosing into the scratch folder, so the symptom state survives.
outputs/<stem>/, not a rerun of the steps upstream.logs/CHANGES.md, get the old state from git, and compare tables with the script below.Phase 1 is done when you can name one command you have already run, and its output shows the exact symptom. If no loop can be built, say so, list what you tried, and ask for what you need: access to the data, a saved intermediate, a before-and-after pair. Do not guess at causes without a loop.
For a result that varies between runs, raise the reproduction rate first: first repeat 20 times with seeds fixed and count how often the symptom shows; that measures nondeterminism (threads, hardware). Then vary the seed as a labelled probe; that measures seed sensitivity.
Run the loop and confirm it shows the symptom the user described, not a neighbour of it. Then cut one thing at a time (donors, genes, steps, parameters) and rerun. Stop when removing anything makes the symptom vanish. Keep the cut list.
Write three to five ranked hypotheses. Each states a prediction: "If X is the cause, then changing Y removes the symptom, and changing Z makes it worse." A hypothesis with no prediction is dropped or sharpened. references/hypotheses.md is a catalogue to prompt from, not a list to run.
Show the ranked list to the user before testing. They often know what changed or what is ruled out. Do not block on it if the user is away: test your top hypothesis and show the list with the result.
One probe per hypothesis, one variable at a time, each tagged. Prefer a saved figure or a count at a boundary over printing everything. For a slow step, time it first and bisect the cost. Do not read logs for causes: they are usually wrong or silent. Measure, then bisect.
Turn the minimal repro into a regression check at a seam where the real pattern occurs, and place it outside the gated paths (for example tests/). Watch it fail. If you forced the red by editing code or a fixture, diff against a pristine copy to prove the edit landed before you trust the failure. Then apply the fix, watch it pass, then rerun the Phase 1 loop on the original scenario. A fix that edits gated code needs an approved plan and a rerun through run.sh.
If no correct seam exists, that is the finding. Say what blocks the check, for example a step that mixes loading, filtering and fitting.
When two fixes that share one premise have failed the same check, stop. Do not try a third.
verify report adds an info line when a step has two failed attempts, so the stop shows in the record.
grep -rn "DEBUG-a4f2" . and find . -name "debug-a4f2_*" (with your prefix) find nothing.Read-only. Exit 0 identical, 1 different, 2 unusable input (missing file, missing or empty key, duplicate keys or column names, a row wider than the header).
<skill-dir>/../../hooks/mxpy - OLD NEW --key donor,gene [--rtol 1e-6] [--atol 1e-8] [--max-rows 10] [--redact-keys] < <skill-dir>/scripts/diff_tables.py
It reports rows and columns present on one side only, type-like changes (integer, number, text) and numeric differences beyond the tolerances, with the first rows that differ. It also reports a changed column order. Text compares exactly, so 007 differs from 7 and NA from an empty cell. An infinite value differs from anything but itself. Use --redact-keys when keys are donor IDs: it hides key values, text cell values and column names (rows and columns show by position).
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub mdmanurung/mycelium-extra --plugin mycelium-extra35 skills in this plugin
/analysis-mapChart a research program too big for one session as a map of decision tickets, then resolve them one at a time. Plans decisions; runs no analysis./analysis-reportFill the Quarto report new-analysis scaffolds in reports/ after a run. Narrative, quoted script excerpts, a step diagram and inspected figures in Overview, Methods, Results and Reproducibility tabs./ask-extraAsk which Mycelium Extra skill fits your situation. Names one to three skills to type and why; starts none of them./check-firstWrite the check that would catch a wrong result before the analysis code, one step at a time. Use when a step will decide something; not for exploratory looks or figure polishing./data-contract-checkCheck a plan's data assumptions (columns, cohort counts, replication unit, pairing, batch nesting) against the sample table or h5ad obs, read-only. Use when a plan rests on table properties nobody has verified; not for Seurat objects or code./decision-statusWork out which past entry in .living/decisions.md still binds a choice when several cover it, and record the resolution after the user confirms. Use when a decision is contested or grill finds two entries on one choice; not for logging a new decision.