/will-wright-eng-skills:annealfrom will-wright-eng-skills
Decompose a god module into stable and volatile pieces whose boundaries match how the code actually changes. Locates hotspots with the hc CLI (decay-weighted churn × complexity quadrants), autopsies the chosen file along three evidence axes (symbol co-change, consumer slices, internal references), interviews through each proposed seam one at a time, and delivers a strangler-fig migration plan with a measurable hc baseline. Use when a file is a "god module" or "god file", one file soaks up every change, a module needs splitting, or the user wants to isolate hot code or reduce churn concentration.
Ships in will-wright-eng-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Help me carve a god module into pieces whose boundaries match how the code actually changes. Locate the target with hot/cold analysis (or start from the file I name), autopsy it along three independent evidence axes, then interview me through each proposed seam — one question at a time, with your recommended answer, as a quick pick when the options are discrete and as a discussion when they aren't — before writing anything. The deliverable is a strangler-fig migration plan with a baseline measurement, written only when I confirm it.
The goal is not "smaller files." It is: dependencies point from volatile to stable, so future churn lands in one quarantined place instead of radiating through the codebase.
Decompose along heat, not ugliness. Quadrants come from hc (churn × complexity, median-split):
Never propose work on a cold file just because it looks bad.
hc computes decay-weighted churn × complexity quadrants with rename tracking, a 14-day file age floor, and a versioned JSON envelope.
command -v hc. If missing, offer go install github.com/will-wright-eng/hc/cmd/hc@latest..hcignore first: run hc md ignore, fulfill the emitted prompt yourself, and confirm the content with me before writing the file.If I named a file, still run the analysis — it supplies the baseline and shows where the file sits in the repo's distribution. If I didn't, rank candidates:
hc analyze --json > /tmp/hotspots.json
jq -r '.files[] | select(.quadrant == "hot-critical")
| [.path, .weighted_commits, .complexity, .lines, .authors] | @tsv' /tmp/hotspots.json
Present the shortlist with absolute numbers alongside the quadrant label. Quadrants are relative to the repo's own median — in a repo where everything churns, half the files are "cold" by construction, so the label alone can mislead. A hot-critical file with a single author is also a knowledge silo; say so.
Ask which file to autopsy (one question), unless I already named it.
Co-change evidence is only as good as the commit history. Measure before trusting it:
git log --pretty=format:'@%H' --name-only | awk '/^@/{if(n)print n;n=0;next}/./{n++}END{print n}' | sort -n
If the median files-per-commit is large or the history is dominated by giant "checkpoint" commits (common in vibe-coded repos), down-weight the co-change axis, lean on consumer slices and the internal graph instead, and tell me you did.
Three independent evidence axes over the target file. Propose a cut only where at least two axes agree; disagreements become interview questions, not proposals.
Symbol co-change — cluster the file's functions/classes by which commits touch them:
git log --format=%H -L ':symbolName:path/to/file' | grep -E '^[0-9a-f]{40}$'
Run per symbol (fall back to -L start,end:file line ranges where funcname detection fails), then cluster symbols by commit-set overlap. Skip commits touching more than ~50 files — mass renames and format-everything commits couple everything to everything. The cluster appearing in the most recent commits is the hot core; symbols untouched for months are the stable core.
Consumer slices — for each exported symbol, grep which files use it (excluding the module itself). God modules almost always serve several disjoint consumer sets; each disjoint set is a free seam.
Internal reference graph — which symbols inside the file call each other. Weakly-connected components are cheap cuts; the tangled center is where interview effort goes.
If hc ships --coupling (proposal 012), use it for the file-level co-change partners. Until then, the pair-count fallback below.
Work through proposed seams one question at a time, waiting for my answer, recommendation stated first:
CONTEXT.md if present; describe the architecture with the vocabulary in LANGUAGE.md — deep/shallow, seam, locality, leverage. The stable core should come out deep: a lot of behavior behind a small interface.Collect resolutions as we go; write nothing yet.
This applies to every question in the session, from the Phase 1 file pick to the Phase 5 plan confirmation. Pick the format from the shape of the decision — the lightest one that carries it:
Escalate a quick pick to Discuss when my free-text answer doesn't map onto the options or shows the question was framed wrong.
For select-one and select-many, use the harness's structured question tool when it has one (Claude Code: AskUserQuestion); otherwise render a numbered list and accept numbers or free text. Either way:
path:line, the hc numbers) so I can answer without scrolling back.When every seam is resolved, propose the plan document — default path docs/plans/anneal-<module>.md, confirm path and content before writing. It contains:
After slices land, re-measure:
hc analyze --json --no-min-age --files-from new-files.txt
--files-from shrinks the rows but thresholds stay computed on the full corpus — exactly right here. --no-min-age is required: freshly split files are otherwise excluded by the 14-day age floor, and are mechanically "cold" under the median split regardless — treat early post-split numbers as provisional and say so.
The refactor worked when: the volatile extract stays hot but its churn no longer co-changes with the stable core; the stable core drifts cold; and if the repo runs hc's PR annotations, the hot-critical warnings stop firing on PRs that used to trip them.
Churn ranking (no decay, no rename tracking):
git log --since="12 months ago" --name-only --pretty=format: | grep . | sort | uniq -c | sort -rn | head -30
Cross with wc -l as the complexity proxy and note the method downgrade.
File-level co-change partners — group git log --name-only --pretty=format:'@%H' output per commit, skip commits with >50 files, count pairs involving the target. Mirror hc proposal 012's floors: keep pairs with support ≥ 5 and confidence ≥ 0.5 (co-changes ÷ target's total changes).
internal/schema.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
Generated from the plugin's indexed repository (will-wright-eng/skills) — no native marketplace selected
npx claudepluginhub p/will-wright-eng-will-wright-eng-skills21 skills in this plugin
/agent-specificationWrite or review the specification of an agent, or of a system of several agents, through a question/answer session. Chooses the arrangement first (one agent, pipeline, orchestrator or blackboard), then settles one SPECIFICATION.md per agent and, when there is more than one agent, a SYSTEM.md that states how they are joined. Works in a fresh repo or against one role of a system that already exists. Takes an optional path to a specification or system document to review. Use when defining, scoping or reviewing an agent or a multi-agent system, choosing between agent patterns, writing an agent's SPECIFICATION.md, or giving each role of an existing agent system a written scope./assess-test-suiteAssess a project's test suite against the verification practice in "How the Claude Code team thinks about verification" — classifies every test on two axes (scope unit/integration/E2E × oracle interaction/example/snapshot/property/differential) plus health tags (flaky, slow, cannot-fail, not agent-runnable), maps user-facing features to E2E coverage, then proposes a ranked refactor toward E2E, property and differential tests, closing with a short note on what the refactor does to CI/CD runtime. Writes the assessment only on confirmation and never edits tests. Use when the user wants to "assess the test suite", "audit our tests", know "are our tests any good" or "which tests are worth writing", plan a test strategy or test refactor, deal with too many mocks or unit tests or with flaky tests, or make a test suite a reliable feedback loop for coding agents./autoresearch-methodExplain the autoresearch methodology — a verifiable autonomous experiment loop — and evaluate whether the current repo is a good fit before running the autoresearch-verify and autoresearch-program skills. Use when a user wants to add autonomous experimentation to a project, asks about autoresearch/autoresearch, or is about to invoke the other autoresearch skills./autoresearch-programGenerate `program.md` at the repo root from the autoresearch program template, with mutable/immutable scope and verifier commands baked in via light templating. Run after autoresearch-verify produces the verifier script. The generated program.md is the operating directive for a fresh agent session running the autoresearch loop — after this skill runs, the autoresearch skills are no longer in the picture. Use when a user wants to generate the loop directive for an autoresearch run./autoresearch-verifyBuild a repo-specific verifier script for an autoresearch loop. The script has two modes — `light` (fast per-candidate metric evaluation, emits the JSON the loop consumes) and `heavy` (matrix-of-conditions integrity check). Run after autoresearch-method confirms the repo fits and before autoresearch-program. Use when a user wants to build the verifier script for an autoresearch loop./blog-antipatternsReview a markdown software blog post against Michael Lynch's "Anti-Patterns in Software Blogging" — the meandering intro and preamble, assuming the reader knows what you know, overreliance on links, the sequel injection bug, excessive formality, and fumbled HTML basics (mobile overflow, unreadable text). Names the post's reference reader first, then reports each finding with its line, the rule it breaks, and a paste-ready rewrite; rendering issues markdown can't settle become targeted manual checks. Read-only — never edits the post. Use when a blog post or draft article needs reviewing before publishing — "review my blog post", "critique this draft", "check this post for blogging anti-patterns", "is this post ready to publish".