tdd-legacy

tdd-legacy is a skill for Claude Code from msbaek/msbaek-claude-plugins. It costs 67 tokens per session (1,728 once invoked), scanned A, original, MIT.

A workflow for adding tests to existing code that has no tests. It first records the current behavior with characterization tests, gets approval for that behavior, and checks the tests with mutation testing before handing the code to further improvements.

In plain words
What is it for?
Use it when adding tests to old code, building a behavior-preserving safety net, or preparing legacy code for refactoring.
Why use it?
It creates a safety net before changing legacy code, including behavior that may be undocumented.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the msbaek-tdd plugin — 28 skills, 10 agents, 2 hooks shipped together

Good fit Use it when adding tests to old code, building a behavior-preserving safety net, or preparing legacy code for refactoring.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add msbaek/msbaek-claude-plugins
Claude Code
/plugin install msbaek-tdd

Made for: Claude Code.

Or install msbaek-tdd, the plugin that ships this one along with the rest of its 28 skills, 10 agents, 2 hooks.

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 tdd-legacy

README.md
[![agentmods](https://agentmods.dev/badge/skills/msbaek/msbaek-claude-plugins/tdd-legacy/github.svg)](https://agentmods.dev/skills/msbaek/msbaek-claude-plugins/tdd-legacy)
Your own site
<a href="https://agentmods.dev/skills/msbaek/msbaek-claude-plugins/tdd-legacy"><img src="https://agentmods.dev/badge/skills/msbaek/msbaek-claude-plugins/tdd-legacy/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 tdd-legacy

Your own site · 80×15
<a href="https://agentmods.dev/skills/msbaek/msbaek-claude-plugins/tdd-legacy"><img src="https://agentmods.dev/badge/skills/msbaek/msbaek-claude-plugins/tdd-legacy.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 67 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,728 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 original No closer match found 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.00067 $0.01728
Opus 5.5 $0.00027 $0.00691
Sonnet 5.5 $0.00013 $0.00346
Haiku 4.5 $0.00007 $0.00173

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

Security

Grade A, and why

tdd-legacy 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 2mo 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.

msbaek-tdd/skills/tdd-legacy/SKILL.md · 116 lines

How it starts

The opening of the file, as written. The whole thing — 116 lines — stays where its author put it; the contents beside it link to each section on GitHub.

TDD Legacy — 레거시 코드 안전망 구축

테스트 없는 기존 코드의 현재 행위를 고정하는 안전망을 만들고, 개선은 기존 스킬로 넘깁니다.

GOAL

  • 성공 = 대상 코드의 현재 행위가 테스트로 고정되고, mutation 검증으로 안전망의 실효성이 확인되며, 개선 스킬로 핸드오프됨
  • characterization 테스트가 현재 행위(옳은 행위가 아니라)를 기록함
  • 모든 어설션이 sabotage 검증을 통과함 (동어반복 어설션 없음)
  • mutation score가 합의된 임계값에 도달함 (기본: 대상 메소드 기준 100%)
  • /tdd-tidy 또는 /system-wide-refactoring 핸드오프 안내로 종료

CONSTRAINTS

Hard Rules

  • 현재 행위를 기록한다 — 버그로 보이는 동작도 일단 고정한다. 수정은 안전망 완성 후 별도 작업 (발견한 의심 동작은 사용자에게 보고만).
  • 프로덕션 코드를 변경하지 않는다 — 이 스킬의 산출물은 테스트뿐이다. sabotage로 일시 변경한 코드는 반드시 원복하고 커밋에 포함하지 않는다.
  • 단계(1→2→3) 경계마다 사용자 검토 후 진행 (레거시는 확신이 낮은 상황 — 기어 모델의 low 상당 밀도로 고정).
  • 리팩토링·seam 생성·의존성 깨기(dependency breaking)는 범위 밖 — 필요하면 핸드오프 후 진행.

Principles

  • 테스트하기 어려운 의존성(DB·시간·랜덤)이 있으면 값을 고정할 수 있는 가장 얇은 방법(고정 입력, 시스템 프로퍼티, 테스트 전용 설정)을 먼저 찾고, 불가능하면 그 지점을 사용자에게 보고한다 — 의존성 깨기는 이 스킬이 하지 않는다.
  • unit test vs approval test는 트레이드오프다: 설계가 매우 나쁠 때는 approval이 효율적이고, 설계가 좋아지면 composable한 unit test가 낫다. 둘은 공존 가능하다.

OUTPUT FORMAT

호출 형식

/tdd-legacy <대상 클래스 FQCN 또는 파일 경로>

1단계: Characterization — 현재 행위 고정

  1. 대상 선정: 인자의 클래스에서 변경 예정 지점(사용자에게 확인) 우선. public 메소드부터, 입력 조합이 단순한 것부터.
  2. golden master 작성: 대표 입력으로 현재 출력을 그대로 어설션에 고정. 기대값을 추측하지 말고 실제 실행 결과를 기록한다.
  3. 어설션 정확성 검증 — SUT sabotage: 통과하는 어설션마다
    • SUT를 일시적으로 변형해서(값 하나 변경 등) 테스트를 실행
    • 해당 어설션이 실제로 실패하는지 확인
    • 원복 후 다시 통과 확인
    • 실패하지 않는 어설션 = 동어반복 — 어설션을 고친다
  4. 비결정 출력 정규화 — scrubber: 타임스탬프·랜덤·해시·순서 등 실행마다 변하는 부분은 정규화(치환) 후 비교한다.
  5. 커밋: test: <대상> characterization 테스트 추가. 커밋 메시지는 docs/reviewable-commits.md(없으면 ${CLAUDE_PLUGIN_ROOT}/references/reviewable-commits.md) 표준을 따른다 — body에 어떤 행위를 고정했고 sabotage 검증 결과를 기록. 길이는 ../../references/commit-style.md의 간결성 규칙(제목 + 핵심 bullet 2~4줄)을 따른다. 커밋 직전 git diff --stat으로 테스트 외 파일 변경이 없는지 확인한다 (sabotage 원복 누락 차단).
  6. 사용자 검토 대기 — 고정한 행위 목록과 의심 동작 보고

2단계: Approval — 조합 커버리지 확장

  1. 입력 조합이 많은 메소드는 CombinationApprovals.verifyAllCombinations()로 조합 전체를 승인 파일에 고정 (approvaltests 의존성 필요 — 없으면 추가를 사용자에게 확인).
  2. 조합이 적거나 설계가 깨끗한 부분은 1단계의 unit 스타일을 유지 — 전환은 트레이드오프 판단이며 전부 approval로 바꾸지 않는다.
  3. 승인 파일(approved.txt)도 scrubber 적용.
  4. 커밋: test: <대상> combination approval 추가
  5. 사용자 검토 대기 — 커버한 조합 범위 보고

Read the full file on GitHub · 116 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. 2mo ago Changed · +1 lines 1e30bbd828c3
  2. 2mo ago Changed 656208034e00
  3. 3mo ago Changed · +1 lines d1304423e794
  4. 3mo ago First seen · 114 lines · 67 tokens per session scan A 26073d677976

Subscribe to this mod's changes

tdd-legacy is a skill published in the GitHub repository msbaek/msbaek-claude-plugins (8 stars, last pushed 1mo ago), licensed MIT. It adds 67 tokens to every session and 1,728 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

tdd-legacy compared with skills from other repositories

tdd-legacy next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
tdd-legacymsbaek/msbaek-claude-pluginsSkill81mo agoMITA67Claude Code
engram-testing-coverageGentleman-Programming/engramSkill8.4k10d agoMITA25Claude Code, Codex
iterative-developmentalinaqi/maggySkill7128d agoMITA24Claude Code
tddglebis/claude-skillsSkill419todayMITA92Claude Code
mobiai-mobile-tddArisGuimera/MobiAI-CoreSkill4964d agoMITA38Claude Code
nw-ddd-eventsourcingnWave-ai/nWaveSkill63815d agoMITA38Claude Code
nw-leanux-methodologynWave-ai/nWaveSkill63815d agoMITA37Claude Code