cs-refactor-ff

Applies small behavior-preserving code refactors with test-based self-verification.

Updated Jun 8, 2026
One-click install
npx skills add https://github.com/wildlily1021/XW_Software --skill cs-refactor-ff-wildlily1021
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: cs-refactor-ff
Source: https://github.com/wildlily1021/XW_Software/tree/main/.agents/skills/cs-refactor-ff
Command: npx skills add https://github.com/wildlily1021/XW_Software --skill cs-refactor-ff-wildlily1021

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Full multi-phase refactoring workflows are too heavy when you only need a tiny, low-risk change like extracting a function or flattening nested conditionals. This Skill provides a fast-track channel that applies 1-3 classic refactoring moves directly, confirms scope once, and proves correctness by running existing tests. ## Core Features & Use Cases - Three Hard Entry Checks: Verifies the change is truly behavior-preserving, limited to one file with at most 3 edit points, and covered by existing tests before proceeding. - Classic Method Grounding: Every edit maps to a named refactoring such as Extract Function, Guard Clauses, Decompose Conditional, Extract Composable, or Memoization. - Self-Verification and One-Line Report: Runs unit tests, type checks, and grep for stale references, then reports method, file, and verification result in a single line. - Use Case: You ask to "quickly clean up this 40-line function" — the Skill confirms it will apply Extract Function to one file, makes the edit, runs the test suite, and reports the result without producing design docs or checklists. ## Quick Start Ask the AI to quickly refactor a specific function using this fast-track skill, for example by saying "do a small refactor of the parseData function and keep it simple".

Frequently Asked Questions about cs-refactor-ff

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I do a quick refactor without a full design process?▼

Use this fast-track refactoring flow: it confirms the planned method and scope in one sentence, applies classic moves like Extract Function or Guard Clauses directly, then runs tests to verify. No scan documents, design docs, or checklists are produced.

What refactoring techniques does a lightweight refactor workflow support?▼

It supports classic named methods including Extract Function, Extract Variable, Guard Clauses, Decompose Conditional, Extract Composable or hook, Memoization, and Cancellation for missing effect cleanup. Anything outside these, such as Parallel Change or Strangler Fig, requires the full refactoring process.

When should I not use a fast-track refactoring approach?▼

Avoid it when changes span multiple files, exceed three edit points or 100 lines, lack test coverage, alter public interfaces, or include any behavior change disguised as refactoring. Those cases need the full refactoring workflow with scan and design phases.

Can I refactor code that has no tests with this approach?▼

No. Test coverage is a hard entry requirement because verification relies on running unit tests, integration tests, or type checks. Without coverage, either write a characterization test first or fall back to the full refactoring process.

What happens if a small refactor grows bigger mid-task?▼

The workflow stops and tells you the change is more complex than expected, recommending a switch to the full refactoring process. Completed edits are either committed or reverted with git restore before rescanning from the start.