characterization-test-writer

characterization-test-writer is a skill for Claude Code, Codex from SkillMedev/legacy-modernization. It costs 149 tokens per session (1,426 once invoked), scanned A, a copy of characterization-test-writer, MIT.

Tests that record what untested legacy code currently does, including its bugs. They act as a safety net while the code is refactored.

In plain words
What is it for?
Use it before changing a module with few or no tests, especially when it depends on databases, clocks, networks, files, or global settings.
Why use it?
A refactor can quietly change an output that other parts of the system depend on. These tests make such changes visible by failing when behavior changes.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it before changing a module with few or no tests, especially when it depends on databases, clocks, networks, files, or global settings.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/skillmedev/legacy-modernization/characterization-test-writer
Install

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.

Any agent
npx skills add SkillMedev/legacy-modernization --skill characterization-test-writer
Clone the repo
git clone --depth 1 https://github.com/SkillMedev/legacy-modernization

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for characterization-test-writer

README.md
[![agentmods](https://agentmods.dev/badge/skills/skillmedev/legacy-modernization/characterization-test-writer/github.svg)](https://agentmods.dev/skills/skillmedev/legacy-modernization/characterization-test-writer)
Your own site
<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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for characterization-test-writer

Your own site · 80×15
<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="Reviewed on agentmods" width="80" height="20"></a>
Per session 149 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,426 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00149 $0.01426
Opus 5.5 $0.00060 $0.00570
Sonnet 5.5 $0.00030 $0.00285
Haiku 4.5 $0.00015 $0.00143

Measured 1mo ago against content hash b48fdc1a25a9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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 1mo 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.

Origin

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.

skills/characterization-test-writer/SKILL.md · 83 lines

How it starts

The opening of the file, as written. The whole thing — 83 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

Read the full file on GitHub · 83 lines

Changes

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.

  1. 1mo ago Changed · +2 lines · +1 tokens per session b48fdc1a25a9
  2. 3mo ago First seen · 81 lines · 148 tokens per session scan A cc3de90e398b

Subscribe to this mod's changes

characterization-test-writer is a skill published in the GitHub repository SkillMedev/legacy-modernization (2 stars, last pushed 1mo ago), licensed MIT. It adds 149 tokens to every session and 1,426 once invoked, about $0.0006 per session on Opus 5.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.

Related

characterization-test-writer compared with skills from other repositories

characterization-test-writer next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
characterization-test-writerSkillMedev/legacy-modernizationSkill21mo agoMITA149Claude Code, Codex
Breaking Change DetectorNotysoty/openagentskillsSkill93mo agoMITA23Claude Code, Codex
Unit Test ImproverNotysoty/openagentskillsSkill93mo agoMITA29Claude Code, Codex
Unit Test WriterNotysoty/openagentskillsSkill93mo agoMITA18Claude Code, Codex
test-masterJeffallan/claude-skillsSkill13ktodayMITA104Claude Code
review-ugc-rendergooseworks-ai/goose-skillsSkill1.4k3d agoMITA201Claude Code, Codex
writing-testshotovo/aider-deskSkill1.5k9d agoApache-2.0A48Claude Code, Codex