Saltar al contenido
Skillpedia
Pruebas8,2 mil · #12551

go-testing

Qué hace

Esta habilidad guía a tu IA cuando escribe o revisa pruebas en el lenguaje Go. Es para desarrolladores de Go que quieren pruebas enfocadas y fiables, incluidas las de interfaces de terminal.

Cuándo usarla

  • ✓Cuando escribes pruebas para una función de Go con muchos casos de entrada.
  • ✓Cuando pruebas una interfaz de terminal construida con Bubbletea.
  • ✓Cuando necesitas pruebas con archivos golden o pruebas que tocan el sistema de archivos.

Link de la skill

https://github.com/Gentleman-Programming/gentle-ai/blob/main/internal/assets/skills/go-testing/SKILL.md

Có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

Usa esta skill para ayudarme: https://github.com/Gentleman-Programming/gentle-ai/blob/main/internal/assets/skills/go-testing/SKILL.md Lee el archivo SKILL.md de ese link y sigue sus instrucciones en mi tarea.
¿Quieres que tu IA encuentre skills como esta por sí sola?Instala el MCP gratis de Skillpedia: una línea, y busca entre 15.000+ skills antes de cada tarea.Instalar en 1 minuto →

Ejemplo de qué pedirle a la IA

“Escribe pruebas en Go por tablas para este analizador, incluyendo los casos de error.”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

La habilidad elige un patrón de prueba según el objetivo, como pruebas por tablas para funciones o actualizaciones directas del modelo para interfaces de terminal. Mantiene las pruebas deterministas y omite las pruebas externas lentas en modo corto.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de GitHub.

Activation Contract

Load this skill when writing or reviewing Go tests, adding coverage, testing Bubbletea/TUI flows, using teatest, or updating golden files.

Hard Rules

  • Prefer table-driven tests for multiple cases; use t.Run(tt.name, ...).
  • Test behavior and state transitions, not implementation trivia.
  • Use t.TempDir() for filesystem tests; never rely on a real home directory.
  • Keep integration tests skippable with testing.Short() when they run external commands or slow flows.
  • For Bubbletea, test Model.Update() directly for state changes; use teatest only for interactive flows.
  • Golden files must be deterministic; update only through the repo's -update path and rerun tests without -update.
  • Use small mocks/interfaces around system or command execution boundaries.

Decision Gates

Target Test pattern
Pure function or parser Table-driven unit test.
Error behavior Explicit success and failure cases.
File operations t.TempDir() plus focused assertions.
TUI state transition Direct Model.Update() call with tea.Msg.
Full TUI interaction teatest.NewTestModel().
Rendered output Golden file test.
Real external command Integration test; skip in -short.

Execution Steps

  1. Identify behavior under test and the smallest public boundary that proves it.
  2. Choose the test pattern from the decision gate.
  3. Name cases by scenario, not input mechanics.
  4. Assert outputs, errors, state, and side effects explicitly.
  5. Run the narrow package test first, then the relevant broader suite.
  6. For golden updates: run with -update, inspect diff, then rerun without -update.

Output Contract

Report test files changed, scenarios covered, commands executed, golden files updated, and any skipped integration scope.

References

Preguntas frecuentes

¿Qué es un archivo golden?

Es una salida esperada guardada con la que las pruebas se comparan, y la habilidad exige que sea determinista.

¿Cómo prueba las interfaces de terminal?

Prueba los cambios de estado directamente y usa teatest solo para flujos interactivos completos.

¿Usa la carpeta personal real en las pruebas?

No. La habilidad indica usar carpetas temporales y nunca depender de un directorio personal real.

Detalles

Descripción original del autor

Trigger: Go tests, go test coverage, Bubbletea teatest, golden files. Apply focused Go testing patterns.

repo: Gentleman-Programming/gentle-ai

Popularidad

Estrellas en GitHub
8,2 mil
Posición en el ranking
#12551
Licencia
MIT
Actualizada
1/11/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas