pocs/agent-plugins/claude-pragma/skills/characterize/SKILL.md
Create characterization tests (Golden Master) for existing code so you can refactor or replace safely. Use before refactoring, strangler-replacing, or modifying code with unclear behavior. Captures observable behavior with a minimal harness, producing tests, fixtures, and a coverage report.
npx skillsauth add hashintel/labs characterizeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Create characterization tests for an existing subsystem whose behavior is unclear, messy, or AI-generated. Pin down current observable behavior so that refactoring and incremental replacement are safe.
Subsystem / entrypoint / behavior surface to lock down: $ARGUMENTS
Preconditions:
List 1-3 surfaces to lock down: public functions, CLI commands, HTTP endpoints, file-in→file-out, serialized outputs. Prefer the most stable public surface available.
Keep it small — a suite that's too big becomes unmaintainable.
Before capturing outputs, neutralize noise sources:
If behavior is inherently nondeterministic, define a tolerant comparator (ignore specific fields, assert shape/membership rather than equality).
For each fixture: run the surface, record observable output (return value / stdout+stderr / exit code / HTTP status+body), store as snapshot/golden file.
Assert: given fixture inputs → output matches golden (or tolerant comparator).
/pragma:refactor or strangler seamsCharacterization: lock down current behavior of <subsystem>
/pragma:refactor or strangler approach)State: stabilizing, Next: /pragma:refactor, Loop: /pragma:consult (default unless user explicitly continues directly)documentation
Read and write a Petri net (SDCPN) document by Automerge URL. Use when creating, editing, or querying Petri nets — adding or removing places, transitions, arcs, color types, differential equations, and parameters.
development
Time-boxed throwaway investigation to answer one hard question. Use when facing technical uncertainty before a slice — the output is knowledge, not production code. Retires risk by producing a spike verdict with clear recommendations.
development
Implement one tracer-bullet slice following the inside-out methodology. Use when you have a tracer-bullet card ready to build. Implements functional core first, then imperative shell, then end-to-end wiring, then alignment refactor.
tools
Build a walking skeleton — the thinnest runnable system that proves build, test, and runtime work end-to-end. Use when starting a new project, before any feature work. Front-loads tooling and infrastructure so every subsequent slice is cheaper.