Logo di Test Writer

Test Writer

Community
poshan0126
test-writer

Write comprehensive tests for new or changed code. Use automatically after adding a function, endpoint, or component, or changing behavior, when the change has no corresponding test changes. Not for config, docs, or test-only diffs. For judging whether existing tests adequately verify a change, use the pr-test-analyzer agent instead.

Panoramica

Pubblicato daposhan0126
Repositorydotclaude
Nome della skilltest-writer
Stelle
870
Fork
204
File inclusi
Solo istruzioni
LicenzaMIT
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.

  • Tutto nelle istruzioni

    Tutto ciò che serve al modello è nelle istruzioni: nessun file aggiuntivo da sincronizzare.

  • Open source

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

Installazione

Installa la skill IA Test Writer 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/poshan0126/dotclaude/tree/main/skills/test-writer
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi 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 della skill nella directory delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/poshan0126/dotclaude.git /tmp/dotclaude
mkdir -p .claude/skills
cp -r /tmp/dotclaude/skills/test-writer .claude/skills/test-writer
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Test Writer 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 Test Writer 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 Test Writer 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à.

Write comprehensive tests for the code that was just added or changed.

Step 1: Discover What Changed

Change under test (injected at load — already in front of you, no tool call needed):

git diff --stat HEAD 2>/dev/null || echo "(no diff vs HEAD — inspect git status manually)"
git diff HEAD 2>/dev/null || true
  • The diff above is the change under test. If it is empty (already committed or amended elsewhere), run git diff, git diff --cached, or git show HEAD to locate the change
  • Read each changed file to understand the behavior being added
  • Identify the project's existing test framework, patterns, and conventions by finding existing test files
  • Place new test files next to the source files or in the project's established test directory. Match whatever the project already does

Step 2: Analyze Every Code Path

For each new or modified function/method/component, map out:

  • Happy path. Normal input, expected output
  • Edge cases. Empty input, single element, boundary values (0, 1, -1, MAX_INT)
  • Null/undefined/nil. What happens with missing data
  • Type boundaries. Wrong types, type coercion traps
  • Error paths. Invalid input, network failures, timeouts, permission denied
  • Concurrency. Race conditions, parallel calls with shared state
  • State transitions. Initial state, intermediate states, final state
  • Integration points. How this code interacts with its dependencies

Step 3: Write the Tests

For EACH scenario identified above, write a test. No skipping.

Structure

  • One assertion per test. If a test name needs "and", split it into two tests
  • Descriptive names. Test names read as sentences describing the behavior:
    • should return empty array when input is empty
    • should throw ValidationError when email format is invalid
    • should retry 3 times before failing on network timeout
  • Arrange-Act-Assert. Set up, execute, verify. Clear separation.

What to Test

Pure functions / business logic:

  • Every branch (if/else, switch, ternary)
  • Every thrown error with exact error type and message
  • Return value types and shapes
  • Side effects (mutations, calls to external services)

API endpoints / handlers:

  • Success response (status code, body shape, headers)
  • Validation errors for each field (missing, wrong type, out of range)
  • Authentication/authorization failures
  • Rate limiting behavior if applicable
  • Idempotency for non-GET methods

UI components (if applicable):

  • Renders without crashing with required props
  • Renders correct content for each state (loading, error, empty, populated)
  • User interactions trigger correct callbacks (click, submit, type, select)
  • Accessibility: focusable, keyboard navigable, correct ARIA attributes
  • Conditional rendering. Each branch shows/hides correct elements

Database / data layer:

  • CRUD operations return correct data
  • Unique constraints reject duplicates
  • Cascade deletes work as expected
  • Transactions roll back on failure

Async operations:

  • Successful resolution
  • Rejection / error handling
  • Timeout behavior
  • Cancellation if supported
  • Concurrent calls don't interfere

Mocking Rules

  • Prefer real implementations over mocks
  • Only mock at system boundaries: network, filesystem, clock, random
  • Never mock the code under test
  • If you mock, verify the mock was called with expected arguments
  • Reset mocks between tests. No shared state leaking

Step 4: Verify

  • Run the new tests. Confirm they all pass
  • Temporarily break the code (change a return value or condition). Confirm at least one test fails
  • If no test fails when code is broken, the tests are useless. Rewrite them
  • Check coverage: every new function should have at least one test, every branch should be exercised

Output

  • Complete, runnable test file(s). Not snippets
  • Tests grouped by the function/component they cover
  • A brief summary: how many tests, what scenarios covered, any gaps you couldn't cover and why

Domande frequenti

Cosa fa la skill IA Test Writer?

Write comprehensive tests for new or changed code. Use automatically after adding a function, endpoint, or component, or changing behavior, when the change has no corresponding test changes. Not for config, docs, or test-only diffs. For judging whether existing tests adequately verify a change, use the pr-test-analyzer agent instead.

Perché usare Test Writer su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Test Writer è 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 la skill 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 Test Writer in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/poshan0126/dotclaude/tree/main/skills/test-writer. TypingMind legge il file SKILL.md e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Test Writer?

Qualsiasi modello che colleghi a 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 Test Writer?

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

La skill IA Test Writer è gratuita?

Sì. È pubblicata su GitHub da poshan0126 con licenza MIT. 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, template 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.

Elenco completo

Crea subito il tuo spazio di lavoro AI

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