/agent-skills:refactoringfrom agent-skills
Restructures code without changing behavior — extracting, renaming, splitting, and untangling. Use when asked to clean up, simplify, or reduce duplication.
Ships in agent-skills. 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.
Refactoring means the observable behaviour is identical afterwards. The moment behaviour changes you are doing something else, and mixing the two is what makes refactors dangerous — a diff that moves 400 lines and alters a condition is unreviewable, and nobody can tell which half broke production.
The one rule: never refactor and change behaviour in the same commit. Everything below exists to make that rule practical.
You need a way to know you did not break anything. In order of preference:
unit-testing.Done when: you can run one command that tells you whether behaviour changed.
Refactor toward something specific. "Cleaning up" without a target produces churn and a diff nobody can evaluate.
| What's wrong | The move |
|---|---|
| One function does several things | Extract function |
| The same logic in three places | Extract and call, but see below |
| A name lies about what it does | Rename |
| A parameter list keeps growing | Introduce a parameter object |
| Conditionals nested four deep | Guard clauses, early return |
| A module knows too much about another | Move the behaviour to the data |
| A comment explains a block | Extract that block, name it after the comment |
On duplication: three occurrences before you extract. Two similar blocks are often coincidence, and a premature abstraction over two cases produces a function with a boolean parameter that both callers have to reason about. That is worse than the duplication.
Done when: you can state what is wrong and which move fixes it.
Each step should leave the code working. Run the tests after each one, not at the end.
If a step cannot be made small, that is information: the code is more tangled than you thought. Back up and find a smaller first move.
Done when: every commit in the series passes tests on its own.
Two categories, and they must not share a commit:
When you mix them, the reviewer must find three risky lines inside four hundred trivial ones,
and they will not. Record mechanical commits in .git-blame-ignore-revs so history stays useful.
Done when: no commit contains both kinds.
Refactoring has no natural end, which is its main hazard. Stop when:
Done when: the original task is unblocked and the diff is defensible line by line.
Say what you changed structurally, what proves behaviour is unchanged (which tests, run when), and what you deliberately left alone. If you found a real bug while refactoring — it happens often — report it separately and do not fix it in the same commit.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub arjunprabhulal/agent-skills --plugin agent-skills60 skills in this plugin
/accessibility-reviewReviews an interface for barriers that stop people using it — keyboard operation, screen reader support, contrast, focus management, and form semantics. Use this whenever the user is building or reviewing UI, mentions accessibility, a11y, WCAG, screen readers, or keyboard navigation, and proactively when a change adds a modal, a custom control, a form, or anything interactive. For general code correctness, use code-review./agent-deploymentShips an agent to production — packaging, config and secrets, staged rollout, and the rollback plan — for a system whose failures are usually silent rather than loud. Use this whenever the user is deploying an agent or LLM feature, planning a rollout or canary, moving an agent from prototype to production, or asking how to release a prompt or model change safely. For monitoring it once live, use agent-observability./agent-designDesigns an agent's architecture — the tool surface, context strategy, control flow, and model choice — from a scoped set of jobs. Use this whenever the user is deciding how an agent should be built rather than what it should do — choosing tools, wiring up an agent loop, deciding single-agent vs multi-agent, picking a model, or planning what goes in the context window. Also use when an existing agent is unreliable and the cause looks structural rather than a prompt problem. For deciding what the agent is for, use agent-scoping first./agent-evaluationBuilds an eval set for an agent or LLM feature, writes graders, establishes a baseline, and reads the results honestly. Use this whenever the user wants to measure whether an agent works, asks if a prompt or model change was an improvement, mentions evals, LLM-as-judge, regression testing for AI, or is about to ship an agent on the strength of a few manual tries. Also use before any prompt or model change, since without a baseline no change can be judged./agent-hardeningMakes an agent safe to run with real permissions on real data — scoping what it can do, handling prompt injection, adding confirmation and dry-run for irreversible actions, and bounding cost. Use this whenever an agent is about to touch production, act autonomously, handle untrusted input, or use credentials, and whenever the user asks about agent safety, guardrails, permissions, or prompt injection. Also use when an agent has broad API access that nothing in code restricts./agent-implementationBuilds an agent from a design — the loop, the tools, the prompts, the schema validation, and the traces you will need later. Use this whenever the user is writing agent code — implementing tool calling, wiring an agent loop, building an MCP server or tool layer, writing system prompts for an agent, or turning a prototype agent into something maintainable. For deciding the architecture first, use agent-design; for measuring whether it works, use agent-evaluation.Other plugins' skills for the same job