/pm-workspace:tdd-vertical-slicesfrom pm-workspace
Guides test-driven development using vertical-slice red-green-refactor cycles, writing one test then its implementation before moving to the next. Avoids the horizontal slicing anti-pattern that produces brittle, implementation-coupled tests.
Ships in pm-workspace. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
If you were dispatched as a subagent to execute a specific delegated task, skip this skill's full orchestration workflow. Execute only the assigned task, report result (DONE / DONE_WITH_CONCERNS / BLOCKED), and return. This guard prevents runaway skill activation in nested agent contexts.
Pattern adoption from mattpocock/skills/tdd/SKILL.md (MIT, 26.4k⭐) — clean-room re-implementation, no source copied. SE-083 Slice única.
Los tests verifican behavior a través de public interfaces, no detalles de implementación. El código puede cambiar entero; los tests no deberían. Un test que se rompe cuando refactorizas pero el behavior no cambia, está testeando past la interface — está mal cortado.
NO escribas todos los tests primero, luego todo el código. Eso es horizontal slicing — tratar RED como "escribir todos los tests" y GREEN como "escribir todo el código".
Produce tests-de-mentira:
Recorrido correcto:
WRONG (horizontal):
RED: test1, test2, test3, test4, test5
GREEN: impl1, impl2, impl3, impl4, impl5
RIGHT (vertical):
RED → GREEN: test1 → impl1
RED → GREEN: test2 → impl2
RED → GREEN: test3 → impl3
...
Cada test responde a lo que aprendiste del ciclo anterior. Como acabas de escribir el código, sabes exactamente qué behavior importa y cómo verificarlo.
Antes de escribir código:
docs/rules/domain/architectural-vocabulary.md (SE-082)Escribe UN test que confirme UNA cosa del sistema:
RED: Test del primer behavior → falla
GREEN: Código mínimo para pasar → pasa
Tu tracer bullet — prueba que el path funciona end-to-end.
Para cada behavior pendiente:
RED: Siguiente test → falla
GREEN: Código mínimo para pasar → pasa
Reglas:
Tras todos los tests verdes, busca refactor candidates:
Nunca refactorizes mientras estás RED. Llega a GREEN primero.
[ ] Test describe behavior, no implementation
[ ] Test usa public interface only
[ ] Test sobreviviría refactor interno
[ ] Código mínimo para este test
[ ] No features especulativas añadidas
docs/rules/domain/architectural-vocabulary.md (SE-082) — Module/Interface/Seam/Adapter discipline. Aplica al diseño de la interface antes de escribir el primer test..opencode/agents/test-architect.md — agente que aplica TDD; consulta este skill antes de generar suites.❌ Horizontal slicing: escribir todos los tests antes de cualquier implementación → tests acoplados a implementación, fallos en cascada al refactorizar, behavior imaginado en lugar de real. ✓ Correcto: un test → un ciclo RED/GREEN → siguiente test.
❌ Slice demasiado grueso: abarcar >1 comportamiento observable en un slice → fallo de RED/GREEN imposible de aislar, refactor bloqueado. ✓ Correcto: cada slice verifica exactamente un comportamiento observable a través de la interfaz pública.
❌ Over-mocking: mockear todo incluyendo el sistema bajo test → los tests pasan siempre porque nunca ejecutan código real, los bugs de integración se ocultan. ✓ Correcto: mockear solo dependencias externas (red, I/O, tiempo); el sistema bajo test ejecuta código real.
❌ Test-after: implementar primero y añadir tests retroactivamente → los tests documentan la implementación existente en lugar de guiarla, cero valor de diseño. ✓ Correcto: RED antes de cualquier implementación — el test que falla prueba que el behavior no existe aún.
mattpocock/skills/tdd/SKILL.md — MIT — pattern only, prosa propia. La disciplina anti-horizontal-slicing es la contribución central de Pocock que pm-workspace adopta explícitamente.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
tdd, red-green-refactor, vertical-slice, test-first, testing-workflow
Claude Code refuses to install this plugin
.claude-plugin/plugin.json: dependencies: Invalid input: expected array, received object, author: Invalid input: expected object, received string
Checked against Claude Code 2.1.332's install rules. The listing below is what the repository ships; Claude Code cannot install it as published.
139 skills in this plugin
/adversarial-securityUsar cuando se necesita auditar la seguridad de un proyecto con pipeline Red Team / Blue Team./agent-code-mapUsar cuando un agente necesita conocer la arquitectura del proyecto sin leer ficheros completos./agent-file-mapUsar cuando se trabaja con ficheros externos al workspace que los agentes deben localizar./agent-messagingUsar cuando un agente debe enviar un mensaje a otro agente con roles y receipts, sin pasar por el usuario. Triggers: mensaje a otro agente, agent-message, notify agent, inbox.Other plugins' skills for the same job