working-with-legacy-code SKILL.md skillA

working-with-legacy-code from wondelai/skills is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.

Install it, pinned
mdr add wondelai/skills/working-with-legacy-code@v1.2.0

Pins v1.2.0 in mdr.lock. Pin the fingerprint instead.

Audit grade
A, 17 of 17 checks passed
Kind
SKILL.md skill
Repository
wondelai/skills
Path
working-with-legacy-code/SKILL.md
Versions recorded
3
Latest version
v1.2.0, committed Jun 30, 2026
First version recorded
Jun 11, 2026
Size
19,511 bytes
Repository stars
2,640
License
MIT

Safely change and test untested codebases using Feathers'' "Working Effectively with Legacy Code". Use when the user mentions "legacy code", "no tests", "untested codebase", "how do I test this", "seams", "characterization tests", "golden master", "sprout method", "afraid to change this code", "monster method", "dependency breaking", or "inherited a messy codebase". Also trigger when changing code without tests safely, getting a class under test when constructors, statics, or singletons block…

Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.

What the file says

# Working Effectively with Legacy Code

A field manual for changing code that has no tests, distilled from Michael C. Feathers' *Working Effectively with Legacy Code*. Use it to get untestable classes into a harness, pin down current behavior with characterization tests, and make changes one safe, verifiable step at a time — without resorting to a rewrite.

## Core Principle

**Legacy code is simply code without tests.** Not old code, not ugly code — untested code: without tests you cannot know whether a change preserves behavior, so every edit is a gamble. The craft is breaking dependencies just enough to get tests in place before changing anything — cover and modify, never edit and pray.

## Scoring

**Goal: 10/10.** Rate changes to untested code 0-10 against the principles below. Report the current score and the specific steps needed to reach 10/10.

- **9-10:** Change points covered by characterization tests before any edit; behavior changes and refactoring shipped as separate verified steps; dependencies broken with the least invasive technique
- **7-8:** Tests at most change points, but occasional mixed refactor-plus-behavior commits or heavier dependency surgery than needed
…

Read the whole file at its exact version.

How to install

The exact contents, by fingerprint
mdr add wondelai/skills/working-with-legacy-code@sha256:4a621798f9a51ad1

The line at the top of this page pins the label v1.2.0, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.

Badge

mdr badge

[![mdr](https://markdownregistry.com/badge/art_2xsvpc4shexqgmh5.svg)](https://markdownregistry.com/a/art_2xsvpc4shexqgmh5)

5 badge image fetches in 30 days. What the badge shows.

Versions

The registry has recorded 3 versions of this file, between Jun 11, 2026 and Jun 30, 2026, about one every 10 days.

versioncommittedcommitsizeaudit
v1.2.0 latest2026-06-30 0dea03f 19,511 BA view · diff
v1.1.02026-06-24 5356d12 19,735 BA view · diff
v1.0.02026-06-11 71ae229 19,688 BA view

Audit of the latest version

A  17 of 17 checks passed. Fixed automatic checks with no AI involved, so the same checks give the same answer every run.
  • pass: Frontmatter block present
  • pass: Frontmatter declares a name
  • pass: Frontmatter declares a description
  • pass: Size between 200 bytes and 200 KB (19511 bytes)
  • pass: No zero-width or bidi control characters
  • pass: No instruction hidden inside an HTML comment
  • pass: No link to an exfiltration or paste host
  • pass: No credential-shaped string
  • pass: No instruction to send local credentials anywhere
  • pass: No text hidden with inline styles
  • pass: No prompt-injection phrasing
  • pass: No curl or wget piped into a shell
  • pass: No recursive delete of root, home or parent
  • pass: No instruction to read or print local credentials
  • pass: No base64 blob over 200 characters
  • pass: No link to a raw IP address
  • pass: No script tag

Source

GitHub

wondelai/skills · 2,640 stars · license MIT · pushed 2026-11-02 · branch main

API

GET https://markdownregistry.com/api/v1/artifacts/art_2xsvpc4shexqgmh5
GET https://markdownregistry.com/api/v1/resolve?ref=wondelai/skills/working-with-legacy-code
GET https://markdownregistry.com/api/v1/blob/4a621798f9a51ad1438f5b25b168615b7caeb540378c8f4d70ab733523135e21

Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.

Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.

More from wondelai/skills

.cursorrules Cursor rule
wondelai/skills · .cursorrules
git:20260701.14a4958 · audit A · 2,640 stars
37signals-way SKILL.md skill
wondelai/skills · 37signals-way/SKILL.md · Build lean, opinionated products using the 37signals philosophy from "Getting Real", "Rework", and "Shape Up". Use when…
v1.3.1 · audit A · 2,640 stars
CLAUDE.md CLAUDE.md file
wondelai/skills · CLAUDE.md
git:20261102.79a0452 · audit A · 2,640 stars
architecture-optimization SKILL.md skill
wondelai/skills · architecture-optimization/SKILL.md · Guided journey from a working codebase grown slow and tangled to one measurably fast, cleanly bounded, and readable…
v1.0.0 · audit A · 2,640 stars
blue-ocean-strategy SKILL.md skill
wondelai/skills · blue-ocean-strategy/SKILL.md · Create uncontested market space using value innovation instead of competing head-to-head. Use when the user mentions…
v1.4.1 · audit A · 2,640 stars
clean-architecture SKILL.md skill
wondelai/skills · clean-architecture/SKILL.md · Structure software around the Dependency Rule: source code dependencies point inward from frameworks to use cases to…
v1.4.0 · audit A · 2,640 stars
clean-code SKILL.md skill
wondelai/skills · clean-code/SKILL.md · Write readable, maintainable code through disciplined naming, small functions, and clean error handling. Use when the…
v1.4.0 · audit A · 2,640 stars
cold-start-problem SKILL.md skill
wondelai/skills · cold-start-problem/SKILL.md · Start and scale networked products using Andrew Chen''s "The Cold Start Problem" framework for network effects. Use…
v1.2.0 · audit A · 2,640 stars
contagious SKILL.md skill
wondelai/skills · contagious/SKILL.md · Engineer word-of-mouth and virality using the STEPPS framework (Social Currency, Triggers, Emotion, Public, Practical…
v1.4.0 · audit A · 2,640 stars
continuous-discovery SKILL.md skill
wondelai/skills · continuous-discovery/SKILL.md · Build a weekly cadence of customer touchpoints using Opportunity Solution Trees, assumption mapping, and interview…
v1.4.0 · audit A · 2,640 stars
conversion-optimization SKILL.md skill
wondelai/skills · conversion-optimization/SKILL.md · Guided journey from a leaking conversion flow - landing page, signup, checkout, or in-app onboarding - to a measured…
v1.0.0 · audit A · 2,640 stars
create-app SKILL.md skill
wondelai/skills · create-app/SKILL.md · Guided journey from a raw app idea to a validated, cleanly architected first version that ships on a sustainable…
v1.0.1 · audit A · 2,640 stars

Every file in wondelai/skills

Other files named working-with-legacy-code

working-with-legacy-code SKILL.md skill
wondelai/skills · plugins/wondelai-skills/skills/working-with-legacy-code/SKILL.md · Safely change and test untested codebases using Feathers'' "Working Effectively with Legacy Code". Use when the user…
v1.2.0 · audit A · 2,640 stars
working-with-legacy-code SKILL.md skill
wondelai/skills · plugins/code-craftsmanship/skills/working-with-legacy-code/SKILL.md · Safely change and test untested codebases using Feathers'' "Working Effectively with Legacy Code". Use when the user…
v1.2.0 · audit A · 2,640 stars

Browse by kind, by grade A, or by owner.