Logo di Oss Write Tests

Oss Write Tests

Community
chiruu12
oss-write-tests

Write tests for untested OSS code as a standalone contribution. Identifies coverage gaps, studies the repo's test conventions, and guides the user through writing tests that match existing patterns. Use when contributing tests to an open source repo, looking for a low-risk first contribution, or improving test coverage. Not for writing tests alongside a bug fix — use oss-contribute for that.

Add to TypingMind

Panoramica

Pubblicato dachiruu12
RepositoryOSS-Skills
Nome della skilloss-write-tests
Stelle
62
Fork
6
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 chiruu12 su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Oss Write Tests 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/chiruu12/OSS-Skills/tree/main/skills/oss-write-tests
  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/chiruu12/OSS-Skills.git /tmp/OSS-Skills
mkdir -p .claude/skills
cp -r /tmp/OSS-Skills/skills/oss-write-tests .claude/skills/oss-write-tests
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Oss Write Tests 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 Oss Write Tests 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 Oss Write Tests 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 Tests

Add tests for untested code — the highest-value, lowest-risk first contribution. You need to understand the code deeply without modifying it, and the result is almost always welcome.

Purpose

Test contributions teach you a codebase faster than any other contribution type. You read every function signature, trace every code path, and understand every edge case — without the pressure of changing production code. Maintainers love test PRs because they reduce risk for everyone. This skill guides you through finding untested code, learning the repo's test conventions, and writing tests that a maintainer would write themselves.

When to Use

  • Making your first contribution to a repo and want something low-risk
  • You've found code with no tests or poor coverage
  • You want to learn a codebase deeply before tackling a bug or feature
  • NOT when writing tests as part of a bug fix — use oss-contribute for that
  • NOT when the repo has no test infrastructure at all — that's a different conversation with maintainers

Prerequisites

  • Repo forked, cloned, and set up (from oss-prep-to-contribute)
  • Test suite runs successfully (make test, npm test, pytest, etc.)
  • User has a target module or area in mind

Process

1. Identify untested code

Find code that lacks test coverage. Use multiple signals — don't rely on just one.

bash
# Check if the repo has coverage reports
ls coverage/ htmlcov/ .coverage *.lcov 2>/dev/null

# Find source files without corresponding test files
# Adapt the pattern to the repo's naming convention
find src/ -name "*.ts" | while read f; do
  test_file=$(echo "$f" | sed 's|src/|tests/|; s|\.ts$|.test.ts|')
  [ ! -f "$test_file" ] && echo "No tests: $f"
done

# Find public functions without any test assertions
grep -rn "export function\|def \|pub fn\|func " src/ --include="*.ts" --include="*.py" --include="*.rs" --include="*.go" | head -30

Then cross-reference against test files:

bash
# What symbols are already tested?
grep -rn "describe\|it(\|test(\|def test_\|func Test" tests/ test/ __tests__/ spec/ | head -30

Look for:

  • Source files with zero test counterparts
  • Public functions never referenced in test files
  • Complex functions with only happy-path tests (no error/edge cases)
  • Recently changed code that outpaced its tests (check git log)

2. Study the repo's test conventions

Before writing a single test, read 3-5 existing test files in the same area. You must match the repo's patterns exactly.

bash
# Find test files near the code you're targeting
find tests/ test/ __tests__/ spec/ -name "*relevant_module*" -o -name "*relevant_feature*" 2>/dev/null

# Read the most recent test files (likely to follow current conventions)
git log --diff-filter=A --name-only --pretty=format: -- "tests/" "test/" "__tests__/" "spec/" | head -10

Document these conventions:

  • File naming: *.test.ts vs *_test.go vs test_*.py vs *_spec.rb
  • File location: co-located with source or in separate test directory?
  • Import patterns: what test framework, what assertion style?
  • Test structure: BDD (describe/it) or xUnit (TestX) or table-driven?
  • Setup/teardown: fixtures, factories, beforeEach, setUp?
  • Mocking strategy: what gets mocked vs what uses real implementations?
  • Test data: inline constants, fixture files, factory functions, or builders?
  • Naming conventions: "should do X" or "test_does_X" or "TestX_WhenY_DoesZ"

3. Understand the code under test

Read the target code thoroughly. You're not fixing it — you're documenting its behavior through tests.

bash
# Read the source file
cat src/path/to/module.ts

# Trace callers — who uses this code?
grep -rn "import.*from.*module\|require.*module" src/ --include="*.ts" --include="*.py"

# Check git history — what was the intent?
git log --oneline -10 -- "src/path/to/module.ts"
git blame src/path/to/module.ts

For each function you plan to test, identify:

  • Inputs: what arguments, what types, what ranges?
  • Outputs: what does it return? What side effects?
  • Error conditions: what makes it throw/return an error?
  • Edge cases: empty input, null, boundary values, concurrent access?
  • Dependencies: what does it call? What needs mocking?

4. Thinking gate — user describes what to test

Present the research (untested code, conventions, function analysis) and ask:

"Based on the code I've analyzed, list the behaviors this module should exhibit. For each behavior:

  1. What input produces what output?
  2. What error conditions exist? (Look at the error handling in the code)
  3. Which edge cases matter? (Think: empty, null, boundary, large, concurrent)
  4. Which behaviors are already tested and which aren't?"

