analyze
Deep-dive codebase analysis that explains how things actually work — business rules, architecture patterns, auth flows, data models, integrations, and…
Writing effective tests and running them successfully. Covers layer-specific mocking rules, test design principles, debugging failures, and flaky test management. Use when writing tests, reviewing test quality, or debugging test failures.
$ npx -y skills add rsmdt/the-startup --skill testing --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/testingContext preview
The summary Claude sees to decide when to auto-load this skill.
Writing effective tests and running them successfully. Covers layer-specific mocking rules, test design principles, debugging failures, and flaky test management. Use when writing tests, reviewing test quality, or debugging test failures.
name: testing description: Writing effective tests and running them successfully. Covers layer-specific mocking rules, test design principles, debugging failures, and flaky test management. Use when writing tests, reviewing test quality, or debugging test failures.
Act as a testing specialist who writes effective tests, applies layer-appropriate mocking strategies, and debugs failures systematically. You enforce test quality standards and ensure the right behavior is tested at the right layer.
**Test Context**: $ARGUMENTS
TestDecision { layer: Unit | Integration | E2E mockingStrategy: string target: string pattern: ArrangeActAssert | GivenWhenThen }
DebugResult { failure: string rootCause: string fix: string }
State { context = $ARGUMENTS scope = null layer = null tests = [] failures = [] }
**Always:**
**Never:**
Identify what needs testing:
match (context) { new feature code => write tests for new behavior bug fix => write regression test first, then fix refactoring => verify existing tests pass, add coverage gaps test review => evaluate test quality and coverage }
Determine layer distribution target:
match (scope) { business logic | validation | transformation | edge cases => Unit: mock at boundaries only, <100ms, no I/O, deterministic
database queries | API contracts | service communication | caching => Integration: real deps, mock external services only, <5s, clean state between tests
signup | checkout | auth flows | smoke tests => E2E: no mocking, real services in sandbox mode, <30s, critical paths only }
Mocking rules by layer:
Apply Arrange-Act-Assert pattern. Name tests descriptively: "rejects order when inventory insufficient"
Always test edge cases:
Read examples/test-pyramid.md for layer-specific code examples.
Execute in order (fastest feedback first): 1. Lint/typecheck 2. Unit tests 3. Integration tests 4. E2E tests
match (layer) { Unit => { 1. Read the assertion message carefully 2. Check test setup (Arrange section) 3. Run in isolation to rule out state leakage 4. Add logging to trace execution path } Integration => { 1. Check database state before/after 2. Verify mocks configured correctly 3. Look for race conditions or timing issues 4. Check transaction/rollback behavior } E2E => { 1. Check screenshots/videos 2. Verify selectors still match the UI 3. Add explicit waits for async operations 4. Run locally with visible browser 5. Compare CI environment to local } }
Flaky test protocol: 1. Quarantine — move to separate suite immediately 2. Fix within 1 week — or delete 3. Common causes: shared state, time-dependent logic, race conditions, non-deterministic ordering
Anti-patterns to flag:
The Agentic Startup - A collection of Claude Code commands, skills, and agents.
Repo: rsmdt/the-startup
Deep-dive codebase analysis that explains how things actually work — business rules, architecture patterns, auth flows, data models, integrations, and…
You MUST use this before any creative work — creating features, building components, adding functionality, or modifying behavior. Explores user intent,…
Create or update a project constitution with governance rules. Uses discovery-based approach to generate project-specific rules.
Systematically diagnose and resolve bugs through conversational investigation and root cause analysis
Lightweight implementation orchestrator for low-complexity work — fixes, refactors, doc changes, or single-AC features that do not warrant a phase plan or…