[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78CWXHCGGCVV6YMJ9SXBZRV":3,"skill-same:01M78CWXHCGGCVV6YMJ9SXBZRV":63},{"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":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":31,"commitSha":32,"skillDirectory":33,"forksCount":34,"repositoryHtmlUrl":35,"repositoryHomepageUrl":36,"ownerHtmlUrl":37,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":38,"install":39,"resources":52},"01M78CWXHCGGCVV6YMJ9SXBZRV","api-integration",null,"Implement REST route handlers, ORM queries, WebSocket telemetry, or SSE endpoints in the main web app, or consume those APIs from clients. NOT for schema-only changes or deployment\u002Finfra config.","atretyak1985\u002Fswarmery","atretyak1985","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1436737?v=4","01M78CTSX57YH0EYY9YGH0TWKX","Andrii Tretiak","01M78CTSXRPJPYQ7GNPMP45TYX",8,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002Fplugins\u002Fcore\u002Fskills\u002Fapi-integration\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: api-integration\ndescription: \"Implement REST route handlers, ORM queries, WebSocket telemetry, or SSE endpoints in the main web app, or consume those APIs from clients. NOT for schema-only changes or deployment\u002Finfra config.\"\nversion: \"1.0.0\"\nowner: \"swarmery-core\"\nallowed-tools: Read, Write, Grep, Glob\ndocs:\n  status: reviewed\n  source_sha: 608ee7571769\n  updated: 2026-08-06\n---\n\n# Purpose\n\nProduce tested integration code connecting the platform's layers: REST route handlers in the main app (project.json -> `mainApp`), ORM queries, server-side WebSocket clients for device\u002Fedge telemetry (project.json -> `device`), and SSE endpoints fanning real-time data to browsers. Generated code follows project conventions; patterns use Drizzle ORM — adapt to the project's actual ORM (project.json -> `stack.db`).\n\n# Rules (never violate)\n\n- Verify the real ORM schema before writing; STOP and ask if table or column names are missing or ambiguous — never code against a guessed schema.\n- Always `getDb()` (lazy init), `await auth()` with 401 on authenticated routes, `dynamic = 'force-dynamic'` on session\u002Fenv-reading routes, Zod on all external data.\n- Never hardcode environment-specific values (URLs, hostnames, API keys) — use `getServerEnv()`; refuse if asked.\n- Every `useEffect` opening an EventSource\u002FWebSocket returns a cleanup function.\n- Never overwrite an existing file without reading it and informing the user first.\n- After any write, run `api-contract` to verify field alignment across layers.\n\n# Resources\n\n- Read `resources\u002Fintegration-patterns.md` when writing code — the six reference patterns (REST handler, ORM queries, lazy DB init, WebSocket, SSE, EventSource hook).\n- Read `resources\u002Fprocedure-and-checks.md` when executing a task — the 8-step procedure, self-check, common mistakes, escalation, failure modes, and a full worked example.\n\n# How to use\n\n## What it does\n\nWrites the integration code connecting your layers: a REST route handler, an ORM query, a server-side WebSocket client ingesting device telemetry, or an SSE endpoint fanning it out. It checks your real schema before writing, then applies project conventions throughout.\n\n## When to use it\n\n- A new route handler under `apps\u002F\u003CmainApp>\u002Fsrc\u002Fapp\u002Fapi\u002F**\u002Froute.ts`.\n- An ORM select, insert, update, or delete in a handler or Server Component.\n- A WebSocket telemetry subscription, SSE endpoint, or browser `EventSource` hook.\n\nNot for schema-only changes (`api-contract`), deploy manifests (the project's infra pack skills), style review (`code-standards`\u002F`code-quality`), or metrics\u002Ftracing (compose with `observability`).\n\n## How to invoke\n\n```\nSkill(skill: \"core:api-integration\")\n```\n\nDescribe the integration in plain words: `task` (required), `entity` (required), and optionally `integration_type` (`rest`, `orm`, `websocket`, `sse`) — inferred when omitted.\n\n## Worked example\n\n```\nSkill(skill: \"core:api-integration\")\n\"Add a route handler to get a single order by ID with its line items.\"\n```\n\nThe skill greps the schema to confirm the `orders` and join tables exist, globs the target path to check nothing gets overwritten, then writes the handler: session check, ID parsed with 400 on bad input, a `getDb()` query with two left joins, 404 on empty result. You get the file path, the pattern applied, and an `api-contract` check confirming field alignment.\n\n## Related\n\n- `api-contract` — mandatory after any write; `code-standards`\u002F`code-quality` — review existing code; `observability` — metrics and tracing.\n","# Purpose\n\nProduce tested integration code connecting the platform's layers: REST route handlers in the main app (project.json -> `mainApp`), ORM queries, server-side WebSocket clients for device\u002Fedge telemetry (project.json -> `device`), and SSE endpoints fanning real-time data to browsers. Generated code follows project conventions; patterns use Drizzle ORM — adapt to the project's actual ORM (project.json -> `stack.db`).\n\n# Rules (never violate)\n\n- Verify the real ORM schema before writing; STOP and ask if table or column names are missing or ambiguous — never code against a guessed schema.\n- Always `getDb()` (lazy init), `await auth()` with 401 on authenticated routes, `dynamic = 'force-dynamic'` on session\u002Fenv-reading routes, Zod on all external data.\n- Never hardcode environment-specific values (URLs, hostnames, API keys) — use `getServerEnv()`; refuse if asked.\n- Every `useEffect` opening an EventSource\u002FWebSocket returns a cleanup function.\n- Never overwrite an existing file without reading it and informing the user first.\n- After any write, run `api-contract` to verify field alignment across layers.\n\n# Resources\n\n- Read `resources\u002Fintegration-patterns.md` when writing code — the six reference patterns (REST handler, ORM queries, lazy DB init, WebSocket, SSE, EventSource hook).\n- Read `resources\u002Fprocedure-and-checks.md` when executing a task — the 8-step procedure, self-check, common mistakes, escalation, failure modes, and a full worked example.\n\n# How to use\n\n## What it does\n\nWrites the integration code connecting your layers: a REST route handler, an ORM query, a server-side WebSocket client ingesting device telemetry, or an SSE endpoint fanning it out. It checks your real schema before writing, then applies project conventions throughout.\n\n## When to use it\n\n- A new route handler under `apps\u002F\u003CmainApp>\u002Fsrc\u002Fapp\u002Fapi\u002F**\u002Froute.ts`.\n- An ORM select, insert, update, or delete in a handler or Server Component.\n- A WebSocket telemetry subscription, SSE endpoint, or browser `EventSource` hook.\n\nNot for schema-only changes (`api-contract`), deploy manifests (the project's infra pack skills), style review (`code-standards`\u002F`code-quality`), or metrics\u002Ftracing (compose with `observability`).\n\n## How to invoke\n\n```\nSkill(skill: \"core:api-integration\")\n```\n\nDescribe the integration in plain words: `task` (required), `entity` (required), and optionally `integration_type` (`rest`, `orm`, `websocket`, `sse`) — inferred when omitted.\n\n## Worked example\n\n```\nSkill(skill: \"core:api-integration\")\n\"Add a route handler to get a single order by ID with its line items.\"\n```\n\nThe skill greps the schema to confirm the `orders` and join tables exist, globs the target path to check nothing gets overwritten, then writes the handler: session check, ID parsed with 400 on bad input, a `getDb()` query with two left joins, 404 on empty result. You get the file path, the pattern applied, and an `api-contract` check confirming field alignment.\n\n## Related\n\n- `api-contract` — mandatory after any write; `code-standards`\u002F`code-quality` — review existing code; `observability` — metrics and tracing.\n",{"docs":24,"name":5,"owner":28,"version":29,"description":7,"allowed-tools":30},{"status":25,"updated":26,"source_sha":27},"reviewed",1785974400000,"608ee7571769","swarmery-core","1.0.0","Read, Write, Grep, Glob","main","2d9e918cc79c9b17b59356780ff0a3da38a3e98a","plugins\u002Fcore\u002Fskills\u002Fapi-integration",5,"https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery","https:\u002F\u002Fatretyak1985.github.io\u002Fswarmery\u002F","https:\u002F\u002Fgithub.com\u002Fatretyak1985","2026-11-11 04:29:12",{"source":8,"skillName":5,"commands":40,"prompt":50,"zipAvailable":51},[41,44,47],{"tool":42,"command":43},"npx","npx skills add atretyak1985\u002Fswarmery --skill api-integration",{"tool":45,"command":46},"bunx","bunx skills add atretyak1985\u002Fswarmery --skill api-integration",{"tool":48,"command":49},"pnpm","pnpm dlx skills add atretyak1985\u002Fswarmery --skill api-integration","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002Fplugins\u002Fcore\u002Fskills\u002Fapi-integration\u002FSKILL.md",true,[53,59],{"path":54,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":57,"sourceHtmlUrl":58},"resources\u002Fintegration-patterns.md","REFERENCE","参考文档",4917,"https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002Fplugins\u002Fcore\u002Fskills\u002Fapi-integration\u002Fresources\u002Fintegration-patterns.md",{"path":60,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":61,"sourceHtmlUrl":62},"resources\u002Fprocedure-and-checks.md",7312,"https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002Fplugins\u002Fcore\u002Fskills\u002Fapi-integration\u002Fresources\u002Fprocedure-and-checks.md",[64,71,77,84,91,98],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M78D4T1FFWFW19Z44AHH5BSY","short-desc","Too short.","https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002Ftools\u002Fswarmery\u002Ftestdata\u002Fsysconfig\u002Fclaude\u002Fskills\u002Fshort-desc\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"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":74,"categories":75,"keywords":76,"publishedAt":19},"01M78D4S0TWT42WXFJHC1DBN0R","no-frontmatter","https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002Ftools\u002Fswarmery\u002Ftestdata\u002Fsysconfig\u002Fclaude\u002Fskills\u002Fno-frontmatter\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M78D4Q14P8DJ4W78N62F3EG2","global-skill","Fixture global skill (minimal user-scope shape, format doc §2.3).","https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002Ftools\u002Fswarmery\u002Ftestdata\u002Fsysconfig\u002Fclaude\u002Fskills\u002Fglobal-skill\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M78D4N1JHGQJQ7EZ43KY5SV3","documented-skill","Fixture skill whose usage guide deliberately omits the Worked example subsection.","https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002Ftools\u002Fswarmery\u002Ftestdata\u002Fsysconfig\u002Fclaude\u002Fskills\u002Fdocumented-skill\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":19},"01M78D4KVNZ03GBKGDFJZWW5FJ","z","NOT auto-discovered — only skills\u002F is scanned for plugins (§2.2).","https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002Ftools\u002Fswarmery\u002Ftestdata\u002Fsysconfig\u002Fclaude\u002Fplugins\u002Fcache\u002Fmkt\u002Ftoolpack\u002F1.0.0\u002Fworkflow-skills\u002Fz\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":19},"01M78D4JMBRZWK51HFE5RZJGHC","y","Plugin skill y from toolpack — stored as \"toolpack:y\".","https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002Ftools\u002Fswarmery\u002Ftestdata\u002Fsysconfig\u002Fclaude\u002Fplugins\u002Fcache\u002Fmkt\u002Ftoolpack\u002F1.0.0\u002Fskills\u002Fy\u002FSKILL.md",[],[]]