Msw Skill — Testing skill for Claude Code
AI agent skill for MSW 2.0 — 20 rules: handler design, REST/GraphQL, test patterns.
How to install Msw Skill
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open anivar/msw-skill and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Msw Skill does
AI agent skill for MSW 2.0 — 20 rules: handler design, REST/GraphQL, test patterns. Works with Claude Code, Cursor, Codex, Windsurf.
Alternatives in Testing
- Spec Kitty — Spec-Driven Development for serious software developers 1.6k ★
- Spec Driven Develop — Spec-driven development workflow for AI coding agents: architecture-first planning, task decomposition, GitHub 975 ★
- Spec Kit Zh — 💫 帮助你快速上手规格驱动开发的工具包💫 Toolkit to help you get started with Spec-Driven Development Works seamlessly across al 238 ★
README
MSW Skill
Created by **[Anivar Aravind](https://anivar.net)**
An AI agent skill for writing, reviewing, and debugging MSW (Mock Service Worker) v3 handlers, server setup, and test patterns with modern best practices.
The Problem
AI agents often generate outdated MSW v1 patterns — `rest.get()` instead of `http.get()`, `res(ctx.json(...))` instead of `HttpResponse.json()`, `(req, res, ctx)` instead of `({ request, params })` — and miss critical testing best practices like `server.boundary()` for concurrent tests, `onUnhandledFrame: 'error'`, and proper lifecycle hook setup. These produce code that fails to compile or silently misbehaves at runtime.
This Solution
20 rules with incorrect/correct code examples that teach agents MSW v3's actual API, handler design, server lifecycle, response construction, testing patterns, GraphQL usage, and v1-to-v2 and v2-to-v3 migration. Each rule targets a specific mistake and shows exactly how to fix it.
Install
npx skills add anivar/msw-skill -g
Or with full URL:
npx skills add https://github.com/anivar/msw-skill
Baseline
- msw ^3.0.0
- TypeScript/JavaScript
What's Inside
20 Rules Across 7 Categories
| Priority | Category | Rules | Impact |
|---|---|---|---|
| 1 | Handler Design | 4 | CRITICAL |
| 2 | Setup & Lifecycle | 3 | CRITICAL |
| 3 | Request Reading | 2 | HIGH |
| 4 | Response Construction | 3 | HIGH |
| 5 | Test Patterns | 4 | HIGH |
| 6 | GraphQL | 2 | MEDIUM |
| 7 | Utilities | 2 | MEDIUM |
Each rule file contains:
- Why it matters
- Incorrect code with explanation
- Correct code with explanation
- Decision tables and additional context
6 Deep-Dive References
| Reference | Covers |
|---|---|
handler-api.md |
http.* and graphql.* methods, URL predicates, path params, handler options |
response-api.md |
HttpResponse class, all 7 static methods, cookie handling |
server-api.md |
setupServer/setupWorker |
Related Skills
Zod Testing
AI agent skill for testing Zod schemas — Jest/Vitest patterns, mock data, property-based testing. Works with C
Specross
Spec-driven development (SDD) for AI coding assistants. Slash commands for BA, Dev & QC — one story spec drive
Redux Saga Testing
AI agent skill for testing Redux Sagas — expectSaga, testSaga, providers, Jest/Vitest. Works with Claude Code,
Bugmind
AI bug intelligence for the terminal: turn Arabic/English bug descriptions into structured QA reports, track r
Qflow
驱动的项目管理 MCP 服务器,50 个工具覆盖任务管理、Spec 驱动开发、多 Agent 协作、自动驾驶引擎|AI-powered project management MCP server — 50 tools f
Spec Driven Guide
Spec-driven governance for AI coding agents. A CLI installs AGENTS.md and on-demand skills, so Claude Code, Cu
Related Agents
10x Tool Calls
Cursor and Windsurf meter usage by requests and tool calls rather than tokens, which means a finished or stall
Backend Flow Structuring Agent
Take ONE backend entry point (REST route, GraphQL operation, or queue/event/cron handler) plus its mechanical
Zanix Feature Builder
Adds a feature or artifact (a provider/connector, middleware, REST/GraphQL/socket/SSR handler, job, subscriber