tdd-workflow
Implement Test-Driven Development Workflow
También disponible en: DoubleslashSE
Developers waste time debugging code without tests. This skill enforces the RED-GREEN-REFACTOR cycle to build reliable software with confidence.
Descargar el ZIP de la skill
Subir en Claude
Ve a Configuración → Capacidades → Skills → Subir skill
Activa y empieza a usar
Pruébalo
Usando "tdd-workflow". Implement a function to validate email addresses
Resultado esperado:
- RED Phase: Created test 'should accept valid email format' - test fails (no implementation yet)
- GREEN Phase: Implemented minimal regex validation - test passes
- REFACTOR Phase: Extracted validation logic to separate function, improved error messages
Usando "tdd-workflow". Fix null pointer exception in user lookup
Resultado esperado:
- RED Phase: Test reproduces the null pointer exception - confirmed failure
- GREEN Phase: Added null check before accessing user properties - test passes
- REFACTOR Phase: Created reusable null-safe lookup helper used throughout codebase
Auditoría de seguridad
SeguroAll static analysis findings are false positives. The arrow character (→) was misidentified as shell backtick execution. References to 'crypto' and 'reconnaissance' are pattern matching errors on plain text documentation. This is a safe TDD methodology guide. External commands are legitimately used for running test suites.
Factores de riesgo
⚙️ Comandos externos (1)
Puntuación de calidad
Lo que puedes crear
New Feature Development
Build reliable features by writing tests first, then implementing minimal code to pass each test.
Bug Fix with Regression Protection
Write a test that reproduces the bug, fix it, then refactor with confidence that the bug stays fixed.
Team Code Quality Improvement
Use multi-agent TDD pattern where different agents write tests, implement code, and refactor.
Prueba estos prompts
I want to implement a function that [describe behavior]. Write a failing test first following the RED phase of TDD. The test should describe the expected behavior clearly.
Let's implement [feature] using TDD. Step 1: Write a failing test. Step 2: Write minimal code to pass. Step 3: Refactor for clarity. Guide me through each phase.
Review this test and restructure it using the AAA pattern (Arrange, Act, Assert). Identify what data needs setup, what code executes, and what outcome to verify.
Run a multi-agent TDD session for [feature]. Agent A writes the failing test, Agent B implements to pass, Agent C refactors. Coordinate the handoffs between phases.
Mejores prácticas
- Always watch the test fail before writing implementation code - this validates the test works
- Write one assertion per test to isolate failures and clarify intent
- Commit after each complete RED-GREEN-REFACTOR cycle to maintain small, reviewable changes
Evitar
- Writing code before the test fails - defeats the purpose of TDD and often means you don't understand requirements
- Testing implementation details like private method names - tests should verify behavior, not internal structure
- Multiple assertions per test - makes failures ambiguous and violates single responsibility principle