Wait for their answer. Do NOT proceed until they've listed specific behaviors, not just "I'll test the main function."

If their list is shallow: "You listed the happy path, but look at src/module.ts:45 — there's an error branch when the input is empty. What should happen there?"

5. User writes the test plan

The user decides:

  • Which behaviors to cover (prioritize untested paths)
  • What test data is needed for each case
  • Which edge cases to include
  • What order to write tests in (start with simplest behavior)

Review their plan:

  • If they're skipping error paths: "The function at src/module.ts:30 has a catch block — what triggers it?"
  • If test data is unrealistic: "Look at how callers use this function — they pass X, not Y"
  • If they're testing internals: "This is a private helper. Test the public function that calls it instead."

6. User implements tests

The user describes what each test should verify. The LLM helps with:

  • Syntax and framework-specific patterns (matching conventions from step 2)
  • Setting up mocks/fixtures following the repo's existing patterns
  • Pointing to similar existing tests as reference
bash
# Point to an existing test as a template
cat tests/path/to/similar.test.ts

What the LLM DOES:

  • Implement test code the user has described ("I want a test that checks X when Y")
  • Match the repo's exact test conventions (naming, structure, assertion style)
  • Point to existing tests as reference patterns

What the LLM DOES NOT DO:

  • Write tests the user hasn't described — the user decides what to test
  • Pick test data — the user decides what inputs to use
  • Skip behaviors the user didn't mention (but DO point out untested paths)

7. Verify

bash
# Run the new tests
# {repo-specific test command for targeted files}

# Run the full suite — make sure nothing broke
# {repo-specific full test command}

# Check coverage improved (if the repo has coverage tooling)
# {repo-specific coverage command}

# Lint/format
# {repo-specific lint command}

Check:

  • New tests pass
  • Existing tests still pass
  • No test pollution (tests don't depend on execution order)
  • Coverage actually improved for the target code

8. Thinking gate — user explains test design

"Before submitting — walk me through your tests:

  1. What behaviors does each test verify? (Not 'tests the function' — what specific behavior?)
  2. Why did you test these cases and not others?
  3. If the code under test changes, which of your tests would break? (This checks whether you're testing behavior or implementation)"

This catches mechanical testing — writing tests without understanding what they prove.

Related Skills

  • Previous step: ← oss-prep-to-contribute — set up the repo and build understanding
  • Next step: → oss-submit-pr — submit the test PR following repo guidelines
  • Alternative entry: ← oss-find-real-issues — if you found untested code while exploring
  • If unfamiliar tech: → oss-learn-stack — learn the test framework from the repo's own tests

Common Rationalizations

ShortcutWhy It Fails
"I'll just add tests for everything in the file"Untargeted testing produces brittle tests that break on refactors. Test behaviors, not lines of code. Maintainers reject test PRs that add noise.
"I don't need to read existing tests, I know how testing works"Every repo has conventions. If the repo uses table-driven tests and you write individual assertions, your PR looks like it was written by an outsider. It will require a full rewrite.
"I'll test the private helpers directly"Private functions are implementation details. When the maintainer refactors, your tests break even though the behavior hasn't changed. Test public interfaces.
"I'll skip the edge cases, the happy path is enough"Happy-path-only tests are the tests that already exist. The value of your contribution IS the edge cases.
"Coverage went up, so the tests are good"Coverage measures execution, not verification. A test that calls a function without asserting anything gets coverage credit but proves nothing.

Red Flags

  • User can't explain what behavior each test verifies — they're writing tests mechanically
  • Tests duplicate existing coverage instead of filling gaps
  • Test data doesn't match how the code is actually called — tests pass but prove nothing about real usage
  • Tests mock everything — they're testing the mocks, not the code
  • User wants to test and refactor at the same time — that's two PRs, not one

Verification Checklist

  • Test conventions match the repo's existing patterns (naming, structure, mocking)
  • Each test verifies a specific behavior (not just "calls the function")
  • Edge cases and error paths are covered (not just happy path)
  • All new tests pass
  • Full test suite still passes (no pollution or breakage)
  • User can explain what each test proves and why they chose these cases (step 8)
  • Coverage improved for the target code (if measurable)

Anti-patterns

  • DO NOT generate a wall of tests without the user describing what to test — they decide the test plan
  • DO NOT test private/internal functions directly — test public behavior
  • DO NOT ignore the repo's test conventions — match them exactly, no matter your personal preference
  • DO NOT combine test contributions with code changes — tests-only PRs are cleaner and easier to review
  • DO NOT use test data that doesn't match real usage — read how callers use the function and mirror that

Domande frequenti

Cosa fa la skill IA Oss Write Tests?

Write tests for untested OSS code as a standalone contribution. Identifies coverage gaps, studies the repo's test conventions, and guides the user through writing tests that match existing patterns. Use when contributing tests to an open source repo, looking for a low-risk first contribution, or improving test coverage. Not for writing tests alongside a bug fix — use oss-contribute for that.

Perché usare Oss Write Tests su TypingMind?

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

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/chiruu12/OSS-Skills/tree/main/skills/oss-write-tests. TypingMind legge il file SKILL.md e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Oss Write Tests?

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 Oss Write Tests?

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

La skill IA Oss Write Tests è gratuita?

Sì. È pubblicata su GitHub da chiruu12 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 👇