Skip to content
Skills Library
Programming · Testing

unit-test-writer

/unit-test-writer

Write focused unit tests for a function, class or module: one behaviour per test, Arrange-Act-Assert, descriptive names, boundary and error cases, no I/O, fast and deterministic; in the project's existing framework (pytest, JUnit 5, xUnit/NUnit, Jest/Vitest, PHPUnit, Go testing). Use when asked to add unit tests, cover a bug fix, or raise confidence in a module.

Licence
MIT
Last repository change
10.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 10.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Write focused unit tests for a function, class or module: one behaviour per test, Arrange-Act-Assert, descriptive names, boundary and error cases, no I/O, fast and deterministic; in the project's existing framework (pytest, JUnit 5, xUnit/NUnit, Jest/Vitest, PHPUnit, Go testing). Use when asked to add unit tests, cover a bug fix, or raise confidence in a module.

Original author description

Write focused unit tests for a function, class or module: one behaviour per test, Arrange-Act-Assert, descriptive names, boundary and error cases, no I/O, fast and deterministic; in the project's existing framework (pytest, JUnit 5, xUnit/NUnit, Jest/Vitest, PHPUnit, Go testing). Use when asked to add unit tests, cover a bug fix, or raise confidence in a module.

How it works

  1. Before writing
  2. Rules for each test
  3. Steps
  4. Output
Original SKILL.md headings · 24 lines, 222 words
SKILL.md preview
---
name: unit-test-writer
description: "Write focused unit tests for a function, class or module: one behaviour per test, Arrange-Act-Assert, descriptive names, boundary and error cases, no I/O, fast and deterministic; in the project's existing framework (pytest, JUnit 5, xUnit/NUnit, Jest/Vitest, PHPUnit, Go testing). Use when asked to add unit tests, cover a bug fix, or raise confidence in a module."
---

# Unit test writer

## Before writing
1. Read the code **and** the existing tests: framework, folder layout, naming style, fixtures, helpers. Follow them.
2. List the behaviours of the unit (not its lines): normal results, boundaries, invalid input, errors from collaborators, state changes.

## Rules for each test
- **One behaviour**, named after it: `test_late_fee_is_zero_on_due_date`, `Should_reject_negative_amount`.
- **Arrange / Act / Assert** separated by a blank line; a single Act.
- **Concrete expected values** computed independently of the code (by hand or from the spec), never by calling the code under test.
- **No I/O**: no network, database, file system or real clock; inject or fake them.
- **Deterministic**: fixed seeds, frozen time, no order dependence.
- Assert on **outputs and observable state**, not on private methods or internal calls (unless the call *is* the behaviour, e.g. "an e-mail is sent").
- Cover: happy path, each boundary, each error path, null/empty, and the bug being fixed (regression test first, red, then fix).

## Steps
1. Write the tests, run them, show the output.
2. If a test passes before the code exists or after deliberately breaking the code, it is not testing anything: fix it.
3. Report what is covered and what deliberately is not.

## Output
Test file(s), the run output, and a short behaviour checklist with ✔ per test.

Versions

RepositoryScoreLicence
This page · RobinBeraud/claude-qa-skills100MIT
matteocervelli/llms95MIT

Database snapshot: 13.11.2026 · package version b86fc22633af (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 86unit-test
    Writes isolated unit tests for a named file using Arrange-Act-Assert. Use when user requests unit tests, test coverage, or missing test cases for a file.
  • 100unit-test-author
    Writes thorough, maintainable unit tests with comprehensive edge cases, table-driven cases, proper mocking/stubbing, and meaningful coverage across languages and frameworks (pytest, Jest/Vitest, Go testing, JUnit, RSpec, xUnit, Rust). Use this skill when the user asks to "write…
  • 90write-tests
    Write unit or integration tests for a function, module, endpoint or bug fix, in the project's existing test framework. Use when the user says "add tests", "write tests for this", "increase coverage", "test this bug fix", or "why isn't this tested".
  • 95unit-testing
    Use when writing, improving, or debugging unit tests that verify isolated functions, methods, and classes. Covers cross-platform frameworks including Vitest, Jest, xUnit, NUnit, MSTest, pytest, JUnit 5, and Go testing with mocking strategies, test doubles, AAA pattern, and…
  • 100test-generator
    Write unit and integration tests for existing code, covering the happy path, edge cases, error paths and boundary values, using the project's own test framework and style. Use when the user asks to add tests, raise coverage, write test cases for a function, module or endpoint, or test a bug fix.
  • 100unit-test-engineer
    Designs and writes fast, deterministic unit tests that assert behaviour, cover boundaries and negative cases, and fail when the code is wrong. Use when adding or improving unit tests for existing or new code.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.