MR
Mayur Rathi
@mayurrathi
⭐ 40.7k GitHub stars

Tdd Workflows Tdd Refactor

Tdd Workflows Tdd Refactor is an productivity AI skill with a core value of Use when working with tdd workflows tdd refactor. It helps developers solve real-world problems in the productivity domain, boosting efficiency, automating repetitive tasks, and optimizing workflows.

Use when working with tdd workflows tdd refactor

Last verified on: 2026-07-07

Quick Facts

Category productivity
Works With Claude
Source sickn33/antigravity-awesome-skills
Stars ⭐ 40.7k
Last Verified 2026-07-07
Risk Level Low
mkdir -p ./skills/tdd-workflows-tdd-refactor && curl -sfL https://raw.githubusercontent.com/sickn33/antigravity-awesome-skills/main/skills/tdd-workflows-tdd-refactor/SKILL.md -o ./skills/tdd-workflows-tdd-refactor/SKILL.md

Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).

Skill Content

Use this skill when


- Working on tdd workflows tdd refactor tasks or workflows

- Needing guidance, best practices, or checklists for tdd workflows tdd refactor


Do not use this skill when


- The task is unrelated to tdd workflows tdd refactor

- You need a different domain or tool outside this scope


Instructions


- Clarify goals, constraints, and required inputs.

- Apply relevant best practices and validate outcomes.

- Provide actionable steps and verification.

- If detailed examples are required, open `resources/implementation-playbook.md`.


Refactor code with confidence using comprehensive test safety net:


[Extended thinking: This tool uses the tdd-orchestrator agent (opus model) for sophisticated refactoring while maintaining all tests green. It applies design patterns, improves code quality, and optimizes performance with the safety of comprehensive test coverage.]


Usage


Use Task tool with subagent_type="tdd-orchestrator" to perform safe refactoring.


Prompt: "Refactor this code while keeping all tests green: $ARGUMENTS. Apply TDD refactor phase:


Core Process


**1. Pre-Assessment**

- Run tests to establish green baseline

- Analyze code smells and test coverage

- Document current performance metrics

- Create incremental refactoring plan


**2. Code Smell Detection**

- Duplicated code → Extract methods/classes

- Long methods → Decompose into focused functions

- Large classes → Split responsibilities

- Long parameter lists → Parameter objects

- Feature Envy → Move methods to appropriate classes

- Primitive Obsession → Value objects

- Switch statements → Polymorphism

- Dead code → Remove


**3. Design Patterns**

- Apply Creational (Factory, Builder, Singleton)

- Apply Structural (Adapter, Facade, Decorator)

- Apply Behavioral (Strategy, Observer, Command)

- Apply Domain (Repository, Service, Value Objects)

- Use patterns only where they add clear value


**4. SOLID Principles**

- Single Responsibility: One reason to change

- Open/Closed: Open for extension, closed for modification

- Liskov Substitution: Subtypes substitutable

- Interface Segregation: Small, focused interfaces

- Dependency Inversion: Depend on abstractions


**5. Refactoring Techniques**

- Extract Method/Variable/Interface

- Inline unnecessary indirection

- Rename for clarity

- Move Method/Field to appropriate classes

- Replace Magic Numbers with constants

- Encapsulate fields

- Replace Conditional with Polymorphism

- Introduce Null Object


**6. Performance Optimization**

- Profile to identify bottlenecks

- Optimize algorithms and data structures

- Implement caching where beneficial

- Reduce database queries (N+1 elimination)

- Lazy loading and pagination

- Always measure before and after


**7. Incremental Steps**

- Make small, atomic changes

- Run tests after each modification

- Commit after each successful refactoring

- Keep refactoring separate from behavior changes

- Use scaffolding when needed


**8. Architecture Evolution**

- Layer separation and dependency management

- Module boundaries and interface definition

- Event-driven patterns for decoupling

- Database access pattern optimization


**9. Safety Verification**

- Run full test suite after each change

- Performance regression testing

- Mutation testing for test effectiveness

- Rollback plan for major changes


**10. Advanced Patterns**

- Strangler Fig: Gradual legacy replacement

- Branch by Abstraction: Large-scale changes

- Parallel Change: Expand-contract pattern

- Mikado Method: Dependency graph navigation


Output Requirements


- Refactored code with improvements applied

- Test results (all green)

- Before/after metrics comparison

- Applied refactoring techniques list

- Performance improvement measurements

- Remaining technical debt assessment


Safety Checklist


Before committing:

- ✓ All tests pass (100% green)

- ✓ No functionality regression

- ✓ Performance metrics acceptable

- ✓ Code coverage maintained/improved

- ✓ Documentation updated


Recovery Protocol


If tests fail:


🎯 Best For

  • Tech leads planning refactors
  • Developers modernizing legacy code
  • Claude users
  • Knowledge workers
  • Remote teams

💡 Use Cases

  • Migrating from class components to hooks
  • Breaking apart monolithic functions
  • Using Tdd Workflows Tdd Refactor in daily workflow
  • Automating repetitive productivity tasks

📖 How to Use This Skill

  1. 1

    Install the Skill

    Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.

  2. 2

    Load into Your AI Assistant

    Open Claude and reference the skill. Paste the SKILL.md content or use the system prompt tab.

  3. 3

    Apply Tdd Workflows Tdd Refactor to Your Work

    Provide context for your task — paste source material, describe your audience, or share existing work to guide the AI.

  4. 4

    Review and Refine

    Edit the AI output for accuracy, tone, and completeness. Add human insight where the AI lacks context.

❓ Frequently Asked Questions

Does this handle breaking changes?

Refactoring skills identify breaking changes but always run your test suite after applying suggestions.

How do I install Tdd Workflows Tdd Refactor?

Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/tdd-workflows-tdd-refactor/SKILL.md, ready to use.

Can I customize this skill for my team?

Absolutely. Edit the SKILL.md file to add team-specific instructions, examples, or workflows.

⚠️ Common Mistakes to Avoid

Refactoring without tests

Never refactor critical paths without a comprehensive test suite to catch regressions.

Not reading the full skill

Skills contain important context and edge cases beyond the quick start.

🔗 Related Skills