refactor

A code-quality review and cleanup that changes the internal structure of a codebase while preserving its external behavior. It focuses on duplication, abstractions, consistency, architecture, and unused code.

In plain words
What is it for?
Use it to remove duplication and dead code, improve internal design, enforce consistent patterns, and refine the architecture while keeping existing behavior and tests intact.
Why use it?
It makes code easier to maintain without changing what users or external systems experience.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/voxtechnologies/transmute-framework/refactor
Any agent
npx skills add VoxTechnologies/transmute-framework --skill refactor
Clone the repo
git clone --depth 1 https://github.com/VoxTechnologies/transmute-framework

Made for: Claude Code, Codex.

Per session 88 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,754 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00088 $0.02754
Opus 5 $0.00044 $0.01377
Sonnet 5 $0.00018 $0.00551
Haiku 4.5 $0.00009 $0.00275

Measured 2d ago against content hash 97610a174707, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

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 2d 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.

skills/refactor/SKILL.md · 165 lines

How it starts

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

Stage 6E: Code Quality and Architecture Refinement

Lead a multi-agent code refactoring project. Audit the COMPLETE codebase for code quality, eliminate duplication, improve abstractions, enforce consistency, and optimize architecture — without changing any external behavior.

Stage Sequence (recommended ordering): Stage 5B → 6A/6B/6C (parallel) → 6E (this stage) → 6F (Seed Data) → 6G (Resilience Hardening) → 6D (Documentation) → 6H (Pre-Launch) → 6V → 6R → 6P/6P-R → 7 (Deploy)

Cardinal Rule

NO BEHAVIORAL CHANGES. Refactoring changes internal structure without altering external behavior. Every test that passed before refactoring MUST still pass after. If a refactoring would require changes to tests that validate external behavior (API contracts, acceptance criteria), the behavior is changing — stop and reconsider. Tests validating implementation details (private functions, internal state) may be restructured.

Scope clarification: 'No behavioral changes' means no changes to external APIs or user-facing behavior. Internal function signatures MAY change if all call sites are updated atomically in the same commit.

Context: Why This Stage Exists

The Feature Orchestrator builds features one at a time, with each cycle's teammates having limited awareness of other features' implementation details. This produces a working product, but leaves behind:

  • Duplicated utility functions and patterns across feature domains
  • Missed abstraction opportunities
  • Inconsistent naming, patterns, or conventions across features
  • Schema and index redundancies from incremental additions
  • Overly coupled code where cross-feature integration was added reactively
  • Dead code from iterative fixes during quality gate cycles

Prerequisites

Verify before starting:

  1. ./plancasting/_audits/implementation-completeness/report.md exists with PASS or CONDITIONAL PASS. If missing or FAIL, STOP — Stage 5B must pass first.
  2. Read ./CLAUDE.md and ./plancasting/tech-stack.md for project conventions.
  3. Check that ./plancasting/_audits/security/report.md (6A), ./plancasting/_audits/accessibility/report.md (6B), and ./plancasting/_audits/performance/report.md (6C) exist. If any are missing, WARN and document in the report.
  4. Incomplete features (5B Category C): Skip refactoring features marked as incomplete. However, DO refactor shared utilities/hooks that incomplete features use (since other complete features may also depend on them).

Read the full file on GitHub · 165 lines

Files

What ships with it

1 file 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. 2d ago First seen · 165 lines · 88 tokens per session scan A 97610a174707

Subscribe to this mod's changes

refactor is a skill published in the GitHub repository VoxTechnologies/transmute-framework (4 stars, last pushed 1mo ago), licensed MIT. It adds 88 tokens to every session and 2,754 once invoked, about $0.0004 per session on Opus 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-08-31.

Related

Other skills, from other repositories

knowledge-base

Create and maintain a Markdown knowledge base that any AI agent can read, search, and update. Use when the user wants to start a knowledge base, add or update notes, organize docs/notes for an agent or LLM to consume, build an index of notes, or run a cleanup/maintenance pass on an existing MD knowledge base. Triggers…

wonderwhy-er/DesktopCommanderMCP · 112 tokens

code-review

Use when code has been written and needs validation before committing, or when the user asks for a code review or security check.

darrenhinde/OpenAgentsControl · 28 tokens

test-generation

Use when the user asks for tests, mentions TDD, or when new code has been written and needs test coverage.

darrenhinde/OpenAgentsControl · 27 tokens

scientific-schematics

Create publication-quality scientific diagrams using Nano Banana 2 AI with smart iterative refinement. Uses Gemini 3.1 Pro Preview for quality review. Only regenerates if quality is below threshold for your document type. Specialized in neural network architectures, system diagrams, flowcharts, biological pathways…

xintaofei/codeg · 68 tokens

statistical-power

Sample-size and statistical power calculations for planning studies. Use whenever someone asks "how many subjects/samples/replicates do I need", wants an a priori power analysis, a minimum detectable effect (MDE), a power curve, or needs to justify a sample size for a grant, IRB protocol, or pre-registration. Covers…

xintaofei/codeg · 190 tokens

build-teaql-app

Build or change a TeaQL application in Java, Rust, Go, Swift, Python, C#/.NET, or TypeScript, including Kotlin/JVM applications that consume Java-generated libraries. Mandatory order: first draft and save a complete KSML model, then verify the client and evaluate that saved model, repair it through repeated evaluation…

teaql/teaql-agent-kit · 112 tokens