# Dev Refactor

AI DevKit · Systematic structural or multi-file refactors across any stack while...

- Repository: https://github.com/codeaholicguy/ai-devkit (1656 stars)
- Category: Engineering
- License: Apache-2.0
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add codeaholicguy/ai-devkit --skill dev-refactor -g -a claude-code -y`
Codex: `npx skills add codeaholicguy/ai-devkit --skill dev-refactor -g -a codex -y`
Cursor: `npx skills add codeaholicguy/ai-devkit --skill dev-refactor -g -a cursor -y`
Gemini CLI: `npx skills add codeaholicguy/ai-devkit --skill dev-refactor -g -a gemini-cli -y`

## Description

AI DevKit · Systematic structural or multi-file refactors across any stack while preserving behavior and public contracts. Use for reorganizing modules, boundaries, naming, APIs/contracts, staged refactor plans, or refactor risk review.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Refactor

Use for structural refactors. Use `dev-simplify` for local readability, dead code, or small logic cleanup.

## Rules

- Preserve behavior and public contracts unless changes are explicit.
- Classify first: small = local/no public movement; medium = multi-file/extraction/boundary/export touch; large = package/cross-package/staged migration/broad consumers.
- For medium/large refactors, write a brief before editing: evidence, pressure, remaining delta, do/defer/avoid ranking, non-goals, contracts, target shape, validation, compatibility.
- Do not propose target trees without current-code evidence: tree, file size/mixed concerns, imports/exports, consumers, validation commands.
- Separate moves/renames from logic changes and design/API behavior questions.
- Prefer existing conventions, provider locality, and the smallest structure that solves observed pressure.
- Subtract before adding: remove dead wrappers, redundant validators, stale exports, and unused paths before introducing new structure.
- Avoid taste refactors, premature abstractions, and thin one-file directories unless staged or conventional.
- Validate with fresh command output.

## Workflow

The rest: https://github.com/codeaholicguy/ai-devkit/blob/HEAD/skills/dev-refactor/SKILL.md
