Writing Tests
Principles for writing effective, maintainable tests. Covers naming conventions, assertion best practices, and comprehensive edge case checklists. Based on BugMagnet by Gojko Adzic. Triggers on: writing any test, 'add tests', test review, test naming, assertion choices, edge case coverage, 'what should I test', test structure decisions.
Install
/plugin marketplace add NTCoding/claude-skillzThe repo is a Claude Code plugin marketplace. Run /plugin afterwards to pick the plugin that includes this skill.
npx skills add NTCoding/claude-skillz --skill writing-testsgit clone --depth 1 https://github.com/NTCoding/claude-skillz.git /tmp/claude-skillz
mkdir -p ~/.claude/skills
cp -r /tmp/claude-skillz/writing-tests ~/.claude/skills/writing-testsPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# Writing Tests How to write tests that catch bugs, document behavior, and remain maintainable. > Based on [BugMagnet](https://github.com/gojko/bugmagnet-ai-assistant) by Gojko Adzic. Adapted with attribution. ## Critical Rules 🚨 **Test names describe outcomes, not actions.** "returns empty array when input is null" not "test null input". The name IS the specification. 🚨 **Assertions must match test titles.** If the test claims to verify "different IDs", assert on the actual ID values—not just count or existence. 🚨 **Assert specific values, not types.** `expect(result).toEqual(['First.', ' Second.'])` not `expect(result).toBeDefined()`. Specific assertions catch specific bugs. 🚨 **One concept per test.** Each test verifies one behavior. If you need "and" in your test name, split it. 🚨 **Bugs cluster together.** When you find one bug, test related scenarios. The same misunderstanding often causes multiple failures. ## When This Applies - Writing new tests - Reviewing test quality - During TDD RED phase (writing the failing test) - Expanding test coverage - Investigating discovered bugs ## Test Naming **Pattern:** `[outcome] when [condition]` ### Good Names (Describe Outcomes) ``` returns empty array when input is null throws ValidationError when email format invalid calculates tax correctly for tax-exempt items preserves original order when duplicates removed ``` ### Bad Names (Describe Actions)
Details
- Skill name
writing-tests- Repository
- NTCoding/claude-skillz
- Path
writing-tests/SKILL.md- Repo updated
- 24 March 2026
FAQ
What does the Writing Tests skill do?
Principles for writing effective, maintainable tests. Covers naming conventions, assertion best practices, and comprehensive edge case checklists. Based on BugMagnet by Gojko Adzic. Triggers on: writing any test, 'add tests', test review, test naming, assertion choices, edge case coverage, 'what should I test', test structure decisions.
How do I install the Writing Tests skill?
Claude Code plugin: /plugin marketplace add NTCoding/claude-skillz. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Writing Tests popular?
It lives in NTCoding/claude-skillz, which has 365 GitHub stars and 47 forks.
Related skills
Architect Refine Critique
365NTCoding/claude-skillz
Three-phase design review. Chain architect → refiner → critique subagents. Triggers on: 'design review', 'architecture review', '/arc', system design proposals, significant refactoring decisions, new service or module design.
Challenge That
365NTCoding/claude-skillz
Force critical evaluation of proposals, requirements, or decisions by analyzing from multiple adversarial perspectives. Triggers on: accepting a proposal without pushback, 'sounds good', 'let's go with', design decisions with unstated tradeoffs, unchallenged assumptions, premature consensus. Invoke with /challenge-that.
Concise Output
365NTCoding/claude-skillz
Enforces brevity and signal-over-noise in all outputs. Eliminates verbose explanations, filler phrases, and unnecessary elaboration. Triggers on: every response (governs output length and density when loaded).
Vitest
398JetBrains/skills
Vitest fast unit testing framework powered by Vite with Jest-compatible API. Use when writing tests, mocking, configuring coverage, or working with test filtering and fixtures.
Webapp Testing
193MavCui/Agent-Skills-Hunter
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
Theorist
193blader/theorist
Maintain a per-repo THEORY.MD as a continuously updated narrative of the operating theory behind the current work. Activates EVERY session and stays active throughout the session. Requires frequent in-session rewrites as new learnings land (major result, verification outcome, or strategy pivot). Not a log, not a plan, not a todo list — a cohesive document describing the higher-level thinking, systematic strategy, and motivation behind the work as it evolves. Updated end-to-end (rewritten, not appended) as understanding deepens.
Browse the most popular Claude skills, all testing & qa skills, or write your own with the skills generator.