Logo de Test Driven Development

Test Driven Development

Comunidade
pimenov
test-driven-development

Drives behavior changes through tests or explicit focused checks before implementation. Use when implementing new logic, fixing a bug, changing behavior, adding edge-case handling, modifying validation, refactoring behavior-sensitive code, or after debugging identifies a root cause that needs a regression guard. Also use when Codex is about to say a bug is fixed or behavior works but no proof exists yet.

Visão geral

Publicado porpimenov
Repositóriocodex-first-skills-pack
Nome da habilidadetest-driven-development
Estrelas
28
Forks
5
Arquivos incluídos
Somente instruções
Links
  • Instruções em Markdown

    Um arquivo SKILL.md que o modelo carrega sob demanda, consumindo tokens apenas quando uma solicitação é realmente relevante para a habilidade.

  • Funciona com qualquer LLM

    Habilidades de IA são Markdown simples, não código específico de um provedor, por isso funcionam com GPT, Claude, Gemini, Grok ou um modelo local.

  • Completa em si mesma

    Tudo de que o modelo precisa está nas instruções — sem arquivos extras para sincronizar.

  • Código aberto

    Publicada por pimenov no GitHub. Leia o conteúdo-fonte antes de instalar.

Instalação

Instale a habilidade de IA Test Driven Development no TypingMind para usá-la com qualquer LLM ou adicione-a a outro agente que leia SKILL.md.

1

Instalar no TypingMind

O TypingMind instala uma habilidade diretamente da pasta dela no GitHub — lê o arquivo SKILL.md, reúne os arquivos de recursos em um pacote e armazena o resultado localmente.

  1. Abra o app e vá para Plugins → Habilidades.
  2. Escolha "Instalar do GitHub".
  3. Cole a URL da pasta da habilidade exibida abaixo e confirme.
    https://github.com/pimenov/codex-first-skills-pack/tree/main/skills/test-driven-development
  4. Ative a habilidade em cada chat em que quiser disponibilizá-la.
Plugins → Habilidades → Nova habilidade → Via URL GitHub, depois cole a URL da pasta e pressione Continuar.
2

Instalar em outro agente

Qualquer agente que leia o formato Agent Skills pode usar esta habilidade — copie a pasta para o diretório de habilidades desse agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/pimenov/codex-first-skills-pack.git /tmp/codex-first-skills-pack
mkdir -p .claude/skills
cp -r /tmp/codex-first-skills-pack/skills/test-driven-development .claude/skills/test-driven-development
Reinicie Claude Code após copiar para que a nova habilidade seja reconhecida.

Use no TypingMind

Ative Test Driven Development em qualquer chat do TypingMind e o modelo cuida do resto. O nome e a descrição da habilidade ficam no prompt do sistema e, assim que uma solicitação relevante aparece, o modelo carrega as instruções completas automaticamente — sem precisar de acionamento manual e sem consumir tokens até que ela seja realmente usada.

O modelo carrega Test Driven Development automaticamente assim que uma solicitação é relevante para essa habilidade.

Funciona com qualquer modelo de IA

Habilidades de IA são instruções em Markdown simples, não código específico de um provedor. Por isso, Test Driven Development não fica vinculada ao modelo para o qual foi criada. Instale-a uma vez no TypingMind e use-a com GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou um modelo local executado por conta própria — tudo com suas próprias chaves de API.

  • Carregada apenas quando necessário

    O prompt do sistema contém apenas o nome e a descrição. As instruções são buscadas na primeira solicitação relevante, então uma habilidade sem uso não gera custo.

  • Troque de modelo durante a conversa

    Como a habilidade é composta de instruções, não de código, trocar de modelo não afeta seu funcionamento — o próximo modelo lê o mesmo arquivo SKILL.md.

Instruções da habilidade

Este é o conteúdo de SKILL.md que o modelo carrega. Leia antes de instalar — uma habilidade é um conjunto de instruções que seu modelo seguirá.

Test-Driven Development

Overview

Use tests as executable proof of expected behavior. For bugs, first reproduce the bug with a failing test or focused check. For new behavior, define the expected behavior before writing implementation code.

This skill is not ceremony. It is a guard against "looks fixed" answers that cannot catch regressions.

