Pular para o conteúdo
Skillpedia
Testes8,2 mil · #12551

go-testing

O que ela faz

Esta skill orienta sua IA quando ela escreve ou revisa testes na linguagem Go. É para desenvolvedores Go que querem testes focados e confiáveis, incluindo testes de interfaces de terminal.

Quando usar

  • ✓Quando você escreve testes para uma função Go que tem muitos casos de entrada.
  • ✓Quando você está testando uma interface de terminal construída com Bubbletea.
  • ✓Quando você precisa de testes com arquivos golden ou testes que acessam o sistema de arquivos.

Link da skill

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

Copie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.

Como usar

O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.

Mensagem pronta para colar

Use esta skill para me ajudar: https://github.com/Gentleman-Programming/gentle-ai/blob/main/internal/assets/skills/go-testing/SKILL.md Leia o arquivo SKILL.md desse link e siga as instruções dele na minha tarefa.
Quer que a sua IA encontre skills como esta sozinha?Instale o MCP grátis do Skillpedia: uma linha, e ela pesquisa entre 15.000+ skills antes de cada tarefa.Instalar em 1 minuto →

Exemplo do que pedir para a IA

“Escreva testes em Go orientados a tabela para este parser, incluindo os casos de erro.”

5 skills novas por semana. 1 minuto de leitura.

Como funciona

A skill escolhe um padrão de teste adequado ao alvo, como testes orientados a tabela para funções ou atualizações diretas de modelo para interfaces de terminal. Ela mantém os testes determinísticos e pula testes externos lentos no modo short.

Conteúdo técnico (SKILL.md original)

Texto original do autor, em inglês, direto do 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

Perguntas frequentes

O que é um arquivo golden?

É uma saída esperada salva contra a qual os testes comparam, e a skill exige que ela seja determinística.

Como ela testa interfaces de terminal?

Ela testa as mudanças de estado diretamente e usa teatest apenas para fluxos interativos completos.

Ela usa a pasta pessoal real nos testes?

Não. A skill diz para usar pastas temporárias e nunca depender de um diretório pessoal real.

Detalhes

Descrição original do autor

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

repo: Gentleman-Programming/gentle-ai

Popularidade

Estrelas no GitHub
8,2 mil
Posição no ranking
#12551
Licença
MIT
Atualizada em
01/11/2026

Essa skill é útil?

0

Entre para votar.

Comentários

  • …

Mais skills deste repositório

Skills parecidas