/code-craft:retrofit-testsfrom code-craft
Adds characterization tests to working code that has none: pins current behavior at its seams before it changes, prioritised by risk. Use when the user says "add tests to this module", "get this under test before the refactor", "raise coverage on X", or must change legacy code safely. Not for new code test-first (tdd), a broken test (diagnose-bugs), or browser checks (webapp-testing).
Ships in code-craft. 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.
None: SKILL.md is the whole skill.
Create a safety net around existing behavior before it changes. Characterization records what the code currently does; it does not prove that every observed behavior is desirable.
Inspect the public interfaces and the change being prepared. Prioritize paths with likely regressions or costly failures, then representative boundary cases. Use deep-modules' boundary test: observe behavior through the interface while keeping implementation choices replaceable. A coverage target can guide gaps, but adding assertions must still protect meaningful behavior.
Run examples to establish current outputs and inspect surprising results. Record expectations as independent literals or checked fixtures, not a copy of the implementation's calculation. Label undesirable behavior explicitly; do not silently bless a vulnerability or defect as the intended contract. Fixing it remains separate unless already authorized.
Prefer existing seams. If a dependency prevents reliable tests, introduce the smallest behavior-preserving seam needed to control it. Avoid broad production refactors before characterization protects the affected behavior.
Tests should pass against the observed baseline after setup errors are fixed. Their first-ever execution need not be green to qualify as characterization. Use controlled dependencies for nondeterministic or external effects.
For the highest-risk assertions, apply a deliberate behavioral mutation in an isolated copy or use the project's mutation tooling. Confirm the relevant test fails, then restore and verify the original behavior. Keep unrelated work safe; never leave temporary mutations in the user's tree. Expand sensitivity checks when surviving mutations expose weak coverage.
Run affected tests and required repository checks. Report protected behaviors, known surprises, and verification limits. Use tdd when introducing new behavior and diagnose-bugs when investigating an existing failing test.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub smithdak/skillsmith --plugin code-craft6 skills in this plugin
/codebase-surveyMaps an unfamiliar repository fast: inventory scripts plus parallel subagent scans, synthesized into a path-anchored survey document. Use when the user says "survey this codebase", "help me get oriented in this repo", "map out this project", or has inherited a codebase. Not for judging its structure (architecture-review), a new design (architecture-spec), one bug (diagnose-bugs), or one function./diagnose-bugsFinds the root cause of a bug, flaky test, or regression: reproduce, read the evidence, one hypothesis at a time until the mechanism is proven. Use when the user says "why is this failing", "this test is flaky", "it works on my machine", or hands over a stack trace. Not for writing up a found cause (postmortem), what could fail (failure-mode-analysis), or diff security (security-diff-review)./