Help us improve
Share bugs, ideas, or general feedback.
From prototyping-skills
This skill scaffolds test infrastructure for a prototype monorepo. It should be used when the user asks to "set up tests", "add test infrastructure", "scaffold tests", "generate tests", "write tests", "create test files", "add testing", or after running init-prototype, generate-api, or generate-mcp. It also applies when the user mentions "bun:test", "test setup", "test helpers", "test patterns", or "missing tests".
npx claudepluginhub kjgarza/marketplace-claude --plugin prototyping-skillsHow this skill is triggered — by the user, by Claude, or both
Slash command
/prototyping-skills:generate-testsThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Scaffold test infrastructure for a prototype monorepo. Detect which packages exist
Generates tests for any file type with automatic framework detection, project convention matching, and type-specific routing (React, Vue, Python, Go, Rust, PHP, E2E).
Generates runnable Vitest unit tests and Playwright E2E specs from BDD/Gherkin test cases and scaffold code. Use when creating test implementations from BDD scenarios.
Sets up Vitest testing by detecting project type (React, Node, Hono, Cloudflare Workers), generating config/tests/utilities, adding scripts, and migrating from Jest.
Share bugs, ideas, or general feedback.
Scaffold test infrastructure for a prototype monorepo. Detect which packages exist and generate appropriate test setup for each.
Before scaffolding, detect the existing package structure:
packages/ to identify which packages existpackage.json to determine its type (api, core, mcp, ui, types)Mirror the source structure within each package:
packages/
├── core/
│ └── tests/
│ ├── helpers.ts # Shared test utilities for core
│ └── index.test.ts # Example test file
├── api/
│ └── tests/
│ ├── helpers.ts # Hono test client factory
│ └── routes/
│ └── health.test.ts # Example route test
├── mcp/
│ └── tests/
│ ├── helpers.ts # MCP mock transport
│ └── tools/
│ └── example.test.ts # Example tool test
├── ui/
│ └── tests/
│ └── helpers.ts # React testing utilities
└── types/
└── tests/
└── schemas.test.ts # Schema validation tests
For each detected package, scaffold the appropriate test helpers and example tests.
Read references/scaffold-templates.md for the exact file contents to generate.
| Package | Test Helper | What It Provides |
|---|---|---|
| core | tests/helpers.ts | Shared test context factory |
| api | tests/helpers.ts | createTestClient(app) — Hono test client using app.request() |
| mcp | tests/helpers.ts | createTestMcpClient(server) — MCP client via InMemoryTransport |
| ui | tests/helpers.ts | Placeholder for React Testing Library setup |
| types | tests/schemas.test.ts | Zod schema validation tests |
Each package also gets an example .test.ts file demonstrating the correct bun:test patterns for that package type.
Ensure the root package.json has:
{
"scripts": {
"test": "bun test",
"test:watch": "bun test --watch"
}
}
Append if not already present:
# Run all tests
test:
bun test
# Run tests in watch mode
test-watch:
bun test --watch
# Run tests for a specific package
test-pkg pkg:
cd packages/{{pkg}} && bun test
After scaffolding tests, append a Testing section to each package's CLAUDE.md:
## Testing
- Test files live in `tests/` mirroring the source structure
- Run tests: `bun test` (from package or root)
- Use `superpowers:test-driven-development` when adding new features
- Minimum: one test file per source file with business logic
Verify that .github/workflows/ci.yml includes bun test. If not, add it.
After scaffolding test infrastructure, inform the user:
superpowers:test-driven-development for the TDD workflow when building featuresbun test before every commitdevelopment-workflow skill provides a full checklist bridging scaffolding to developmentFor detailed test patterns and scaffolding templates, consult:
references/scaffold-templates.md — Exact file contents to generate per package typereferences/test-patterns.md — Advanced bun:test patterns: database setup, mocking, snapshots, async, Zod schema testing