/mycelium-extra:hardenfrom mycelium-extra
Ship one Mycelium learning's structural_mitigation_candidate as a real test, then mark the learning structural.
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.
Turn a learning the project keeps having to remember into a test that remembers it. Mycelium counts a learning as structural only once its check has shipped; until then it stays ambient-awareness, the weakest kind. This skill ships the check. One learning per run.
.living/learnings.md. Without it, say so and stop.rg -n 'structural_mitigation_candidate' .living/learnings.md, then read each matching entry (it starts at the ### [YYYY-MM-DD] heading above the match).mitigation_type is not structural and whose candidate names a concrete check: a function, file, column, or assertion. Skip the template placeholder and vague candidates ("be careful with X").analysis/.../x.py, assert ...") still qualifies when the check reads a file a test can read too: show it with "(check moves to a test)". If it checks a value only the running script holds, skip it and say why: it belongs to a grill plan and a re-run.A repeated mistake is one that has happened twice. Before section 2, ask which level removes it, and take the highest that works. Say why each higher level did not work. Idea from pstack (MIT, cursor/plugins): correct.
Levels 1 to 3 change package or repository code. Make that change only when the user approves it, and never in analysis code, which belongs to a grill plan and a re-run. When the choice is level 4, go on with sections 2 to 4.
For a level 1 to 3 fix, show the user the change (the files and the diff) and the reproduction of the past mistake, and make the change only after a yes. Then prove it on the reproduction: before the change the mistake goes through, and after it the wrong import fails, the bad state cannot be written, or the lint fires with its message. Show both results. If the mistake still goes through after the change, revert the change, stop, and leave the entry ambient-awareness. Then go to section 4, and record the changed file (or the lint rule) in place of a test path.
The learning becomes structural only for a level 1 to 4 fix that ships and is proved on the reproduction (section 3 for a test); a docs-only fix leaves it ambient-awareness.
pytest.ini, [tool.pytest] in pyproject.toml, tests/testthat/, or existing test_*.py files and how they are run (check README, AGENTS.md, CLAUDE.md).tests/test_<slug>.py (stdlib assert, runnable with python3) or tests/testthat/test-<slug>.R.gated_paths in .mycelium-extra/gate.json; default analysis/**, nbs/**), and never edit analysis code. A check inside analysis code changes what ran, so it belongs to a grill plan and a re-run, not to this skill. For a candidate placed in analysis code, write the same assertion in the test, reading the file the analysis reads or writes, and leave the script as it is.# Guards learning "<title>" (.living/learnings.md, <date>).Do not write the test file yet. Show the user the proposed test (path and body) and the reproduction it will use, and ask whether that reproduction really is the problem the learning describes: you chose it, and a wrong reproduction makes a worthless test. Write the file only after the user says yes; if they correct the reproduction, revise and ask again.
Then run the test twice and show both results:
If it cannot be made to fail on the reproduction, it guards nothing: delete the test file you wrote, stop, and leave the entry ambient-awareness. If it fails on the current code, the problem is live: report it, and do not mark the learning structural.
For a data learning (a column, a sample count, a file format), the test may read the repository's data file. If that file is large or git-ignored, say the test only runs where the data exists.
Show the test path (or the changed files), both runs, and the exact edit, then ask. After the user confirms, edit only that entry:
**mitigation_type**: structural**structural_mitigation_candidate**: line: Shipped: \<test path, or the changed file or lint rule for a level 1 to 3 fix>` (YYYY-MM-DD).`Change no other field or entry. Do not commit. This confirmation is the agent's instruction, not a gate rule: nothing enforces it, unless .mycelium-extra/gate.json sets confirm_writes to true. Then, before writing the test file (section 3), run <skill-dir>/../../hooks/mxpy <skill-dir>/../../hooks/confirm_write.py prepare --kind harden --target <test path or changed file> --target .living/learnings.md, show the user the confirm write <id> line, and write either file only after they type it: the gate denies both before. If Mycelium's Stop hook asks for .living/ updates afterwards, follow it. End with one line: the learning, the test path (or the changed file), and how to run it.
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.