07-refactor

07-refactor is a skill for Claude Code from ai-driven-dev/framework. It costs 57 tokens per session (535 once invoked), scanned A, original, MIT.

A workflow for improving existing code in one chosen area: speed, security, code cleanup, or system structure.

In plain words
What is it for?
It helps find and fix slow paths, security weaknesses, messy or duplicated code, and poorly separated parts of a codebase.
Why use it?
It gives refactoring a defined focus while preserving existing behavior where appropriate and avoiding unrelated changes.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the aidd-dev plugin — 10 skills shipped together

Good fit It helps find and fix slow paths, security weaknesses, messy or duplicated code, and poorly separated parts of a codebase.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ai-driven-dev/framework/07-refactor
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ai-driven-dev/framework --skill 07-refactor
Clone the repo
git clone --depth 1 https://github.com/ai-driven-dev/framework

Made for: Claude Code.

Or install aidd-dev, the plugin that ships this one along with the rest of its 10 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for 07-refactor

README.md
[![agentmods](https://agentmods.dev/badge/skills/ai-driven-dev/framework/07-refactor/github.svg)](https://agentmods.dev/skills/ai-driven-dev/framework/07-refactor)
Your own site
<a href="https://agentmods.dev/skills/ai-driven-dev/framework/07-refactor"><img src="https://agentmods.dev/badge/skills/ai-driven-dev/framework/07-refactor/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for 07-refactor

Your own site · 80×15
<a href="https://agentmods.dev/skills/ai-driven-dev/framework/07-refactor"><img src="https://agentmods.dev/badge/skills/ai-driven-dev/framework/07-refactor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 535 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00057 $0.00535
Opus 5.5 $0.00023 $0.00214
Sonnet 5.5 $0.00011 $0.00107
Haiku 4.5 $0.00006 $0.00053

Measured 1mo ago against content hash 982f3a78293b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

07-refactor scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/aidd-dev/skills/07-refactor/SKILL.md · 30 lines

How it starts

The opening of the file, as written. The whole thing — 30 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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.

Read the full file on GitHub · 30 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed 982f3a78293b
  2. 3mo ago First seen · 30 lines · 57 tokens per session scan A 9450d45cc7aa

Subscribe to this mod's changes

07-refactor is a skill published in the GitHub repository ai-driven-dev/framework (600 stars, last pushed today), licensed MIT. It adds 57 tokens to every session and 535 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

07-refactor compared with skills from other repositories

07-refactor next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
07-refactorai-driven-dev/frameworkSkill600todayMITA57Claude Code
error-recoverybojieli/ai-agent-bookSkill61ktodayApache-2.0A111Claude Code, Codex
doctortinyfish-io/tinyfish-cookbookSkill2.3kyesterdayMITA72Claude Code
feedbacktinyfish-io/tinyfish-cookbookSkill2.3kyesterdayMITA54Claude Code
code-searchagentscope-ai/agentscope-javaSkill6.6kyesterdayApache-2.0A38Claude Code, Codex
ci-troubleshootBlackBeltTechnology/pi-agent-dashboardSkill357todayMITA97Claude Code, Codex
coding-agent-harnessbojieli/ai-agent-bookSkill61ktodayApache-2.0C106Claude Code, Codex