Use after deleting a feature, function, component, validation rule, config flag, enum value, or any symbol — to find the downstream artifacts the deletion orphaned. Covers orphaned string keys in object/label/i18n maps, dead branches, now-unused imports/props, stale comments, and test fixtures that ESLint and code review miss. Trigger when you removed code and want a clean, zero-dead-code diff.
69
83%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
When you delete something, the thing you deleted usually had dependents — code and data elsewhere that only existed to serve it. Deleting the definition without sweeping its dependents leaves dead code: it compiles, it lints, all tests pass, and the reviewer often misses it too. It just sits there, quietly wrong, until it confuses the next person.
Core principle: A removal is not "the definition." A removal is "the definition and everything that only existed for it." Sweep for dependents on the same commit that deletes the definition.
bun run lint (ESLint no-unused-vars) catches unused bindings — a variable, import, or parameter no longer referenced. It does not catch:
"team-members": "Team Members" in a label map is not a binding; nothing flags it when its only consumer disappears.errors["team-members"], labels[key], dispatch({ type: "X" }). The key is data, not a symbol.if (mode === "legacy") whose only caller you removed.This repo has no knip / ts-prune / depcheck. ESLint is the only static safety net, so the orphan classes above must be swept manually. (This is exactly the class of miss that survives review: a reviewer verifies the binding-level cleanup ESLint already guarantees, and the data-level orphan slips through.)
Run this checklist on the same branch as the deletion, before you call the work done.
List every identifier and string literal tied to the deleted thing:
data-cy attributes, event names, feature-flag strings, enum string values.The string keys are the ones that bite. Write them down explicitly.
# For each removed symbol AND each removed string key:
grep -rn "team-members" src/ --include="*.js" --include="*.jsx" | grep -v "\.test\."For every hit, classify it:
For a removed producer (e.g. a validation rule that emitted an error key), find who consumed its output:
# Who reads this key / renders this error / maps this label?
grep -rn 'getErrors("team-members")\|convertCodeForDisplay("validation"' src/For a removed consumer (e.g. a component), find data that existed only to feed it — fixtures, selector maps, mock builders.
bun run lint # binding-level orphans (unused import/var/param)
git diff main # read every hunk: any comment, fixture field, or
# branch that referenced the removed thing?ESLint clearing is necessary, not sufficient. The git diff read is where you catch the data-level orphans by eye.
Before deleting an orphaned key/label, grep tests for it. If a test asserts its presence, that test is testing the dead thing — update or remove it in the same sweep.
| Orphan class | Caught by ESLint? | How to find |
|---|---|---|
| Unused import / var / param | ✅ Yes | bun run lint |
| Object-map / label / i18n key | ❌ No | grep the string literal |
String-keyed lookup (errors[k], action type) | ❌ No | grep the string literal |
| Unreachable branch after caller removed | ❌ No | trace callers, read diff |
| Stale comment / JSDoc | ❌ No | read the diff |
| Fixture field for a deleted rule | ❌ No | grep field name in fixtures/tests |
helpers/ module, fixtures in a test dir, renderers in a page component. Grep repo-wide.On OPS-5882 (removing the team-member Vest validation), ESLint and a first code review both passed. A second review caught an orphaned "team-members": "Team Members" entry in the validation label map in src/helpers/utils.js — dead the moment the Vest test that produced the team-members error key was deleted, because its only consumer was convertCodeForDisplay("validation", key) in ReviewAgreement.jsx. Grepping the removed string key repo-wide (step 2) would have surfaced it immediately.
4ff5a51
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.