Tooluck logoTooluck
SKILL.md

refactor

Agent skill fromSethGammon/Citadel

Safe multi-file refactoring with automatic rollback. Establishes a type/test baseline, plans all changes, executes file-by-file, and verifies zero regressions. Reverts if verification fails after two fix attempts. Handles renames, extracts, moves, splits, merges, and inlines.

How to install refactor

install refactor
# install the Citadel pack with the skills CLI
npx skills add SethGammon/Citadel

# or add only this skill to Claude Code: copy the folder

skills/refactor/

# into

~/.claude/skills/refactor/ (all projects)

.claude/skills/refactor/ (one project)

skills/refactor/SKILL.md

MITFull file
1# /refactor — Safe Multi-File Refactoring
2
3## Orientation
4
5Use `/refactor` when you need to:
6- Rename a symbol, file, or module across the codebase
7- Extract a function, component, hook, class, or module from existing code
8- Inline a function or module back into its callers
9- Move a file or set of files to a new location
10- Split a large file into smaller pieces
11- Merge related files into one
12- Change a function signature and update all call sites
13
14**Don't use when:** debugging a specific bug (use /systematic-debugging); adding new features (use /marshal or /scaffold); deleting dead code (use /marshal for a targeted cleanup).
15
16**Boundary with /organize:** /refactor changes code structure within files (extract, inline, split, merge, rename) and moves files as part of those operations. Repository-wide file/directory placement, naming sweeps, and where-does-this-belong decisions are /organize.
17
18**Behavior does not change.** Tests pass before and after, no new type errors — the refactoring is correct.
19
20## Commands
21
22| Command | Behavior |
23|---|---|
24| `/refactor rename [old] to [new]` | Rename symbol, file, or module |
25| `/refactor extract [target] from [source]` | Extract function/component/module |
26| `/refactor inline [target]` | Inline a function/module into callers |
27| `/refactor move [source] to [dest]` | Move file(s) with import updates |
28| `/refactor split [file]` | Split a file into logical pieces |
29| `/refactor merge [files...]` | Merge related files into one |
30…

Excerpt shown under the repository's MIT license.

More skills in Citadel

Keep exploring

Similar skill repositories

thedotmack /

claude-mem
116k

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

CCCXGHGM+135 skills

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates