[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M735HM18C7ZC06Q7JXAC08K6":3,"skill-same:01M735HM18C7ZC06Q7JXAC08K6":62},{"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":30,"commitSha":31,"skillDirectory":32,"forksCount":14,"repositoryHtmlUrl":33,"repositoryHomepageUrl":6,"ownerHtmlUrl":34,"ownerBlogUrl":35,"ownerDescription":36,"updatedAt":37,"install":38,"resources":51},"01M735HM18C7ZC06Q7JXAC08K6","agent-building",null,"How to build an AI agent component on the platform — designing its `agent.afm.md` contract and implementing that contract as a TypeScript service with the Vercel AI SDK, generating its tools from the OpenAPI contracts of the components it depends on. Apply when a component's `type` is `ai-agent`. For a plain backend service, use `ballerina` or `go` instead.","wso2\u002Flabs-agentic-engineer","wso2","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F533043?v=4","01M6CDAFS40T9Y86DYXWE0NJES","WSO2","01M735EE4N2PP2ZR56AX7DNPNP",24,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Fagent-building\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: agent-building\ndescription: How to build an AI agent component on the platform — designing its `agent.afm.md` contract and implementing that contract as a TypeScript service with the Vercel AI SDK, generating its tools from the OpenAPI contracts of the components it depends on. Apply when a component's `type` is `ai-agent`. For a plain backend service, use `ballerina` or `go` instead.\nmetadata:\n  aep:\n    kind: org\n    audience: [design, coding]\n---\n\n# Building an agent\n\nAn `ai-agent` component is one contract and one implementation of it:\n\n- **`specs\u002Fdesign\u002Fcomponents\u002F\u003Cname>\u002Fagent.afm.md`** — the agent itself. Its\n  markdown body becomes the system prompt verbatim; its allow-list becomes the\n  only operations the model can reach.\n- **A TypeScript service** running a Vercel AI SDK loop, which implements that\n  document the way a service implements its `openapi.yaml`.\n\nBoth halves are here on purpose. They used to be two skills, and the facts\nbelow — which each half states from its own side — drifted apart in ways that\nonly showed up in a deployed agent.\n\n## Read one of these next\n\n**Writing or editing `agent.afm.md`** → read `references\u002Fdesigning.md`, and stop.\n\n**Implementing the component** → read `references\u002Fbuilding.md`, and stop. It\ncarries the code to copy, and an agent built without it will be missing its\nconversation store or its identity gate.\n\nThe rest of this page is what BOTH halves must agree on. Read it either way.\n\n## The contract\n\n**`POST \u002Fchat`** — `{ conversationId?, message }` in, `{ conversationId, text,\ntoolCalls }` out. History lives in the agent's own store and never crosses the\nwire. `GET \u002Fhealthz` is the other route; there are no more.\n\n**`conversationId` is the caller's only piece of state.** ABSENT means \"new\nconversation\": create one and return its id. An id that is present but does not\nresolve **for this user** is **404, never a new conversation** — adopting a\ncaller-chosen id lets one caller pick another's and write under it.\n\n**Memory is server-held.** The agent keeps the conversation; the caller holds an\nidentifier. `x-aep.memory.type: \"server\"` is the default and what the store\nimplements. `client` remains valid only where the caller genuinely owns the\ntranscript — rare, and the design says why.\n\n**Identity is the gateway's, not the caller's.** Every turn arrives with a\ngateway-injected `x-user-id`. The agent 401s without it, and scopes every\nconversation row by it. The agent never derives identity from the request body\nor from the conversation itself.\n\n**The allow-list is the security boundary.** `x-aep.tools.openapi[].allow` names\noperations by `operationId` from the dependency's committed contract. An\noperation left out is never generated as a tool, so no phrasing can reach it.\nA prohibition written in the prompt is a hint; omission from `allow` is a\nguarantee. This is why neither half may \"helpfully\" add an operation the design\ndid not list.\n\n**Nothing is a literal.** Addresses and credentials are `${env:NAME}`, injected\nfrom the component's dependencies at deploy. `specs\u002F` is committed to git.\n`MODEL_*` needs no dependency — an `ai-agent` gets model access from its\ncomponent type, either on the organisation's own key or through the platform's\nAI gateway. Which one is not the agent's business: it reads the same `MODEL_*`\nvariables either way, whatever host or API format the organisation's connection\nnames. See `references\u002Fbuilding.md`, \"Model access\", for the switch on the\nformat and the one header override that differs.\n\n## Where each fact is enforced\n\nA design that declares something the implementation ignores is not a design.\n\n| The contract says | The design declares | The implementation does |\n|---|---|---|\n| one turn per request | `interfaces: webchat`, path `\u002Fchat` | serves `POST \u002Fchat`, that shape |\n| the agent owns history | `x-aep.memory.type: \"server\"` | the conversation store, scoped by user |\n| only these operations | `allow: [...]` | generates a tool per entry, and no others |\n| the caller is whoever signed in | `x-aep.identity.mode: \"on-behalf-of\"` | gates on `x-user-id`, forwards the caller's token |\n| the agent takes files | `x-aep.attachments: { types, maxFiles, maxFileSizeMB }` | `\u002Fchat` accepts base64 `attachments` within them; 413 past 24 MiB; files ride one turn; 422 when the model can't read them |\n| a Product Decision asks for a guardrail | `x-aep.guardrails: [{ policy, params, why }]` | the AI gateway applies it to the agent's model traffic at deploy; each outcome is on the deployment |\n| behaviour is graded before the PR | `specs\u002Fvalidation\u002Fagent-scenarios.json`, from the requirements alone | runs the scenarios, may revise only the prompt body, reports the score — **unless evaluation is disabled** (`AEP_AGENT_EVAL` unset or not `on`), in which case it is skipped and the PR says so. See `references\u002Fbuilding.md`, \"Evaluate before you open the PR\" |\n| no secrets in git | `${env:NAME}` | reads them from config, never hardcodes |\n","# Building an agent\n\nAn `ai-agent` component is one contract and one implementation of it:\n\n- **`specs\u002Fdesign\u002Fcomponents\u002F\u003Cname>\u002Fagent.afm.md`** — the agent itself. Its\n  markdown body becomes the system prompt verbatim; its allow-list becomes the\n  only operations the model can reach.\n- **A TypeScript service** running a Vercel AI SDK loop, which implements that\n  document the way a service implements its `openapi.yaml`.\n\nBoth halves are here on purpose. They used to be two skills, and the facts\nbelow — which each half states from its own side — drifted apart in ways that\nonly showed up in a deployed agent.\n\n## Read one of these next\n\n**Writing or editing `agent.afm.md`** → read `references\u002Fdesigning.md`, and stop.\n\n**Implementing the component** → read `references\u002Fbuilding.md`, and stop. It\ncarries the code to copy, and an agent built without it will be missing its\nconversation store or its identity gate.\n\nThe rest of this page is what BOTH halves must agree on. Read it either way.\n\n## The contract\n\n**`POST \u002Fchat`** — `{ conversationId?, message }` in, `{ conversationId, text,\ntoolCalls }` out. History lives in the agent's own store and never crosses the\nwire. `GET \u002Fhealthz` is the other route; there are no more.\n\n**`conversationId` is the caller's only piece of state.** ABSENT means \"new\nconversation\": create one and return its id. An id that is present but does not\nresolve **for this user** is **404, never a new conversation** — adopting a\ncaller-chosen id lets one caller pick another's and write under it.\n\n**Memory is server-held.** The agent keeps the conversation; the caller holds an\nidentifier. `x-aep.memory.type: \"server\"` is the default and what the store\nimplements. `client` remains valid only where the caller genuinely owns the\ntranscript — rare, and the design says why.\n\n**Identity is the gateway's, not the caller's.** Every turn arrives with a\ngateway-injected `x-user-id`. The agent 401s without it, and scopes every\nconversation row by it. The agent never derives identity from the request body\nor from the conversation itself.\n\n**The allow-list is the security boundary.** `x-aep.tools.openapi[].allow` names\noperations by `operationId` from the dependency's committed contract. An\noperation left out is never generated as a tool, so no phrasing can reach it.\nA prohibition written in the prompt is a hint; omission from `allow` is a\nguarantee. This is why neither half may \"helpfully\" add an operation the design\ndid not list.\n\n**Nothing is a literal.** Addresses and credentials are `${env:NAME}`, injected\nfrom the component's dependencies at deploy. `specs\u002F` is committed to git.\n`MODEL_*` needs no dependency — an `ai-agent` gets model access from its\ncomponent type, either on the organisation's own key or through the platform's\nAI gateway. Which one is not the agent's business: it reads the same `MODEL_*`\nvariables either way, whatever host or API format the organisation's connection\nnames. See `references\u002Fbuilding.md`, \"Model access\", for the switch on the\nformat and the one header override that differs.\n\n## Where each fact is enforced\n\nA design that declares something the implementation ignores is not a design.\n\n| The contract says | The design declares | The implementation does |\n|---|---|---|\n| one turn per request | `interfaces: webchat`, path `\u002Fchat` | serves `POST \u002Fchat`, that shape |\n| the agent owns history | `x-aep.memory.type: \"server\"` | the conversation store, scoped by user |\n| only these operations | `allow: [...]` | generates a tool per entry, and no others |\n| the caller is whoever signed in | `x-aep.identity.mode: \"on-behalf-of\"` | gates on `x-user-id`, forwards the caller's token |\n| the agent takes files | `x-aep.attachments: { types, maxFiles, maxFileSizeMB }` | `\u002Fchat` accepts base64 `attachments` within them; 413 past 24 MiB; files ride one turn; 422 when the model can't read them |\n| a Product Decision asks for a guardrail | `x-aep.guardrails: [{ policy, params, why }]` | the AI gateway applies it to the agent's model traffic at deploy; each outcome is on the deployment |\n| behaviour is graded before the PR | `specs\u002Fvalidation\u002Fagent-scenarios.json`, from the requirements alone | runs the scenarios, may revise only the prompt body, reports the score — **unless evaluation is disabled** (`AEP_AGENT_EVAL` unset or not `on`), in which case it is skipped and the PR says so. See `references\u002Fbuilding.md`, \"Evaluate before you open the PR\" |\n| no secrets in git | `${env:NAME}` | reads them from config, never hardcodes |\n",{"name":5,"metadata":24,"description":7},{"aep":25},{"kind":26,"audience":27},"org",[28,29],"design","coding","main","e3b5fc8668f26761380b2d4965719f2d8f2eb246","skills\u002Fagent-building","https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer","https:\u002F\u002Fgithub.com\u002Fwso2","https:\u002F\u002Fwso2.com","Welcome to the WSO2 source code! For info on working with the WSO2 repositories and contributing code, click the link below.","2026-11-11 15:36:27",{"source":8,"skillName":5,"commands":39,"prompt":49,"zipAvailable":50},[40,43,46],{"tool":41,"command":42},"npx","npx skills add wso2\u002Flabs-agentic-engineer --skill agent-building",{"tool":44,"command":45},"bunx","bunx skills add wso2\u002Flabs-agentic-engineer --skill agent-building",{"tool":47,"command":48},"pnpm","pnpm dlx skills add wso2\u002Flabs-agentic-engineer --skill agent-building","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Fagent-building\u002FSKILL.md",true,[52,58],{"path":53,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":56,"sourceHtmlUrl":57},"references\u002Fbuilding.md","REFERENCE","参考文档",60137,"https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Fagent-building\u002Freferences\u002Fbuilding.md",{"path":59,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":60,"sourceHtmlUrl":61},"references\u002Fdesigning.md",13108,"https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Fagent-building\u002Freferences\u002Fdesigning.md",[63,70,77,84,91,98],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M735MP9NFFRPS260G9D16JQX","validation-task","Load when working a VALIDATION task dispatched by WSO2 Labs Agentic Engineer — judging a deployed version against its acceptance criteria.","https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Fvalidation-task\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"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},"01M735MJ8ZMRZR20A57TMF7R9Q","thunder-authentication","Apply when a component sits on the project's sign-in — a SPA whose users authenticate through the auth platform-resource dependency, or a protected backend those signed-in users call.","https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Fthunder-authentication\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},"01M735MFQMY8DY1EM7JKS784D3","task-planning","Use when planning a version's build from a design — the plan turn that writes the build's checklist with planBuild, one item per feature the version carries in build order, after a Foundation item when the version needs one.","https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Ftask-planning\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},"01M735MCJQ4EVH7G4ZFMC682Y4","start","Use when kicking off a project from its idea — the product pass that agrees the feature list and writes the product page, the product-wide page and a stub per feature — or re-running \u002Fstart on a project that already has requirements.","https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Fstart\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},"01M735M9R050KT3H34PVXN2MKK","security-design","Write specs\u002Fdesign\u002Fsecurity.json when a design has sign-in, permissions, roles or test users — the permission catalog every API operation is gated on.","https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Fsecurity-design\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},"01M735M60CTW4S7XMS6XCX9A7Y","resolve-dependency","Use for taking one external dependency from open to resolved — `\u002Fresolve-dependency \u003Cname> [answer]` names it and may carry the provider the user chose; `\u002Fresolve-dependencies` walks every open one in turn. Ask which provider (their suggestions as options; never choose for them), get its interface on disk (found, uploaded from the card, or assumed under the authorization the card records), then derive the config keys.","https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Fresolve-dependency\u002FSKILL.md",[],[]]