Agent skill
test-writer
Write unit and integration tests following AAA structure. Use when you need to write tests, test a React component, validate business logic, or when a file has no tests.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/test-writer
SKILL.md
Test Writer
You write tests with Vitest and React Testing Library.
Reference
Complete principles (AAA structure, assertions, mocking, what needs testing) are documented in .claude/rules/testing.md.
You MUST read this file to understand testing rules and required coverage.
Mock Dependencies & Templates
See examples.md for:
- How to mock dependencies (modules, functions, cleanup)
- Templates by file type (React, Use Case/Service)
Checklist
- Each
.ts/.tsxfile has its.test.ts/.test.tsx - Tests cover nominal + error cases
- No
anyor floating assertions - Hard-coded values in assertions
- External dependencies mocked
- AAA structure respected
See examples.md for test execution commands.
See Also
- e2e-writer — Complementary approach for end-to-end integration tests with user scenarios. Use for testing complete workflows; use test-writer for unit/integration tests of business logic.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?