[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7C487ASA65G80KRZP51AN0X":3,"skill-same:01M7C487ASA65G80KRZP51AN0X":66},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":28,"commitSha":29,"skillDirectory":30,"forksCount":13,"repositoryHtmlUrl":31,"repositoryHomepageUrl":6,"ownerHtmlUrl":32,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":33,"install":34,"resources":47},"01M7C487ASA65G80KRZP51AN0X","api-testing",null,"API testing patterns with supertest, MSW, and Vitest. Covers integration testing for REST APIs, HTTP request mocking with Mock Service Worker v2, response assertions, schema validation, test organization, and framework-specific patterns for Express, Fastify, and Hono.\n\nUse when writing integration tests for REST APIs, mocking HTTP requests, or testing API endpoints. Use for api-test, supertest, msw, mock-service-worker, integration-test, http-mock, endpoint-test, request-test.","pohlai88\u002Fafenda-xforge-v5","pohlai88","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F216658843?v=4","01M7C3ZWD8Y9WVZSNWJ6200V3P","01M7C3ZWDW077V142FSQEFJJ0B",0,"MIT","https:\u002F\u002Fgithub.com\u002Fpohlai88\u002Fafenda-xforge-v5\u002Fblob\u002Fmaster\u002F.claude\u002Fskills\u002Fapi-testing\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: api-testing\ndescription: |\n  API testing patterns with supertest, MSW, and Vitest. Covers integration testing for REST APIs, HTTP request mocking with Mock Service Worker v2, response assertions, schema validation, test organization, and framework-specific patterns for Express, Fastify, and Hono.\n\n  Use when writing integration tests for REST APIs, mocking HTTP requests, or testing API endpoints. Use for api-test, supertest, msw, mock-service-worker, integration-test, http-mock, endpoint-test, request-test.\nlicense: MIT\nmetadata:\n  author: oakoss\n  version: '1.0'\n  source: 'https:\u002F\u002Fmswjs.io\u002Fdocs'\nuser-invocable: false\n---\n\n# API Testing\n\n## Overview\n\nAPI testing validates HTTP endpoints by sending requests and asserting responses, covering status codes, headers, body content, and error handling. Supertest provides a fluent chainable API for integration testing against Express, Fastify, and Hono apps without starting a real server. MSW (Mock Service Worker) v2 intercepts outgoing HTTP requests at the network level, enabling realistic mocking of external services in both Node.js tests and browser environments.\n\n**When to use:** Integration tests for REST APIs, testing middleware pipelines, validating request\u002Fresponse contracts, mocking third-party APIs in tests, testing error handling and edge cases.\n\n**When NOT to use:** Unit testing pure functions (use direct assertions), E2E browser testing (use Playwright\u002FCypress), load\u002Fperformance testing (use k6\u002FArtillery), testing static file serving.\n\n## Quick Reference\n\n| Pattern               | API                                        | Key Points                                  |\n| --------------------- | ------------------------------------------ | ------------------------------------------- |\n| GET request           | `request(app).get('\u002Fpath')`                | Returns supertest `Test` object             |\n| POST with body        | `request(app).post('\u002Fpath').send(body)`    | Automatically sets Content-Type             |\n| Auth header           | `.set('Authorization', 'Bearer token')`    | Chain before `.expect()`                    |\n| Status assertion      | `.expect(200)`                             | Chainable with body assertions              |\n| Body assertion        | `.expect({ key: 'value' })`                | Deep equality check                         |\n| Header assertion      | `.expect('Content-Type', \u002Fjson\u002F)`          | Accepts string or regex                     |\n| MSW HTTP handler      | `http.get('\u002Fapi\u002Fusers', resolver)`         | Intercepts matching requests                |\n| MSW GraphQL handler   | `graphql.query('GetUser', resolver)`       | Intercepts by operation name                |\n| MSW response          | `HttpResponse.json(data, { status })`      | v2 response format                          |\n| MSW error simulation  | `HttpResponse.error()`                     | Simulates network failure                   |\n| MSW one-time handler  | `http.get(path, resolver, { once: true })` | Auto-removed after first match              |\n| MSW per-test override | `server.use(handler)`                      | Override default handlers in specific tests |\n| Schema validation     | `schema.parse(response.body)`              | Validates response structure with Zod       |\n| Cookie persistence    | `const agent = request.agent(app)`         | Maintains cookies across requests           |\n| Fastify inject        | `app.inject({ method, url })`              | Built-in testing without supertest          |\n| Hono test client      | `testClient(app)`                          | Type-safe request builder                   |\n\n## Common Mistakes\n\n| Mistake                                    | Correct Pattern                                             |\n| ------------------------------------------ | ----------------------------------------------------------- |\n| Not awaiting supertest requests            | Always `await request(app).get('\u002Fpath')`                    |\n| Sharing server state between tests         | Reset handlers with `server.resetHandlers()` in `afterEach` |\n| Mocking fetch\u002Faxios directly               | Use MSW to intercept at the network level                   |\n| Forgetting `server.listen()` in setup      | Call in `beforeAll`, `resetHandlers` in `afterEach`         |\n| Passing Fastify instance to supertest      | Use `fastify.server` (the underlying Node server)           |\n| Asserting before response completes        | Use `await` or return the supertest chain                   |\n| Hardcoding test data across many tests     | Use factories or fixtures for test data                     |\n| Not testing error responses                | Test 4xx and 5xx paths alongside happy paths                |\n| Using `server.close()` in `afterEach`      | Use `afterAll` for close, `afterEach` for reset only        |\n| Ignoring response headers in assertions    | Validate Content-Type, Cache-Control, CORS headers          |\n| Not using `onUnhandledRequest: 'error'`    | Catch unhandled requests to prevent silent test gaps        |\n| Testing implementation instead of behavior | Assert on response shape, not internal function calls       |\n\n## Delegation\n\n- **Test structure review**: Use `Task` agent\n- **Code review**: Delegate to `code-reviewer` agent\n- **Pattern discovery**: Use `Explore` agent\n\n> If the `vitest-testing` skill is available, delegate general Vitest configuration and patterns to it.\n> Otherwise, recommend: `npx skills add oakoss\u002Fagent-skills --skill vitest-testing`\n\n## References\n\n- [Supertest integration testing patterns for Express, Fastify, and Hono](references\u002Fsupertest-patterns.md)\n- [MSW request handlers, response resolvers, and server setup](references\u002Fmsw-handlers.md)\n- [Test organization, fixtures, factories, and setup\u002Fteardown](references\u002Ftest-organization.md)\n- [Response assertions, status codes, headers, and schema validation](references\u002Fassertion-patterns.md)\n","# API Testing\n\n## Overview\n\nAPI testing validates HTTP endpoints by sending requests and asserting responses, covering status codes, headers, body content, and error handling. Supertest provides a fluent chainable API for integration testing against Express, Fastify, and Hono apps without starting a real server. MSW (Mock Service Worker) v2 intercepts outgoing HTTP requests at the network level, enabling realistic mocking of external services in both Node.js tests and browser environments.\n\n**When to use:** Integration tests for REST APIs, testing middleware pipelines, validating request\u002Fresponse contracts, mocking third-party APIs in tests, testing error handling and edge cases.\n\n**When NOT to use:** Unit testing pure functions (use direct assertions), E2E browser testing (use Playwright\u002FCypress), load\u002Fperformance testing (use k6\u002FArtillery), testing static file serving.\n\n## Quick Reference\n\n| Pattern               | API                                        | Key Points                                  |\n| --------------------- | ------------------------------------------ | ------------------------------------------- |\n| GET request           | `request(app).get('\u002Fpath')`                | Returns supertest `Test` object             |\n| POST with body        | `request(app).post('\u002Fpath').send(body)`    | Automatically sets Content-Type             |\n| Auth header           | `.set('Authorization', 'Bearer token')`    | Chain before `.expect()`                    |\n| Status assertion      | `.expect(200)`                             | Chainable with body assertions              |\n| Body assertion        | `.expect({ key: 'value' })`                | Deep equality check                         |\n| Header assertion      | `.expect('Content-Type', \u002Fjson\u002F)`          | Accepts string or regex                     |\n| MSW HTTP handler      | `http.get('\u002Fapi\u002Fusers', resolver)`         | Intercepts matching requests                |\n| MSW GraphQL handler   | `graphql.query('GetUser', resolver)`       | Intercepts by operation name                |\n| MSW response          | `HttpResponse.json(data, { status })`      | v2 response format                          |\n| MSW error simulation  | `HttpResponse.error()`                     | Simulates network failure                   |\n| MSW one-time handler  | `http.get(path, resolver, { once: true })` | Auto-removed after first match              |\n| MSW per-test override | `server.use(handler)`                      | Override default handlers in specific tests |\n| Schema validation     | `schema.parse(response.body)`              | Validates response structure with Zod       |\n| Cookie persistence    | `const agent = request.agent(app)`         | Maintains cookies across requests           |\n| Fastify inject        | `app.inject({ method, url })`              | Built-in testing without supertest          |\n| Hono test client      | `testClient(app)`                          | Type-safe request builder                   |\n\n## Common Mistakes\n\n| Mistake                                    | Correct Pattern                                             |\n| ------------------------------------------ | ----------------------------------------------------------- |\n| Not awaiting supertest requests            | Always `await request(app).get('\u002Fpath')`                    |\n| Sharing server state between tests         | Reset handlers with `server.resetHandlers()` in `afterEach` |\n| Mocking fetch\u002Faxios directly               | Use MSW to intercept at the network level                   |\n| Forgetting `server.listen()` in setup      | Call in `beforeAll`, `resetHandlers` in `afterEach`         |\n| Passing Fastify instance to supertest      | Use `fastify.server` (the underlying Node server)           |\n| Asserting before response completes        | Use `await` or return the supertest chain                   |\n| Hardcoding test data across many tests     | Use factories or fixtures for test data                     |\n| Not testing error responses                | Test 4xx and 5xx paths alongside happy paths                |\n| Using `server.close()` in `afterEach`      | Use `afterAll` for close, `afterEach` for reset only        |\n| Ignoring response headers in assertions    | Validate Content-Type, Cache-Control, CORS headers          |\n| Not using `onUnhandledRequest: 'error'`    | Catch unhandled requests to prevent silent test gaps        |\n| Testing implementation instead of behavior | Assert on response shape, not internal function calls       |\n\n## Delegation\n\n- **Test structure review**: Use `Task` agent\n- **Code review**: Delegate to `code-reviewer` agent\n- **Pattern discovery**: Use `Explore` agent\n\n> If the `vitest-testing` skill is available, delegate general Vitest configuration and patterns to it.\n> Otherwise, recommend: `npx skills add oakoss\u002Fagent-skills --skill vitest-testing`\n\n## References\n\n- [Supertest integration testing patterns for Express, Fastify, and Hono](references\u002Fsupertest-patterns.md)\n- [MSW request handlers, response resolvers, and server setup](references\u002Fmsw-handlers.md)\n- [Test organization, fixtures, factories, and setup\u002Fteardown](references\u002Ftest-organization.md)\n- [Response assertions, status codes, headers, and schema validation](references\u002Fassertion-patterns.md)\n",{"name":5,"license":14,"metadata":23,"description":27,"user-invocable":19},{"author":24,"source":25,"version":26},"oakoss","https:\u002F\u002Fmswjs.io\u002Fdocs","1.0","API testing patterns with supertest, MSW, and Vitest. Covers integration testing for REST APIs, HTTP request mocking with Mock Service Worker v2, response assertions, schema validation, test organization, and framework-specific patterns for Express, Fastify, and Hono.\n\nUse when writing integration tests for REST APIs, mocking HTTP requests, or testing API endpoints. Use for api-test, supertest, msw, mock-service-worker, integration-test, http-mock, endpoint-test, request-test.\n","master","ee4668daab05d977b529036c0b1711dc09f997e0",".claude\u002Fskills\u002Fapi-testing","https:\u002F\u002Fgithub.com\u002Fpohlai88\u002Fafenda-xforge-v5","https:\u002F\u002Fgithub.com\u002Fpohlai88","2026-09-05 22:56:19",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add pohlai88\u002Fafenda-xforge-v5 --skill api-testing",{"tool":40,"command":41},"bunx","bunx skills add pohlai88\u002Fafenda-xforge-v5 --skill api-testing",{"tool":43,"command":44},"pnpm","pnpm dlx skills add pohlai88\u002Fafenda-xforge-v5 --skill api-testing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fpohlai88\u002Fafenda-xforge-v5\u002Fblob\u002Fmaster\u002F.claude\u002Fskills\u002Fapi-testing\u002FSKILL.md",true,[48,54,58,62],{"path":49,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":52,"sourceHtmlUrl":53},"references\u002Fassertion-patterns.md","REFERENCE","参考文档",8694,"https:\u002F\u002Fgithub.com\u002Fpohlai88\u002Fafenda-xforge-v5\u002Fblob\u002Fmaster\u002F.claude\u002Fskills\u002Fapi-testing\u002Freferences\u002Fassertion-patterns.md",{"path":55,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":56,"sourceHtmlUrl":57},"references\u002Fmsw-handlers.md",7444,"https:\u002F\u002Fgithub.com\u002Fpohlai88\u002Fafenda-xforge-v5\u002Fblob\u002Fmaster\u002F.claude\u002Fskills\u002Fapi-testing\u002Freferences\u002Fmsw-handlers.md",{"path":59,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":60,"sourceHtmlUrl":61},"references\u002Fsupertest-patterns.md",7820,"https:\u002F\u002Fgithub.com\u002Fpohlai88\u002Fafenda-xforge-v5\u002Fblob\u002Fmaster\u002F.claude\u002Fskills\u002Fapi-testing\u002Freferences\u002Fsupertest-patterns.md",{"path":63,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":64,"sourceHtmlUrl":65},"references\u002Ftest-organization.md",8508,"https:\u002F\u002Fgithub.com\u002Fpohlai88\u002Fafenda-xforge-v5\u002Fblob\u002Fmaster\u002F.claude\u002Fskills\u002Fapi-testing\u002Freferences\u002Ftest-organization.md",[67,74,81,88,95,103],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":18},"01M7C4FZM0ZBB1P5GV1EZJJCCT","vercel-react-best-practices","React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React\u002FNext.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.","https:\u002F\u002Fgithub.com\u002Fpohlai88\u002Fafenda-xforge-v5\u002Fblob\u002Fmaster\u002F.claude\u002Fskills\u002Fvercel-react-best-practices\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":18},"01M7C4F67V83B35BDPW73AQNWR","turborepo","Turborepo monorepo build system and orchestration. Covers task pipelines, dependsOn syntax, caching configuration, remote cache, filtering, CI optimization, environment variables, workspace management, watch mode, package boundaries, and code generation.\n\nUse when configuring tasks, creating packages, setting up monorepo, sharing code between apps, running changed packages, debugging cache, optimizing CI, resolving workspace dependencies, enforcing package boundaries, or generating code.","https:\u002F\u002Fgithub.com\u002Fpohlai88\u002Fafenda-xforge-v5\u002Fblob\u002Fmaster\u002F.claude\u002Fskills\u002Fturborepo\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":18},"01M7C4ET5ETKW3FFB4SFFPNQWG","tailwind","Tailwind CSS v4 patterns and design systems. Use when configuring Tailwind themes, building components, implementing dark mode, using container queries, migrating from v3, integrating shadcn\u002Fui, or fixing build errors. Use for tailwind, css, styling, theme, design-tokens.","https:\u002F\u002Fgithub.com\u002Fpohlai88\u002Fafenda-xforge-v5\u002Fblob\u002Fmaster\u002F.claude\u002Fskills\u002Ftailwind\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":18},"01M7C4DESY6RA5XWDNVV155THK","pnpm-workspace","pnpm workspace monorepo management with filtering, catalogs, and shared configs. Use when setting up monorepos, managing workspace dependencies, filtering package commands, or sharing configuration across packages.","https:\u002F\u002Fgithub.com\u002Fpohlai88\u002Fafenda-xforge-v5\u002Fblob\u002Fmaster\u002F.claude\u002Fskills\u002Fpnpm-workspace\u002FSKILL.md",[],[],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":99,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":18},"01M7C4CZ3VMTYQQJXVJXGY3M0X","material-theme-builder","Generate Material Design 3 color themes programmatically from a source color using @material\u002Fmaterial-color-utilities, the same engine that powers the Material Theme Builder. Use this when the user asks to generate an M3 color palette, create a custom theme from a brand color, or export M3 tokens to CSS, JSON, or framework configs.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fpohlai88\u002Fafenda-xforge-v5\u002Fblob\u002Fmaster\u002F.claude\u002Fskills\u002Fmaterial-theme-builder\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":99,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":18},"01M7C4CT86QFTT2N0PJCPTG5RB","material-design-3-typography","Applies Material Design 3 Expressive typography principles including variable fonts, type scales, and hierarchy. Use this when working on text styling, type hierarchy, readable interfaces, or when the user asks to apply Material Design 3 typography guidelines.","https:\u002F\u002Fgithub.com\u002Fpohlai88\u002Fafenda-xforge-v5\u002Fblob\u002Fmaster\u002F.claude\u002Fskills\u002Fmaterial-design-3-typography\u002FSKILL.md",[],[]]