.claude/skills/tdd-refactor/SKILL.md
Execute the REFACTOR phase of TDD by improving code structure while keeping all tests green. Removes duplication, improves naming, and enhances code quality without changing behavior.
npx skillsauth add swiftyjunnos/claude-code-with-tdd tdd-refactorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill executes the REFACTOR phase of Test-Driven Development. It improves code quality, removes duplication, and enhances structure while ensuring all tests remain green. Changes are purely structural with no behavioral modifications.
Use this skill when:
Confirm Prerequisites:
If Tests Fail:
Look for Code Smells:
Common Refactorings:
One Change at a Time:
Keep Tests Green:
Structural Changes (Safe to commit together):
Behavioral Changes (Commit separately):
Keep Them Separate:
Document Changes:
Safety First:
Quality Goals:
When to Stop:
After completing REFACTOR phase:
development
Execute Kent Beck's Tidy First approach by making structural changes to code without changing behavior. Prepares code for easier behavioral changes by improving structure first.
testing
Execute the RED phase of TDD by writing a failing test for the next unmarked item in PLAN.md. Writes tests with Korean descriptions and confirms test failure.
development
Execute the GREEN phase of TDD by implementing the minimum code needed to make the failing test pass. Follows the principle of simplest solution that could possibly work.
development
Main TDD workflow command. Finds next test in PLAN.md and executes complete TDD cycle automatically. This is the primary command for TDD development as specified in CLAUDE.md.