specwright/templates/skills/testing-strategies/SKILL.md
--- name: [PROJECT]-testing-strategies description: [PROJECT] testing patterns and quality assurance strategies globs: ["**/*.{test,spec}.{ts,js,java,py,rb}", "**/test/**/*", "**/tests/**/*"] --- # Testing Strategies > **Template for project-specific testing strategies skill** > Fill in [CUSTOMIZE] sections with your project's testing stack and patterns **Project**: [PROJECT NAME] **Last Updated**: [DATE] --- ## Testing Philosophy **Coverage Target**: [CUSTOMIZE: 80% / 85% / 90%] **Testin
npx skillsauth add michsindlinger/specwright specwright/templates/skills/testing-strategiesInstall 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.
Template for project-specific testing strategies skill Fill in [CUSTOMIZE] sections with your project's testing stack and patterns
Project: [PROJECT NAME] Last Updated: [DATE]
Coverage Target: [CUSTOMIZE: 80% / 85% / 90%]
Testing Pyramid:
[CUSTOMIZE: Adjust ratios for your project]
/\
/E2E\ <- [5-10%] Critical flows
/------\
/Integr.\ <- [20%] API endpoints, DB
/----------\
/ Unit \ <- [70%] Functions, components
/--------------\
Test Framework: [CUSTOMIZE: JUnit 5 / Jest / Pytest / RSpec / Go testing]
Mocking Library: [CUSTOMIZE: Mockito / sinon / unittest.mock / RSpec mocks / gomock]
Assertion Library: [CUSTOMIZE: JUnit assertions / expect / assert / should]
Pattern: [CUSTOMIZE: AAA / Given-When-Then / Arrange-Act-Assert]
Example - Service Test:
[CUSTOMIZE: Show service unit test pattern]
Examples:
- JUnit 5:
@Test
void getUserById_ExistingId_ReturnsUser() {
// Arrange
when(repository.findById(1L)).thenReturn(Optional.of(user));
// Act
UserDTO result = service.getUserById(1L);
// Assert
assertEquals("John", result.name());
}
- Jest:
it('getUserById returns user when exists', async () => {
repository.findById.mockResolvedValue(user)
const result = await service.getUserById(1)
expect(result.name).toBe('John')
})
Service Layer:
Repository Layer:
Test Framework: [CUSTOMIZE: Jest / Vitest / Jasmine/Karma]
Component Testing: [CUSTOMIZE: React Testing Library / Angular Testing Library / Vue Test Utils]
User Interaction: [CUSTOMIZE: @testing-library/user-event / Jasmine click() / @testing-library/vue]
Philosophy: [CUSTOMIZE: Test user behavior / Test implementation / Test contracts]
Example - Component Test:
[CUSTOMIZE: Show component test pattern]
Examples:
- React Testing Library:
it('renders user list and handles click', async () => {
render(<UserList users={mockUsers} onSelect={mockFn} />)
await userEvent.click(screen.getByText('John'))
expect(mockFn).toHaveBeenCalledWith(mockUsers[0])
})
Components:
Framework: [CUSTOMIZE: Spring Test / Supertest / TestClient / request specs]
Database: [CUSTOMIZE: TestContainers / In-memory H2 / Rollback / Test database]
Example - API Endpoint Test:
[CUSTOMIZE: Show API integration test]
Examples:
- Spring Boot:
@Test
void createUser_ValidData_Returns201() {
ResponseEntity<UserDTO> response = restTemplate.postForEntity(
"/api/users", request, UserDTO.class
);
assertEquals(HttpStatus.CREATED, response.getStatusCode());
}
- Supertest:
it('POST /api/users creates user', async () => {
const res = await request(app).post('/api/users').send(data)
expect(res.status).toBe(201)
})
API Endpoints:
E2E Framework: [CUSTOMIZE: Playwright / Cypress / Selenium / Puppeteer]
Browser Coverage: [CUSTOMIZE: Chrome / Chrome + Firefox + Safari / Chrome only]
Organization: [CUSTOMIZE: Page Object Model / Direct interaction / Custom abstraction]
Example - E2E Test:
[CUSTOMIZE: Show E2E test pattern]
Examples:
- Playwright:
test('user can create account', async ({ page }) => {
await page.goto('/signup')
await page.fill('[name="email"]', '[email protected]')
await page.fill('[name="password"]', 'password123')
await page.click('button:has-text("Sign Up")')
await expect(page.locator('text=Welcome')).toBeVisible()
})
[CUSTOMIZE - LIST PROJECT CRITICAL FLOWS]
[Flow Name]: [Description]
[Flow Name]: [Description]
Location: [CUSTOMIZE: src/test/resources / tests/fixtures / test/fixtures]
Format: [CUSTOMIZE: JSON / YAML / SQL / Code]
Example:
[CUSTOMIZE: Show test data structure]
Strategy: [CUSTOMIZE: Rollback / Clean + Seed / Snapshot + Restore]
Example:
[CUSTOMIZE: Show database setup/teardown]
[CUSTOMIZE WITH PROJECT GUIDELINES]
Always Mock:
Never Mock (use real):
Backend:
[CUSTOMIZE: Show mocking pattern]
Examples:
- Mockito: when(service.getUser()).thenReturn(user)
- Jest: service.getUser = jest.fn().mockResolvedValue(user)
Frontend API Mocking:
[CUSTOMIZE: MSW / nock / HttpClientTestingModule / fetch-mock]
Overall: [CUSTOMIZE: 80% / 85% / 90%]
Per Component Type:
[CUSTOMIZE - AREAS TO SKIP]
Skip coverage for:
Backend Unit Tests:
[CUSTOMIZE: mvn test / npm test / pytest / rspec / go test]
Frontend Unit Tests:
[CUSTOMIZE: npm test / ng test / vitest]
Integration Tests:
[CUSTOMIZE: mvn verify / npm run test:integration / pytest tests/integration]
E2E Tests:
[CUSTOMIZE: npx playwright test / npm run e2e / cypress run]
Coverage Report:
[CUSTOMIZE: mvn jacoco:report / npm run test:coverage / pytest --cov]
[CUSTOMIZE WITH PROJECT GATES]
Before deployment:
Where Tests Run: [CUSTOMIZE: GitHub Actions / GitLab CI / Jenkins]
Parallelization:
[CUSTOMIZE: Show how tests run in parallel in CI]
Example:
jobs:
backend-tests:
runs-on: ubuntu-latest
steps: [...]
frontend-tests:
runs-on: ubuntu-latest
steps: [...]
Strategy: [CUSTOMIZE: Fail fast / Retry / Notify]
[CUSTOMIZE - ADD DETECTED OR CHOSEN PATTERNS]
Customization Complete: Replace all [CUSTOMIZE] sections with project-detected or chosen patterns.
Auto-generated by: /add-skill testing-strategies command
tools
Session Handoff: Erstellt eine vollständige Zusammenfassung der aktuellen Session für einen sauberen Kontextwechsel. NUR bei explizitem Aufruf (/session-handoff). NICHT automatisch auslösen. Geeignet wenn der User die Session resetten will, den Kontext aufräumen will, oder bei ~120k Tokens angelangt ist.
development
Pre-Mortem Risk Analysis: Strukturierte Prospective-Hindsight-Übung um launch-blocking Risiken vor Commitment aufzudecken. Team stellt sich vor, das Produkt sei 14 Tage nach Launch gefloppt, und arbeitet rückwärts. Klassifiziert Risiken in Tigers (echt), Paper Tigers (hypothetisch), Elephants (unausgesprochen). Nutze diesen Skill vor Build-Commitment, bei zu hoher Stakeholder-Confidence, vor Major-Releases, oder wenn das Team vage Sorgen nicht artikulieren kann. Trigger: /pre-mortem, 'pre-mortem', 'risk analysis', 'was könnte schiefgehen', 'risiken vor launch'.
testing
Six-Sigma Atomicity Validator for create-spec stories
tools
UX pattern definition guidance for navigation, user flows, interactions, and accessibility