Write tests that catch bugs, with explicit assertions, realistic data, and proper structure.

MITAuto-check: notesTesting & QA

Install Test Writer

skills CLI
$ npx skills add TheDecipherist/claude-code-mastery-project-starter-kit --skill test-writer -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install TheDecipherist/claude-code-mastery-project-starter-kit test-writer --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/TheDecipherist/claude-code-mastery-project-starter-kit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/test-writer .claude/skills/test-writer && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
test-writer
GitHub stars
338
Token cost
~767 tokens
SKILL.md length
307 words
Files
1
Skills in repo
24
Repo updated
First seen
Licence
MIT

At a glance

Write tests that catch bugs, with explicit assertions, realistic data, and proper structure.

  • Works in 5 steps: Every test has explicit assertions.… → Test behavior, not implementation details. → Cover the happy path, the error cases,… → …
  • Tasks that involve Test generation
  • SKILL.md covers Principles, Structure, Assertions and Data-layer tests (this codebase), plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Test Writer is an agent skill from TheDecipherist/claude-code-mastery-project-starter-kit. Write tests that catch bugs, with explicit assertions, realistic data, and proper structure. Use when asked to write, add, improve, or expand tests, or to raise coverage. Writes test files and runs them to confirm they assert real behavior.

Its SKILL.md is about 770 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Test generation. The repository describes itself as: The definitive starting point for Claude Code projects. Based on Claude Code Mastery Guides V1-V5. The licence is MIT.

When your agent uses it

  • Tasks that involve Test generation

Example prompts

  • “/test-writer”

Requirements

  • Pre-approved tools (allowed-tools): Read, Write, Grep, Glob, Bash

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Every test has explicit assertions. "Page loads" is not a test.
  2. Test behavior, not implementation details.
  3. Cover the happy path, the error cases, and the edge cases.
  4. Use realistic test data, never test / asdf.
  5. Tests are independent. No shared mutable state between them.

What it can do on your machine

Read from SKILL.md and the folder at commit 61fbb99. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Grep
    • Glob
    • Bash

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Test Writer loads about 767 tokens when it runs. Until then it costs about 63 tokens; SKILL.md has 307 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~63
When it runs · the whole SKILL.md, loaded when a task matches
~767

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Write, Grep, Glob, Bash

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from TheDecipherist/claude-code-mastery-project-starter-kit at commit 61fbb99, republished under its MIT licence (© TheDecipherist). 307 words, ~767 tokens.

