# Test Writer

> Generate tests that match the project's existing test patterns and framework

- Skill: `claudifytech/test-writer` (Agent Skill)
- Install (CLI): `npx skillmds@latest add claudifytech/test-writer`
- Raw SKILL.md: https://api.skillmd.com/api/skills/claudifytech/test-writer/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: claudifytech (https://skillmd.com/u/claudifytech)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/claudifytech/test-writer

---


# Test Writer

Write tests for a target file or function that fit how the project already tests things.

## When to use
When the user asks to add tests, improve coverage, or test a specific module.

## Procedure
1. Find the project's test setup before writing anything:
   - Look for existing test files (`*.test.*`, `*.spec.*`, a `tests/` or `__tests__/` folder).
   - Identify the framework and assertion style from those files, for example Vitest, Jest, Pytest, or Go testing.
   - Note the project's patterns: how it names tests, sets up fixtures, and mocks dependencies.
2. Read the code under test fully. List the behaviors worth covering: the happy path, each branch, boundary values, and error handling.
3. Write tests that mirror the existing patterns exactly. Do not introduce a new framework or style.
4. Cover the cases from step 2. Prefer a few clear, meaningful tests over many shallow ones.
5. Run the tests. If any fail, decide whether the test or the code is wrong, fix the right one, and re-run until green or until you have a genuine finding to report.

## Notes
- Match the project, do not impose your own preferences.
- A test that always passes is worse than no test. Each test should be able to fail for a real reason.

