test
Use for multi-modal test generation — unit, integration, e2e, property-based, mutation. Sub-modes pick the right shape per intent. Different from /tdd (which is the discipline) — /test is the production tool.
What this skill does
# test
Multi-modal test generation. Picks the right shape per the intent.
## Sub-modes
| Mode | When | Tool / pattern |
|---|---|---|
| `unit` | bounded function/class | vitest / jest / pytest |
| `integration` | multi-component flow | API client → real downstream / DB |
| `e2e` | user-facing happy path | Playwright / Cypress / WebDriver |
| `property` | universal contracts | fast-check / hypothesis / proptest |
| `mutation` | test-quality audit | stryker / mutmut |
| `coverage` | gap-finding | c8 / istanbul + threshold review |
| `bulk` | Salesforce 200+ record paths | Apex test class |
## When this differs from /tdd
- `/tdd` — discipline (red-green-refactor, refuse production code without failing test)
- `/test` — production tool (generate tests for existing or new code, in any of the above modes)
Use both together: TDD for new behaviour; `/test` for filling coverage gaps or generating integration scaffolds.
## Method
1. **Pick mode** (or detect from intent).
2. **Read target.** Function signature, callers, existing test style in the repo.
3. **Behaviour enumeration.** For each public behaviour:
- Happy path
- Edge cases (empty, null, boundary)
- Error cases
- State transitions
4. **Generate tests** in the project's existing style (extracted from neighbouring tests).
5. **Mocking decisions:**
- Boundary I/O (network, time, randomness, file): mock
- Internal pure logic: don't mock
- Database in integration tests: real DB, not mock
6. **Run.** All pass. Mutation-test sample: each test should fail when implementation is broken.
7. **Coverage report.** Gaps named explicitly.
## Output shape
```
Mode: unit
Target: src/auth/middleware.ts:authenticate
Behaviours covered:
✓ valid token → next() called
✓ missing token → 401
✓ expired token → 401
✓ malformed token → 400
✓ revoked token → 401
✓ token with tampered sig → 401
Tests added:
tests/auth/middleware.test.ts:14 — valid token
tests/auth/middleware.test.ts:34 — missing token
...
Mocking:
- mocked: jwt.verify (boundary)
- not mocked: token-format validation (internal pure)
Verification:
✓ all 6 tests pass
✓ mutation-test sample: each fails when authenticate() is broken
Coverage delta: +12% lines, +8% branches on auth/
Captured: <memory id>
```
## Rules
- **Behaviour-named tests** ("should reject expired token" not "test_expired").
- **Mutation-test sanity** — sample 1-2 tests; verify they fail with broken implementation.
- **Match project style** — vitest? jest? Apex `@IsTest`? Don't reinvent.
- **Don't mock the thing under test.**
- **Salesforce: 200-record bulk-safety pattern** for triggers / DML code.
## Anti-patterns
- Generated tests that all pass regardless of implementation (fake coverage)
- Mocking internals (test does nothing)
- Implementation-detail assertions (`expect(x).toHaveBeenCalledWith(...)` for private methods)
- Coverage chasing without behaviour mapping
## When NOT to use
- Pure red-green-refactor — `/tdd` skill
- Property-based on integer math when unit is enough — overkill
- Generated code (codegen output) — test the inputs, not the gen
## Subagent dispatch
- `tester` agent for the structured pass
- `Explore` to find existing test style
- `Bash` for mutation-test invocation
## Value over native CC
CC will write tests. CC won't naturally pick the mode, enforce mutation-test sanity, or refuse to mock internals. The mode-aware + discipline framing IS the value.
Related in Code Review
gstack
IncludedFast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)
startup-due-diligence
IncludedLegal due diligence review for seed-stage and Series A startups (US, Delaware C-Corp focus). Supports both investor and founder perspectives. Capabilities include: (1) Interactive document review and issue spotting; (2) Document request list generation; (3) Cap table and SAFE/convertible note analysis; (4) Red flag identification with severity ratings; (5) Diligence report generation. TRIGGERS: due diligence, DD, startup investment, cap table review, Series A, seed round, investor diligence, legal review startup, SAFE analysis, convertible note, 409A, founder vesting.
interview-master
IncludedThis skill should be used when the user asks to "generate interview questions", "prepare for interview", "optimize resume", "conduct mock interview", "analyze git commits for resume", "generate resume from code", "review my resume", or mentions interview preparation, career assistance, or extracting project experience from git history. Provides comprehensive interview and career development guidance for both job seekers and interviewers.
fix-issue
IncludedFixes GitHub issues using parallel analysis agents for root cause investigation, code exploration, and regression detection. Reads issue context from gh CLI, searches codebase and memory for related patterns, generates a fix with tests, and links the resolution back to the issue via PR. Includes prevention analysis to avoid recurrence. Use when debugging errors, resolving regressions, fixing bugs, or triaging issues.
sf-apex
IncludedGenerates and reviews Salesforce Apex code with 150-point scoring. TRIGGER when: user writes, reviews, or fixes Apex classes, triggers, test classes, batch/queueable/schedulable jobs, or touches .cls/.trigger files. DO NOT TRIGGER when: LWC JavaScript (use sf-lwc), Flow XML (use sf-flow), SOQL-only queries (use sf-soql), or non-Salesforce code.
swift-development
IncludedComprehensive Swift development for building, testing, and deploying iOS/macOS applications. Use when Claude needs to: (1) Build Swift packages or Xcode projects from command line, (2) Run tests with XCTest or Swift Testing framework, (3) Manage iOS simulators with simctl, (4) Handle code signing, provisioning profiles, and app distribution, (5) Format or lint Swift code with SwiftFormat/SwiftLint, (6) Work with Swift Package Manager (SPM), (7) Implement Swift 6 concurrency patterns (async/await, actors, Sendable), (8) Create SwiftUI views with MVVM architecture, (9) Set up Core Data or SwiftData persistence, or any other Swift/iOS/macOS development tasks.