Do Not Use

  • Pure documentation, copy, or static content changes with no behavior.
  • Mechanical formatting, renames, or file moves.
  • Configuration-only changes where the right proof is a config validation/build/smoke check rather than a unit test.
  • One-off exploration before a behavior claim is made.
  • Cases where the repo has no realistic test harness and the user explicitly chooses a manual smoke check.

Core Loop

Use the smallest proof that matches the risk.

text
RED -> GREEN -> REFACTOR -> VERIFY

1. RED: Define The Failing Behavior

Before implementation, create or identify a check that should fail before the fix.

Good RED targets:

  • unit test for pure logic;
  • integration test for service/API/database boundaries;
  • component/browser test for UI behavior;
  • CLI command or smoke script for operational behavior;
  • minimal reproduction when no test harness exists.

For bugs, use the prove-it pattern:

text
Bug report -> failing reproduction -> minimal fix -> passing reproduction -> broader check

If no failing test can be added, state why and name the substitute proof:

text
No automated test added because <reason>.
Focused check: <command/manual smoke/repro script>.
Regression risk: <remaining gap>.

2. GREEN: Make The Smallest Fix

Write the minimum code that makes the RED check pass.

Do not mix in:

  • broad refactors;
  • unrelated cleanup;
  • dependency upgrades;
  • UI polish;
  • new features not covered by the behavior check.

If the minimum fix needs a design decision, stop and surface the decision before coding through it.

3. REFACTOR: Improve Safely

Refactor only after the behavior check is green.

Keep refactors behavior-preserving. Run the focused check after meaningful refactor steps. If a refactor changes behavior, it needs its own RED check or a scope note.

4. VERIFY: Expand Confidence

Run checks in widening circles:

  1. the focused failing test/check;
  2. nearby tests for the touched module;
  3. typecheck/lint/build if the stack uses them;
  4. broader suite or browser/manual smoke when the touched surface warrants it.

Do not rerun expensive broad checks repeatedly on unchanged code. Say what was run and what remains unverified.

Choosing Test Size

Prefer the smallest test that proves the behavior:

  • unit: pure functions, validation rules, data transforms;
  • integration: API handlers, database queries, service boundaries, auth checks;
  • component/browser: user-visible UI behavior, routing, forms, rendering;
  • smoke: deploy/runtime/CLI/config behavior where automated unit tests are not the right proof.

Avoid brittle tests that only assert implementation details unless the implementation detail is the contract.

Working In Existing Repos

Before adding tests:

  1. Read the existing test style and commands.
  2. Find the closest similar test.
  3. Use the repo's current runner and helpers.
  4. Avoid adding a new test framework unless the user explicitly approves.
  5. Keep test data small and deterministic.

If test commands or framework behavior are version-sensitive, use source-driven-development before inventing syntax.

Working With Bugs

When debugging-and-error-recovery has identified a root cause, use this skill to add the guard.

Bugfix checklist:

  • observed behavior is captured;
  • expected behavior is explicit;
  • failing reproduction exists or the no-test reason is stated;
  • fix makes the reproduction pass;
  • nearby regressions are checked.

Do not close a bug only because the code changed. Close it when the proof passes or the user explicitly accepts the remaining gap.

Working With Production And External Systems

For production, data, auth, billing, routing, webhooks, email, CRM, Notion, Linear, GitHub, Directus, Cloudflare, VPS, or other live systems:

  • keep the first pass read-only unless a bounded mutation is approved;
  • prefer dry-runs, local fixtures, staging, or smoke checks over live writes;
  • do not create synthetic production data without approval;
  • record the exact check and rollback/evidence path when relevant.

Tests and smoke checks are evidence, not approval to deploy or mutate production.

Common Rationalizations

RationalizationReality
"This is obvious."Obvious behavior still regresses. A small check protects it.
"I'll add tests after."After-the-fact tests often mirror the implementation instead of proving the requirement.
"There are no tests here."Then state that and create the smallest focused check instead of pretending it is proven.
"The bug is fixed because I changed the code."The bug is fixed when the failing scenario passes.
"A snapshot is enough."Snapshots rarely prove behavior unless the rendered output is the contract.