Download SKILL.mdSave it as .claude/skills/test-writer/SKILL.md (or your agent's skills folder).
name
test-writer
description
Write tests that catch bugs, with explicit assertions, realistic data, and proper structure. Use when asked to write, add, improve, or expand tests, or to raise coverage. Writes test files and runs them to confirm they assert real behavior.
allowed-tools
Read, Write, Grep, Glob, Bash
when_to_use
- User asks to write tests, add coverage, or improve existing tests - New code needs a test, or a bug needs a regression test - User says "write tests", "add…

Test Writer

You write tests that catch bugs, not tests that pass. A test that can't fail isn't a test.

Principles

  1. Every test has explicit assertions. "Page loads" is not a test.
  2. Test behavior, not implementation details.
  3. Cover the happy path, the error cases, and the edge cases.
  4. Use realistic test data, never test / asdf.
  5. Tests are independent. No shared mutable state between them.

Structure

typescript
describe('[Feature]', () => {
  describe('[Scenario]', () => {
    it('should [expected behavior] when [condition]', async () => {
      // Arrange — set up test data
      // Act — perform the action
      // Assert — verify SPECIFIC outcomes
    });
  });
});

Assertions

typescript
// GOOD — explicit, specific
expect(result.status).toBe(200);
expect(result.body.user.email).toBe('ada@example.com');
await expect(page.locator('h1')).toContainText('Welcome');

// BAD — passes even when broken
expect(result).toBeTruthy();   // too vague
await page.goto('/dashboard'); // no assertion at all

Data-layer tests (this codebase)

The data layer has rules that test data must respect, or the test passes while masking the exact bug that bites in production.

  • Seed real ObjectId values, not string ids. The single most common production bug here is a string-vs-ObjectId _id mismatch that silently returns nothing. A test seeded with string ids passes and hides it. Use actual ObjectId types in fixtures.
  • Exercise the data adapter (StrictDB or native), not a hand-rolled driver mock. Tests go through the same adapters/ boundary the handlers use. Mock at the network or data boundary, not by reimplementing the driver.
  • Test the round trip. Where data is serialized (JSON in, JSON out), assert that types survive it, since that round trip is where _id mismatches and code-66 upsert errors appear.

Unit tests (Vitest)

Each test verifies:

  1. Return value matches expected.
  2. Side effects occurred, or provably didn't.
  3. Error cases throw the proper error.
  4. Edge cases: null, empty, max values, and for ids, wrong-type ids.

E2E tests (Playwright)

Each test verifies:

  1. Correct URL after navigation.
  2. Key elements are present.
  3. Correct data is displayed.
  4. Error states show the proper message.

Before finishing

Run the tests. A new test should fail against code that doesn't satisfy it and pass once it does. If a test passes the moment you write it without the behavior existing, it isn't asserting anything, fix the assertion.

© TheDecipherist, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/test-writer of TheDecipherist/claude-code-mastery-project-starter-kit.

Open the folder on GitHubat commit 61fbb99

Compare with similar skills

Test Writer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Test Writer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Test Writer this skillTheDecipherist/claude-code-mastery-project-starter-kit338—~767Automated safety check: NotesMIT
Emcaklofas/kicad-happy1.4k1 repos~2.8kAutomated safety check: PassMIT
Swig Testswig/swig6.3k—~2.3kAutomated safety check: PassCustom licence
Generate Test Cases342164796/generate-test-cases1191 repos~2.9kAutomated safety check: PassNone
Verify Cc Safety Netkenryu42/cc-safety-net1.6k—~2kAutomated safety check: PassMIT
Wioworkersio/skills190—~5.8kAutomated safety check: PassMIT

Similar skills

  • Emc

    aklofas/kicad-happy

    EMC pre-compliance risk analysis for KiCad PCB designs — 18 check categories, 44 rule IDs covering ground planes, decoupling, I/O filtering, switching harmonics, clock routing, differential pair…

    1.4k GitHub starsUsed in 1 repo~2.8k tokens
    Testing & QAAuto-check passed
  • Swig Test

    swig/swig

    Run SWIG test suite for specific languages. An agent skill from swig/swig.

    6.3k GitHub stars~2.3k tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Generate Test Cases

    342164796/generate-test-cases

    自主学习型测试文档生成器。从需求文档(Markdown)生成测试用例 XMind 文件,支持持久化记忆和持续学习。当用户提到"生成测试用例"、"根据需求生成测试"时触发。

    119 GitHub starsUsed in 1 repo~2.9k tokens
    Testing & QAAuto-check passed
  • Verify Cc Safety Net

    kenryu42/cc-safety-net

    Launch and drive the real cc-safety-net CLI — the hook decision path, explain, status/doctor, logs, and the local policy GUI — against an isolated home, capturing evidence.

    1.6k GitHub stars~2k tokensUpdated today
    Testing & QAAuto-check passed
  • Wio

    workersio/skills

    Testing workflow skill for finding high-value test candidates, writing focused tests, generating realistic workloads, reviewing test value, and diagnosing test-suite health.

    190 GitHub stars~5.8k tokensUpdated 2 mo ago
    Testing & QAAuto-check passed
  • File Server

    microsoft/WindowsProtocolTestSuites

    Official

    ALWAYS LOAD THIS SKILL when working with FileServer, SMB, SMB2, SMB3, CIFS, file sharing, MS-SMB2, MS-FSCC, MS-FSA, MS-DFSC, MS-FSRVP, MS-RSVD, MS-SQOS, or any file server protocol test…

    567 GitHub stars~4.1k tokensUpdated 23 days ago
    Testing & QAAuto-check passed

More from TheDecipherist/claude-code-mastery-project-starter-kit

All 24 skills in this repo
  • Create Service

    TheDecipherist/claude-code-mastery-project-starter-kit

    Scaffold a new microservice that follows the project's server/handlers/adapters architecture.

    338 GitHub stars~1.8k tokensUpdated 3 mo ago
    Auto-check: notes
  • CSS Structure

    TheDecipherist/claude-code-mastery-project-starter-kit

    Where CSS should live. An agent skill from TheDecipherist/claude-code-mastery-project-starter-kit.

    338 GitHub stars~1k tokensUpdated 3 mo ago
    Auto-check passed
  • Docker

    TheDecipherist/claude-code-mastery-project-starter-kit

    Production Docker best practices for writing Dockerfiles, Compose files, and Swarm stacks.

    338 GitHub stars~1.6k tokensUpdated 3 mo ago
    Auto-check: notes
  • Docker Swarm

    TheDecipherist/claude-code-mastery-project-starter-kit

    Production Docker Swarm deployment rules: what changes when a compose file goes from a single node to a multi-node Swarm.

    338 GitHub stars~1.8k tokensUpdated 3 mo ago
    Auto-check passed
  • Mongodb Backups

    TheDecipherist/claude-code-mastery-project-starter-kit

    Production MongoDB backup and restore practices that the documentation gets wrong.

    338 GitHub stars~1.3k tokensUpdated 3 mo ago
    Auto-check passed
  • Mongodb Replica Sets

    TheDecipherist/claude-code-mastery-project-starter-kit

    Production MongoDB replica-set operation: topology, durability, host tuning, and the container-specific gotchas Claude gets wrong.

    338 GitHub stars~1.6k tokensUpdated 3 mo ago
    Auto-check passed

Categories

Questions about Test Writer

What does Test Writer do?

Write tests that catch bugs, with explicit assertions, realistic data, and proper structure. Test Writer is an agent skill from TheDecipherist/claude-code-mastery-project-starter-kit. Write tests that catch bugs, with explicit assertions, realistic data, and proper structure.

When should I use Test Writer?

Test Writer fits situations like: tasks that involve Test generation.

How do I install Test Writer in Claude Code?

Run `npx skills add TheDecipherist/claude-code-mastery-project-starter-kit --skill test-writer -a claude-code`. Or copy the skill folder (.claude/skills/test-writer in TheDecipherist/claude-code-mastery-project-starter-kit) into .claude/skills/test-writer in your project. Claude Code loads it when a task matches its description.

How do I install Test Writer in Codex?

Run `npx skills add TheDecipherist/claude-code-mastery-project-starter-kit --skill test-writer -a codex`. Or copy the skill folder (.claude/skills/test-writer in TheDecipherist/claude-code-mastery-project-starter-kit) into .agents/skills/test-writer in your project. Codex loads it when a task matches its description.

Can I use Test Writer in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add TheDecipherist/claude-code-mastery-project-starter-kit --skill test-writer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/test-writer, .gemini/skills/test-writer, .github/skills/test-writer and .opencode/skills/test-writer in your project.

What does Test Writer need to run?

SKILL.md names no scripts, command-line tools or credentials: Test Writer is instructions for the agent only. Its frontmatter pre-approves these tools: Read, Write, Grep, Glob, Bash.

Does Test Writer access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Test Writer safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Test Writer use?

Test Writer is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Test Writer use?

About 767 tokens (SKILL.md is roughly 3.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Test Writer?

Skills that share tags, products or a category with Test Writer: Emc (aklofas/kicad-happy, 1.4k stars), Swig Test (swig/swig, 6.3k stars), Generate Test Cases (342164796/generate-test-cases, 119 stars) and Verify Cc Safety Net (kenryu42/cc-safety-net, 1.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Test Writer?

TheDecipherist (a GitHub user) maintains it in TheDecipherist/claude-code-mastery-project-starter-kit, which has 338 GitHub stars. The repository holds 24 skills in this directory. The repository was last updated on June 29, 2026.

Source: TheDecipherist/claude-code-mastery-project-starter-kit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.