/godmode:legacyfrom godmode
Modernizes legacy codebases through characterization tests, golden master snapshots, incremental refactoring, dependency upgrades, and dead code removal.
Ships in godmode. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
/godmode:legacy# Assess codebase age and activity
git log --format='%ai' --reverse | head -1
git shortlog -sn --all | head -10
git log --since="6 months ago" --oneline | wc -l
# Check test coverage
ls -d test/ tests/ spec/ __tests__/ 2>/dev/null
npx jest --coverage 2>/dev/null || \
pytest --cov 2>/dev/null || echo "No test runner"
# Audit dependencies
npm audit 2>/dev/null || pip-audit 2>/dev/null
npm outdated 2>/dev/null || pip list --outdated 2>/dev/null
# Find complexity hotspots
find . -name "*.ts" -o -name "*.py" -o -name "*.js" \
| xargs wc -l 2>/dev/null | sort -rn | head -10
LEGACY ASSESSMENT:
Language: <detected>, Age: <from git>
Size: <files, LOC>
Contributors: <active/total>
Test coverage: <% or "none">
Dependencies: <total>, <outdated>, <EOL>, <vulns>
Dead code: <estimated LOC>
Change confidence: HIGH | MEDIUM | LOW | NONE
CONFIDENCE LEVELS:
Tests + CI + Types = HIGH
Tests only = MEDIUM
No tests = LOW
Nothing = NONE
IF confidence == NONE: add characterization tests first
IF vulns > 0: prioritize security patches
IF EOL deps > 0: flag for urgent migration planning
IF files > 500 LOC: identify god classes to extract
Code Archaeology:
The most critical step. Tests before any changes.
TEST STRATEGIES:
| Strategy | When to Use |
|-------------------|--------------------------|
| Characterization | Capture current behavior |
| Golden Master | Complex outputs (HTML) |
| Approval Testing | Snapshots as approval |
CHARACTERIZATION TEST:
Run code with known input
Record actual output as expected value
Test PASSES today by definition
Test FAILS if behavior changes
THRESHOLDS:
Critical paths: 100% must have tests before change
Min characterization tests per module: 5
Golden master update: requires UPDATE_GOLDEN=true
IF test captures a bug: document, fix separately
PRIORITY ORDER:
P0 (urgent): Security — patch vulns, fix auth
P1 (high): Stability — tests on critical paths
P2 (medium): Maintainability — extract god classes
P3 (normal): Performance — optimize hot paths
P4 (low): Modernization — upgrade frameworks
SAFE REFACTORING TECHNIQUES:
Extract Method, Extract Class
Replace Conditional with Polymorphism
Introduce Parameter Object
Wrap External Dependency
Sprout Method/Class (new tested code from legacy)
THRESHOLDS:
Max change size per PR: 200 lines
Each change must be independently revertable
IF change breaks characterization test: revert
ORDER: security vulns → PATCH → MINOR → MAJOR
RULES:
PATCH: safe to batch, apply all at once
MINOR: one at a time, read changelog
MAJOR: one at a time, read migration guide
THRESHOLDS:
IF dep has known CVE: upgrade within 48 hours
IF dep is EOL: plan migration within 2 weeks
IF major upgrade breaks > 5 tests: pause, plan
Run full test suite between each major upgrade
DETECTION (require 2+ signals):
Static analysis: ESLint no-unused, Ruff
Coverage analysis: 0% coverage = likely dead
Dependency analysis: depcheck/madge
Git history: untouched for > 1 year
Runtime tracking: instrumented but never called
PROCESS:
1. Identify with static analysis
2. Verify with git log (last touched date)
3. Confirm with runtime tracking if available
4. Remove in dedicated commit
5. Deploy and monitor for errors
6. IF errors: revert immediately
THRESHOLDS:
Require 2+ signals before removing
File untouched > 2 years: likely dead
Export with 0 importers: likely dead
LEGACY MODERNIZATION REPORT:
Confidence: <before> → <after>
Critical issues: <vulns, EOL deps>
Phase 1: characterization tests + fix vulns
Phase 2: replace deprecated, remove dead code
Phase 3: upgrade major deps, add types
Commit: "legacy: <action> — <target> (<impact>)"
Never ask to continue. Loop autonomously until done.
1. Git history: activity, contributors, age
2. Test coverage: test dirs, config, run coverage
3. Dependency health: audit, outdated, deprecated
4. Complexity: files > 500 LOC, circular deps
5. Confidence: Tests+CI+Types=HIGH, None=NONE
Print: Legacy: {files} modernized. Dead: {removed}. Tests added: {N}. Deps upgraded: {M}. Confidence: {before} -> {after}. Status: {status}.
timestamp project language age_years loc coverage_pct confidence vulns deprecated dead_loc verdict
KEEP if: existing tests pass AND characterization
tests cover changed code AND no behavior change
DISCARD if: tests break OR behavior changed
OR dead code removal causes errors
On discard: revert, add more tests, retry.
STOP when ALL of:
- Characterization tests cover modified paths
- Dead code removed and verified
- Dependencies upgraded to supported versions
- No behavior changes unless approved
What SKILL.md sets; muted values are Claude Code's defaults
Claude Code installs this plugin but refuses to load it
hooks/hooks.json: hooks.json declares PreToolUse/PermissionRequest at its top level, outside the "hooks" object — a PreToolUse/PermissionRequest hook that cannot be loaded may be what guards the permissions declared beside it, so nothing it sits in is applied until the entry is fixed or removed
hooks/hooks.json: hooks.json declares PreToolUse/PermissionRequest at its top level, outside the "hooks" object — a PreToolUse/PermissionRequest hook that cannot be loaded may be what guards the permissions declared beside it, so nothing it sits in is applied until the entry is fixed or removed
Checked against Claude Code 2.1.332. The listing below is what the repository ships; Claude Code doesn't load it as published.
135 skills in this plugin
/a11yAccessibility. WCAG 2.1 AA/AAA, a11y audit, color contrast, keyboard navigation, screen reader, Axe, Pa11y, Lighthouse./agentAI agent development. ReAct/plan-and-execute/multi-agent architectures, tool design, memory systems, guardrails, orchestration (LangChain, LlamaIndex, CrewAI, AutoGen)./analyticsProduct analytics implementation — event tracking, funnel analysis, A/B testing, Segment/Amplitude/Mixpanel/PostHog, privacy-compliant instrumentation./angularAngular architecture. NgRx, Signals, RxJS, standalone components, lazy loading, dependency injection, Jasmine, Jest./apiAPI design and specification. REST, GraphQL, gRPC, OpenAPI, design an API, create API spec, validate my API, endpoint./apidocsAPI documentation. OpenAPI, Swagger, Redoc, contract-first development, spec-first, code-first, interactive docs.Other plugins' skills for the same job