Home
cd ../playbooks
Developer ToolsIntermediate

Test Specialist

Comprehensive JavaScript/TypeScript testing guidance with test writing, bug analysis, coverage analysis, and proactive issue detection.

10 minutes
By AI LabsSource
#testing#jest#playwright#tdd#code-quality#javascript#typescript

Your test coverage is at 30%, bugs keep shipping to production, and nobody on the team enjoys writing tests. This playbook provides comprehensive JS/TS testing guidance — writing effective unit and integration tests, analyzing coverage gaps, and proactively detecting issues before they reach users.

Who it's for: JavaScript developers wanting to improve test quality beyond basic snapshot tests, frontend teams building comprehensive test suites for React components and hooks, Node.js engineers writing integration tests for API endpoints and middleware, tech leads establishing testing standards and coverage requirements for their teams, QA engineers transitioning from manual testing to automated test development

Example

"Add comprehensive tests to our Express API with 30% coverage" → Test specialist pipeline: coverage gap analysis identifying untested critical paths, unit test generation for business logic and utility functions, integration test creation for API endpoints with database mocking, edge case identification for error handling and boundary conditions, and CI configuration for coverage reporting with minimum thresholds

CLAUDE.md Template

New here? 3-minute setup guide → | Already set up? Copy the template below.

Or install from your terminal:
npx ccplaybooks add test-specialist
# Test Specialist

## Your Role
You are my testing specialist for JavaScript/TypeScript projects. Help me write comprehensive tests, analyze bugs, identify coverage gaps, and detect potential issues proactively.

## Core Capabilities

### 1. Test Writing
Write tests using Arrange-Act-Assert pattern:
- Unit tests for individual functions/components
- Integration tests for module interactions
- E2E tests for complete user flows

Get new playbooks like this one

One email a week with new Claude Code workflows. Free, like everything here.

No spam. Unsubscribe anytime.

README.md

What This Does

Complete testing guidance for JavaScript/TypeScript projects. Write unit, integration, and E2E tests. Analyze bugs systematically. Identify coverage gaps. Detect potential issues proactively.


Quick Start

Step 1: Navigate to Your Project

cd ~/your-js-project

Step 2: Download the Template

Click Download above, then:

mv ~/Downloads/CLAUDE.md ./

Step 3: Start Testing

claude

Then ask: "Help me write tests for the user authentication module"


Testing Approach

Arrange-Act-Assert Pattern

describe('UserService', () => {
  it('should create a new user', async () => {
    // Arrange
    const userData = { email: 'test@example.com', name: 'Test' };

    // Act
    const user = await userService.create(userData);

    // Assert
    expect(user.email).toBe('test@example.com');
  });
});

Testing Types

Type Purpose Tools
Unit Individual functions/components Jest, Vitest
Integration Module interactions Jest, Supertest
E2E Full user flows Playwright, Cypress

Example Prompts

Test Writing

  • "Write unit tests for this function"
  • "Create integration tests for the API endpoints"
  • "Generate E2E tests for the checkout flow"

Bug Analysis

  • "Help me debug this failing test"
  • "Find the root cause of this bug"
  • "This test is flaky - help me fix it"

Coverage

  • "Find untested code in this project"
  • "Which files need more test coverage?"
  • "Prioritize what to test next"

Bug Analysis Process

  1. Reproduce: Confirm the issue exists
  2. Isolate: Find the minimal reproduction case
  3. Root Cause: Identify why it happens
  4. Fix: Implement the solution
  5. Validate: Add tests to prevent regression

Common Bug Patterns

Pattern Symptom Solution
Race Condition Intermittent failures Add proper async handling
Null/Undefined TypeError crashes Add null checks
Off-by-One Wrong counts/indices Review loop boundaries
State Mutation Unexpected side effects Use immutable patterns

Test Coverage Strategy

Priority Order:

  1. Critical business logic
  2. Edge cases and error handling
  3. Happy path flows
  4. Integration points
  5. UI components

