refactor
/refactor
Use for refactoring — same behaviour, better structure. Test-coverage gate enforced. Extract-then-rename ordering. Refuses to mix in feature changes or bug fixes.
- Author
- ialameh ↗
- Repository
- sift-coder ↗
- Licence
- MIT
- Last repository change
- 03.06.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 03.06.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Use for refactoring — same behaviour, better structure. Test-coverage gate enforced. Extract-then-rename ordering. Refuses to mix in feature changes or bug fixes.
Original author description
Use for refactoring — same behaviour, better structure. Test-coverage gate enforced. Extract-then-rename ordering. Refuses to mix in feature changes or bug fixes.
How it works
- Method
- Output shape
- Rules
- Anti-patterns
- When NOT to use
- Subagent dispatch
- Value over native CC
SKILL.md preview
--- name: refactor description: Use for refactoring — same behaviour, better structure. Test-coverage gate enforced. Extract-then-rename ordering. Refuses to mix in feature changes or bug fixes. --- # refactor Same behaviour, better structure. Tests are the contract — they must stay green throughout. ## Method 1. **Coverage gate.** Read the test coverage of the area you're refactoring. **If < 80% line coverage of the target code, write tests first** until it is. Refactor without coverage = unsafe. 2. **Memory pass.** Has this area been refactored before? Reuse the lessons. 3. **Plan.** State the target shape (in < 100 words). State the smell being addressed (e.g. "long method", "feature envy", "shotgun surgery"). 4. **Mechanical sequence.** Refactor in this order: - **Extract** before **rename** before **move** - Each step is its own commit (or commit-shaped diff in a PR) - Run tests **after every step** 5. **Verify.** Tests green. Lint. Typecheck. Read your own diff — does it actually look better? ## Output shape ``` Target: <area: file/symbol> Smell: <which one> Goal shape: <one paragraph> Steps: 1. Extract <X> from <Y> ✓ tests green 2. Rename <A> → <B> ✓ tests green 3. Move <fn> to <module> ✓ tests green ... Verify: lint ✓ types ✓ tests ✓ (M passing, N before N after) ``` ## Rules - **Tests stay green.** If a test breaks, the refactor changed behaviour — that's a different workflow. - **No feature changes.** Spotted a bug or missing feature? Note in memory + suggest as follow-up. - **One smell per refactor.** Don't mix "long method" with "rename" with "move" in undisclosed ways. - **Mechanical.** If you can't describe the step in one verb + one noun, it's too big. ## Anti-patterns - "Refactor" that touches semantics (e.g. changing default values, error messages) - Big-bang refactor in one commit — impossible to review or revert - Renaming variables across 50 files when only the public API needs renaming - Refactor that increases line count without increasing clarity ## When NOT to use - Bug fix — `/siftcoder:fix` - Performance — `/siftcoder:optimize` - Aggressive simplification / deletion — `/siftcoder:zen` - New feature — `/siftcoder:add-feature` ## Subagent dispatch - `Explore` to map current shape - `Plan` for non-trivial multi-step refactors - `general-purpose` for the mechanical edits ## Value over native CC CC will refactor when asked. CC won't naturally insist on coverage gates, mechanical step ordering, or refuse to mix concerns. This skill enforces the discipline that makes refactors safe.
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · ialameh/sift-coder | 100 | MIT |
| froglet-studio/cosmic-shore | 100 | MIT |
| mgiovani/cc-arsenal | 100 | MIT |
| jongio/skills | 100 | MIT |
| boshu2/agentops | 100 | Apache-2.0 |
| y-miyazaki/terraform-aws-base | 100 | Apache-2.0 |
| mickeyyaya/evolve-loop | 100 | Apache-2.0 |
| j0hanz/j0hanz-marketplace | 100 | MIT |
| kriscard/kriscard-claude-plugins | 100 | MIT |
Database snapshot: 13.11.2026 · package version 77b7f2f862ed (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100refactoring
Changes code structure without changing behaviour. Use when the user asks to refactor, clean up, restructure, extract, rename across files, reduce duplication, or improve the architecture. Not for features, bug fixes or reviews. - 100refactor-safely
Use when code is hard to change, has accumulated cruft, or before a feature that the current structure resists — improve structure in small, behavior-preserving steps under green tests; never mix a refactor with a behavior change. - 90refactor-safely
Refactor code without changing what it does (rename, extract, split files, remove duplication, simplify). Use when the user says "clean this up", "refactor", "split this file", "simplify this function", "rename X everywhere", or "remove this duplication". - 100refactoring
Use when restructuring code or guidance without changing behaviour, meaning a rename, an extraction, a move, deduplication, or hoisting repeated code into a shared module. Keeps behaviour identical, scope contained, and every reference (code, docs, guidance, generated maps)… - 100refactor-module
Use when a ticket asks to restructure code without changing what it does — extract a function, split a file, rename for clarity, reduce duplication — with behaviour preserved. Invoke for "refactor X", "clean up the Y module", or "extract Z" where no behaviour change is intended. - 100dev-refactor
Use when changing structure without changing behavior: restructure, extract, rename, dedupe or split code.