Skip to main content
skill CX Codex

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

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add ai-driven-dev/framework
/plugin install aidd-dev@aidd-framework
Open on GitHub

What 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 security axis over api/ 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-framework

This 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-code

3Manually: put the files in place

~/.claude/skills/07-refactor/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/07-refactor/

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

Similar skills

All skills for Code review and refactoring →

From the same set80

The whole set →
12-cook 12-cook is a Claude Code skill for finding and maintaining project recipes, researching techniques, and applying existing guides. It can also check recipe steps and investigate improvements. CX Codex +1 ★ 571repo stars 03-assert 03-assert runs a project's assertions and fixes code until they pass, with optional checks on architecture and a running UI. Useful as the last gate before you push. CX Codex +1 ★ 571repo stars 00-repo-init 00-repo-init prepares a fresh Git repository with a default branch, CONTRIBUTING.md, and a bootstrap commit, then pushes it to a remote host on request. CX Codex +1 ★ 571repo stars 09-for-sure The 09-for-sure skill runs an agent through repeated attempts until a runnable success check passes. Use it for work with a result that can be verified, such as a command. CX Codex +1 ★ 571repo stars 00-init 00-init controls AIDD telemetry in projects: turns resource tracking on or off with consent, configures identity, or purges recorded metrics. CX Codex +1 ★ 571repo stars 03-shadow-areas 03-shadow-areas — a skill that scans written artifacts (ideas, user stories, PRDs, specs) and produces a structured report of blind spots—what the author has not addressed. Runs on Claude Code, Cursor, Codex, GitHub Copilot, and OpenCode. CX Codex +1 ★ 571repo stars 11-explore 11-explore surveys a project along three axes: installed tooling, context and codebase. You get a compact map, then a deeper walk down whichever axis you name. CX Codex +1 ★ 571repo stars 04-audit 04-audit is a Claude Code skill that audits a codebase across seven quality pillars and produces a ranked report without changing code. CX Codex +1 ★ 571repo stars

Project sponsors

Companies that keep this analytics open