What problem does it solve?
Test suites often accumulate duplicated initialization, cleanup, fixtures, and mock configuration across files, making maintenance costly and hiding real test intent. This Skill provides a disciplined workflow to identify genuinely repeated lifecycle behavior and move it to the narrowest shared owner without weakening isolation or hiding scenario-specific state.
Core Features & Use Cases
- Duplication Analysis: Classifies repeated setup by owned state, lifetime, scope, and intentional differences before treating similar code as duplicates.
- Runner-Specific Guidance: Ships dedicated references for Vitest (setup files, module mocks, vi.mock hoisting) and Playwright (fixtures, worker scope, global setup/teardown).
- Safe Migration Workflow: A six-step process (discover, classify, challenge, place, migrate, prove) that removes suspected cargo-cult setup first and validates with full suite runs.
- Use Case: When dozens of Vitest files repeat the same mock reset and environment setup, use this Skill to determine whether the behavior belongs in vitest.setup.ts, a scoped fixture, or should stay local, then migrate one responsibility at a time.
Quick Start
Ask the AI to consolidate the repeated test setup across the test files in this repository using the consolidating-test-setup workflow.