Start a fresh conversation. Replace the highlighted placeholders.
Use writing-tests to add behavior-focused unit and integration tests for [module or file], covering public behavior, errors, edge cases, and async paths; mock external dependencies and make the tests pass.
Required inputs
[module or file]
User-approved starter prompt based on a pinned source version; check current skill requirements before running. Task evidence ↗
SKILL.md
name: writing-testsdescription: Analyze existing code and write comprehensive unit and integration tests for it. Detects the test framework, identifies untested code paths, and generates tests with proper mocking, edge cases, and assertions. Use when the user asks to add tests, improve coverage, or test a specific module.
Writing Tests
Use this skill when the user asks to add tests to existing code, improve test coverage, or write tests for a specific file or module.
Steps
Detect the test setup — check what's already configured:
# Check package.json for test runner
cat package.json | grep -E "jest|vitest|mocha|playwright|cypress"
Look for config files: vitest.config.ts, jest.config.ts, playwright.config.ts, .mocharc.*. Check for existing test files to understand the project's test patterns and conventions.