U
unit-test-task-generator
About unit-test-task-generator
A planning skill that creates task files for backend unit and HTTP integration tests tied to a feature. It uses existing implementation tasks and requirements data models to define component scenarios, mandatory test patterns, dependencies, and run commands.
Key features
- 01Plans unit and HTTP integration tests
- 02Covers requests, services, models, and controllers
- 03Includes tenant-isolation scenarios
- 04Links test tasks to implementation tasks
- 05Specifies test files and run commands
Use cases
- 01Plan backend tests for a feature
- 02Add cross-tenant checks to CRUD test plans
- 03Prepare test tasks before implementation
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ nextstage-brasil/ skills --skill unit-test-task-generatorAfter installing, type/unit-test-task-generatorin Claude Code to confirm it loaded.
Bundled filesevals/evals.json
Details
From the project READMEUnit Test Task Generator
Create task-NNN-*.md for backend unit and HTTP integration tests covering a Feature.
Boundary
- Planning: this skill (task markdown)
- Execution: implement tests per task — use
create-backend-testsor implementation workflow
Harness discovery
Load {harness}/rules/backend-tests-rules.mdc and backend-rules.mdc when present.
Inputs
- Feature to cover
- List of backend implementation tasks already generated
requirements.mddata model
Test pyramid (backend)
[ E2E ] ← e2e-test-generator
[ Integration ] ← Controller/HTTP tests
[ Unit tests ] ← Service, FormRequest, Model, Rules
What to test
| Component | Type | Focus |
|---|---|---|
| FormRequest | Unit | Valid/invalid fields, tenant FK rules |
| Service | Unit | Business logic, mocks |
| Model | Unit | Scopes, casts, relations |
| Controller | Integration | Status, response shape, auth, 401/403 |
| Tenant scope | Integration | Cross-tenant P0 — never 200 for other company |
Output structure
See factory pattern in skill body — include:
- Summary and detailed test plan (not duplicate)
- Backend root —
{product_root}/backend/(monorepo) or detected brownfield path - Files under
tests/Unit/andtests/Feature/ - Scenario checklists per component
- Mandatory patterns: RefreshDatabase, factories, response shape, cross-tenant cases
- Run command —
vendor/bin/phpunit --testdox --stop-on-failure --stop-on-errorin Docker with 120s timeout (seecreate-backend-tests) - Bootstrap note when project has no
tests/yet: executor must runcreate-backend-testsPhase 0 before test classes
Dependencies
Task must reference task-NNN.md of the backend implementation it covers.
Rules
- Happy-path-only tasks for tenant-scoped CRUD are incomplete without cross-tenant P0
- Do not point tests at production database
- Match project's test runner commands — PHPUnit:
vendor/bin/phpunit --testdox --stop-on-failure --stop-on-errorin Docker, 120s timeout
Related skills
task-generator— implementation tasks firstcreate-backend-tests— execution and bootstrape2e-test-generator— UI coverage
Comments
Markdown supported