tdd-workflows-tdd-refactor
Skill1 starsChanged 10 months agoMITView on GitHub
Use when working with tdd workflows tdd refactor
2 other projects use a version of this.
Adopted by
Most recently taken up by
- ai4brands-design/claude-skillsword for word, first seen Mar 22, 2026
- xfstudio/skillsword for word, first seen Jan 22, 2026
Other versions2 projects use a version of this.
Word for word · 2
- xfstudio/skills★ 9100% same
- ai4brands-design/claude-skills★ 2100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository57 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- api-design-principlesSkill
- architect-reviewSkill
- architecture-decision-recordsSkill
- architecture-patternsSkill
- architectureSkill
- c4-architectureSkill
- c4-codeSkill
- c4-componentSkill
- c4-containerSkill
- c4-contextSkill
- clean-codeSkill
- mermaid-diagramsSkill
- mermaid-expertSkill
- tdd-orchestratorSkill
- tdd-workflowSkill
- tdd-workflows-tdd-cycleSkill
- tdd-workflows-tdd-greenSkill
- tdd-workflows-tdd-redSkill
- tdd-workflows-tdd-refactorSkill
- test-driven-developmentSkill
- api-design-principlesSkill
- architect-reviewSkill
- architecture-decision-recordsSkill
- architecture-patternsSkill
- architectureSkill
- auth-securitySkill
- billing-saasSkill
- c4-architectureSkill
- c4-codeSkill
- c4-componentSkill
- c4-containerSkill
- c4-contextSkill
- clean-codeSkill
- design-consistencySkill
- disciplined-devSkill
- gurusup-workflowSkill
- hardening-interviewerSkill
- linkedin-contentSkill
- mermaid-diagramsSkill
- mermaid-expertSkill
- mobile-first-ui-librarySkill
- mvp-automationSkill
- mvp-generatorSkill
- observabilitySkill
- parallel-integrationSkill
- prd-workflowSkill
- production-readinessSkill
- shape-upSkill
- spec-interviewerSkill
- tdd-orchestratorSkill
- tdd-workflowSkill
- tdd-workflows-tdd-cycleSkill
- tdd-workflows-tdd-greenSkill
- tdd-workflows-tdd-redSkill
- tech-advisorSkill
- test-driven-developmentSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 14 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈14
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 21
If detailed examples are required, open resources/implementation-playbook.md.
- Distinctive: line 29
Use Task tool with subagent_type="tdd-orchestrator" to perform safe refactoring.
- Distinctive: line 36
Run tests to establish green baseline
- Distinctive: line 38
Document current performance metrics
- Distinctive: line 39
Create incremental refactoring plan
- Distinctive: line 56
Use patterns only where they add clear value
- Distinctive: line 81
Always measure before and after
- Distinctive: line 85
Run tests after each modification
- Distinctive: line 86
Commit after each successful refactoring
- Distinctive: line 87
Keep refactoring separate from behavior changes
- Distinctive: line 88
Use scaffolding when needed
- Distinctive: line 97
Run full test suite after each change
- Distinctive: line 111
Test results (all green)
- Distinctive: line 112
Before/after metrics comparison
- Distinctive: line 132
Use version control for safe experimentation
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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:
- Immediately revert last change
- Identify breaking refactoring
- Apply smaller incremental changes
- Use version control for safe experimentation
Example: Extract Method Pattern
Before:
class OrderProcessor {
processOrder(order: Order): ProcessResult {
// Validation
if (!order.customerId || order.items.length === 0) {
return { success: false, error: "Invalid order" };
}
// Calculate totals
let subtotal = 0;
for (const item of order.items) {
subtotal += item.price * item.quantity;
}
let total = subtotal + (subtotal * 0.08) + (subtotal > 100 ? 0 : 15);
// Process payment...
// Update inventory...
// Send confirmation...
}
}After:
class OrderProcessor {
async processOrder(order: Order): Promise<ProcessResult> {
const validation = this.validateOrder(order);
if (!validation.isValid) return ProcessResult.failure(validation.error);
const orderTotal = OrderTotal.calculate(order);
const inventoryCheck = await this.inventoryService.checkAvailability(order.items);
if (!inventoryCheck.available) return ProcessResult.failure(inventoryCheck.reason);
await this.paymentService.processPayment(order.paymentMethod, orderTotal.total);
await this.inventoryService.reserveItems(order.items);
await this.notificationService.sendOrderConfirmation(order, orderTotal);
return ProcessResult.success(order.id, orderTotal.total);
}
private validateOrder(order: Order): ValidationResult {
if (!order.customerId) return ValidationResult.invalid("Customer ID required");
if (order.items.length === 0) return ValidationResult.invalid("Order must contain items");
return ValidationResult.valid();
}
}Applied: Extract Method, Value Objects, Dependency Injection, Async patterns
Code to refactor: $ARGUMENTS"
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

