Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add SkillMedev/legacy-modernization --skill characterization-test-writergit clone --depth 1 https://github.com/SkillMedev/legacy-modernizationWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/skillmedev/legacy-modernization/characterization-test-writer)<a href="https://agentmods.dev/skills/skillmedev/legacy-modernization/characterization-test-writer"><img src="https://agentmods.dev/badge/skills/skillmedev/legacy-modernization/characterization-test-writer.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00148 | $0.01415 |
| Opus 5 | $0.00074 | $0.00707 |
| Sonnet 5 | $0.00030 | $0.00283 |
| Haiku 4.5 | $0.00015 | $0.00142 |
Grade A, and why
Characterization Test Writer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
This is a copy
100% identical to Characterization Test Writer — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 81 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Characterization Test Writer
Pin what legacy code currently does - bugs included - so a refactor that changes behavior fails loudly instead of silently. The costly mistake this prevents is the "clean" refactor that quietly changes an output nobody noticed was load-bearing, discovered weeks later in production. A characterization test records reality; it never judges it.
Operating procedure
Order matters: the seam must exist before you can capture output, output must be captured before you can stabilize it, and coverage is only measurable once tests run.
Step 1: Gather inputs
- The exact function/module about to change, and the refactor's blast radius - which code paths will the change touch? Only those need pinning.
- The dependency list: database, clock, RNG, network, filesystem, globals, environment. Each is a nondeterminism source to control in Step 4.
- Any recorded production inputs or logs available for replay. Label assumptions about "typical inputs" as guesses.
Step 2: Find the smallest seam
Untested legacy code reaches for databases, clocks, network, and globals, so it usually cannot be called in isolation. Introduce the minimum seam that lets you invoke it: extract a method, parameterize a constructor, inject the dependency, or subclass-and-override (the "subclass to sense" technique from Working Effectively with Legacy Code). Do not refactor the body before the net exists - seam-introduction edits must be mechanical and behavior-preserving (rename, extract, inject), nothing that changes logic.
Step 3: Capture actual output, not expected
Write a deliberately failing assertion, run it, read the real value from the failure message, and paste it in:
def test_characterize_shipping_for_oversize_order():
result = calc_shipping(weight_kg=32, region="EU")
assert result == "PLACEHOLDER" # run -> failure says: AssertionError: 47.6 != PLACEHOLDER
becomes, after one run:
def test_characterizes_oversize_eu_shipping():
result = calc_shipping(weight_kg=32, region="EU")
assert result == 47.6 # observed 47.6, not the 45.0 the spec claims - see pins_known_bug below
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 7d ago First seen · 81 lines · 148 tokens per session scan A cc3de90e398b
Characterization Test Writer is a skill published in the GitHub repository SkillMedev/legacy-modernization (2 stars, last pushed 2mo ago), licensed MIT. It adds 148 tokens to every session and 1,415 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to Characterization Test Writer, differing in 0 lines, and is treated as a copy.
Other skills, from other repositories
Unit Test Improver
Reviews existing unit tests for gaps, weak assertions, and missing edge cases, then rewrites them to be more robust.
Unit Test Writer
Generates comprehensive unit tests for any function or module with edge cases.
writing-tests
Write unit tests, component tests, and integration tests for AiderDesk using Vitest and React Testing Library. Use when creating new tests, adding test coverage, configuring mocks, setting up test files, or debugging failing tests.
review-ugc-render
Mandatory pre-publish review gate for a UGC video render. Transcribes the finished render's AUDIO with Whisper and word-diffs it against the approved spoken script, then gates setfinalrender — blocking a render whose generated audio mis-voices a word (e.g. the approved "human-vetted" spoken as "human witted"), drops…
test-generator
A test-writing helper that creates unit or integration tests from the code's actual behavior and contracts. Unit tests check small pieces of code, while integration tests check how real components work together.
testing-r-packages
Best practices for writing R package tests using testthat version 3+. Use when writing, organizing, or improving tests for R packages. Covers test structure, expectations, fixtures, snapshots, mocking, and modern testthat 3 patterns including self-sufficient tests, proper cleanup with withr, and snapshot testing.