CtrlK
BlogDocsLog inGet started
Tessl Logo

testland/msw-handlers

Authors Mock Service Worker (MSW) request handlers for both browser and Node.js test environments using the `http.get` / `http.post` / `HttpResponse.json` API, wires them via `setupWorker` (browser) or `setupServer` (Node), and manages the test lifecycle (`server.listen` / `resetHandlers` / `close`). Use when the project uses JavaScript / TypeScript and needs to mock fetch / XHR at the network layer for both Vitest / Jest unit tests and Cypress / Playwright integration tests.

80

Quality

100%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide

SecuritybySnyk

Passed

No findings from the security scan

Overview
Quality
Evals
Security
Files

Quality

Content

100%

Reviews the quality of instructions and guidance provided to agents. Good implementation is clear, handles edge cases, and produces reliable results.

An efficient, highly actionable MSW skill body: lean code-first sections, executable examples for both browser and Node lifecycle, a strict-mode validation checkpoint, and a clean anti-patterns/limitations structure. It makes exemplary use of a single self-contained file with consistent external references.

DimensionReasoningScore

Conciseness

The body is dense and assumes Claude's competence — install commands, handler authoring, an HttpResponse-helpers table, browser/node setup, lifecycle table, per-test overrides, CI, anti-patterns, and limitations — with no padding explaining what MSW or Service Workers are; nearly every token earns its place.

3 / 3

Actionability

Multiple complete, copy-paste-ready code blocks (`npm i msw`, `npx msw init public/`, full handlers.js/browser.js/node.js, vitest.setup.js lifecycle, a per-test override test, and CI yaml) use the real `http.*`/`HttpResponse` API with no pseudocode, matching the score-3 anchor.

3 / 3

Workflow Clarity

The test lifecycle is sequenced explicitly (listen beforeAll → resetHandlers afterEach → close afterAll) in a When/Purpose table, with the per-test override→reset pattern shown end-to-end; `onUnhandledRequest: 'error'` acts as an explicit validation checkpoint that fails the test on unhandled requests.

3 / 3

Progressive Disclosure

With no bundle files present, the single ~213-line SKILL.md is organized into clearly labeled sections (Overview, When to use, Install, Authoring handlers, Browser/Node setup, Per-test overrides, CI, Anti-patterns, Limitations, References) and references only one external, one-level-deep link ([msw-getting-started][gs]); per the rubric's simple-skill note, well-organized sections warrant a 3.

3 / 3

Total

12

/

12

Passed

Description

100%

Based on the skill's description, can an agent find and select it at the right time? Clear, specific descriptions lead to better discovery.

A strong, third-person description that names concrete actions and specific MSW APIs, covers natural trigger terms across the major test frameworks, and pairs an explicit 'what' with a detailed 'Use when' clause. It is clearly distinguishable from sibling mocking skills.

DimensionReasoningScore

Specificity

Lists multiple concrete actions with named APIs — 'Authors Mock Service Worker (MSW) request handlers', 'wires them via setupWorker (browser) or setupServer (Node)', 'manages the test lifecycle (server.listen / resetHandlers / close)' — matching the score-3 anchor for multiple specific concrete actions.

3 / 3

Completeness

Explicitly answers both what (authoring/wiring/managing handlers) and when via a clear 'Use when the project uses JavaScript / TypeScript and needs to mock fetch / XHR at the network layer for both Vitest / Jest unit tests and Cypress / Playwright integration tests' clause, matching the score-3 anchor.

3 / 3

Trigger Term Quality

Natural user-facing terms appear throughout — 'mock fetch / XHR at the network layer', 'Vitest / Jest unit tests', 'Cypress / Playwright integration tests', 'JavaScript / TypeScript' — covering the frameworks and phrases a user would actually say when needing network mocking for tests.

3 / 3

Distinctiveness Conflict Risk

A clear niche — MSW network-layer mocking for JS/TS test environments with named frameworks — makes it unlikely to trigger for the wrong skill; the body's references to wiremock-stubs (JVM) and mountebank-imposters (multi-protocol) further sharpen the boundary.

3 / 3

Total

12

/

12

Passed

Validation

100%

Checks the skill against the spec for correct structure and formatting. All validation checks must pass before discovery and implementation can be scored.

Validation16 / 16 Passed

Validation for skill structure

No warnings or errors.

Reviewed

Table of Contents