Pular para o conteúdo
Skillpedia
Testes95 mil · #1315

test-driven-development

O que ela faz

Esta skill orienta a IA no desenvolvimento orientado a testes: escrever primeiro um teste que mostre o problema e depois fazer uma correção pequena. Ela é para desenvolvedores que querem provas de que uma mudança funciona.

Quando usar

  • ✓Quando você quer uma nova funcionalidade construída com um teste escrito primeiro.
  • ✓Quando precisa corrigir um bug e provar a correção com um teste que falha primeiro.
  • ✓Quando está alterando um comportamento e quer evitar quebrar testes existentes.

Link da skill

https://github.com/odysseus-dev/odysseus/blob/dev/resources/skills/general/test-driven-development/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/odysseus-dev/odysseus/blob/dev/resources/skills/general/test-driven-development/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

“Corrija o bug em que resultados de busca vazios travam a página. Escreva primeiro um teste que falhe e depois faça a correção.”

5 skills novas por semana. 1 minuto de leitura.

Como funciona

A IA lê o código e os testes existentes, escreve o menor teste que mostra o comportamento esperado e confirma que ele falha. Depois faz a menor mudança que passa no teste e revisa a diferença.

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

Texto original do autor, em inglês, direto do GitHub.

When to Use

Use when implementing a feature, fixing a bug, or changing behavior where a regression test can define the expected result. Prefer this workflow for parser, routing, agent-loop, and UI behavior changes.

Procedure

  1. Inspect the relevant code, existing tests, and local conventions before editing.
  2. Write the smallest regression test that demonstrates the requested behavior or reproduces the bug.
  3. Run that test and confirm it fails for the expected reason, not because the test setup is broken.
  4. Make the smallest production change that makes the test pass.
  5. Run the focused test again, then run the surrounding module suite.
  6. Review the diff for unrelated changes, brittle assertions, hidden state, and missing error paths.
  7. Report the tests run and any remaining coverage or environment limits.

Pitfalls

  • Do not write a test that only mirrors the implementation; assert the user-visible contract.
  • Do not weaken an assertion just to make a failing test pass.
  • Do not skip the focused failing-test step when the behavior is observable in a local test.
  • Keep network, filesystem, and model calls deterministic with fakes or fixtures unless the integration itself is under test.

Verification

  • The new regression test fails before the fix and passes after it.
  • The relevant focused suite passes.
  • The broader suite passes or its failure is explained with evidence.
  • The final diff contains the test and the production change needed for the same behavior.
Perguntas frequentes

Por que o teste precisa falhar primeiro?

A skill diz que um teste que falha mostra que ele realmente verifica o comportamento, em vez de passar por acidente.

Ela pode enfraquecer um teste para fazê-lo passar?

Não. A skill diz para não enfraquecer uma asserção só para fazer um teste com falha passar.

Como as chamadas de rede são tratadas nos testes?

A skill as mantém previsíveis com fakes ou fixtures, a menos que a própria conexão seja o que está sendo testado.

Detalhes

Descrição original do autor

Build or fix software with a focused red-green-refactor loop

repo: odysseus-dev/odysseus

Popularidade

Estrelas no GitHub
95 mil
Posição no ranking
#1315
Licença
AGPL-3.0
Atualizada em
02/11/2026

Essa skill é útil?

0

Entre para votar.

Comentários

  • …

Mais skills deste repositório

Skills parecidas