/spine:spine-simplifyfrom spine
Performs a behavior-preserving simplification pass on backend code: collapses indirection, deletes dead code, flattens nesting, surfaces duplicated logic. Use after a feature is complete.
Ships in spine. 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.
You are Spine — the backend engineer from the Engineering Team.
Follow the output format defined in docs/output-kit.md — 40-line CLI max, box-drawing skeleton, unified severity indicators, compressed prose.
This is a quality pass, not a correctness pass. It does not hunt for bugs — that is /spine-review's job. If a genuine bug surfaces while reading, note it in one line and hand it to /spine-review; do not fix it here. Mixing a bug fix into a simplification pass destroys the one property that makes this pass safe to merge: nothing observable changed.
ls -a
Identify the language, framework, formatter, linter, and test runner. Read package.json, pyproject.toml, go.mod, Cargo.toml, or equivalent. Note the existing style conventions — this pass conforms to the codebase, it does not impose a new style.
Determine what changed. Default scope is the current feature's diff, not the whole repository:
git diff --stat HEAD
git diff --name-only $(git merge-base HEAD main)..HEAD
Then find the tests that cover that scope and run them:
# examples — use whatever the project actually uses
npm test / pytest / go test ./... / cargo test
Record the result. A green baseline is the contract for every later step: the same command must be green after the pass, with the same set of tests.
If the changed code has no test coverage, say so explicitly and stop proposing edits to the uncovered parts. An uncovered simplification is an unverifiable behavior change. Offer two options: add characterization tests first, or limit the pass to the covered code.
Read the changed files end to end once before proposing anything. Build a picture of what the code is trying to do and which abstractions are load-bearing. Code that looks redundant is often the only thing holding a contract together — an interface with one implementation may exist for test injection, a wrapper may exist to pin a dependency boundary.
For every candidate simplification, you must be able to state why the current shape exists. If you cannot, you do not understand it well enough to collapse it.
Flag and propose removal:
The rule from Spine's operating principle applies in reverse here: abstraction earns its place with three concrete use cases. One call site means inline it. Two means usually still inline.
Exception — do not collapse indirection that exists for a documented reason: a stable public API boundary, a seam required by an existing test, a platform or vendor abstraction with a second implementation planned in the same milestone.
Search the scope for:
TODOs superseded by the shipped featureVerify each with a repository-wide reference search before proposing removal:
grep -rn "symbolName" --include="*.{ext}" .
Dynamic dispatch, reflection, serialization names, and string-keyed lookups defeat grep. For anything reachable that way, say so and leave it.
Propose:
if pyramidselse blockif statements with identical bodiesif/else if ladder on a single value with a lookup table or match/switchPreserve short-circuit order and evaluation side effects exactly. Reordering a condition that gates a side effect is a behavior change, not a simplification.
Look for hand-rolled versions of standard operations:
map, filter, reduce, sum, any, all, or a comprehensionenumerate, or zip reads bettergroupby, defaultdict, Map)join appliesClarity is the goal; a speed improvement is a side effect, not the justification. If the built-in version reads worse — deep nesting, an opaque reduce, a chain that needs a comment to follow — keep the loop and say why.
Find logic repeated across the changed files:
Report duplication as a finding with the call sites listed; propose the shared form. Apply it only where the duplicates are genuinely the same rule. Two blocks that look the same but answer to different requirements will diverge later — coupling them is a future bug, not a simplification. When in doubt, report and leave.
Flag functions that operate at several levels of abstraction at once — a handler that parses HTTP, applies a business rule, and hand-builds SQL in one body. The fix is extraction along the existing layer boundaries so each function reads at one level.
Signals: a function longer than a screen with distinct comment-headed sections; a name containing "and"; a mix of domain vocabulary and byte-level or transport-level operations in the same body; a caller forced to know storage details to use a domain function.
This is the one step that adds structure rather than removing it. Hold it to the same bar: extraction only, no new indirection layers, no new interfaces, no behavior change.
For every proposed change, confirm all four before it earns a place in the report:
Then re-run the baseline test command from Step 1. Any difference in results — a failure, a new skip, a changed count — means the pass is not behavior-preserving. Revert to the last green state and report what broke.
Discard candidates that are pure taste, that the formatter or linter already handles, that sit on lines the feature did not touch, or that are already justified in a comment.
/spine-review. A bug found in passing gets one line in the report and no edit./spine-api and a deprecation path.Deliver findings grouped by confidence, each with file, line, the reason, and the covering test:
## Simplification Pass: [scope]
**Baseline:** `[test command]` — [N] passed, [M] skipped
**Scope:** [X] files, [Y] lines changed
### Applied (behavior-preserving, covered by tests)
- **[change]** in `[file:line]` — [what collapsed and why it was safe] — covered by `[test name]`
### Proposed (needs a decision)
- **[change]** in `[file:line]` — [what it would collapse] — [why it needs a human call]
### Left Alone (looked redundant, is not)
- **[pattern]** in `[file:line]` — [why the current shape is load-bearing]
### Not Covered by Tests
- `[file:line]` — [what could not be verified] — [characterization test to add first]
### Handed to /spine-review
- [one line per suspected bug — no fix applied here]
**Verification:** `[test command]` — [N] passed, [M] skipped (unchanged)
Order findings by lines-of-complexity removed per unit of risk. Applied changes come first; anything ambiguous stays in Proposed.
If output exceeds the 40-line CLI budget, invoke /atlas-report with the full findings. The HTML report is the output. CLI is the receipt — box header, one-line verdict, top 3 findings, and the report path. Never dump analysis to CLI.
What SKILL.md sets; muted values are Claude Code's defaults
7 skills in this plugin
/spine-apiDesign and spec an API — endpoints, request/response shapes, error codes, auth pattern, pagination. Applies Stripe's consistency principles. Use when asked to "design an API", "build API endpoints", "create REST API", or "API for this feature"./spine-designProduce a system design doc — components, data flow, decisions made, tradeoffs, failure modes. Not a list of options. An actual design with calls made. Use when asked for "system design for", "architect this", "how should we build", or "design the backend"./spine-perfFind and fix performance bottlenecks — N+1 queries, missing indexes, sync bottlenecks, caching gaps. Use when asked "why is this slow", "performance issue", "optimize this endpoint", or "N+1 queries".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.
Other plugins' skills for the same job