Skip to content
Back to skills

Legacy

ASecurity

Take over an existing codebase safely - survey where it hurts, pin its behaviour with characterization tests before changing it, register the debt as tickets, and ratchet the worst metrics so they only improve. Use on "reprise de code", "legacy", "dette technique", "on hérite de ce projet", "how bad is this codebase", before a large change in code nobody fully understands.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 2, 2026
developmentgosecurity

Security analysis

A100/100

Scanned December 2, 2026

npx -y skills add Sycatle/senior-mode --skill legacy --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Legacy?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Legacy
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/sycatle-legacy-senior-mode/badge)](https://www.skillsdirectory.com/skills/sycatle-legacy-senior-mode)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: legacy
description: Take over an existing codebase safely - survey where it hurts, pin its behaviour with characterization tests before changing it, register the debt as tickets, and ratchet the worst metrics so they only improve. Use on "reprise de code", "legacy", "dette technique", "on hérite de ce projet", "how bad is this codebase", before a large change in code nobody fully understands.
disable-model-invocation: true
---

# Legacy

Inherited code works, more or less, and people depend on what it does today, bugs included. The risk is
not that it is ugly; it is changing it without knowing what it does. So the order is: understand, pin,
then improve in small steps, never a rewrite on faith.

## Survey

1. **Run it and its checks.** Build it, run the tests, `senior-mode check`. Done when you know what runs,
   what fails, and what is missing (no tests, no lint, no CI).
2. **Find where it hurts.** `senior-mode hotspots` lists the files that change most, with their size:
   churn on a large file is where bugs and slow changes concentrate. Cross it with the bug history, the
   modules nobody dares touch, and the dependencies years behind (`senior-mode audit` when senior-security
   is installed).
3. **Map it** for the next reader: the modules, what each owns, the entry points, the data, the
   integrations, the traps. Into `docs/architecture.md` and the instruction file (`docs`), short.

Done when you can say, with evidence, the three places where a change is riskiest and why.

## Characterize before changing

Before touching code with weak tests, pin what it does now: characterization tests through the public
seams (an endpoint, a command, a function), asserting the current output, even when it looks wrong. A
wrong-looking behaviour is a question for the user, not a fix to slip in. Then change the structure under
those tests (`tdd`, refactor case). Golden files or snapshots are fine for wide outputs; review them as code.

## Register the debt

Each problem worth fixing becomes a ticket (`to-tickets`, `senior-mode ticket add`): what hurts, the
evidence (hotspot, incidents, the time it costs), the smallest fix, its size. Not a wish list: what is not
worth fixing this year is left out, or written down once as a known limitation.

## Ratchet

Some debt is measurable and too big to fix at once: lint warnings, type errors, `any` or `unwrap` counts,
skipped tests, coverage. Freeze it so it only shrinks:

1. List the metrics in `.senior-mode/ratchet`, one per line: `<name><TAB><command printing a number>`, with
   a third field `up` when higher is better (coverage).
2. `senior-mode ratchet update` records the baseline in `.senior-mode/ratchet-baseline`; commit both.
3. From then on `senior-mode check` fails when a metric gets worse. When one improves, `ratchet update`
   locks the gain. It never records a worse value: lowering the bar is a hand edit a reviewer sees.

Pick metrics that are cheap to compute and hard to game; three good ones beat ten noisy ones.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.