Logo di Tdd

Tdd

Community
spences10
tdd

Test-Driven Development workflow with red-green-refactor cycle. Use only when explicitly asked for TDD, not for general test writing.

Panoramica

Autorespences10
Repositoryclaude-code-toolkit
Nome della skilltdd
Stelle
37
Fork
2
File inclusi
5
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • 5 file inclusi

    Script, modelli di documento e riferimenti che il modello può leggere mentre lavora. I file sono di sola lettura e non vengono mai eseguiti.

  • Open source

    Pubblicata da spences10 su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Tdd in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/spences10/claude-code-toolkit/tree/main/plugins/dev-practices/skills/tdd
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Nuova skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella nella cartella delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/spences10/claude-code-toolkit.git /tmp/claude-code-toolkit
mkdir -p .claude/skills
cp -r /tmp/claude-code-toolkit/plugins/dev-practices/skills/tdd .claude/skills/tdd
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Tdd in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Tdd non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Tdd non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

Test-Driven Development

Drive implementation through tests using the red-green-refactor cycle.

Adapted from Matt Pocock's TDD skill

Trigger Patterns

  • "use TDD"
  • "TDD this feature"
  • "red-green-refactor"
  • "test-driven"
  • "write tests first"

Do not activate for general "write tests for X" or "add test coverage" requests. This skill is specifically for the TDD workflow where tests lead implementation.

Philosophy

Test behavior, not implementation. Every test should verify what the code does from the outside, not how it works inside. See deep-modules.md for the reasoning behind this.

Good tests act as a contract: they define what the module promises to its callers. If you can swap the internals completely and your tests still pass, they're testing the right thing.

Workflow

1. Plan the Interface

Before writing any code, decide the public surface area:

  • What functions/methods/endpoints will exist?
  • What are the inputs and outputs?
  • What are the edge cases and error conditions?

Design for the caller, not the implementation. See interface-design.md.

2. Write a Tracer Bullet Test

Start with one test that exercises the simplest meaningful path through the feature. This test should:

  • Call the public API as a real consumer would
  • Assert the most basic expected output
  • Fail — because the implementation doesn't exist yet
RED: test exists, code does not

Run the test. Confirm it fails for the right reason (missing function, wrong return value — not a syntax error).

3. Make It Green

Write the minimum code to pass that one test. Do not write more than what the test demands. Hardcode return values if that's all it takes. The goal is a green test suite, not elegant code.

GREEN: test passes with minimal implementation

4. Refactor Under Green

With the test passing, clean up. Remove duplication, improve names, extract helpers — but only while tests stay green. See refactoring.md.

REFACTOR: improve code quality, tests still pass

5. Repeat

Add the next test. Pick the next simplest behavior that isn't covered. Follow the same cycle:

  1. Write a failing test
  2. Make it pass with minimal code
  3. Refactor while green

Build up complexity incrementally. Each cycle should take minutes, not hours.

6. Handle Edge Cases

After the core behavior works, add tests for:

  • Invalid inputs and error conditions
  • Boundary values
  • Empty/null/undefined cases
  • Concurrent access if relevant

7. Final Refactor

Once all behavior is covered, do a final pass:

  • Look for patterns across tests — consolidate setup with helpers
  • Check that test names clearly describe the behavior being verified
  • Ensure no test depends on another test's state
  • Review implementation for unnecessary complexity

When to Mock

Use real dependencies when practical. Mock only at system boundaries — network calls, databases, file systems, clocks. See mocking.md for detailed guidance.

Test Quality

Write tests that are readable, independent, and fast. See tests.md for patterns on naming, structure, and assertion style.

Anti-patterns

  • Writing implementation before the test (defeats the purpose)
  • Writing multiple tests before making any pass (too much red)
  • Skipping the refactor step (accumulates mess)
  • Testing private methods or internal state
  • Making tests pass by weakening assertions
  • Mocking everything instead of testing real behavior

References

File inclusi

Il modello legge questi file quando servono, mentre la skill è caricata. Sono accessibili in sola lettura e non vengono mai eseguiti.

Domande frequenti

Cosa fa la skill IA Tdd?

Test-Driven Development workflow with red-green-refactor cycle. Use only when explicitly asked for TDD, not for general test writing.

Perché usare Tdd su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Tdd è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Tdd in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/spences10/claude-code-toolkit/tree/main/plugins/dev-practices/skills/tdd. TypingMind legge il file SKILL.md, include i file associati e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Tdd?

Qualsiasi modello che colleghi in TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Tdd?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Tdd: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Tdd è gratuita?

È pubblicata su GitHub da spences10. Consulta il repository per i termini di licenza. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, modelli o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