Security Testing

Include tests for:

  • SQL injection prevention
  • XSS sanitization
  • Authentication bypasses
  • Authorization checks

Tips

  • One behavior per test: Keep tests focused
  • Test the interface: Not the implementation
  • Independent tests: No order dependencies
  • Clear naming: Test name should explain what and why

$Related Playbooks

Developer Tools

Three.js Scroll World Builder

Build a scroll-controlled real-time Three.js experience as one persistent 3D world instead of stacked sections — a scene-ledger data model for authoring chapters, native-scroll-to-deterministic-state mapping with separate exact and smoothed progress, cinematic camera composition, a measurable per-device performance budget, and mandatory reduced-motion and WebGL-failure fallbacks.

20 minutes
Advanced
Developer Tools

Visual Explainer HTML Pages

Have Claude Code explain architectures, diffs and plans as self-contained HTML pages with labeled Mermaid diagrams and a deliberate design pass, instead of walls of chat text, terminal ASCII or generic AI-looking pages.

5 minutes
Intermediate
Developer Tools

Web Animation Design Principles

Design web animations that feel natural and purposeful — a decision-first easing blueprint (ease-out for entrances, ease-in-out for movement, ease for hover), duration and frequency rules, spring configuration, the GPU-only performance rule, and mandatory prefers-reduced-motion accessibility patterns with working CSS and Framer Motion code.

5 minutes
Intermediate
Developer Tools

Web Technique to Skill Extractor

Turn a one-off web visual or interaction technique into a reusable, well-scoped skill — the one-sentence mechanism test that separates a real technique from mere styling, a mechanism-vs-staging sort for what belongs in the skill versus the demo, rules anchored to named failures instead of adjectives, and a demo craft bar that treats the acceptance reference as a target, not inspiration.

10 minutes
Advanced
Developer Tools

Tool Interface Design for Agents

Design agent-facing tools as contracts an agent must infer entirely from the description alone — the consolidation principle over narrow overlapping tools, architectural reduction toward primitives, actionable error-recovery messages, and an 8-point audit checklist.

10 minutes
Advanced
Developer Tools

Vercel Analytics & Speed Insights Setup

Wire up Vercel Analytics, Speed Insights, and SPA routing rewrites into a React/Vite project in one pass — including the routing fix most people miss.

5 minutes
Beginner
Developer Tools

Unslop UI Skill for Claude: Kill the AI Design Tells

A frontend guardrail built from a 3.2M-post Reddit analysis of what people actually call AI slop, with a build mode that forces design decisions up front and an audit mode that scans existing code for the tells

10 minutes
Intermediate
Developer Tools

Tunnel Doctor

Diagnose and fix conflicts between Tailscale and proxy/VPN tools on macOS — route hijacking, proxy env vars, SSH double-tunneling, and the ~60s DNS resolver stall.

15 minutes
Advanced
Developer Tools

Windows RDP Connection Doctor

Diagnose Windows App / AVD / W365 remote-desktop connection quality on macOS — transport selection (UDP Shortpath vs WebSocket), VPN/proxy interference with STUN/TURN, and Shortpath failures from the logs.

15 minutes
Intermediate
Developer Tools

Vibe Coder: Idea to Prototype

Describe what you want to build and get clean, working code with a simple approach explanation, setup instructions, and optional improvements — optimized for shipping over perfecting.

5 minutes
Beginner
Developer Tools

Who Built This Before Me

Check whether your project, tool, library, or product idea has already been built — before you invest a weekend or a quarter in it.

5 minutes
Intermediate
Developer Tools

Vibe Skill Creator

Build world-class Claude skills through a guided 10-step conversation — explore where Claude fails by default, research the domain, draft, self-critique, test on a real scenario, and iterate until the skill actually improves output.

10 minutes
Intermediate

Browse all Developer Tools playbooks →