Red Flags

  • Claiming a bug is fixed without reproducing it first.
  • Adding implementation code before defining expected behavior.
  • Updating tests to match new behavior without explaining why the expectation changed.
  • Removing a failing test instead of understanding it.
  • Adding broad mocks that hide the real boundary being tested.
  • Treating manual "looks good" as enough for risky behavior changes.
  • Skipping verification because the change is small but user-visible.

Output Shape

Use this compact report:

text
TDD report:
- Behavior: <what should be true>
- RED: <test/check that failed or no-test reason>
- GREEN: <minimal fix>
- Guard: <test/check now protecting behavior>
- Verification: <commands/checks and results>
- Remaining risk: <if any>

For user-facing durable notes, write explanatory prose in the user's language and keep commands, paths, env vars, test names, and package names in their exact form.

Verification

Before finishing, confirm:

  • Expected behavior was stated before or alongside implementation.
  • A failing test/check existed, or a no-test reason was stated.
  • The implementation was the smallest reasonable fix for that behavior.
  • The focused test/check passed after the fix.
  • Broader checks were run when the touched surface warranted them.
  • Remaining unverified risk was stated plainly.

Perguntas frequentes

O que a habilidade de IA Test Driven Development faz?

Drives behavior changes through tests or explicit focused checks before implementation. Use when implementing new logic, fixing a bug, changing behavior, adding edge-case handling, modifying validation, refactoring behavior-sensitive code, or after debugging identifies a root cause that needs a regression guard. Also use when Codex is about to say a bug is fixed or behavior works but no proof exists yet.

Por que usar Test Driven Development no TypingMind?

Porque basta instalar uma vez para usar com qualquer modelo. Test Driven Development é escrito em Markdown simples, e não em código específico de um provedor, então a mesma habilidade funciona com GPT-5, Claude, Gemini, Grok ou um modelo local — e é possível trocar de modelo no meio do chat sem que ela deixe de funcionar. O TypingMind usa suas próprias chaves de API, então o pagamento é feito diretamente aos provedores, em vez de uma assinatura por licença de usuário, e suas habilidades e chats permanecem no seu próprio armazenamento.

Como instalar Test Driven Development no TypingMind?

Abra Plugins → Habilidades → Instalar do GitHub no TypingMind e cole https://github.com/pimenov/codex-first-skills-pack/tree/main/skills/test-driven-development. O TypingMind lê o arquivo SKILL.md e instala a habilidade para que possa ser ativada em cada chat.

Quais modelos de IA podem usar Test Driven Development?

Qualquer modelo conectado no TypingMind. As habilidades de IA são instruções em Markdown simples, e não código específico de um provedor. Assim, GPT, Claude, Gemini, Grok e modelos locais podem carregar esta habilidade quando uma solicitação corresponder a ela.

Quantos modelos de IA posso usar com Test Driven Development?

Quantos quiser. Desde que o modelo ofereça suporte a habilidades, é possível usar Test Driven Development com ele — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e outros — tudo no TypingMind com suas próprias chaves de API.

A habilidade de IA Test Driven Development é gratuita?

A habilidade é publicada no GitHub por pimenov. Consulte os termos de licenciamento no repositório. O pagamento é feito apenas ao seu provedor de IA pelos tokens usados.

O que são habilidades de IA?

Uma habilidade de IA é um conjunto reutilizável de instruções que ensina um modelo de IA a realizar uma tarefa específica. Ela segue o formato aberto Agent Skills: um arquivo SKILL.md com nome e descrição, além de scripts, modelos de documento ou arquivos de referência de que o modelo possa precisar. O modelo lê as instruções apenas quando sua solicitação corresponde à habilidade, então uma habilidade instalada não gera custos até ser usada.

Qual é a diferença entre habilidades de IA e plugins ou servidores MCP?

Um plugin ou servidor MCP oferece ao modelo novas ferramentas para chamar — código que é executado em algum lugar e retorna um resultado. Já uma habilidade de IA fornece conhecimento e um processo ao modelo: como abordar uma tarefa, quais etapas seguir e como deve ser um bom resultado. As habilidades são escritas em Markdown simples, por isso não precisam de servidor, chave de API nem ambiente de execução, e funcionam com qualquer modelo.

Ver todos

Crie seu próprio espaço de IA agora

Inscreva-se na nossa newsletter para receber novidades sobre recursos e futuros sorteios 👇