msw

msw is a skill for Claude Code, Codex from PyModel/react-frontend-skills. It costs 12 tokens per session (1,264 once invoked), scanned A, original, MIT.

A guide to MSW v2, a tool that intercepts network requests and returns planned responses during development and testing.

In plain words
What is it for?
Use it when setting up request handlers, mocking REST or GraphQL APIs, isolating tests, checking request matching, or debugging mock responses.
Why use it?
It lets tests cover successful responses, errors, and edge cases without depending on a live REST or GraphQL service.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when setting up request handlers, mocking REST or GraphQL APIs, isolating tests, checking request matching, or debugging mock responses.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/pymodel/react-frontend-skills/msw
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add PyModel/react-frontend-skills --skill msw
Clone the repo
git clone --depth 1 https://github.com/PyModel/react-frontend-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for msw

README.md
[![agentmods](https://agentmods.dev/badge/skills/pymodel/react-frontend-skills/msw/github.svg)](https://agentmods.dev/skills/pymodel/react-frontend-skills/msw)
Your own site
<a href="https://agentmods.dev/skills/pymodel/react-frontend-skills/msw"><img src="https://agentmods.dev/badge/skills/pymodel/react-frontend-skills/msw/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for msw

Your own site · 80×15
<a href="https://agentmods.dev/skills/pymodel/react-frontend-skills/msw"><img src="https://agentmods.dev/badge/skills/pymodel/react-frontend-skills/msw.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 12 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,264 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00012 $0.01264
Opus 5.5 $0.00005 $0.00506
Sonnet 5.5 $0.00002 $0.00253
Haiku 4.5 $0.00001 $0.00126

Measured 20d ago against content hash 73cb20d7e0e2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

msw scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 20d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/msw/SKILL.md · 122 lines

How it starts

The opening of the file, as written. The whole thing — 122 lines — stays where its author put it; the contents beside it link to each section on GitHub.

MSW Best Practices

Comprehensive API mocking guide for MSW v2 applications (current: MSW 2.15), designed for AI agents and LLMs. Contains 48 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.

When to Apply

Reference these guidelines when:

  • Setting up MSW for testing or development
  • Writing or organizing request handlers
  • Configuring test environments with MSW
  • Mocking REST or GraphQL APIs
  • Debugging handler matching issues
  • Testing error states and edge cases

Rule Categories by Priority

Priority Category Impact Prefix
1 Setup & Initialization CRITICAL setup-
2 Handler Architecture CRITICAL handler-
3 Test Integration HIGH test-
4 Response Patterns HIGH response-
5 Request Matching MEDIUM-HIGH match-
6 GraphQL Mocking MEDIUM graphql-
7 Advanced Patterns MEDIUM advanced-
8 Debugging & Performance LOW debug-

Quick Reference

1. Setup & Initialization (CRITICAL)

  • setup-server-node-entrypoint - Use correct entrypoint for Node.js (msw/node)
  • setup-lifecycle-hooks - Configure server lifecycle in test setup
  • setup-worker-script-commit - Commit worker script to version control
  • setup-node-version - Require Node.js 18+ for MSW v2
  • setup-unhandled-requests - Configure unhandled request behavior
  • setup-typescript-config - Configure TypeScript for MSW v2

2. Handler Architecture (CRITICAL)

  • handler-happy-path-first - Define happy path handlers as baseline
  • handler-domain-grouping - Group handlers by domain
  • handler-absolute-urls - Use absolute URLs in handlers
  • handler-shared-resolvers - Extract shared response logic into resolvers
  • handler-v2-response-syntax - Use MSW v2 response syntax
  • handler-request-body-parsing - Explicitly parse request bodies
  • handler-resolver-argument - Destructure resolver arguments correctly
  • handler-reusability-environments - Share handlers across environments

Read the full file on GitHub · 122 lines

Files

What ships with it

48 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 20d ago Changed · -34 tokens per session 73cb20d7e0e2
  2. 27d ago Changed · +3 lines 7497647398f3
  3. 1mo ago First seen · 119 lines · 46 tokens per session scan A bd70ee7158b3

Subscribe to this mod's changes

msw is a skill published in the GitHub repository PyModel/react-frontend-skills (37 stars, last pushed 3d ago), licensed MIT. It adds 12 tokens to every session and 1,264 once invoked, about $0.0000 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

lov-atom-feature-dev

An end-to-end workflow for building a small, self-contained feature across its shared core, command-line tool, API, user interface, saved parameter presets, agent tool, and debugging panel. It uses one contract and shared test cases across the pieces.

lovstudio/skills · 62 tokens

lov-runtime-verification

Verify client runtime fixes on actual desktop builds, physical iOS/Android devices, React Native/Flutter hosts, and deployed Web/PWA browsers with comparable workloads and lifecycle checks.

lovstudio/skills · 40 tokens

lov-wechat-parity-validation

A review workflow for checking whether a WeChat compatibility fix works across data parsing, shared meaning, interfaces, downstream uses, and the real user path. It treats regression checks as proof that the fix is complete.

lovstudio/skills · 58 tokens

lov-fix-until-no-error

A verification-focused debugging workflow that repeatedly runs specified checks, fixes the highest-priority failure, and stops when the checks pass or a genuine external blockage remains.

lovstudio/skills · 48 tokens

lov-atom-operations

A checklist and implementation workflow for making a completed feature ready to explain, test, find, authorize, sell, measure, and maintain. It decides which supporting work applies instead of adding every integration by default.

lovstudio/skills · 62 tokens

lov-atom-core-sdk

A shared software core and typed SDK that contain the feature's main rules, validation, defaults, state changes, and side effects. Command-line tools, APIs, pages, and agent tools can call this core instead of implementing those rules again.

lovstudio/skills · 55 tokens