[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6GZDYVCE3YM8RHNAA2ZA012":3,"skill-same:01M6GZDYVCE3YM8RHNAA2ZA012":98},{"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":16,"sourceHtmlUrl":17,"categories":18,"keywords":35,"publishedAt":56,"linkOnly":57,"markdownContent":58,"markdownBody":59,"frontMatter":60,"refName":61,"commitSha":62,"skillDirectory":63,"forksCount":64,"repositoryHtmlUrl":65,"repositoryHomepageUrl":6,"ownerHtmlUrl":66,"ownerBlogUrl":67,"ownerDescription":68,"updatedAt":69,"install":70,"resources":83},"01M6GZDYVCE3YM8RHNAA2ZA012","pin-an-api-contract-with-a-consumer-test",null,"Use when a provider team can silently change a response your client depends on — record the consumer's real expectations as a pact and verify the provider against it in CI.","jiayaoqijia\u002Fcryptoskill","jiayaoqijia","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1453879?v=4","01M6GMYTX7Q7S504VC6E756ENR","YQ","01M6GMYV1QKJ1CC75MTTGT9PR0",81,"MIT","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-pin-an-api-contract-with-a-consumer-test\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-pin-an-api-contract-with-a-consumer-test\u002FSKILL.md",[19,24,27,32],{"categoryNo":20,"categoryName":21,"taxonomyType":22,"taxonomyTypeDesc":23},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",{"categoryNo":25,"categoryName":26,"taxonomyType":22,"taxonomyTypeDesc":23},"01JBSEEDCAT000000000000010","后端与接口",{"categoryNo":28,"categoryName":29,"taxonomyType":30,"taxonomyTypeDesc":31},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",{"categoryNo":33,"categoryName":34,"taxonomyType":30,"taxonomyTypeDesc":31},"01JBSEEDCAT000000000000037","律师与法务",[36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55],"pin an api contract with a consumer test","api","with","pin","api contract","test","contract","record","when","can","pact","it","client","as","provider","use","team","verify","ci","change","2026-11-10 10:12:30",false,"---\nname: pin-an-api-contract-with-a-consumer-test\ndescription: Use when a provider team can silently change a response your client depends on — record the consumer's real expectations as a pact and verify the provider against it in CI.\n---\n\n# Pin an API contract with a consumer test\n\nUnit tests mock the provider, so they pass while production breaks. A consumer-driven contract records what your client actually needs and fails the provider build when it stops honoring it.\n\n## Procedure\n\n1. Declare the exact request the consumer makes and the fields it reads:\n```python\nfrom pact import Consumer, Provider\npact = Consumer(\"checkout-web\").has_pact_with(Provider(\"orders-api\"))\n(pact.given(\"order 42 exists\")\n     .upon_receiving(\"a request for order 42\")\n     .with_request(\"GET\", \"\u002Forders\u002F42\")\n     .will_respond_with(200, body={\"id\": 42, \"status\": \"paid\"}))\n```\n2. Run the consumer tests against the mock provider Pact generates — this proves the consumer needs only what it declares:\n```\npytest tests\u002Fconsumer\u002F -q && ls pacts\u002Fcheckout-web-orders-api.json\n```\n3. Parse the response into a typed model so undeclared fields cannot silently become requirements:\n```python\nclass Order(BaseModel):      # pydantic\n    id: int\n    status: Literal[\"paid\", \"pending\"]\n```\nAdd body fields to the model only when the code reads them.\n4. Publish the pact to the broker:\n```\npact-broker publish pacts\u002F --consumer-app-version=$(git rev-parse --short HEAD) --broker-base-url=$BROKER\n```\n5. Verify on the provider side against a real, seeded instance:\n```\npact-provider-verifier --provider-base-url=http:\u002F\u002Flocalhost:8080 \\\n  --pact-broker-base-url=$BROKER --provider-app-version=$(git rev-parse --short HEAD)\n```\nRequired: all interactions verified, exit 0.\n6. Gate deployment:\n```\npact-broker can-i-deploy --pacticipant checkout-web --version $(git rev-parse --short HEAD) --to-environment production\n```\n7. Run consumer tests on every client PR and provider verification on every provider PR so a break is caught on whichever side moved.\n\n## Pitfalls\n\n- A pact asserting the whole response body makes the provider unable to add fields; assert only consumed fields.\n- Verifying against a stubbed provider is not verification. Point `--provider-base-url` at a real seeded instance.\n- Contracts drift if the client model is \"just in case\" broad. Keep it to fields the code reads.\n- `can-i-deploy` needs both versions published; a missing publish fails open. Fail closed if the broker call errors.\n\n## Verification\n\n```\npact-broker can-i-deploy --pacticipant checkout-web --version $(git rev-parse --short HEAD) --to-environment production\n```\nPasses = prints `Computer says yes`. Report: \"checkout-web 3f9a1c can-i-deploy=yes against orders-api, 4 interactions verified.\"\n","# Pin an API contract with a consumer test\n\nUnit tests mock the provider, so they pass while production breaks. A consumer-driven contract records what your client actually needs and fails the provider build when it stops honoring it.\n\n## Procedure\n\n1. Declare the exact request the consumer makes and the fields it reads:\n```python\nfrom pact import Consumer, Provider\npact = Consumer(\"checkout-web\").has_pact_with(Provider(\"orders-api\"))\n(pact.given(\"order 42 exists\")\n     .upon_receiving(\"a request for order 42\")\n     .with_request(\"GET\", \"\u002Forders\u002F42\")\n     .will_respond_with(200, body={\"id\": 42, \"status\": \"paid\"}))\n```\n2. Run the consumer tests against the mock provider Pact generates — this proves the consumer needs only what it declares:\n```\npytest tests\u002Fconsumer\u002F -q && ls pacts\u002Fcheckout-web-orders-api.json\n```\n3. Parse the response into a typed model so undeclared fields cannot silently become requirements:\n```python\nclass Order(BaseModel):      # pydantic\n    id: int\n    status: Literal[\"paid\", \"pending\"]\n```\nAdd body fields to the model only when the code reads them.\n4. Publish the pact to the broker:\n```\npact-broker publish pacts\u002F --consumer-app-version=$(git rev-parse --short HEAD) --broker-base-url=$BROKER\n```\n5. Verify on the provider side against a real, seeded instance:\n```\npact-provider-verifier --provider-base-url=http:\u002F\u002Flocalhost:8080 \\\n  --pact-broker-base-url=$BROKER --provider-app-version=$(git rev-parse --short HEAD)\n```\nRequired: all interactions verified, exit 0.\n6. Gate deployment:\n```\npact-broker can-i-deploy --pacticipant checkout-web --version $(git rev-parse --short HEAD) --to-environment production\n```\n7. Run consumer tests on every client PR and provider verification on every provider PR so a break is caught on whichever side moved.\n\n## Pitfalls\n\n- A pact asserting the whole response body makes the provider unable to add fields; assert only consumed fields.\n- Verifying against a stubbed provider is not verification. Point `--provider-base-url` at a real seeded instance.\n- Contracts drift if the client model is \"just in case\" broad. Keep it to fields the code reads.\n- `can-i-deploy` needs both versions published; a missing publish fails open. Fail closed if the broker call errors.\n\n## Verification\n\n```\npact-broker can-i-deploy --pacticipant checkout-web --version $(git rev-parse --short HEAD) --to-environment production\n```\nPasses = prints `Computer says yes`. Report: \"checkout-web 3f9a1c can-i-deploy=yes against orders-api, 4 interactions verified.\"\n",{"name":5,"description":7},"main","3df1d0d67b30ff15236561f8c0f9f06d33f42dfd","skills\u002Fpayments\u002F0xklen-pin-an-api-contract-with-a-consumer-test",17,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia","https:\u002F\u002Feth2030.com","Hardcore infra. Building @alt-research and applied cryptography.","2026-11-15 02:28:10",{"source":8,"skillName":5,"commands":71,"prompt":81,"zipAvailable":82},[72,75,78],{"tool":73,"command":74},"npx","npx skills add jiayaoqijia\u002Fcryptoskill --skill pin-an-api-contract-with-a-consumer-test",{"tool":76,"command":77},"bunx","bunx skills add jiayaoqijia\u002Fcryptoskill --skill pin-an-api-contract-with-a-consumer-test",{"tool":79,"command":80},"pnpm","pnpm dlx skills add jiayaoqijia\u002Fcryptoskill --skill pin-an-api-contract-with-a-consumer-test","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-pin-an-api-contract-with-a-consumer-test\u002FSKILL.md",true,[84,88,94],{"path":85,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":87,"sourceHtmlUrl":16},"LICENSE","许可证",1063,{"path":89,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":92,"sourceHtmlUrl":93},"SOURCE.md","REFERENCE","参考文档",366,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-pin-an-api-contract-with-a-consumer-test\u002FSOURCE.md",{"path":95,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":96,"sourceHtmlUrl":97},"TRUST.auto.yaml",2219,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-pin-an-api-contract-with-a-consumer-test\u002FTRUST.auto.yaml",[99,127,149,167,180,190],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":103,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":56},"01M712C436EQYE43342Q4E7GG1","recipe-performance","Diagnose a specific MetaMask user flow's real-app performance and Sentry critical-user-flow telemetry with deterministic mm-harness recipes. Use for CUF boundaries, cold\u002Fwarm\u002Fbackground-resume behavior, latency regressions, lifecycle tags, duplicate or blocking network requests, long tasks, layout\u002Fpaint cost, screen redraws, React rerenders, or browser trace analysis where tests alone cannot prove the real app.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fwallets\u002Fmetamask-official-recipe-performance\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fwallets\u002Fmetamask-official-recipe-performance\u002FSKILL.md",[],[107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126],"performance","recipe performance","recipe","mm","sentry","harness","app","deterministic","recipes","flow","cold","critical","analysis","tasks","react","browser","layout","screen","network","metamask",{"skillNo":128,"name":129,"nameZh":6,"description":130,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":131,"licenseFileUrl":132,"sourceHtmlUrl":133,"categories":134,"keywords":135,"publishedAt":56},"01M70XT2F8A5CQZ81JBP98KSW3","mexc-spot-websocket","MEXC Spot WebSocket workflows for public streams, protobuf handling, depth maintenance, listen keys, and private streams without exposing API keys.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-spot-websocket\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-spot-websocket\u002FSKILL.md",[],[136,137,138,37,139,140,141,142,143,144,145,146,147,148],"mexc spot websocket","spot","websocket","workflows","public","listen","streams","depth","keys","for","api keys","maintenance","protobuf",{"skillNo":150,"name":151,"nameZh":6,"description":152,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":131,"licenseFileUrl":153,"sourceHtmlUrl":154,"categories":155,"keywords":156,"publishedAt":56},"01M70XT0MBXN3WZY1BKN0CPNKR","mexc-spot-rest","MEXC Spot REST workflows for public data, signed account requests, orders, wallet\u002Fadmin actions, and secure signing without exposing API keys.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-spot-rest\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-spot-rest\u002FSKILL.md",[],[157,137,158,159,160,161,162,146,145,144,163,164,165,140,166,139,37],"mexc spot rest","REST","admin","signing","Wallet","requests","actions","secure","data","orders",{"skillNo":168,"name":169,"nameZh":6,"description":170,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":131,"licenseFileUrl":171,"sourceHtmlUrl":172,"categories":173,"keywords":174,"publishedAt":56},"01M70XSYSVZ2N0N91XCAR2CAK0","mexc-futures-websocket","MEXC Futures WebSocket workflows for public streams, private account\u002Forder\u002Fposition streams, ping\u002Fpong, subscriptions, and depth maintenance.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-futures-websocket\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fexchanges\u002Fmncrftfrcnm-mexc-futures-websocket\u002FSKILL.md",[],[175,176,138,177,178,147,145,179,143,142,140,139],"mexc futures websocket","futures","position","ping","subscriptions",{"skillNo":181,"name":182,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":183,"sourceHtmlUrl":184,"categories":185,"keywords":186,"publishedAt":56},"01M6H0ZWHVE5W04WG2DKQE2SQC","0xklen-version-and-refresh-sanctions-lists","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-version-and-refresh-sanctions-lists\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-version-and-refresh-sanctions-lists\u002FSKILL.md",[],[187,188,189],"refresh","0xklen version and refresh sanctions lists","version",{"skillNo":191,"name":192,"nameZh":6,"description":193,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":194,"sourceHtmlUrl":195,"categories":196,"keywords":197,"publishedAt":56},"01M6H0Z28Q3R8J0S799GJQWXM3","verify-tests-cover-changed-lines","Use when a PR adds code that the existing suite may not exercise. Measures patch coverage — the share of newly changed lines hit by tests — before approving.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-verify-tests-cover-changed-lines\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-verify-tests-cover-changed-lines\u002FSKILL.md",[],[198,199,200,53,201,202,203,51,204,205,206],"tests","cover","verify tests cover changed lines","coverage","pr","exercise","patch","code","share"]