Skip to content
Back to skills

Write Tests

ASecurity

Writes tests for a named file or function in your existing test style, runs them and reports what they cover and what they miss.

  • 3 stars
  • 0 votes
  • 1 copy
  • 7 views
  • Added November 15, 2026
ai-agents

Security analysis

A100/100

Scanned November 15, 2026

npx -y skills add workspace-templates/ai-agent-templates --skill write-tests --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Write Tests?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Write Tests
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/workspace-templates-write-tests/badge)](https://www.skillsdirectory.com/skills/workspace-templates-write-tests)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: write-tests
description: Writes tests for a named file or function in your existing test style, runs them and reports what they cover and what they miss.
argument-hint: "<file or function to test>"
user-invocable: true
disable-model-invocation: true
---

Write tests for: $ARGUMENTS

1. Read the target and what it depends on. Then find the closest existing test file and copy its runner, imports, naming, fixtures and mocking style. Find the test command in package.json, pyproject.toml, Makefile or the CI file.
2. List the behaviors first: the normal path, boundaries (empty, zero, one, maximum), invalid input, error paths, and any ordering or time dependence.
3. Write one test per behavior with a name that states the expectation. Assert on outputs and visible effects, not on internals. Mock only I/O boundaries such as network, clock and filesystem.
4. Run only the new tests. If one fails, decide whether the test or the code is wrong. Never weaken an assertion to get green.
5. Put the file next to the others, following project layout.

Report: the tests added, the command to run them, behaviors deliberately left out, and any real bug found. Ask before changing source code.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.