mcpField
U
unit-test-task-generator

unit-test-task-generator

github.com/nextstage-brasilTesting & quality040 installsUpdated 5d ago
Repository

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

  1. 01Plans unit and HTTP integration tests
  2. 02Covers requests, services, models, and controllers
  3. 03Includes tenant-isolation scenarios
  4. 04Links test tasks to implementation tasks
  5. 05Specifies test files and run commands

Use cases

  1. 01Plan backend tests for a feature
  2. 02Add cross-tenant checks to CRUD test plans
  3. 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-generator

After installing, type/unit-test-task-generatorin Claude Code to confirm it loaded.

Bundled filesevals/evals.json

Details

From the project README

Unit 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-tests or 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.md data model

Test pyramid (backend)

        [ E2E ]  ← e2e-test-generator
     [ Integration ]  ← Controller/HTTP tests
    [ Unit tests ]  ← Service, FormRequest, Model, Rules

What to test

ComponentTypeFocus
FormRequestUnitValid/invalid fields, tenant FK rules
ServiceUnitBusiness logic, mocks
ModelUnitScopes, casts, relations
ControllerIntegrationStatus, response shape, auth, 401/403
Tenant scopeIntegrationCross-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/ and tests/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-error in Docker with 120s timeout (see create-backend-tests)
  • Bootstrap note when project has no tests/ yet: executor must run create-backend-tests Phase 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-error in Docker, 120s timeout

Related skills

  • task-generator — implementation tasks first
  • create-backend-tests — execution and bootstrap
  • e2e-test-generator — UI coverage

Comments

Markdown supported