agentleFS
JasonBoyJasonBoy/msw-mcp/skills/msw-setup/SKILL.md

msw-setup

Skill81 starsChanged 5 months agoMITView on GitHub

Scaffold MSW and @msw-mcp/client in a web project for AI-driven dynamic mocks. Use when the user asks to set up MSW, add mocking to a new app, or migrate an existing MSW project.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. mish-design/skills★ 2same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository4 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 0 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run msw-cli setup in the project root (optional: --framework vite).

    line 14
  2. Very specific:

    Follow the printed setup guide step by step (detect bundler, install deps, create mocks/, env vars, entry point).

    line 15
  3. Very specific:

    Run msw-cli open and set the app's WebSocket URL to the URL from the output.

    line 16
  4. Very specific:

    Run msw-cli status after starting the dev server — confirm connected: true (this only proves the WebSocket bridge, not that the first …

    line 17
  5. Very specific:

    Use msw-cli add (and related commands) to manage mocks at runtime.

    line 19
  6. Very specific:

    Do not duplicate the full setup guide in chat — execute from msw-cli setup output.

    line 21
  7. Very specific:

    Ask permission before npm install / npx msw init (as the guide describes).

    line 25

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

msw-setup

Project scaffolding for MSW + the MCP client bridge. For runtime handler changes after setup, use the msw-cli skill.

Workflow

  1. Run msw-cli setup in the project root (optional: --framework vite).
  2. Follow the printed setup guide step by step (detect bundler, install deps, create mocks/, env vars, entry point).
  3. Run msw-cli open and set the app's WebSocket URL to the URL from the output.
  4. Run msw-cli status after starting the dev server — confirm connected: true (this only proves the WebSocket bridge, not that the first browser requests were intercepted).
  5. Hard reload the app and confirm in DevTools → Network that initial API calls are mocked. This catches render-before-mock races that msw-cli status misses.
  6. Use msw-cli add (and related commands) to manage mocks at runtime.

Do not duplicate the full setup guide in chat — execute from msw-cli setup output.

Notes

  • Ask permission before npm install / npx msw init (as the guide describes).
  • The WebSocket URL env var name depends on the framework: NEXT_PUBLIC_MSW_WS_URL (Next.js), VITE_MSW_WS_URL (Vite), or MSW_WS_URL (Rspack/Rsbuild/Webpack) — must match the port from msw-cli open. (MCP_SERVER_URL is accepted as a legacy fallback.)
  • Next.js App Router: app/layout.tsx is a Server Component; the MSW bootstrap must be a 'use client' gate so the app subtree does not mount (and fetch) before initMocks() finishes. Follow the guide’s gated MswProvider pattern — do not start MSW in a parallel useEffect while rendering the full tree.
  • MCP users can still use /msw-setup in an MCP client; the same guide backs both paths.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.