Safely refactors legacy or untested code by pinning behavior with characterization tests, finding seams to break dependencies, and making small behavior-preserving changes.
Ships in engineering-core. 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.
Refactoring changes structure without changing behavior. If you cannot show that behavior did not change, you are rewriting, not refactoring. Pin the current behavior first, then move in small steps, running the tests after every step.
git log --follow -p -- <file> and git blame explain why odd-looking code exists. Odd code often encodes a past bug fix.testdata/*.golden).| Problem | Seam |
|---|---|
The code creates its own dependency (new DbClient() inside a method) | Parameterize: pass the dependency in through the constructor or a parameter, defaulting to the current one so callers do not change |
| It calls a static or global (current time, random, a config singleton) | Extract and inject: wrap the call in a small interface or function parameter; or extract and override it in a test subclass |
| A method is too large to test, but you need to add logic | Sprout method/class: write the new logic in a new, fully tested function and call it from the old code |
| You need behavior before or after existing logic | Wrap method/class: rename the original, create a new method with the old name that calls the original plus the new behavior (a decorator) |
| The code talks directly to an external system | Adapter: introduce a narrow interface around the external system; use a fake in tests |
| A module imports something with side effects at load time | Link/module seam: module-level mocking or test build configuration (jest.mock, unittest.mock.patch). Use as a last resort; it couples tests to file layout |
Prefer seams that also improve the design (parameterize, adapter) over seams that exist only for tests (subclass-and-override, module patching).
.git-blame-ignore-revs so blame stays useful.What SKILL.md sets; muted values are Claude Code's defaults
/engineering-core:legacy-refactoringfrom engineering-core
npx claudepluginhub reddygopalkrishna/developer-agent-skills --plugin engineering-core14 skills in this plugin
/codebase-onboardingMaps an unfamiliar repository before changing it - stack, build/test/run commands, entry points, data flow, conventions and how changes ship - and writes a short map. Use when starting work in a repo you have not seen, when asked to explain how a codebase works, onboard to a project, find where something lives, or before a first change in a large or legacy codebase. Not for reviewing a specific diff./code-review-changesReviews code changes (a pull request, merge request or diff) like a senior engineer - finds real bugs, security holes, data risks and breaking changes, verifies each one, and reports it with file:line, a concrete failure scenario and a suggested fix. Use when asked to review a PR, merge request, diff, branch, staged changes or patch, or to check code before merging. Also covers responding to review comments on your own PR./dependency-upgradesUpgrades libraries, frameworks and toolchains safely - inventory outdated and vulnerable packages, read changelogs and migration guides, upgrade one major version at a time, regenerate and review lockfiles, test, and keep a one-commit rollback. Use when bumping dependencies, fixing security advisories or Dependabot and Renovate PRs, resolving version conflicts or peer dependency errors, or upgrading a framework, SDK or runtime version. Not for moving to a different framework or language (use large-scale-migrations)./design-docsWrites and reviews technical design documents (RFCs) and Architecture Decision Records (ADRs) with goals and non-goals, real alternatives, risks, security, rollout, rollback and observability. Use when planning a new system, service or major feature, choosing between architectures or technologies, recording an architectural decision, writing an RFC or ADR, or reviewing someone else's design doc. Not for user-facing documentation or API reference docs./git-workflowUses Git safely and cleanly - atomic commits with clear messages, branching, rebase vs merge, conflict resolution, pull request descriptions, and recovering from mistakes such as lost commits, bad merges, commits on the wrong branch, or a committed secret. Use when committing, writing commit messages, branching, rebasing, merging, resolving conflicts, preparing a pull request, undoing changes, cleaning history, or when someone says they broke their repository./incident-responseGuides production incident handling - assess severity, mitigate first (roll back, disable a flag, scale, fail over), then diagnose from recent changes, metrics, logs and traces, keep a timestamped timeline, draft status updates, and write a blameless postmortem with owned action items. Use when production is down or degraded, errors or latency spike, an alert fires, users report an outage, or the user asks for an incident review or postmortem. Not for debugging in local or development environments.Other plugins' skills for the same job