← ClaudeAtlas

rescue-characterizelisted

Writes characterization ("golden master") tests that pin what a legacy module does today, bugs included, before anyone changes it. Uses the repo's existing test framework, finds the seams where inputs and outputs can be captured, breaks dependencies with the smallest possible change, and records every surprising behaviour instead of fixing it. Use when the user says "add tests before I change this", "write characterization tests", "golden master this module", "pin the current behaviour", "there are no tests and I need to refactor", "safety net for this file", or "lock down how this works".
vivekbhange-hub/legacy-rescue-skill · ★ 0 · AI & Automation · score 75
Install: claude install-skill vivekbhange-hub/legacy-rescue-skill
# rescue-characterize A characterization test does not ask "is this right?". It asks "what does it do?" and fails the moment that changes. That is exactly the safety net a legacy rescue needs: once the current behaviour is pinned, every later refactor can be checked in seconds, and every intended behaviour change becomes visible in a diff. This skill writes those tests for one module at a time, using the framework the project already has, and touches production code only when there is no other way in, with the smallest change that could work. ## Inputs - `$ARGUMENTS`: the target, e.g. `src/billing/invoice.py`, `OrderService.calculateTotal`. If empty, take the top hotspot from `rescue/hotspots.md` and confirm it with the user. - `rescue/map.md` for the test command. If it is missing, find the test command from CI config or the manifest first. ## Output - New test files next to the project's existing tests, following their naming and layout. - Golden files (approved outputs) under the test tree, e.g. `tests/golden/<module>/`. - `rescue/characterization.md`: what is pinned, how, the seams used, and the surprises found. ## Steps 1. **Run the existing suite first.** Use the project's own command. Record pass/fail counts and duration. If it is red, stop and tell the user: a safety net on top of red tests is noise. Offer to record the failing tests as known failures and carry on only with their consent. 2. **Read the target.** List its public entry points, inputs (