07-refactor — Claude Code skill: what it does, how to install
07-refactor rewrites code along one of four axes: performance, security, cleanup, architecture. It scans on its own or takes a finished audit report as the to-do list.
MIT ★ 571 updated 2026-10-29
/plugin marketplace add ai-driven-dev/framework
/plugin install aidd-dev@aidd-frameworkWhat 07-refactor does
07-refactor is the side of code improvement that edits files. Pick one of four axes, performance, security, cleanup or architecture, and the skill reads the matching file in actions/ before it touches anything.
Cleanup, performance and architecture work keeps public inputs and outputs the same. The skill checks that with tests, a type check or a side-by-side run. Security is the exception: it may change behavior to close a hole and has to say so. If you only want a read-only diagnosis, this is the wrong tool, because it writes to your code.
Hand it an audit report and the scan is skipped: a path under aidd_docs/tasks/audits/ or pasted findings become the fix list for that axis. Findings rank on three severity levels: critical, major, minor. An unscoped request gets one question, all applicable axes or one, and a request to remove code goes straight to cleanup. Dependency upgrades and UI redesign sit outside the axes.
What it helps with
- strip dead code and duplication before a review
- close input-validation and authorization holes
- drop an N+1 query from a hot path
- split layers and loosen coupling between modules
- turn a finished audit report into applied fixes
Example prompts for the agent
- Run the
securityaxis overapi/and fix what it finds; list separately any change that alters behavior. - Clean up dead code and duplication in the payments module, keep the public inputs and outputs identical.
- Use the report at
aidd_docs/tasks/audits/as the fix list for the performance axis.
How to install 07-refactor
1Plugin marketplace
/plugin marketplace add ai-driven-dev/framework/plugin install aidd-dev@aidd-frameworkThis installs the whole aidd-dev plugin with all its skills
2Skills CLI (Vercel)
npx skills add ai-driven-dev/framework --skill 07-refactor -a claude-code3Manually: put the files in place
~/.claude/skills/07-refactor/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/07-refactor/
1Skills CLI (Vercel)
npx skills add ai-driven-dev/framework --skill 07-refactor -a codex2Manually: put the files in place
.agents/skills/07-refactor/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add ai-driven-dev/framework --skill 07-refactor -a cursor2Manually: put the files in place
.cursor/skills/07-refactor/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install ai-driven-dev/framework plugins/aidd-dev/skills/07-refactor2Manually: put the files in place
.github/skills/07-refactor/SKILL.md1Skills CLI (Vercel)
npx skills add ai-driven-dev/framework --skill 07-refactor -a gemini-cli2Platform CLI
gemini skills install https://github.com/ai-driven-dev/framework --path plugins/aidd-dev/skills/07-refactorManually: put the files in place
.devin/skills/07-refactor/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add ai-driven-dev/framework --skill 07-refactor -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about 07-refactor
How do I install 07-refactor in Claude Code?
From the marketplace: run /plugin marketplace add ai-driven-dev/framework, then /plugin install aidd-dev@aidd-framework.
What does 07-refactor do?
It edits code along one of four axes: performance, security, code quality, architecture. Reach for it when code needs improving rather than just inspecting.
What do I need to feed it an existing audit report?
Point it at a path under aidd_docs/tasks/audits/ or paste the findings into your request. Those become the fix list for the axis and the scan is skipped.
Source text
SKILL.md · MIT
--- name: 07-refactor description: Improve code across four axes (cleanup, performance, security, architecture) by scanning and fixing, or applying a pushed audit report. Use when the user wants to refactor, optimize, harden, or remove code. Not for read-only diagnosis or adding tests. argument-hint: scope | audit --- # Skill: refactor The act-side of code improvement: it changes code to make it better. Behavior-preserving for cleanup, performance, and architecture; security may change behavior on purpose to close a hole. ## Actions | # | Action | Axis | Lens | | --- | -------------- | ------------ | ---------------------------------------------------------- | | 01 | `performance` | performance | N+1, hot paths, batching, memoization, unnecessary I/O | | 02 | `security` | security | OWASP, input validation, authz, secrets: harden and fix | | 03 | `cleanup` | code-quality | clean code: rename, extract, DRY, dead code, complexity | | 04 | `architecture` | architecture | extract layers, fix coupling, enforce boundaries | Run the one axis named, or offer all applicable when the request is unscoped. Before running an action, read its file in `actions/`, not only the table or assets. ## Transversal rules - Scope: run the one named axis, or for an unscoped request ask once "all applicable axes, or one?" before running. A request to delete or remove code runs `cleanup` directly, with no axis question. Never silently default to one axis. - Behavior-preserving for cleanup, performance, and architecture: public inputs and outputs stay identical, verified by tests, type checks, or a side-by-side run. Security may alter behavior to close a vulnerability, and must call that out explicitly. - Audit-fed, optional: when the caller pushes an audit report (a path under `aidd_docs/tasks/audits/` or pasted findings), take its findings for this axis as the fix list and skip the scan. The bridge is the report artifact; this skill never loads or calls another skill. The audit `code-quality` pillar feeds the `cleanup` axis; the other axes map by name. - Severity uses the shared 3-level scale: 🔴 critical, 🟡 major, 🟢 minor. - Stay inside the axis: dependency upgrades and UI redesign are out of scope. Add tests only as a regression for a security fix, never otherwise.
© AI-Driven Dev · MIT · ai-driven-dev/framework