A solid reference for MSW v2 that covers the essentials without the usual documentation bloat. You get 45 rules across setup, handler architecture, test integration, and response patterns, all prioritized by impact so you know what actually matters. The handler architecture section is especially useful for avoiding the common pitfall of dumping all your mocks in one file. It's built for AI agents but reads fine for humans who need to set up API mocking correctly the first time. Works best alongside testing skills like test-vitest since this deliberately skips general testing methodology.
- skills.sh installs
- 897
- GitHub stars
- 222
- last updated
- Aug 21, 2026
Install
$ npx -y skills add pproenca/dot-skills --skill msw --agent claude-codeInstalls into .claude/skills of the current project.
Files
MSW Best Practices
Comprehensive API mocking guide for MSW v2 applications, designed for AI agents and LLMs. Contains 45 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)
Sponsors
Details
- Repository
- github.com/pproenca/dot-skills
- Categories
- Backend & APIs, Testing & QA, Documentation
- First seen
- Jun 3, 2026
More from pproenca/dot-skills
All 100- Tanstack Query858
- Clean Code857
- Terminal Ui853
- Ui Design827
- Typescript Refactor799
- React Refactor791
- Chrome Extension Ui732
- Shadcn732
- Chrome Extension729
- Shell704
- Tailwind657
- Refactor651
- Expo561
- React496
- Tailwind Responsive Ui470
- Tailwind Ui Refactor467
- Zustand453
- Debug444
- Ios Design436
- Feature Spec431
- Feature Arch423
- React Testing Library418
- Jscodeshift416
- Expo React Native Coder415
