/agentic-sdlc:codebase-modernizationfrom agentic-sdlc
Guides safe modernization of legacy codebases: inventory components, score value/risk, decide disposition (retire/refactor/migrate), research current behavior with citations, pin with characterization tests, design expand-contract or strangler cutover, and write migration runbooks.
Ships in agentic-sdlc. 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.
Read when SKILL.md points to them.
Agentic SDLC · Specify and Design stages (feeds Build) on brownfield code. Used by the Analyst (inventory, classification, current-state research), the Architect (dispositions, target design, expand–contract and strangler), the Planner (migration slices), the Test Engineer (characterization tests CHAR-n at the base commit) and the Developer (pinning before each change in Build).
Legacy code carries behaviour nobody wrote down. This skill makes the current state explicit before the change: what exists and who depends on it, which parts deserve investment, how the code behaves today (cited at one commit, pinned by tests, bugs included) and how to move from old to new in steps that each deploy and roll back alone.
The stage contract is ../agentic-sdlc/references/brownfield.md (CHAR rule and ID format, research and citation rule, expand–contract and strangler rule). Repository entry — the AGENTS.md block, docs/codemap.md, the test baseline — is adopt mode in project-context (../agentic-sdlc/references/paths.md §5) and must be complete before this skill starts. Every rule in ../agentic-sdlc/references/rules.md applies; this file adds the procedure, rubrics and formats.
Artifacts this skill writes:
| Artifact | Location | Written by | Step |
|---|---|---|---|
| Inventory, dependency map, scores, dispositions | docs/modernization/inventory.md | Analyst (dispositions proposed with the Architect) | 1–3 |
| Current-state research + CHAR register | specs/NNN-slug/current-state.md from templates/current-state.md | Analyst (research), Test Engineer (register) | 4, 6 |
| Characterization tests | test files listed in the plan task's Files | Test Engineer or Developer | 6 |
| ADR per non-retain disposition and per transition pattern | docs/adr/NNNN-slug.md | Architect | 3, 7 |
| Migration tasks | specs/NNN-slug/plan.md ## Tasks | Planner | 8 |
| Migration runbook | specs/NNN-slug/migration-runbook.md from templates/migration-runbook.md | Release Engineer (drafted in Design) | 9 |
Not for:
project-context adopt mode.test-driven-development (its brownfield variant references this skill for CHAR-n).systematic-debugging.spec-driven-development; comparing technologies for a new system → senior-solution-architect.deployment-pipeline; acceptance tests from approved ACs → test-strategy.deep-research (knowledge-superskills, when installed).<!-- AGENTIC-SDLC:BEGIN -->) and docs/codemap.md. Either missing → status BLOCKED, next step project-context adopt. Code map verified older than 90 days, or a touched top-level directory unmapped → refresh the map first (project-context codemap mode).Baseline: line. A red baseline blocks Build on the affected modules until each failing test is fixed or waived; never delete or skip a failing test.| Scope | Use when | Steps |
|---|---|---|
| portfolio | A roadmap or "what should we modernize" across ≥ 2 components | 1–3, then one work item per roadmap entry |
| change | One change to existing, partly untested code | 4, 6, (7 when a schema, format, API or component swap is involved), 8 |
| cutover | Replacing a live component or moving data | 4, 6, 7, 8, 9 |
| retire | Deleting a component, endpoint, job or table | 3 (retire criteria), 4, 9 |
../agentic-sdlc/references/paths.md §2 for each work item (not for the portfolio). Typical triggers here: schema/migration, public API, irreversible (data removal, contract step). ../agentic-sdlc/references/lifecycle.md §3 lists brownfield modernization under Full; the score decides, and the path never routes down.Build docs/modernization/inventory.md from the code map, not from a fresh scan. Procedure, commands and the file format: references/inventory-and-dependency-map.md.
deploy unit). Add runtime and framework with exact versions from manifests and lockfiles, datastore, owner, test command and coverage of the module.depends_on from the map), runtime calls (HTTP, RPC, queues, cron), data (tables or files read or written by ≥ 2 modules — the riskiest edges), external (ext: packages and third-party services with version and support end date).git log --since=12.months --name-only --format=), excluding dependency bumps; top 10 files by churn.unknown and score it as the worst value.Output: the inventory table, the dependency map, cycles listed, shared-data edges flagged. No owner → none; an unreadable version → unknown, never guessed.
Score every component with references/disposition-rubric.md §1. Summary:
Quadrant: Act now V ≥ 5 and K ≥ 6 · Keep healthy V ≥ 5 and K ≤ 5 · Contain or retire V ≤ 4 and K ≥ 6 · Leave V ≤ 4 and K ≤ 5. Order inside a quadrant by V × K. Every score cell cites its evidence (lockfile line, advisory ID, coverage output, commit count).
Apply references/disposition-rubric.md §2–§3. One disposition per component per roadmap entry:
| Disposition | Meaning | Typical quadrant |
|---|---|---|
| retire | Remove the component and its data path | Contain or retire; V = 0 |
| retain | Keep as is; set a review date ≤ 12 months | Keep healthy, Leave |
| rehost | Same code, new infrastructure | Hosting end-of-life, code supported |
| upgrade | Same platform, supported versions | Any quadrant with support or advisory risk |
| re-platform | New runtime, framework or datastore, minimal code change | Act now, upgrade path closed |
| refactor | Same behaviour, new structure, to cut change cost | Act now with high demand |
| migrate | Replace the capability with another system, via strangler | Act now, platform dead end |
Record per component: V, K, quadrant, disposition, evidence, the strongest rejected alternative with the reason, reversibility (one-way or two-way door), estimated iterations (merged PRs), first slice.
Approval routing — agents propose, humans decide:
Proposed (Architect), accepted only at the Design sign-off of the first work item that implements it.Output: the roadmap — ordered work items, each with its disposition, first slice and path triggers. Each item enters Discover as its own scored work item.
For the modules a work item touches, write specs/NNN-slug/current-state.md from templates/current-state.md. Rules and catalogue: references/research-firewall.md; researcher prompt: prompts/current-state-researcher.md.
git show <sha>:<path>, git grep -n <pattern> <sha> -- <paths>, git log <sha>.specs/, docs/plans/, issues, PR text, design notes — anything stating intent). Budget: ≤ 15 files read per question. No subagents on the platform → write the questions to the file first, clear working notes and the change request from context, then answer from the questions file alone in a separate labelled pass.path:line @ <sha> (a range path:12-30 @ <sha> for a block). History claims: <sha> "<commit subject>". Commit messages are claims by their author, weaker than code. No recommendations in this file; design questions go to the Architect in a separate list.prompts/citation-verifier.md; no subagents → run it in a fresh labelled pass after clearing working notes) re-opens every load-bearing citation and ≥ 20% of the others. Verdict per claim: verified · disputed (both readings reported, never averaged) · overturned (removed) · unverified (kept with the label, never used as the basis for an AC).git diff --name-only <sha>..HEAD -- <cited paths>; each changed path → re-verify its claims and bump the SHA.The Analyst writes the spec with spec-driven-development; this skill supplies brownfield content:
## Constraints: "Behaviour pinned by CHAR-a..b is preserved except where an AC states otherwise", the consumers from the dependency map that must keep working, and the schema compatibility rule (old and new code valid at every step).## Rollback: the per-phase rollback from Step 7, and for an irreversible step the backup and restore commands.## Release & observability: the dual-run mismatch threshold, the zero-use window for retirement and the bake period before the contract step — each a number with a unit.Contract: ../agentic-sdlc/references/brownfield.md §1. Techniques (golden master, approval files, seams): references/characterization-tests.md.
## Impact will modify that no existing test executes. Check with coverage on the touched files at the base commit; the target is 100% of the lines the plan modifies executed by ≥ 1 existing or CHAR-n test. A line with no reachable seam → missing-seam finding.NEEDS_CONTEXT to the Planner.CHAR-3 legacy rounding keeps half-even. CHAR-n is unique in the repository: highest existing number + 1 (git grep -ho "CHAR-[0-9]*" | sort -t- -k2 -n | tail -1). Expected values are what the code returns today. Known bugs are pinned and named (pins bug #212). Inputs are synthetic; nondeterministic fields (timestamps, generated IDs, ordering) are scrubbed by named scrubbers.current-state.md: ID · behaviour · citation · pins bug: #n or — · protects AC-n · status (active, superseded by AC-n, retired with AC-n). Quick path: the register lives in the PR body.AC-n red → green (test-driven-development brownfield variant). A standalone pinning task (at most 1 per plan) closes with node ../agentic-sdlc/scripts/run-ledger.mjs task --run <id> --task Tn --state done --no-red "characterization: CHAR-a..b".Change rule. A CHAR test changes only in the commit that carries the AC changing that behaviour (Refs: Tn AC-n), with the reason in the commit body and the register row set to superseded by AC-n. On Quick, the issue's acceptance test plays the AC role. A CHAR test edited, skipped or deleted any other way is a weakened check: Critical finding.
Patterns, sequences and gates: references/expand-contract-and-strangler.md.
| Situation | Pattern |
|---|---|
| Column, table or stored format changes | Expand–contract: expand → dual-write → backfill → switch reads → contract |
| Component replaced while traffic flows | Strangler: facade → route by flag → dual-run → staged shift → retire old |
| Internal implementation swapped behind a stable interface | Branch by abstraction: interface → old impl → new impl behind flag → remove old |
| Consumers on an old interface | Adapter: old interface delegating to the new implementation, plus a deprecation notice |
Rules:
../agentic-sdlc/references/release-ops.md (1% → 10% → 100% with 30 min / 60 min / 24 h minimum watch windows); rollback routes traffic back to the old path with one command.Write the tasks into plan.md with writing-plans; validate with node ../agentic-sdlc/scripts/plan-graph.mjs specs/NNN-slug/plan.md --write.
## Impact comes from the code map plus the dependency map's runtime and data edges; consumers on data edges are dependents.Fill specs/NNN-slug/migration-runbook.md from templates/migration-runbook.md during Design; the Release Engineer completes and rehearses it before the Release sign-off request. It holds: entry criteria, the phase table (command · verify · expected · go condition · rollback), the irreversible point, backup and restore evidence, dual-run readings, the consumer deprecation notice, abort criteria and post-cutover zero-use evidence. The service runbook docs/runbooks/<service>.md (../agentic-sdlc/templates/runbook.md) receives the new alerts, flags and a change-log row in the same release.
| Status | When |
|---|---|
DONE | Artifacts for the scope written; every claim verified or labelled; CHAR targets covered |
DONE_WITH_CONCERNS | Unverified claims, unknown support dates or missing-seam findings listed with owners |
BLOCKED | Adopt mode missing, red baseline on a touched module, or a disposition awaiting a human decision |
NEEDS_CONTEXT | No seam reachable, or a question only a person can answer (owner, consumer list) |
CANNOT_VERIFY | Zero-use or support evidence only available in production; name who checks and when |
Close. End with the status.mjs --next output.
| Thought | Reality |
|---|---|
| "The legacy result is obviously wrong; pin the correct value" | A CHAR test pins what the code does today, bugs included. Correct behaviour arrives through an AC. |
| "The CHAR test passed first time, done" | Expected for CHAR. Mutate the pinned line once and paste the red output. |
| "This CHAR test is in the way; update it to match" | Only in the commit carrying the AC that changes the behaviour. Otherwise it is a weakened check: Critical. |
| "Tell the researcher the plan so it focuses" | Intent bends findings toward the plan. Questions only; the change stays outside the firewall. |
| "I know this code, no need to cite" | Uncited claims are removed or labelled unverified; no AC rests on them. |
| "Rename and convert in one migration, it's quicker" | Old code still reads the old column during rollout. Expand–contract, one reversible step per deploy. |
| "Drop the old column in the same release" | The contract step is irreversible: own PR, own Release sign-off, after the bake period, restore verified. |
| "Nobody uses it; delete it" | Zero-use evidence over the spec's window, plus a Product Owner decision when users can see it. |
| "A rewrite from scratch is cleaner" | A big-bang rewrite has no rollback. Migrate through a strangler with dual-run comparison. |
| "A few production records make the golden master realistic" | Synthetic inputs only; production data never enters fixtures, logs or prompts. |
| "Inventory the whole system before any change" | Portfolio scope only when a roadmap is requested; a single change gets scoped research. |
| "Coverage is low everywhere, test it all first" | Pin what the plan modifies: 100% of touched lines, not the whole codebase. |
CHAR-n tests pin it, or before a missing-seam finding is recorded and ruled on.specs/, plans, tickets, PR text) into its reading.path:line @ <sha>; never base an AC on an unverified or disputed claim.1. Portfolio roadmap. "Billing (PHP 7.2, no tests), reports (Python 3.6, 12% coverage), auth (Java 11, 70%), an unowned fax-export job." Inventory from the code map; billing V = 8, K = 9 → Act now, re-platform (ADR Proposed); reports V = 5, K = 9 → Act now, upgrade; auth V = 7, K = 1 → Keep healthy, retain, review in 12 months; fax job V = 0, K = 9 → Contain or retire, retire after 30 days of zero calls and a Product Owner decision. Roadmap: billing research + CHAR first, each item its own spec.
2. Change to untested code. Spec 041: AC-2 rounds half-up. Research questions ("how is an invoice total rounded today?") answered with billing/legacy/Invoice.php:212 @ 4f1c2a9b0d3e. CHAR-1..4 pin calculateTotal() through its public entry point, CHAR-3 pins half-even rounding; each shown red under one mutation. T1's first commit pins; AC-2 red; green; the AC-2 commit updates CHAR-3 and marks it superseded by AC-2.
3. Pressure: rename in place and delete failing CHAR tests. "Rename customers.phone to phone_e164, convert in place, ship tonight, delete the two failing CHAR tests." Refuse both: failing CHAR tests mean the change alters pinned behaviour → an AC is needed. Re-score: schema/migration + personal data → Full. Expand–contract in four releases; contract (drop phone) is its own PR and Release sign-off after the bake period.
4. Strangler cutover. Replace /api/v1/quotes with the new pricing service. CHAR tests from synthetic requests; facade with flag quotes.newEngine (default off); dual-run until mismatch ≤ 0.1% over ≥ 10,000 comparisons (spec threshold); exposure 1% → 10% → 100%; old engine removed after 30 days of zero calls. migration-runbook.md rehearsed in staging.
5. Firewalled research. "Research cancellation — we plan to move it into an OrderLifecycle service." The brief keeps only factual questions (where does an order end, what touches status, how is it tested), SHA 9b7e…, exclusions specs/, docs/plans/. The verifier overturns one claim whose line moved; the design question goes to the Architect.
| File | Load when |
|---|---|
../agentic-sdlc/references/brownfield.md | Always — the stage contract this skill implements |
references/inventory-and-dependency-map.md | Step 1: inventory format, commands, dependency edge kinds, hot spots |
references/disposition-rubric.md | Steps 2–3: V and K scoring tables, quadrant rules, disposition criteria, worked scoring |
references/research-firewall.md | Step 4: question shapes, rewrite catalogue, exclusion list, citation and verdict formats |
prompts/current-state-researcher.md | Step 4: dispatching the firewalled researcher (inline fallback included) |
prompts/citation-verifier.md | Step 4 item 5: verifying citations in a fresh pass |
templates/current-state.md | Step 4: creating specs/NNN-slug/current-state.md and its CHAR register |
references/characterization-tests.md | Step 6: seams, golden master, approval files, scrubbers, mutation proof |
references/expand-contract-and-strangler.md | Steps 7–8: phase sequences, dual-run, bake, cutover and rollback gates |
templates/migration-runbook.md | Step 9: cutover and retire runbook |
../agentic-sdlc/references/paths.md | Step 0: path score and brownfield entry |
../agentic-sdlc/references/tdd.md | Step 6: brownfield variant and anti-pattern catalogue |
../agentic-sdlc/references/release-ops.md | Steps 7, 9: rollout stages, runbook rule |
README.md (opens in a new tab)evals/evals.json (opens in a new tab)evals/trigger-eval.json (opens in a new tab)prompts/citation-verifier.md (opens in a new tab)prompts/current-state-researcher.md (opens in a new tab)references/characterization-tests.md (opens in a new tab)references/disposition-rubric.md (opens in a new tab)references/expand-contract-and-strangler.md (opens in a new tab)references/inventory-and-dependency-map.md (opens in a new tab)references/research-firewall.md (opens in a new tab)templates/current-state.md (opens in a new tab)templates/migration-runbook.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub ericgandrade/agentic-sdlc --plugin agentic-sdlc23 skills in this plugin
/agentic-sdlcThis skill should be used when the user wants to run software work end to end through the Agentic SDLC (Discover, Specify, Design, Build, Test, Release, Operate) with AI agents and four human sign-offs — starting a feature, bug fix or modernization the disciplined way, asking which stage or step comes next, resuming from specs/ artifacts, choosing the Quick, Standard or Full path, or handling a requirement change after Specify sign-off (deciding where it re-enters). It hands each stage to its stage skill and is not for one stage task asked on its own, such as writing a spec, writing or executing a plan, implementing or debugging a task, or reviewing a PR (use that stage skill), nor for non-software multi-skill plans (use agent-skill-orchestrator)./agent-skill-discoveryThis skill should be used when the user wants to see all installed plugins, agents, skills, and MCP servers, and also inspect the current repository for local agents, skills, and MCP configuration. Scans the environment and presents a structured catalog of available resources. Works across all AI CLI platforms (Claude Code, GitHub Copilot, Gemini CLI, OpenCode, OpenAI Codex)./agent-skill-orchestratorThis skill should be used when the user needs to solve a complex task and wants a detailed execution plan using the best available resources. Analyzes user requirements, discovers available plugins/agents/skills/MCPs, performs intelligent matching with confidence scoring, and creates strategic execution plans with alternatives. Works across all AI CLI platforms. Not for running software delivery through the Agentic SDLC stages (use agentic-sdlc), writing an implementation plan from a spec (use writing-plans), or only listing installed resources (use agent-skill-discovery)./brainstormingThis skill should be used when the user needs pre-implementation ideation before a spec or code — framing the real problem behind a request, generating and comparing genuinely different approaches with named techniques, scoring them, auditing assumptions, running a throwaway UI or logic prototype when paper cannot settle a question, and agreeing a discovery brief that feeds the spec; also for standalone ideation such as names, positioning or programs (the Discover stage of the Agentic SDLC). Not for intake, duplicate search or path scoring of a new request (use issue-triage), comparing technical designs for an approved spec (use senior-solution-architect), or writing the spec itself (use spec-driven-development)./deployment-pipelineThis skill should be used when a project needs CI/CD gates that enforce the Agentic SDLC — discovering the existing pipeline, mapping the sdlc-dod Definition of Done and the spec-lint/plan-graph approval checks to required CI jobs, setting branch protection, CODEOWNERS and production environment reviewers so the Test and Release sign-offs cannot be bypassed, proving each gate blocks a bad change, choosing a deployment strategy, rehearsing the rollback in staging, and deciding advance, hold or roll back at each rollout stage (the Release stage of the Agentic SDLC). Not for the PR, release notes, runbook or hand-over (use shipping-and-handover), writing the sdlc-dod block (use project-context), or watching production after rollout and running incidents (use operations-and-incidents)./executing-plansThis skill should be used when an approved plan (specs/NNN-slug/plan.md or docs/plans/*.md) must be executed or an interrupted Build run resumed — test-first tasks via fresh Developer subagents or inline, per-task spec-then-quality review, bounded fix loops with escalation rulings, a run ledger copied into the PR, preflight, worktree isolation, file-disjoint parallel tasks and unattended runs (the Build stage of the Agentic SDLC). Not for one test-first task on its own (use test-driven-development), writing the plan (use writing-plans), or a failure whose cause is unknown (use systematic-debugging).Other plugins' skills for the same job