[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6FG2YX910YXTTRH5AFA4DAZ":3,"skill-same:01M6FG2YX910YXTTRH5AFA4DAZ":79},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":37,"linkOnly":38,"markdownContent":39,"markdownBody":40,"frontMatter":41,"refName":42,"commitSha":43,"skillDirectory":44,"forksCount":45,"repositoryHtmlUrl":46,"repositoryHomepageUrl":47,"ownerHtmlUrl":48,"ownerBlogUrl":6,"ownerDescription":49,"updatedAt":50,"install":51,"resources":64},"01M6FG2YX910YXTTRH5AFA4DAZ","api-contract-testing",null,"Verifies API contracts between services using consumer-driven contracts, schema validation, and tools like Pact. Use when testing microservices communication, preventing breaking changes, or validating OpenAPI specifications.","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fsecondsky\u002Fclaude-skills\u002Fapi-contract-testing\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36],"contract testing","contract","api contract","api","api contract testing","testing","schema","specifications","pact","driven","contracts","use","openapi","Tools","services","microservices","communication","validation","2026-11-10 10:12:30",false,"---\nname: api-contract-testing\ndescription: Verifies API contracts between services using consumer-driven contracts, schema validation, and tools like Pact. Use when testing microservices communication, preventing breaking changes, or validating OpenAPI specifications.\nlicense: MIT\n---\n\n# API Contract Testing\n\nVerify that APIs honor their contracts between consumers and providers without requiring full integration tests.\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| Consumer | Service that calls an API |\n| Provider | Service that exposes an API |\n| Contract | Agreed request\u002Fresponse format |\n| Pact | Consumer-driven contract testing tool |\n| Schema | Structure definition (OpenAPI, JSON Schema) |\n| Broker | Central repository for contracts |\n\n## Pact Consumer Test (TypeScript)\n\n```typescript\nimport { PactV3, MatchersV3 } from '@pact-foundation\u002Fpact';\n\nconst provider = new PactV3({\n  consumer: 'OrderService',\n  provider: 'UserService'\n});\n\ndescribe('User API Contract', () => {\n  it('returns user by ID', async () => {\n    await provider\n      .given('user 123 exists')\n      .uponReceiving('a request for user 123')\n      .withRequest({ method: 'GET', path: '\u002Fusers\u002F123' })\n      .willRespondWith({\n        status: 200,\n        body: MatchersV3.like({\n          id: '123',\n          name: MatchersV3.string('John'),\n          email: MatchersV3.email('john@example.com')\n        })\n      })\n      .executeTest(async (mockServer) => {\n        const response = await fetch(`${mockServer.url}\u002Fusers\u002F123`);\n        expect(response.status).toBe(200);\n      });\n  });\n\n  it('returns 404 for non-existent user', async () => {\n    await provider\n      .given('user does not exist')\n      .uponReceiving('a request for non-existent user')\n      .withRequest({ method: 'GET', path: '\u002Fusers\u002F999' })\n      .willRespondWith({\n        status: 404,\n        body: MatchersV3.like({\n          error: { code: 'NOT_FOUND', message: MatchersV3.string() }\n        })\n      })\n      .executeTest(async (mockServer) => {\n        const response = await fetch(`${mockServer.url}\u002Fusers\u002F999`);\n        expect(response.status).toBe(404);\n      });\n  });\n});\n```\n\n## Provider Verification\n\n```typescript\nimport { Verifier } from '@pact-foundation\u002Fpact';\n\nnew Verifier({\n  provider: 'UserService',\n  providerBaseUrl: 'http:\u002F\u002Flocalhost:3000',\n  pactBrokerUrl: process.env.PACT_BROKER_URL,\n  publishVerificationResult: true,\n  providerVersion: process.env.GIT_SHA,\n  stateHandlers: {\n    'user 123 exists': async () => {\n      await db.users.create({ id: '123', name: 'John' });\n    },\n    'user does not exist': async () => {\n      await db.users.deleteAll();\n    }\n  }\n}).verifyProvider();\n```\n\n## OpenAPI Validation (Express)\n\n```javascript\nconst OpenApiValidator = require('express-openapi-validator');\n\napp.use(OpenApiValidator.middleware({\n  apiSpec: '.\u002Fopenapi.yaml',\n  validateRequests: true,\n  validateResponses: true,\n  validateSecurity: true\n}));\n```\n\n## Additional Implementations\n\n- **Python JSON Schema**: See [references\u002Fpython-json-schema.md](references\u002Fpython-json-schema.md)\n- **Java REST Assured**: See [references\u002Fjava-rest-assured.md](references\u002Fjava-rest-assured.md)\n- **Pact Broker CI\u002FCD**: See [references\u002Fpact-broker-cicd.md](references\u002Fpact-broker-cicd.md)\n\n## Best Practices\n\n**Do:**\n- Test from consumer perspective\n- Use matchers for flexible matching\n- Validate structure, not specific values\n- Version contracts explicitly\n- Test error responses\n- Run tests in CI pipeline\n- Test backward compatibility\n\n**Don't:**\n- Test business logic in contracts\n- Hard-code specific values\n- Skip error scenarios\n- Ignore versioning\n- Deploy without verification\n\n## Tools\n\n- **Pact** - Multi-language consumer-driven contracts\n- **Spring Cloud Contract** - JVM ecosystem\n- **OpenAPI\u002FSwagger** - Schema-first validation\n- **Dredd** - API blueprint testing\n- **Spectral** - OpenAPI linting\n","# API Contract Testing\n\nVerify that APIs honor their contracts between consumers and providers without requiring full integration tests.\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| Consumer | Service that calls an API |\n| Provider | Service that exposes an API |\n| Contract | Agreed request\u002Fresponse format |\n| Pact | Consumer-driven contract testing tool |\n| Schema | Structure definition (OpenAPI, JSON Schema) |\n| Broker | Central repository for contracts |\n\n## Pact Consumer Test (TypeScript)\n\n```typescript\nimport { PactV3, MatchersV3 } from '@pact-foundation\u002Fpact';\n\nconst provider = new PactV3({\n  consumer: 'OrderService',\n  provider: 'UserService'\n});\n\ndescribe('User API Contract', () => {\n  it('returns user by ID', async () => {\n    await provider\n      .given('user 123 exists')\n      .uponReceiving('a request for user 123')\n      .withRequest({ method: 'GET', path: '\u002Fusers\u002F123' })\n      .willRespondWith({\n        status: 200,\n        body: MatchersV3.like({\n          id: '123',\n          name: MatchersV3.string('John'),\n          email: MatchersV3.email('john@example.com')\n        })\n      })\n      .executeTest(async (mockServer) => {\n        const response = await fetch(`${mockServer.url}\u002Fusers\u002F123`);\n        expect(response.status).toBe(200);\n      });\n  });\n\n  it('returns 404 for non-existent user', async () => {\n    await provider\n      .given('user does not exist')\n      .uponReceiving('a request for non-existent user')\n      .withRequest({ method: 'GET', path: '\u002Fusers\u002F999' })\n      .willRespondWith({\n        status: 404,\n        body: MatchersV3.like({\n          error: { code: 'NOT_FOUND', message: MatchersV3.string() }\n        })\n      })\n      .executeTest(async (mockServer) => {\n        const response = await fetch(`${mockServer.url}\u002Fusers\u002F999`);\n        expect(response.status).toBe(404);\n      });\n  });\n});\n```\n\n## Provider Verification\n\n```typescript\nimport { Verifier } from '@pact-foundation\u002Fpact';\n\nnew Verifier({\n  provider: 'UserService',\n  providerBaseUrl: 'http:\u002F\u002Flocalhost:3000',\n  pactBrokerUrl: process.env.PACT_BROKER_URL,\n  publishVerificationResult: true,\n  providerVersion: process.env.GIT_SHA,\n  stateHandlers: {\n    'user 123 exists': async () => {\n      await db.users.create({ id: '123', name: 'John' });\n    },\n    'user does not exist': async () => {\n      await db.users.deleteAll();\n    }\n  }\n}).verifyProvider();\n```\n\n## OpenAPI Validation (Express)\n\n```javascript\nconst OpenApiValidator = require('express-openapi-validator');\n\napp.use(OpenApiValidator.middleware({\n  apiSpec: '.\u002Fopenapi.yaml',\n  validateRequests: true,\n  validateResponses: true,\n  validateSecurity: true\n}));\n```\n\n## Additional Implementations\n\n- **Python JSON Schema**: See [references\u002Fpython-json-schema.md](references\u002Fpython-json-schema.md)\n- **Java REST Assured**: See [references\u002Fjava-rest-assured.md](references\u002Fjava-rest-assured.md)\n- **Pact Broker CI\u002FCD**: See [references\u002Fpact-broker-cicd.md](references\u002Fpact-broker-cicd.md)\n\n## Best Practices\n\n**Do:**\n- Test from consumer perspective\n- Use matchers for flexible matching\n- Validate structure, not specific values\n- Version contracts explicitly\n- Test error responses\n- Run tests in CI pipeline\n- Test backward compatibility\n\n**Don't:**\n- Test business logic in contracts\n- Hard-code specific values\n- Skip error scenarios\n- Ignore versioning\n- Deploy without verification\n\n## Tools\n\n- **Pact** - Multi-language consumer-driven contracts\n- **Spring Cloud Contract** - JVM ecosystem\n- **OpenAPI\u002FSwagger** - Schema-first validation\n- **Dredd** - API blueprint testing\n- **Spectral** - OpenAPI linting\n",{"name":5,"license":15,"description":7},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Fsecondsky\u002Fclaude-skills\u002Fapi-contract-testing",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":8,"skillName":5,"commands":52,"prompt":62,"zipAvailable":63},[53,56,59],{"tool":54,"command":55},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill api-contract-testing",{"tool":57,"command":58},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill api-contract-testing",{"tool":60,"command":61},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill api-contract-testing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fsecondsky\u002Fclaude-skills\u002Fapi-contract-testing\u002FSKILL.md",true,[65,71,75],{"path":66,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":69,"sourceHtmlUrl":70},"references\u002Fjava-rest-assured.md","REFERENCE","参考文档",4632,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fsecondsky\u002Fclaude-skills\u002Fapi-contract-testing\u002Freferences\u002Fjava-rest-assured.md",{"path":72,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":73,"sourceHtmlUrl":74},"references\u002Fpact-broker-cicd.md",4436,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fsecondsky\u002Fclaude-skills\u002Fapi-contract-testing\u002Freferences\u002Fpact-broker-cicd.md",{"path":76,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":77,"sourceHtmlUrl":78},"references\u002Fpython-json-schema.md",12302,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fsecondsky\u002Fclaude-skills\u002Fapi-contract-testing\u002Freferences\u002Fpython-json-schema.md",[80,89,98,107,113,119],{"skillNo":81,"name":82,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":37},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[86,87,88],"model","model hierarchy","model hierarchy skill",{"skillNo":90,"name":91,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":37},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[95,96,97],"MCP","zoom","zoom mcp",{"skillNo":99,"name":100,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":37},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[104,105,106,96],"sdk","zoom apps sdk","apps",{"skillNo":108,"name":109,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":37},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[109],{"skillNo":114,"name":115,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":37},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[115],{"skillNo":120,"name":121,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":37},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[121]]