skills/council/craftsman/testing-strategy/SKILL.md
Use when designing test plans for new features or improving existing test coverage. Covers test pyramid design, coverage targets, quality gates, and test file specifications. Do not use for codebase pattern audits or convention enforcement (use pattern-analysis).
npx skillsauth add dtsong/my-claude-setup testing-strategyInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Design comprehensive test strategies with test pyramid coverage, test file structure, and quality gates.
No user-provided values are used in commands or file paths. All inputs are treated as read-only analysis targets.
From the feature, extract:
/ E2E \ <- Few: critical user paths only (expensive, slow)
/----------\
/ Integration \ <- Some: cross-boundary, API contracts, DB queries
/----------------\
/ Unit Tests \ <- Many: fast, isolated, 80%+ of test count
/--------------------\
For each layer, specify:
| Layer | Test File | Test Cases | Mocks Needed | Priority | |-------|-----------|------------|--------------|----------| | Unit | ... | ... | ... | ... | | Integration | ... | ... | ... | ... | | E2E | ... | ... | ... | ... |
For each test case:
__tests__/, top-level tests/, or .test.ts suffix)describe('ModuleName', () => { it('should ...') }) formatCompaction resilience: If context is compacted mid-task, check the Progress Checklist for completed steps, re-read this Procedure section, and continue from the next incomplete step.
| Layer | Count | Run Time | Mock Strategy | |-------|-------|----------|---------------| | Unit | ... | ... | ... | | Integration | ... | ... | ... | | E2E | ... | ... | ... |
For each test file:
File: src/__tests__/feature.test.ts
Layer: Unit
describe('FeatureName')
it('should handle the happy path')
- Input: ...
- Expected: ...
it('should handle invalid input')
- Input: ...
- Expected: throws/returns error
it('should handle edge case')
- Input: ...
- Expected: ...
Mocks: ExternalService (return mock data)
| Category | Target | Rationale | |----------|--------|-----------| | Business logic | 90%+ | Core value, must be correct | | API handlers | 80%+ | Contract compliance | | UI components | 70%+ | Render + key interactions | | Utilities | 90%+ | Pure functions, easy to test | | Glue/config | Skip | Not worth testing |
development
Use when planning implementation steps, deciding commit format, or structuring development approach. Provides brainstorm-plan-implement flow with conventional commits. Triggers on 'how should I approach this', 'commit format'.
development
Security audit checklist for web applications. Use when reviewing, auditing, or hardening a web app's security posture. Covers rate limiting, auth headers, IP blocking, CORS, security middleware, input validation, file upload limits, ORM usage, and password hashing. Triggers on requests like "review security", "harden this app", "security audit", "check for vulnerabilities", or when building/reviewing API endpoints.
development
Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".
development
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.