OpenSkills
PublishCollections
All skills

OpenSkills

Open registry for Agent Skills. Built on Base.

@getOpenSkills

Product

  • Gallery
  • Collections
  • Publish a skill

Account

  • Dashboard
  • My stars

Learn

  • What is a skill?
  • Content policy

Community

  • X (@getOpenSkills)

Skills are published by the community. Review a skill before giving it to your agent.

© 2026 OpenSkills

Coding#testing#unit-tests#tdd

test-writer

Write focused unit and integration tests for existing code using the project's own test framework and conventions. Use when the user asks to add tests, improve coverage, or write a failing test for a bug.

Author
OpenSkills
Downloads
0 downloads
Updated
Updated Nov 27, 2026
Version
v1 · History
Download

Test Writer

When to use

  • "Add tests for this function / module / endpoint."
  • "Write a test that reproduces this bug."
  • Coverage is low around code the user is about to change.

Process

  1. Learn the project's testing setup first. Find the framework (look at package.json, pyproject.toml, go.mod, existing *_test.* / *.test.* files) and copy the style of the nearest existing test file: imports, fixtures, naming, assertion library.
  2. Read the code under test and list its behaviors: normal results, edge cases, error paths, side effects.
  3. Choose cases (prefer few meaningful tests over many shallow ones):
    • the main happy path,
    • boundaries: empty, zero, one, max, off-by-one, unicode, very long input,
    • invalid input and the error it must raise,
    • every branch that guards money, auth, data loss or security.
  4. Write the tests, then run them. A test that never ran is not done.
  5. For a bug: write the test first, confirm it fails for the right reason, then fix the code and confirm it passes.

Rules

  • Test behavior through the public interface, not private internals.
  • One reason to fail per test; name it after the behavior (returns_empty_list_when_no_matches).
  • Arrange → Act → Assert, with no logic (loops/ifs) inside assertions.
  • Mock only what is slow, random, or external (network, clock, filesystem). Do not mock the code under test.
  • Make tests deterministic: fix seeds, freeze time, avoid sleeps.
  • Never weaken or delete an existing test just to make it pass. If a test really must change, explain the reason to the user.

Output

  • The test file(s), placed where the project keeps tests.
  • The command you ran and its result (pass/fail counts).
  • Any behavior you found that looks like a bug, reported separately — do not silently "fix" it in the test.
Safety check
No issues found

Automatic pattern check — always read a skill before using it.

Install
Each skill is a folder with a SKILL.md inside. Run one command in your terminal:

This project (.claude/skills/test-writer/)

mkdir -p .claude/skills/test-writer && curl -fsSL https://getopenskills.xyz/api/skills/test-writer/raw -o .claude/skills/test-writer/SKILL.md

All projects (~/.claude/skills/test-writer/)

mkdir -p ~/.claude/skills/test-writer && curl -fsSL https://getopenskills.xyz/api/skills/test-writer/raw -o ~/.claude/skills/test-writer/SKILL.md

Skills are published by the community. Read a skill before giving it to your agent.

Reviews

No reviews yet.

Similar skills

webapp-testing
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.
Codingby anthropics/skills
Downloads:0
git-commit-writer
Write clear git commit messages from a diff or a description of the change, following Conventional Commits. Use when the user asks for a commit message, to commit changes, or to clean up commit history wording.
Codingby OpenSkills
Downloads:0
code-reviewer
Review a code diff or file for bugs, security issues, performance problems, and readability, and return prioritized, actionable findings. Use when the user asks for a code review, PR review, or "check my code".
Codingby OpenSkills
Downloads:0
debugger
Find the root cause of a bug systematically: reproduce it, form hypotheses, test them with evidence, then fix and verify. Use when something is broken, a test fails, or the user reports an error or unexpected behavior.
Codingby OpenSkills
Downloads:0
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
Codingby anthropics/skills
Downloads:0