Skip to content
Back to skills

Test Writer

ASecurity

Generate unit tests for existing code

  • 205 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 3, 2026
ai-agentsgotestingdatabase

Security analysis

A100/100

Scanned September 3, 2026

npx -y skills add prapaa-ai/agav --skill test-writer --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Test Writer?

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

Security grade badge for Test Writer
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/prapaa-ai-test-writer/badge)](https://www.skillsdirectory.com/skills/prapaa-ai-test-writer)

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: test-writer
description: Generate unit tests for existing code
version: 1.0.0
invocation: both
allowed-tools: read_file write_file grep_search find_files list_directory run_command run_tests
tags:
  - testing
  - quality
---

# Test Writer

Generate comprehensive unit tests for the specified code.

## Instructions

1. Read the target file to understand its exports, functions, classes, and behavior.
2. Detect the project's test framework by checking package.json, config files, or existing test files (e.g., Jest, Mocha, Pytest, Go testing, JUnit).
3. Locate existing tests to match the project's conventions for file placement, naming, and import style.
4. Write tests covering:
   - **Happy paths**: Typical inputs producing expected outputs.
   - **Edge cases**: Empty inputs, boundary values, large inputs, special characters.
   - **Error handling**: Invalid inputs, thrown exceptions, rejected promises, error return values.
   - **State transitions**: Side effects, mutations, event emissions where applicable.
5. Use descriptive test names that state the expected behavior (e.g., "returns empty array when input is null").
6. Mock external dependencies (network, filesystem, databases) rather than calling them.
7. Write the test file to the correct location following project conventions.
8. Run the tests and verify they all pass. If any fail, diagnose and fix the test before finishing.
9. Report a summary of how many tests were written and what they cover.

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.