tdd-workflows-tdd-refactor

Automate TDD-based refactor workflows while keeping all tests green.

1|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/caobingsheng/skills --skill tdd-workflows-tdd-refactor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-workflows-tdd-refactor
Source: https://github.com/caobingsheng/skills/tree/main/tdd/tdd-workflows-tdd-refactor
Command: npx skills add https://github.com/caobingsheng/skills --skill tdd-workflows-tdd-refactor

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill guides teams through safe, test-driven refactor workflows, ensuring changes improve code quality without breaking existing behavior.

Core Features & Use Cases

  • TDD-guided refactoring: Apply iterative design improvements while preserving test green status.
  • Pre- and post-change safety checks: Run baselines, detect code smells, and validate outcomes.
  • Architecture-evolution patterns: Use patterns like Extract Method, Move Method, and Dependency Injection to improve structure.

Quick Start

Provide the target codebase and let the tdd-orchestrator guide the safe refactor while keeping all tests green.

Frequently Asked Questions about tdd-workflows-tdd-refactor

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

FAQPage Schema
How do I refactor code safely without breaking existing tests?

Safe refactoring involves enforcing pre- and post-change test baselining to ensure all tests remain green. TDD-guided workflows apply incremental design improvements while preserving existing behavior across software modules.

What's the best way to detect code smells before refactoring?

Automated pre-change safety checks detect code smells by establishing baselines before refactoring. This validates outcomes and ensures structural improvements via patterns like Extract Method, Move Method, and Dependency Injection.

How does test-driven refactoring apply design patterns to improve architecture?

Test-driven refactoring applies architecture-evolution patterns like Extract Method, Move Method, and Dependency Injection to improve structure. It iteratively evolves design while maintaining a built-in rollback strategy for safety.

Can I use TDD refactoring workflows for incremental changes across multiple modules?

Yes, TDD refactoring workflows support software projects employing unit and integration tests across modules. The orchestrator automates incremental refactors while ensuring all tests stay green throughout the process.

What happens if a test breaks during an incremental refactor?

If a test breaks during an incremental refactor, the built-in rollback strategy and safety reporting identify the failure. This ensures changes that break existing behavior are caught and rolled back before finalizing.