[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6GYF80YBWCPY73AVRCR5EMR":3,"skill-same:01M6GYF80YBWCPY73AVRCR5EMR":95},{"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":32,"publishedAt":53,"linkOnly":54,"markdownContent":55,"markdownBody":56,"frontMatter":57,"refName":58,"commitSha":59,"skillDirectory":60,"forksCount":61,"repositoryHtmlUrl":62,"repositoryHomepageUrl":6,"ownerHtmlUrl":63,"ownerBlogUrl":64,"ownerDescription":65,"updatedAt":66,"install":67,"resources":80},"01M6GYF80YBWCPY73AVRCR5EMR","document-an-api-endpoint-with-a-runnable-example",null,"Use when writing reference docs for an HTTP API endpoint. Specifies method, path, parameters, a copy-pasteable request, a real response, and each error with its fix.","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-document-an-api-endpoint-with-a-runnable-example\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-document-an-api-endpoint-with-a-runnable-example\u002FSKILL.md",[19,24,27],{"categoryNo":20,"categoryName":21,"taxonomyType":22,"taxonomyTypeDesc":23},"01JBSEEDCAT000000000000002","文档处理","SCENARIO","使用场景",{"categoryNo":25,"categoryName":26,"taxonomyType":22,"taxonomyTypeDesc":23},"01JBSEEDCAT000000000000010","后端与接口",{"categoryNo":28,"categoryName":29,"taxonomyType":30,"taxonomyTypeDesc":31},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],"endpoint","api","document an api endpoint with a runnable example","example","api endpoint","document","with","when","writing","request","for","path","http api","error","copy","reference","use","fix","http","docs","2026-11-10 10:12:30",false,"---\nname: document-an-api-endpoint-with-a-runnable-example\ndescription: Use when writing reference docs for an HTTP API endpoint. Specifies method, path, parameters, a copy-pasteable request, a real response, and each error with its fix.\n---\n\n# Document an API Endpoint with a Runnable Example\n\nAPI docs are read by someone writing a client under deadline. Give them a request they can paste into curl and the exact response, then the errors.\n\n## Procedure\n\n1. Open with the method and path in a code span: `POST \u002Fv1\u002Finvoices`. State the purpose in one sentence.\n2. Give an auth line: required scopes and header, e.g. `Authorization: Bearer $ACME_TOKEN`, scope `invoices:write`.\n3. List path, query, and body parameters in a table with name, type, required, and default. Mark enum values exhaustively: status in {draft, open, paid, void}.\n4. Provide a runnable curl example with real-looking values and the token in a variable so the reader substitutes one thing:\n   `curl -sS -X POST https:\u002F\u002Fapi.acme.dev\u002Fv1\u002Finvoices -H \"Authorization: Bearer $ACME_TOKEN\" -d '{\"amount_cents\":500,\"currency\":\"usd\"}'`\n5. Show the actual JSON response with a 200, including field types. Do not hand-wave with an empty object.\n6. Document every error the endpoint can return: code, HTTP status, meaning, and the fix. For 409 conflict_idempotency, tell the caller to reuse the same Idempotency-Key or fetch the existing resource.\n7. Note rate limits and the `Retry-After` header value the endpoint sends.\n8. State idempotency behaviour explicitly: which key header, and the retention window (e.g. 24h).\n9. Add one worked error example showing the fix applied.\n10. Document pagination if the endpoint lists: the cursor field, the page size limit, and the parameter to advance.\n11. Keep the request and response in a consistent order so a reader scans top-to-bottom.\n12. Give a timestamp and timezone convention for any date field (`ISO 8601, UTC`).\n\n## Pitfalls\n\n- A request example that omits the auth header, so the first copy-paste returns 401.\n- Showing only the happy path response; callers then mishandle the 4xx cases.\n- Parameter tables that mark everything optional when the server rejects missing fields.\n- Field descriptions that restate the name, such as \"amount: the amount\".\n- Documenting the success status only, hiding that the same verb returns 202 when queued.\n- A pagination note that omits the maximum page size, so callers guess and get truncated results.\n- Amounts shown as floats where the field is integer minor units, causing rounding bugs downstream.\n\n## Verification\n\n    curl -sS -o \u002Fdev\u002Fnull -w '%{http_code}\\n' -X POST \"$BASE\u002Fv1\u002Finvoices\" -H \"Authorization: Bearer $ACME_TOKEN\" -d '{}'\n    # run against staging; the code must match the documented error for that input\n\nRun every documented example against staging and confirm status codes and response shapes match the docs exactly.\n","# Document an API Endpoint with a Runnable Example\n\nAPI docs are read by someone writing a client under deadline. Give them a request they can paste into curl and the exact response, then the errors.\n\n## Procedure\n\n1. Open with the method and path in a code span: `POST \u002Fv1\u002Finvoices`. State the purpose in one sentence.\n2. Give an auth line: required scopes and header, e.g. `Authorization: Bearer $ACME_TOKEN`, scope `invoices:write`.\n3. List path, query, and body parameters in a table with name, type, required, and default. Mark enum values exhaustively: status in {draft, open, paid, void}.\n4. Provide a runnable curl example with real-looking values and the token in a variable so the reader substitutes one thing:\n   `curl -sS -X POST https:\u002F\u002Fapi.acme.dev\u002Fv1\u002Finvoices -H \"Authorization: Bearer $ACME_TOKEN\" -d '{\"amount_cents\":500,\"currency\":\"usd\"}'`\n5. Show the actual JSON response with a 200, including field types. Do not hand-wave with an empty object.\n6. Document every error the endpoint can return: code, HTTP status, meaning, and the fix. For 409 conflict_idempotency, tell the caller to reuse the same Idempotency-Key or fetch the existing resource.\n7. Note rate limits and the `Retry-After` header value the endpoint sends.\n8. State idempotency behaviour explicitly: which key header, and the retention window (e.g. 24h).\n9. Add one worked error example showing the fix applied.\n10. Document pagination if the endpoint lists: the cursor field, the page size limit, and the parameter to advance.\n11. Keep the request and response in a consistent order so a reader scans top-to-bottom.\n12. Give a timestamp and timezone convention for any date field (`ISO 8601, UTC`).\n\n## Pitfalls\n\n- A request example that omits the auth header, so the first copy-paste returns 401.\n- Showing only the happy path response; callers then mishandle the 4xx cases.\n- Parameter tables that mark everything optional when the server rejects missing fields.\n- Field descriptions that restate the name, such as \"amount: the amount\".\n- Documenting the success status only, hiding that the same verb returns 202 when queued.\n- A pagination note that omits the maximum page size, so callers guess and get truncated results.\n- Amounts shown as floats where the field is integer minor units, causing rounding bugs downstream.\n\n## Verification\n\n    curl -sS -o \u002Fdev\u002Fnull -w '%{http_code}\\n' -X POST \"$BASE\u002Fv1\u002Finvoices\" -H \"Authorization: Bearer $ACME_TOKEN\" -d '{}'\n    # run against staging; the code must match the documented error for that input\n\nRun every documented example against staging and confirm status codes and response shapes match the docs exactly.\n",{"name":5,"description":7},"main","3df1d0d67b30ff15236561f8c0f9f06d33f42dfd","skills\u002Fpayments\u002F0xklen-document-an-api-endpoint-with-a-runnable-example",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":68,"prompt":78,"zipAvailable":79},[69,72,75],{"tool":70,"command":71},"npx","npx skills add jiayaoqijia\u002Fcryptoskill --skill document-an-api-endpoint-with-a-runnable-example",{"tool":73,"command":74},"bunx","bunx skills add jiayaoqijia\u002Fcryptoskill --skill document-an-api-endpoint-with-a-runnable-example",{"tool":76,"command":77},"pnpm","pnpm dlx skills add jiayaoqijia\u002Fcryptoskill --skill document-an-api-endpoint-with-a-runnable-example","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-document-an-api-endpoint-with-a-runnable-example\u002FSKILL.md",true,[81,85,91],{"path":82,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":84,"sourceHtmlUrl":16},"LICENSE","许可证",1063,{"path":86,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":89,"sourceHtmlUrl":90},"SOURCE.md","REFERENCE","参考文档",374,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-document-an-api-endpoint-with-a-runnable-example\u002FSOURCE.md",{"path":92,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":93,"sourceHtmlUrl":94},"TRUST.auto.yaml",2217,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fpayments\u002F0xklen-document-an-api-endpoint-with-a-runnable-example\u002FTRUST.auto.yaml",[96,124,145,163,176,186],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":100,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":53},"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",[],[104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123],"performance","recipe performance","recipe","mm","sentry","harness","app","deterministic","recipes","flow","cold","critical","analysis","tasks","react","browser","layout","screen","network","metamask",{"skillNo":125,"name":126,"nameZh":6,"description":127,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":128,"licenseFileUrl":129,"sourceHtmlUrl":130,"categories":131,"keywords":132,"publishedAt":53},"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",[],[133,134,135,34,136,137,138,139,140,141,43,142,143,144],"mexc spot websocket","spot","websocket","workflows","public","listen","streams","depth","keys","api keys","maintenance","protobuf",{"skillNo":146,"name":147,"nameZh":6,"description":148,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":128,"licenseFileUrl":149,"sourceHtmlUrl":150,"categories":151,"keywords":152,"publishedAt":53},"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",[],[153,134,154,155,156,157,158,142,43,141,159,160,161,137,162,136,34],"mexc spot rest","REST","admin","signing","Wallet","requests","actions","secure","data","orders",{"skillNo":164,"name":165,"nameZh":6,"description":166,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":128,"licenseFileUrl":167,"sourceHtmlUrl":168,"categories":169,"keywords":170,"publishedAt":53},"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",[],[171,172,135,173,174,143,43,175,140,139,137,136],"mexc futures websocket","futures","position","ping","subscriptions",{"skillNo":177,"name":178,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":179,"sourceHtmlUrl":180,"categories":181,"keywords":182,"publishedAt":53},"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",[],[183,184,185],"refresh","0xklen version and refresh sanctions lists","version",{"skillNo":187,"name":188,"nameZh":6,"description":189,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":190,"sourceHtmlUrl":191,"categories":192,"keywords":193,"publishedAt":53},"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",[],[194,195,196,197,198,199,200,49,201,202,203],"tests","cover","verify tests cover changed lines","verify","coverage","pr","exercise","patch","code","share"]