Scaffolds comprehensive testing setup for Next.js applications including Vitest unit tests, React Testing Library component tests, and Playwright E2E flows with accessibility testing via axe-core. This skill should be used when setting up test infrastructure, generating test files, creating test utilities, adding accessibility checks, or configuring testing frameworks for Next.js projects. Trigger terms include setup testing, scaffold tests, vitest, RTL, playwright, e2e tests, component tests, unit tests, accessibility testing, a11y tests, axe-core, test configuration.
View on GitHubhopeoverture/worldbuilding-app-skills
testing-next-stack
plugins/testing-next-stack/skills/testing-next-stack/SKILL.md
January 21, 2026
Select agents to install to:
npx add-skill https://github.com/hopeoverture/worldbuilding-app-skills/blob/main/plugins/testing-next-stack/skills/testing-next-stack/SKILL.md -a claude-code --skill testing-next-stackInstallation paths:
.claude/skills/testing-next-stack/# Testing Next Stack Scaffold complete testing infrastructure for Next.js applications with modern testing tools. ## Overview To create a comprehensive testing setup for Next.js applications, use this skill to generate: - Vitest configuration for fast unit tests - React Testing Library setup for component testing - Playwright configuration for E2E testing - Accessibility testing with axe-core - Test utilities and helpers - Example test files demonstrating best practices ## When to Use Use this skill when: - Starting a new Next.js project requiring test infrastructure - Migrating from Jest to Vitest - Adding E2E testing with Playwright - Implementing accessibility testing requirements - Creating test utilities for worldbuilding app features (entities, relationships, timelines) - Standardizing testing patterns across projects ## Setup Process ### 1. Analyze Project Structure To understand the project layout, examine: - Package.json for existing dependencies - Next.js version and configuration - TypeScript or JavaScript setup - Existing testing infrastructure - Component architecture ### 2. Install Dependencies Generate package.json additions using `scripts/generate_test_deps.py`: ```bash python scripts/generate_test_deps.py --nextjs-version <version> --typescript ``` Install required packages: - `vitest` - Fast unit test runner - `@testing-library/react` - Component testing utilities - `@testing-library/jest-dom` - Custom matchers - `@testing-library/user-event` - User interaction simulation - `@playwright/test` - E2E testing framework - `@axe-core/playwright` - Accessibility testing - `@vitejs/plugin-react` - Vite React plugin - `jsdom` - DOM implementation for Vitest ### 3. Generate Configuration Files Create configuration files using templates from `assets/`: **Vitest Configuration** (`vitest.config.ts`): - Use template from `assets/vitest.config.ts` - Configure path aliases matching Next.js - Set up test environment (jsdom) - Configure coverage repo