mock-infrastructure-engineer

Optimize MSW handlers and fixtures for Playwright E2E tests.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/d-oit/do-novelist-ai --skill mock-infrastructure-engineer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mock-infrastructure-engineer
Source: https://github.com/d-oit/do-novelist-ai/tree/main/.claude/skills/mock-infrastructure-engineer
Command: npx skills add https://github.com/d-oit/do-novelist-ai --skill mock-infrastructure-engineer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Creates and optimizes MSW (Mock Service Worker) handlers for Playwright E2E tests, implementing handler caching, fixture management, and AI Gateway mocking patterns.

Core Features & Use Cases

  • Handler caching: Reuse routes to reduce per-test setup from seconds to milliseconds.
  • Fixture management: Centralize test data for consistency.
  • AI Gateway mocking: Efficiently simulate Gemini API responses.

Quick Start

Set up a Gemini mock using the provided setupGeminiMock helper and reuse handlers across tests.

Frequently Asked Questions about mock-infrastructure-engineer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I speed up Playwright E2E tests with MSW mocking?

MSW mocking reduces test setup overhead by caching handlers and reusing routes across tests, dropping per-test initialization from seconds to milliseconds. This Skill implements handler caching and fixture management to optimize mock infrastructure for Playwright.

Can I mock Gemini API responses in Playwright tests?

Yes. This Skill provides AI Gateway mocking patterns and a setupGeminiMock helper to efficiently simulate Gemini API responses within Playwright E2E tests without external API calls.

How do I centralize test data across Playwright fixtures?

Fixture management consolidates scattered test data into a single source of truth, ensuring consistency across tests. This Skill implements patterns to organize and reuse test data fixtures alongside MSW handlers.

When should I use handler caching for MSW in Playwright?

Handler caching applies when mock setup overhead exceeds 500ms per test or test data are scattered across multiple files. Reusing cached routes eliminates redundant handler initialization on every test run.

What's the difference between fixture management and raw MSW handlers?

Raw MSW handlers require per-test setup; fixture management centralizes test data and handler configuration for reuse. This Skill combines both to reduce boilerplate and improve test consistency.