tdd
Qué hace
La skill guía una corrección de error que empieza con una prueba de regresión concreta. Está pensada para desarrolladores que quieren una prueba de que el error está corregido y no volverá.
Cuándo usarla
- ✓Cuando pides desarrollo guiado por pruebas o una prueba de regresión.
- ✓Cuando un error tiene una prueba sencilla y barata que muestra el comportamiento roto.
- ✓Cuando quieres una corrección que una prueba demuestre que no volverá.
Link de la skill
https://github.com/cursor/plugins/blob/main/harness/pstack/claude-code/skills/tdd/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Corrige el error del inicio de sesión, pero escribe primero una prueba que falle para saber que de verdad está corregido.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
El agente describe el error, escribe una prueba pequeña que debería fallar, la ejecuta para confirmar el fallo y luego hace el cambio de código más pequeño que la hace pasar. Si una prueba barata no es práctica, usa otra comprobación.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
TDD Bug Fix
When fixing a bug with a clear, cheap test path, make the broken behavior executable before changing production code. The goal is a focused regression test that fails before the fix and passes after it.
Do not force a test when it would be impractical. If the available test would require broad harness setup, brittle mocks, slow end-to-end infrastructure, production-only state, vague reproduction steps, or large unrelated fixture churn, skip adding a new test and use the closest useful verification instead.
Workflow
- Understand the bug. Identify the intended behavior, current behavior, affected path, and smallest observable reproduction.
- Choose the narrowest executable check. Prefer the closest unit, component, integration, or regression test already used for that codepath. If no practical test path is obvious, do not create one from scratch just to satisfy the workflow.
- Write the failing test first. Add the smallest focused test that would have caught the bug. The test should encode intended behavior, not mirror the current implementation.
- Run the new test before fixing. Confirm it fails for the intended reason. If it passes or fails for an unrelated reason, correct the test or reproduction before editing the implementation.
- Fix the bug. Make the smallest production change that satisfies the intended behavior while preserving nearby contracts.
- Rerun the regression test. Confirm the test now passes.
If a Failing Test Is Impractical
Use the closest executable regression check instead: a targeted script, manual reproduction command, browser automation, snapshot comparison, log assertion, or focused integration check.
Prefer no new test over a bad test. A bad test is one that mostly tests mocks, encodes current implementation details, depends on timing or unrelated global state, needs expensive infrastructure for a small fix, or would be deleted immediately after proving the fix.
Guardrails
- Do not change tests merely to match a wrong implementation.
- Do not weaken existing assertions unless the expected behavior has genuinely changed and the reason is clear.
- Keep the regression test focused on the bug. Avoid broad fixture churn or unrelated coverage expansion.
- If the bug is flaky, make the test deterministic where possible and document the signal being locked down.
- If the bug exposes a broader class of failures, first land the focused regression path, then consider additional sibling coverage.
Final Response
Report the evidence, not just the outcome:
- Name the failing-before test or executable check and the failure it produced.
- Name the passing-after test run and any nearby validation performed.
- If failing-before evidence could not be demonstrated, state why and describe the closest regression check used instead.
Preguntas frecuentes
¿Qué pasa si no es práctica ninguna prueba?
La skill no la impone. Usa la comprobación útil más cercana.
¿La prueba tiene que fallar primero?
Sí. La nueva prueba se ejecuta antes de la corrección para confirmar que falla por el motivo correcto.
¿Por qué escribir la prueba antes de la corrección?
Primero muestra que el error existe, y después demuestra cuándo queda corregido.
Detalles
Descripción original del autor
Use only when the user explicitly asks for TDD, a failing test, or a regression test, OR when the bug has an obvious cheap local test target. Skip when the test path is unclear, expensive, integration-heavy, or not requested.
repo: cursor/plugins
Popularidad
- Estrellas en GitHub
- 15 mil
- Posición en el ranking
- #10999
- Licencia
- —
- Actualizada
- 31/10/2026
Comentarios
- …
Más skills de este repositorio
advisor
15 milPermite que tu agente consulte a un segundo modelo más potente en puntos clave, como antes de una decisión importante o si se atasca con un error, si lo activas.
check-agent-compatibility
15 milRevisa si los agentes de IA pueden arrancar, verificar y documentar un repositorio, y devuelve una puntuación de compatibilidad con los problemas principales.
cli-for-agents
15 milEnseña a tu agente a diseñar o revisar herramientas de línea de comandos para que los agentes de IA las ejecuten sin preguntas, con textos de ayuda claros y ejemplos.
continual-learning
15 milMantiene tus notas de AGENTS.md al día entregando la revisión de chats anteriores a un actualizador de memoria dedicado.
Skills parecidas
test-driven-development
311 milEnseña a tu agente a escribir primero una prueba que falle, verla fallar y después escribir el código más pequeño que la hace pasar, antes de construir cualquier función o corrección.
verification-before-completion
311 milEnseña a tu agente a ejecutar comprobaciones reales y leer su resultado antes de afirmar que una tarea, una corrección o una compilación está completa o en buen estado.
migrate-to-shoehorn
310 milSustituye los casts de tipo arriesgados de tus archivos de prueba por la librería shoehorn, para que las pruebas usen datos parciales y sigan pasando las comprobaciones de tipos.