Generate tests for code — use when asked to write tests, create a test suite, add test coverage, or generate unit/integration tests for a file or module.
From devkitnpx claudepluginhub 5uck1ess/devkitThis skill uses the workspace's default tool permissions.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Sorts ECC skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using repo evidence like file extensions and configs. Creates trimmed install plan for project-specific needs.
Generate tests for target code, run them, and iterate until they pass.
Read the target files and detect:
If test framework isn't obvious, check package.json, pyproject.toml, go.mod, Cargo.toml, etc.
Spawn the test-writer agent:
Task: Generate comprehensive tests for {target}.
Agent: test-writer
Context:
- Target: {target}
- Framework: {detected_framework}
- Existing test patterns: {patterns}
- User instructions: {args}
The test-writer should:
{test_command} 2>&1
If tests fail, send failures back to the test-writer agent to fix. Repeat up to 3 times.
## Test Generation Report
**Target:** {target}
**Framework:** {framework}
**Tests created:** {count}
**Status:** all passing ✓ / {n} failing ✗
### Files Created
- tests/test_parser.py (12 tests)
- tests/test_api.py (8 tests)
### Coverage
- Lines: {line_coverage}%
- Branches: {branch_coverage}%
### Run
{test_command}
/devkit:test-gen src/parser.ts
/devkit:test-gen lib/ --focus "error handling"
/devkit:test-gen src/api/ --unit-only