[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6D2HFT70Y207Z8MC98KN75G":3,"skill-same:01M6D2HFT70Y207Z8MC98KN75G":71},{"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":23,"publishedAt":44,"linkOnly":45,"markdownContent":46,"markdownBody":47,"frontMatter":48,"refName":49,"commitSha":50,"skillDirectory":51,"forksCount":52,"repositoryHtmlUrl":53,"repositoryHomepageUrl":54,"ownerHtmlUrl":55,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":56,"install":57,"resources":70},"01M6D2HFT70Y207Z8MC98KN75G","creating-worca-cc-plugins",null,"Use when creating, scaffolding, debugging, reviewing, or extending a Worca CC plugin — anything involving worca-cc-plugin.json, a task-source connector, plugin-shipped agents\u002Fscripts\u002Fskills\u002Fworkflow templates, the `worca plugin` CLI, or the Marketplace page.","SinishaDjukic\u002Fworca-cc","SinishaDjukic","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F5585698?v=4","01M6D2H74230S1Y6B2G3GCWRWQ","Sinisha Djukic","01M6D2H78EVBK4NCN9KKVCG3XZ",56,"MIT","https:\u002F\u002Fgithub.com\u002FSinishaDjukic\u002Fworca-cc\u002Fblob\u002Fdev\u002F.claude\u002Fskills\u002Fcreating-worca-cc-plugins\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"plugins","worca","creating worca cc plugins","cc","Connector","extending","when","source","scripts","scaffolding","task","cli","use","page","json","templates","marketplace","debugging","plugin","workflow","2026-11-10 10:12:30",false,"---\nname: creating-worca-cc-plugins\ndescription: Use when creating, scaffolding, debugging, reviewing, or extending a Worca CC plugin — anything involving worca-cc-plugin.json, a task-source connector, plugin-shipped agents\u002Fscripts\u002Fskills\u002Fworkflow templates, the `worca plugin` CLI, or the Marketplace page.\n---\n\n# Creating Worca CC Plugins\n\nA Worca CC plugin is a **git repo** (or a subdir one level deep) containing `worca-cc-plugin.json`.\nIt contributes up to six things to the host, ships **no code that runs in the browser**, and — from\nplugin API 4 — can ship the **declared forms** its agents ask questions with.\n\n| Dir | Contributes | Executed? |\n|---|---|---|\n| `connector\u002F*.mjs` (via `taskSources[].module`) | task-source connector | **Yes** — in an ephemeral child process |\n| `scripts\u002F\u003Ckey>.meta.json` + the program it names | pipeline scripts (node \u002F shell \u002F python) | **Yes** — worca spawns the program per execution |\n| `agents\u002F\u003Ckey>.md` + `\u003Ckey>.meta.json` | pipeline agents (meta v2 sidecar: typed input\u002Foutput ports; `ask.forms` from API 4) | No — prompt text fed to `claude -p`, forms drawn by the host |\n| `skills\u002F\u003Cname>\u002FSKILL.md` | agent skills | No — copied into the run worktree for an agent that requires it; a user can add any of them to a set, and runs and Chat then get it as `\u002F\u003Cset>:\u003Cname>` |\n| `workflows\u002F*.json` | pipeline templates (v2 graph JSON — one Task node, one End node) | No — validated into DB rows |\n| `mcpServers` in the manifest (API 5) | MCP servers for worca's registry | **Yes** — a stdio server is started per spawn once a user adds it to a set |\n\n**The connector, the scripts and stdio MCP servers are the executable seams.** Everything else is data.\nInternalize this before designing anything.\n\n## Start here — always scaffold\n\n```bash\nworca plugin init my-plugin --with task-source,agents,skills,workflows\n```\n\nProduces a plugin that already passes `validate --strict`. Edit it; don't hand-roll a manifest.\nDrop parts you don't need with `--with` (note: `workflows` requires `agents`).\n\n## Dev loop\n\n```bash\nworca plugin link .\u002Fmy-plugin                                  # current\u002F -> your working dir (imports workflows\u002F)\nWORCA_MOCK=1 worca plugin exec my-plugin main listTasks        # offline, canned frames\nworca plugin exec my-plugin main getTask --args '{\"id\":\"X-1\"}' # real call\nworca plugin exec my-plugin main listTasks --inspect           # --inspect-brk on the child\nworca plugin reimport my-plugin                                # re-read workflows\u002F*.json after an edit\nworca plugin validate .\u002Fmy-plugin --strict\nworca plugin new-script tidy --dir .\u002Fmy-plugin                 # scripts\u002Ftidy.{meta.json,mjs,tests.json}\nworca plugin validate .\u002Fmy-plugin --run-cases                  # lint, then RUN every shipped script case\nworca script test tidy                                         # one bench run of a linked\u002Finstalled script\nworca script test tidy --all                                   # its saved cases; exit 1 = a case failed\nworca plugin doctor my-plugin\n```\n\n`link` takes a **dir**, not a name — the name comes from the manifest. Linked plugins refuse `update`.\nEdits to a linked dir are live for the connector, agents and skills: no reinstall, the next op spawns\na fresh child. **Pipeline templates are the exception** — they are DB rows, imported once at `link`\n(and at `install`\u002F`update`), so after editing `workflows\u002F*.json` run `worca plugin reimport \u003Cname>`.\nReimport upserts: a template file you DELETE keeps its row until the plugin is removed.\n\n`plugin list`, `plugin doctor` and its row under Marketplace › Installed › Needs attention name every contribution worca **ignored** —\nan agent key that collides with an existing agent, a sidecar that fails the meta v2 gate, a template\nthat fails graph validation. If your agent or flow is missing, that line says why.\n\n## Manifest quick reference\n\nOnly `name` is required. Unknown fields are warnings (errors under `--strict`).\n\n| Field | Notes |\n|---|---|\n| `name` | kebab-case, ≤64 chars, machine-unique, used as a dir name |\n| `version` | optional — absent means the pinned SHA **is** the version; the Marketplace offers an update only when the marketplace lists a higher `x.y.z` on the branch your install follows |\n| `engines.worca-cc-api` | `\">=4 \u003C5\"` (what `plugin init` writes); `\">=5 \u003C6\"` to ship MCP servers. Integer host API. Unparseable → fails closed, won't install. Host APIs are a SET ([1, 2, 3, 4, 5]); the highest version your range admits is **negotiated**, and that is what decides which features you get. API 3 adds meta v2 sidecars and v2 graph templates; **API 4 honours an agent's `ask.forms`**; **API 5 honours the manifest's `mcpServers`** |\n| `setup.node` | `true` → `npm ci --ignore-scripts --omit=dev` at install. **Lockfile mandatory** |\n| `setup.python` | only `\"pyproject\"` → `uv sync`. Worca CC never *runs* python; your JS spawns it |\n| `taskSources[].id` | kebab-case |\n| `taskSources[].module` | must start `.\u002F`, no `..`, no backslashes |\n| `taskSources[].configSchema[]` | persistent config — `text` \\| `select`, plus `secret`\u002F`required`\u002F`default`\u002F`help`\u002F`options`\u002F`advanced` (`advanced: true` folds an optional tuning field under **More options**; hosts older than this ignore it with an unknown-field warning) |\n| `taskSources[].multiProfile` | `true` → one install holds several independent configurations (two Jira servers, two orgs), each with its own config\u002Fsecrets\u002Fstate. Users create profiles in the UI and bind each project\u002Fworkspace to one. Omit it and the source uses a single implicit `default` profile — identical to before profiles existed |\n| `taskSources[].inputs[]` | per-run UI — see next table. **Exactly one `task-browser` required** |\n| `models[]` | catalog entries: `id`, `label`, `efforts`, `env` (literal or `{\"secret\": \"\u003Ckey>\"}`), `cost` (`{free:true}` \\| `{perMtok:{…}}`), and `upstream` for a bridged model — `{provider: \"copilot\"\\|\"openai\"\\|\"anthropic\", api: \"anthropic\"\\|\"openai-chat\"\\|\"openai-responses\", model, baseUrl?, apiKey? (a `${VAR}` ref only, never a literal), headers?, capabilities? (toolCalls, vision, reasoning, maxPromptTokens, maxOutputTokens, reasoningEfforts)}`. A `copilot` entry resolves against each user's own sign-in |\n| `modelSecrets[]` | `{key, label}` — the secrets `models[].env` may reference; prompted for at install. With the credential broker on, each person adds the key on the key page instead (a per-person `p-\u003Cplugin>-\u003Ckey>` slot): keep `ANTHROPIC_BASE_URL` a literal URL and put the secret only in `ANTHROPIC_AUTH_TOKEN` or `ANTHROPIC_API_KEY` (docs\u002Fcredential-broker.md \"Plugin slots\") |\n| `mcpServers` | API 5: name → MCP server definition (`type`, `command`\u002F`args`\u002F`env` or `url`\u002F`headers`, `fields`, `description`) — see **MCP servers (API 5)** |\n\n## Marketplace manifest (repo-level, optional)\n\nA repo can declare itself a **marketplace** with `worca-cc-marketplace.json` at its root:\n\n```json\n{ \"name\": \"My Plugins\", \"description\": \"…\", \"plugins\": [\"plugins\u002Fone\", \"plugins\u002Ftwo\"] }\n```\n\nListed dirs (any depth, no `..`) each contain a `worca-cc-plugin.json`; when the file is\npresent it is the complete plugin list (the depth 0–1 auto-scan is skipped). Repos without\nit still work as implicit marketplaces via the scan, named `owner\u002Frepo` (a local folder by its folder name). The worca-cc repo itself is a\nmarketplace (its bundled plugins live under `plugins\u002F`), registered by default.\n\n## UI is schema-driven — pick from these widgets\n\nYou declare shapes; the host renders them. **No plugin code ever runs in the browser** — not for a\nsource pane, not for a question form. The two declarative surfaces are the source `inputs[]` below\nand an agent's `ask.forms` (see [Ask forms](#ask-forms-api-4)).\n\n| `inputs[].type` | Widget | Requires |\n|---|---|---|\n| `text` | text box | — |\n| `select` | static dropdown | `options[]` |\n| `remote-select` | dropdown, loaded on first focus by calling your connector | `optionsFrom` (a connector op name) |\n| `task-browser` | debounced search + result list + preview | exactly one per source |\n\n`configSchema[]` supports only `text` and `select`; `secret: true` renders `type=password` and is\nnever sent back to the browser (arrives redacted as `{set: true}`).\n\nSecrets are stored in the plugin's `data\u002Fsecrets.json` (mode 0600) under Worca's home and reach your\nconnector or chat worker on stdin, never in its env. That is not isolation between plugins: on a\nnative install every plugin child runs as Worca's own user and could open any plugin's\n`secrets.json`. Only the container with single-volume isolation runs connectors and chat workers\nas a separate `worca-plugin` user, with its own `HOME` and no access to `data\u002F` or Worca's home\n(docs\u002Fdocker.md). Don't promise users more, and on that container don't write into your own\ninstall folder (it is read-only to that user): keep caches under `HOME`.\n\n**`remote-select` + `optionsFrom` is the extensibility hatch.** Naming an op there is also what\nallowlists it for the browser — undeclared ops are rejected with 400 at `\u002Fapi\u002Fsources\u002Fcall`.\nThe data, filtering, and pagination semantics behind every widget are entirely yours.\n\n## Connector contract (unchanged through API 3)\n\nDefault-export a **factory**, not a class:\n\n```js\nexport default function createTaskSource(ctx) {\n  return { validateConfig, listTasks, getTask, reportResult, capabilities, \u002F* custom ops *\u002F };\n}\n```\n\n| Op | Signature | Returns |\n|---|---|---|\n| `validateConfig` | `()` | `{ok:true, identity?}` \\| `{ok:false, errors:[{field,message}]}` — gates the whole pane |\n| `listTasks` | `({inputs, search, cursor})` | `{tasks:[{id,title,url,state,labels,updatedAt}], cursor?}` |\n| `getTask` | `(id)` — **positional** | `{...summary, body \u002F* markdown *\u002F, meta}` |\n| `reportResult` | `(id, {status, summary, links, inputs, move?})` — **positional** | anything; with `move` (Ticket updates): `{moved: {from, to} \\| null, note}` |\n| `capabilities` | `({inputs})` — optional | `{writeBack, incrementalSync, export?, import?, ticketUpdates?}`; missing → `writeBack: true`; `export: true` turns on the export ops below, `import: true` the import ops, `ticketUpdates: true` the Ticket updates ops |\n| `exportOptions` | `({project?, issueType?})` — optional, export | `{projects:[{value,label}], issueTypes?, priorities?, criteriaFields?, doneStatus, tooOld?}` — `issueTypes` with a project, the last two with both |\n| `createTicket` | `({ticket})` — optional, export | `{key, url, fingerprint}` \\| `{refused:{field, message}}` |\n| `updateTicket` | `({key, ticket})` — optional, export | `{key, url, fingerprint}` \\| `{gone:true}` \\| `{refused}` |\n| `commentTicket` | `({key, body})` — optional, export | `{ok:true}` \\| `{gone:true}` |\n| `ticketState` | `({key})` — optional, export | `{exists:true, url, fingerprint}` \\| `{exists:false}` |\n| `findTicket` | `({project, label, marker})` — optional, export | `{key, url, fingerprint, lastLine, marker, labels}` \\| `null` |\n| `importOptions` | `({})` — optional, import | `{projects:[{value,label}]}` — may be the same list as `exportOptions({})`'s projects; it is its own op because a source may import without exporting |\n| `searchTickets` | `({project?, search?, cursor?})` — optional, import | `{tickets:[{key,title,url,type,status,updatedAt}], cursor?}` — no search: most recently updated first; a pasted key or ticket link finds that ticket in any project |\n| `importTicket` | `({key, criteriaField?})` — optional, import | `{key, url, title, description, criteria, comments, commentsTotal, restrictedComments, attachments, meta, fingerprint}` \\| `{gone:true}` |\n| `downloadAttachment` | `({key, id, maxBytes, dest})` — optional, import | the body written to `dest`, and `{name, mime, bytes}` \\| `{tooLarge:true, bytes}` \\| `{gone:true, forbidden?}` |\n| `listProjects` | `({})` — the project input's `optionsFrom` | `[{value, label, name?}]`; `name` (optional) is the project's name alone, for Ticket updates' chips; `value` is the project's key: at most one `\u002F` (GitHub's `owner\u002Frepo`), each part 1 to 100 characters and never `.` or `..`; control characters, `\\`, `?`, `#` and `%` are refused |\n| `listStatuses` | `({project})` — optional, Ticket updates | `[{value, label, category}]`, every status of the project once; `category` one of `todo`, `in_progress`, `done`, `cancelled` |\n| `legacyMove` | `({})` — optional, Ticket updates | `{field, target}`: your old \"on completion\" config key and what it means: `{category: 'done'}`, `{typed: '\u003Ctext>'}` or `null` |\n| custom | `(args)` | whatever the widget needs |\n\n**Ticket updates (`move`).** With `capabilities().ticketUpdates`, Worca decides what a finished run does to its ticket and\npasses it as `reportResult`'s `move`: `{category: 'done'}` (any status of the done category the ticket can reach, never a\ncancelled one), `{status: '\u003ClistStatuses value>', name?}` (one status; without `name` it is the typed text of your old\nsetting, matched as before: a transition's name first, then a target status's name) or `{none: true}`. Without `move`, keep\ndoing exactly what your old setting does. Move first, then post one comment ending with `note`, the line saying what happened\n(`''` when nothing was to be done), and answer `{moved, note}`. A move the tracker refuses (Jira: a 4xx other than 401 and\n429) is a `note` (\"Not moved: …\"), and the comment is still posted; throw on a refused token (401), a rate limit (429), a\nserver error, a network error or a timeout, so the write-back fails and can be retried. `getTask`'s `meta.project` names the\nticket's project as a `listProjects` value, so Worca can pick the project's rule without parsing your ids.\n\nThe export ops (Requirements' **Export to a tracker**) receive a tool-neutral ticket: `{project, issueType, title, description\n(Markdown), labels (already normalised, never with spaces), priority (id or null), criteria: {target:'description'} |\n{target:'field', field, items}, marker?}`. Write the description in your tracker's format, store `marker` invisibly on a\ncreate (Worca finds a ticket whose create answer was lost by it), add labels on an update without removing any, and return\n`fingerprint`: a hash of the description as your tracker stores it (read it back), normalised so the same stored text\nalways gives the same string. Worca compares fingerprints only. A field the tracker refuses and a ticket that is gone are\nresults (`refused`, `gone`), not throws; every call runs in the host, never from the browser, with a 60 s limit. The\nreference implementation is `plugins\u002Fjira-source`.\n\nThe import ops (Requirements' **New feature › From a ticket…**) only read. `importTicket` answers the ticket tool-neutrally:\n`description` and comment bodies as Markdown (never HTML), `criteria` only from a field (`{field:{id,name}, items}`, else\n`null`: Worca finds a criteria section in the description itself), the newest 50 comments oldest first with the author's\ndisplay name and `authorKind: 'person' | 'app'` only (never an email, account id or avatar; profile links and mentions become\nplain names), comments restricted to a group or role left out and counted in `restrictedComments`, attachments as metadata\n`{id, name, mime, bytes, created}`, `meta: {project, projectName, type:{id,name}, status, priority}` and the description's\n`fingerprint` as `ticketState` computes it. A ticket the connection cannot see is `{gone:true}`. `downloadAttachment` checks the\nattachment belongs to `key`, refuses before downloading when its size is over `maxBytes` (`{tooLarge}`), downloads only from the\nsite's own address (one redirect at most, `https:` only and without the Authorization header when it leaves the site), streams\nthe body into `dest` — a fixed file name inside a fresh private folder the host made — creating it exclusively, deletes what it\nwrote on any failure or once the body grows past `maxBytes`, and never writes anywhere else. Worca checks the file before it\ntrusts it.\n\n`ctx` = `{ apiVersion, profile, config, state: {get, set}, log }` — `apiVersion` is the negotiated highest version your range admits.\n\n- `ctx.config` — `configSchema` values, defaults applied, `{\"$env\":\"VAR\"}` already resolved\n- `ctx.state.get\u002Fset` — a KV bag; `set` only *records*, the **host** persists it after a successful frame\n- `ctx.profile` — which profile this op runs against (`'default'` unless `multiProfile`). `config` and `state` are *already* that profile's bucket; the id is here so a connector that keeps its own on-disk storage can key it the same way\n- `ctx.log(level, msg)` — the only legal output channel\n\nThrow `Object.assign(new Error(msg), { kind })` to pick the error kind:\n`auth | rate-limit | network | plugin | timeout | protocol`. The UI renders kind-keyed messages.\n\n## Runtime model — design around it\n\nOne `node` child process **per op**. No daemon, no reuse. Env is scrubbed to `{PATH, HOME}` only.\nPayload arrives on stdin, one JSON frame leaves on stdout, process exits. 30s timeout → SIGKILL.\n\n## Agents & templates (API 3)\n\nAn agent sidecar is meta v2: typed PORTS replace the v1 channel vocabulary.\n\n```json\n{\n  \"metaVersion\": 2,\n  \"displayName\": \"My Helper\",\n  \"runnerType\": \"producer\",\n  \"inputs\":  [{ \"id\": \"task\", \"type\": \"md\", \"required\": true }],\n  \"outputs\": [{ \"id\": \"plan\", \"type\": \"md\", \"filename\": \"plan.md\" }],\n  \"placeable\": true\n}\n```\n\n- `inputs[]`: `{ id, type, required?, loop?, expands?, as?, directive? }`\n- `outputs[]`: `{ id, type, when?, filename?, store?, artifactKind? }`\n- `runnerType`: `producer` | `verifier` | `clarifier`; a `verifier` also declares `verdict`.\n- `humanEffort` (optional): `{ \"factor\": \u003Cnumber ≥ 0> }` scales the human-hours estimate of this\n  agent's executions, `{ \"hours\": \u003Cnumber ≥ 0> }` fixes it per execution; `{ \"factor\": 0 }` opts out.\n  Absent → the heuristic (code delta, md\u002Fjson outputs, verifier reads). Invalid → ignored with a warning.\n- `progressStage` (optional): the stage of the run progress bar this agent advances; one of `plan`, `build`, or `review`. Omit for agents that don't fit the bar.\n- `placeable: false` keeps an agent off the composer canvas (off-pipeline scanners).\n- `agentFile`: optional; the prompt file for this agent. It is a **plain basename inside\n  `agents\u002F`** — no `\u002F`, no `..`, never absolute. Defaults to nothing (the scaffold writes\n  `\"\u003Ckey>.md\"`). The install sheet's Review step (and the Team policy consent) reads the tools of\n  exactly this file.\n\nA workflow template is a v2 graph, and `worca plugin init` scaffolds this shape:\n\n```json\n{\n  \"version\": 2,\n  \"name\": \"My Pipeline\",\n  \"domain\": \"coding\",\n  \"nodes\": [\n    { \"id\": \"n_task\",   \"kind\": \"task\", \"x\": 40,  \"y\": 200, \"config\": {} },\n    { \"id\": \"n_helper\", \"kind\": \"agent\", \"key\": \"myHelper\", \"x\": 320, \"y\": 200, \"config\": {} },\n    { \"id\": \"n_end\",    \"kind\": \"end\",  \"x\": 600, \"y\": 200, \"config\": {} }\n  ],\n  \"wires\": [\n    { \"id\": \"w1\", \"from\": { \"node\": \"n_task\",   \"port\": \"task\" }, \"to\": { \"node\": \"n_helper\", \"port\": \"task\" } },\n    { \"id\": \"w2\", \"from\": { \"node\": \"n_helper\", \"port\": \"plan\" }, \"to\": { \"node\": \"n_end\",    \"port\": \"result\" } }\n  ]\n}\n```\n\nNode ids must match `\u002F^n_[a-z0-9]{1,32}$\u002F`; exactly one `task` node and one `end` node are required.\n\n## Ask forms (API 4)\n\nAn agent that needs a human can ship the UI its question is asked with. The form is **JSON in the\nsidecar** — the host draws it from a fixed widget catalog, validates the answer, and resumes the\nagent. Nothing you write runs in the browser.\n\nYour manifest must **negotiate** API 4 or later (`\">=5 \u003C6\"` honours forms too) or the block is ignored:\n\n```json\n\"engines\": { \"worca-cc-api\": \">=4 \u003C5\" }\n```\n\nA plugin declaring `\">=3 \u003C4\"` keeps working: its agents load, its ports are intact, and it asks with\ngeneric questions. The ignored block is named in `worca plugin list`, `worca plugin doctor` and its\nrow under Marketplace › Installed › Needs attention, the same way an ignored sidecar is.\n\n### The declaration\n\n`ask.forms.\u003Cid>` in `agents\u002F\u003Ckey>.meta.json`. This is the form worca itself ships on its code\nreviewer — copy its shape:\n\n```json\n{\n  \"version\": 1,\n  \"title\": \"Confirm these findings\",\n  \"data\": {\n    \"type\": \"object\",\n    \"required\": [\"findings\"],\n    \"properties\": {\n      \"summary\": { \"type\": \"string\", \"maxLength\": 4000 },\n      \"findings\": {\n        \"type\": \"array\",\n        \"maxItems\": 20,\n        \"items\": {\n          \"type\": \"object\",\n          \"required\": [\"id\", \"title\"],\n          \"properties\": {\n            \"id\": { \"type\": \"string\", \"maxLength\": 64 },\n            \"severity\": { \"type\": \"string\", \"enum\": [\"critical\", \"major\", \"minor\", \"suggestion\"] },\n            \"title\": { \"type\": \"string\", \"maxLength\": 200 },\n            \"detail\": { \"type\": \"string\", \"maxLength\": 2000 }\n          }\n        }\n      }\n    }\n  },\n  \"answer\": {\n    \"type\": \"object\",\n    \"required\": [\"findings\"],\n    \"properties\": {\n      \"findings\": {\n        \"type\": \"array\",\n        \"items\": {\n          \"type\": \"object\",\n          \"required\": [\"id\", \"verdict\"],\n          \"properties\": {\n            \"id\": { \"type\": \"string\" },\n            \"verdict\": { \"type\": \"string\", \"enum\": [\"keep\", \"waive\"], \"default\": \"keep\" },\n            \"note\": { \"type\": \"string\", \"maxLength\": 2000 }\n          }\n        }\n      },\n      \"notes\": { \"type\": \"string\", \"maxLength\": 4000 }\n    }\n  },\n  \"layout\": [\n    { \"widget\": \"markdown\", \"bind\": \"data.summary\" },\n    { \"widget\": \"review-list\", \"bind\": \"data.findings\", \"field\": \"findings\", \"label\": \"Findings\" },\n    { \"widget\": \"textarea\", \"field\": \"notes\", \"label\": \"Notes\" }\n  ],\n  \"example\": {\n    \"summary\": \"Two findings I would waive if the deviation was intended.\",\n    \"findings\": [\n      { \"id\": \"f1\", \"severity\": \"major\", \"title\": \"Plan deviation: the retry lives in the caller\", \"detail\": \"The plan put it in the client. Was that intentional?\" },\n      { \"id\": \"f2\", \"severity\": \"minor\", \"title\": \"No unit test for the empty-list branch\", \"detail\": \"It is covered by the integration test only.\" }\n    ]\n  }\n}\n```\n\nThree parts, three owners: **`data`** is what your agent must supply at run time, **`answer`** is what\nthe human returns (the contract your prompt reads), **`layout`** is view only.\n\n### What the agent writes at run time\n\nInstead of the legacy `{\"questions\":[…]}` payload, your agent writes `{form, data}` to the questions\nfile and stops:\n\n```json\n{ \"form\": \"review-findings\",\n  \"data\": {\n    \"summary\": \"Two findings I would waive if the deviation was intended.\",\n    \"findings\": [\n      { \"id\": \"f1\", \"severity\": \"major\", \"title\": \"Plan deviation: the retry lives in the caller\",\n        \"detail\": \"The plan put it in the client. Was that intentional?\" }\n    ] } }\n```\n\n### What it receives back\n\nOn resume (or on a clarifier's `answers` port):\n\n```json\n{ \"form\": \"review-findings\", \"version\": 1,\n  \"values\": { \"findings\": [ { \"id\": \"f1\", \"verdict\": \"waive\", \"note\": \"Deliberate, see ADR-12.\" } ],\n              \"notes\": \"\" } }\n```\n\n`version` is the integer you declared; bump it when the `answer` contract changes so a resumed agent\ncan tell which shape it is reading.\n\n### Widget catalog (`askCatalog: 1`)\n\n| Class | Widgets |\n|---|---|\n| Input | `text`, `textarea`, `number`, `slider`, `toggle`, `date`, `select` (radio cards ≤ 6, else dropdown), `multiselect`, `rank`, `table-select`, `review-list`, `gallery` (with `field`) |\n| Display | `markdown`, `callout`, `image`, `gallery`, `compare`, `pdf`, `code`, `diff`, `table`, `json`, `file-list`, `media` |\n| Layout | `group`, `columns`, `tabs` |\n\nAn item may carry `\"requires\": { \"askCatalog\": 2 }` plus a `\"fallback\"` item for a widget a newer\nhost has; with no fallback the form fails validation. Display widgets contribute nothing to the\nanswer.\n\n### Layout item keys\n\nAn item may carry `widget`, `field`, `bind`, `label`, `help`, `when`, `requires`, `fallback` — plus\nits widget's own keys. Anything else is a validation error, so a misspelt `lables` is named instead\nof silently ignored.\n\n| Widget | Own keys |\n|---|---|\n| `text` | `placeholder`, `mono` |\n| `textarea` | `placeholder`, `rows` |\n| `number` | `unit`, `placeholder` |\n| `slider` | `unit`, `minLabel`, `maxLabel` |\n| `toggle`, `date`, `markdown`, `pdf`, `media`, `json` | — |\n| `select` | `style`, `options`, `labels`, `descriptions`, `tones`, **`suggest`** |\n| `multiselect` | `style`, `options`, `labels`, `descriptions` |\n| `rank` | `titleKey`, `metaKey` |\n| `table-select`, `table` | `columns` |\n| `review-list` | `titleKey`, `bodyKey`, `metaKey`, `labels`, `tones`, `notePlaceholder` |\n| `gallery` | `captionKey`, `fileKey` |\n| `callout` | `text`, `title`, `tone` |\n| `image` | `caption` |\n| `compare` | `before`, `after`, `beforeLabel`, `afterLabel` |\n| `code` | `name`, `lang` |\n| `diff` | `name` |\n| `file-list` | `fileKey`, `noteKey` |\n| `group` | `title`, `children` |\n| `columns` | `columns` |\n| `tabs` | `tabs` |\n\n`suggest` on a `select` is suggested answers **plus free text**: the field's schema stays a plain\n`{ \"type\": \"string\" }` with no `enum`, so the value is whatever the human types.\n\n### The dialect\n\nA closed JSON Schema subset: `type` (`string`, `number`, `integer`, `boolean`, `array`, `object`,\n`file`), `enum`, `enumFrom`, `default`, `defaultFrom`, `required`, `minimum`, `maximum`,\n`multipleOf`, `minLength`, `maxLength`, `pattern`, `patternHint`, `format` (`date`, `date-time`,\n`email`, `uri`), `items`, `minItems`, `maxItems`, `uniqueItems`, `properties`, `title`,\n`description`, `accept`. Nothing else — no `$ref`, `oneOf`, `anyOf`, `if`\u002F`then`;\n`additionalProperties` is always false; nesting stops at object → array → object.\n\n- `file` is **data-side only**: a run-relative path plus `accept` (mime patterns). worca snapshots\n  the file at ask time, sniffs its real type against your `accept` and a host allowlist, and serves\n  it by index — never by path. html and anything scriptable is refused.\n- An **opaque object** — `{ \"type\": \"object\" }` with no `properties` — is data-side only and never at\n  the root. It is how the `json` display widget shows an arbitrary blob your agent produced. The\n  answer side stays closed.\n- `enumFrom` \u002F `defaultFrom` are **answer-side only** and resolve against your data\n  (`data.images[].id`), so the human picks from a closed set your agent just produced and a field\n  like a suggested version number arrives prefilled. `enum` and `enumFrom` are mutually exclusive.\n- `patternHint` is the sentence shown when `pattern` fails. Write one: \"Does not match the expected\n  format\" tells nobody what a semver field wants.\n- `bind`, `enumFrom`, `defaultFrom` and `options.from` use one tiny path language: `data.a.b` and\n  `data.items[].id`. No expressions, no indexes, no functions.\n- `when` is the only conditional: `{ \"field\": \"value\" }` or `{ \"field\": [\"a\", \"b\"] }`, equality on\n  answer fields, and an item may not depend on its own field. A hidden field is dropped from the\n  answer and is not required while hidden.\n- `\"surface\": \"web\"` says a text answer is meaningless. Chat then prints the projection and keeps\n  waiting; the CLI refuses the run rather than pretend. Default is `\"any\"`.\n- `default` prefills the web form **and** feeds `--yes`: with no default, auto mode takes the first\n  `enum` value, a `rank` takes data order, and a `review-list` takes every item's default verdict.\n  Pick defaults that are safe to apply unattended.\n\n### Limits\n\nAt most 8 forms per agent, and the whole `ask` block stays under 64 KB:\n\n| Rule | Value |\n|---|---|\n| Form id | `^[a-z][a-z0-9-]{0,47}$` |\n| `title` | 1–120 characters, mandatory |\n| Forms per agent | 8 |\n| `ask` block size | 64 KB |\n| Files per ask | 24 |\n| Bytes per file \u002F per ask | 25 MB \u002F 100 MB |\n\n### Two gates you will meet\n\n**At load \u002F validate time**, a form must prove itself: `example` is mandatory, it must validate\nagainst `data`, every widget, `field`, `bind` and item key must be legal, every required answer field\nmust have an input in the layout — and the **auto answer built from `example` must be a valid\nanswer**. That last rule is the one that surprises authors: a *required*, always-visible free-text\nfield with no `default` and no `defaultFrom` **fails validation**, because `--yes` could never answer\nit. Give it a default, make it optional, or put it behind a `when`.\n\n**At ask time**, worca runs the same check against the data your agent actually wrote. Data that\npasses the schema but that an unattended run could not answer — an `enumFrom` that resolved to an\nempty list on a required choice, a `defaultFrom` whose source the agent left out — is **refused**,\nand your agent is resumed once with the error list so it can supply better data. A second failure\ndowngrades to a plain free-text question. A run is never crashed by a form.\n\n### Validate before you ship\n\nA form that fails is a **warning** (worca drops it and the agent keeps generic questions) and an\n**error** under `--strict`, which is the author's gate:\n\n```bash\nworca plugin validate .\u002Fmy-plugin --strict\n```\n\nErrors name the item by its reading position — `ask.forms.\"review-findings\" layout#2: …` — and every\nfailed rule is listed, not just the first.\n\nThe install sheet's Review step, the Team policy consent and `worca plugin install`'s receipt name, per agent, how many forms ship\nand which file types they may display from the run folder — on a host that will honour them, so only\nwhen your manifest negotiates API 4 (below that the line is absent and the ignored-contributions line\nnames the block instead). That list is read from your `accept` patterns alone, before anything is\ninstalled and without running a line of your code — so keep `accept` as narrow as the form really\nneeds.\n\n## Skills\n\nA plugin's `skills\u002F\u003Cname>\u002FSKILL.md` folders reach agents two ways:\n\n- **Required by an agent** (`requiresSkills` on its sidecar): copied into the run's checkout.\n- **Through sets** (`docs\u002Fskills.md`): installing adds every skill to the catalog (Connectors › Skills);\n  a user adds one to a set, and every run and Chat turn of that set's projects gets it as\n  `\u002F\u003Cset>:\u003Cname>` — one generated plugin per set, through `--plugin-dir`. A team policy can require one\n  (`skills.required: [{ \"plugin\": \"acme\", \"skill\": \"deploy-checklist\" }]`); each developer turns it on.\n\nFor a skill that works from a set:\n\n- The folder name is the skill name and equals the frontmatter `name`: `^[a-z0-9]+(-[a-z0-9]+)*$`, at most\n  64 characters, not `synced` or `anthropic-skills`. A skill that breaks a rule is listed invalid and never\n  mounted.\n- Refer to the skill's own files with `${CLAUDE_SKILL_DIR}`, never `${CLAUDE_PLUGIN_ROOT}`: from a set the\n  skill sits in a generated plugin that holds only `skills\u002F`, so a plugin-root path breaks (the catalog flags it).\n- At most 300 files, 1000 links and folders, 1 MB per file, 8 MB in all; no `.claude-plugin\u002F` folder inside.\n- Chat never runs inline shell blocks (`` !`cmd` ``). Pipeline runs DO run them, without guardrail checks:\n  Claude Code runs them when it renders the skill, not as a tool call a guardrail sees — so keep them read-only.\n  A `.sh` script is badged \"shell scripts — Windows\".\n- Updates list `new skill: x`; a skill a set holds reads `SKILL CHANGED: x — in \u003Csets>` or\n  `SKILL REMOVED: x — leaves \u003Csets>` (it leaves those sets); uninstalling the plugin takes its skills out of\n  every set.\n\n## MCP servers (API 5)\n\nA plugin can ship **MCP server definitions** for worca's own registry — never written into anyone's\nClaude Code config. Installing starts nothing: a user adds a server to one or more **sets** on\nthe Connectors page, fills in that set's values and secrets, and assigns sets to projects; pipeline\nagents and Chat then get one copy per (set, server). The consent card lists each server with its\ncommand or URL.\n\nYour manifest must **negotiate** API 5 or the block is ignored (and named as an ignored contribution):\n\n```json\n\"engines\": { \"worca-cc-api\": \">=5 \u003C6\" }\n```\n\n```json\n{\n  \"name\": \"acme-tools\",\n  \"version\": \"1.4.0\",\n  \"engines\": { \"worca-cc-api\": \">=5 \u003C6\" },\n  \"mcpServers\": {\n    \"sentry\": {\n      \"type\": \"http\",\n      \"url\": \"https:\u002F\u002Fmcp.sentry.dev\u002Fmcp\",\n      \"headers\": { \"Authorization\": { \"field\": \"token\", \"prefix\": \"Bearer \" },\n                   \"X-Sentry-Org\": { \"field\": \"org\" } },\n      \"fields\": [\n        { \"key\": \"token\", \"label\": \"Sentry token\", \"secret\": true, \"oauth\": true, \"required\": true },\n        { \"key\": \"org\",   \"label\": \"Organization\", \"required\": true }\n      ],\n      \"description\": \"Sentry issues and events\"\n    },\n    \"jira\": {\n      \"type\": \"stdio\", \"command\": \"node\", \"args\": [\".\u002Fmcp\u002Fjira.mjs\"],\n      \"env\": { \"JIRA_URL\": { \"field\": \"baseUrl\" }, \"JIRA_TOKEN\": { \"field\": \"token\" } },\n      \"fields\": [\n        { \"key\": \"baseUrl\", \"label\": \"Jira URL\", \"required\": true, \"default\": \"https:\u002F\u002Facme.atlassian.net\" },\n        { \"key\": \"token\",   \"label\": \"API token\", \"secret\": true, \"required\": true }\n      ],\n      \"description\": \"Search and read Jira issues\"\n    }\n  }\n}\n```\n\nRules — `worca plugin validate` checks every one, and an error blocks the install:\n\n- **Name** (the map key): `^[a-z][a-z0-9-]{0,19}$`; `worca` is reserved; no `_` (copy names use it).\n- **`type`**: `stdio` needs `command` (+ `args`, `env`); `http` \u002F `sse` need `url` — `https:`, or `http:`\n  only for `localhost`, `127.0.0.1`, `::1` — plus optional `headers`.\n- **`fields[]`** — what each set fills in: `key` `^[A-Za-z][A-Za-z0-9_]{0,31}$` (unique ignoring case),\n  `label`, `secret` (default false), `oauth` (secret only: a bearer token the user refreshes by hand),\n  `required` (default false), `default` (non-secret only).\n- **Field refs** `{ \"field\": \"\u003Ckey>\", \"prefix\"?: \"…\", \"suffix\"?: \"…\" }` go in an `env` value, a\n  `headers` value, an `args` element, or `url` (a string, one ref, or an array of strings and refs\n  joined in order). A secret field goes in `env`, `headers` or the path\u002Fquery of `url` — never in\n  `args` (argv is readable by every local user), never the whole `url`, its host or userinfo. A field\n  used in `url` must be `required`. A field behind a secret-sounding env\u002Fheader key (`TOKEN`, `KEY`,\n  `SECRET`, `Authorization`, …) or query parameter (`api_key`, `token`, …) must be `secret`.\n- **Env keys** `^[A-Za-z_][A-Za-z0-9_]{0,63}$`, unique ignoring case, never starting `MCPSECRET_` or\n  `MCPCHILD_`. **Header names** are RFC 7230 tokens, unique ignoring case; `Host`, `Content-Length`,\n  `Transfer-Encoding`, `Connection` and `Upgrade` are refused.\n- **No literal secrets.** Every literal (`command`, `args`, `url` parts, env and header values,\n  `prefix`\u002F`suffix`, `default`, `description`) refuses `${` and control characters; a `prefix` may not\n  end in `$` and a `suffix` may not start with `{`. A token-shaped literal (`Bearer ghp_…`, a JWT,\n  `?api_key=…`, a URL with a password) is an error: make it a secret field.\n- **Paths**: a `command` or `args` element starting `.\u002F` resolves against your plugin dir (the pinned\n  version; your working dir when linked) and must exist inside it — the `command` as a file, an `args`\n  element may name a directory; the consent card shows it as `\u003Cplugin-dir>\u002F…`. `\"command\": \"node\"`\n  runs worca's own Node. Python: `\"command\": \"uv\", \"args\": [\"run\", \"--directory\", \".\u002F\", \"server.py\"]`\n  — `uv run --directory .\u002F`, since no working directory is assumed.\n- **`description`**: at most 200 characters (it is flattened into prompts).\n\nA stdio server starts with only a keep-list of the environment (`HOME`, `PATH`, `LANG`, …) plus the\n`env` you declare: declare every variable it needs.\n\n**Updates** list each new, removed and changed server. A changed `type`, `command`, `args`, `url`,\n`headers` or `env`, a field added or removed, or a field's `default`, `secret` or `required` is a red\nline naming the sets that hold secrets for it; a `label`, `description` or `oauth` change is not.\nApplying keeps a set's value whose key and `secret` flag survive and drops the rest; a server you\ndrop, like an uninstall, leaves every set with its values and secrets.\n\n## Scripts (API 3)\n\nA script card runs **your program** instead of spawning Claude: worca hands it the bound\ninput paths and the allocated output paths in one JSON envelope on stdin and reads one\nJSON frame back on stdout. Cost is $0 and the result is repeatable.\n\n| File | Required |\n|---|---|\n| `scripts\u002F\u003Ckey>.meta.json` | yes — meta v2, `key` = filename stem |\n| `scripts\u002F\u003Ckey>.mjs` \u002F `.py` \u002F `.sh` (+ `.cmd`) | the program `file` names, per runtime |\n| `scripts\u002F\u003Ckey>.tests.json` | optional — saved test cases that travel with the script |\n\n```bash\nworca plugin new-script tidy --runtime node --dir .\u002Fmy-plugin\n```\n\nScaffolds all three, already valid. `--runtime shell` writes **both** `tidy.sh` and\n`tidy.cmd`: on Windows worca runs the `win32` entry under `cmd.exe`, which cannot run a `.sh`.\n\n### The three runtime contracts\n\n`node` — the default export receives one api object and returns a frame:\n\n```js\nexport default async function ({ inputs, outputs, params, ctx, log }) {\n  log('info', 'hello from a worca script');\n  return { summary: 'ok' };     \u002F\u002F plus { outputs: { \u003Cport>: { value } }, verdict }\n}\n```\n\n`shell` — the envelope arrives as environment variables, and whatever the command prints\nis captured into every md output it did not write itself. Exit `0` is clean, exit `1` is\nblocking, anything else is an execution error (`exitCodes` in the sidecar overrides).\n\n```sh\n#!\u002Fbin\u002Fsh\necho \"checking $WORCA_IN_PLAN\"     # WORCA_IN_\u003CPORT>, WORCA_OUT_\u003CPORT>, WORCA_PARAM_\u003CID>,\n                                   # WORCA_VERDICT, WORCA_CWD, WORCA_ENVELOPE\n```\n\n`python` — `main(api)`, where `api` exposes `inputs`, `outputs`, `params`, `ctx` and `log`\nboth as attributes and as keys. Standard library only, python ≥ 3.8.\n\n```python\ndef main(api):\n    api.log('info', 'hello from a worca script')\n    return { 'summary': 'ok' }\n```\n\n`stdout` carries the frame in `node` and `python`. `console.*` and `print` are re-routed to\nthe run log, so they are safe; a direct `process.stdout.write` (or a child process that\ninherits fd 1) corrupts the frame — use `log`, or write to stderr.\n\n### Test cases\n\n`\u003Ckey>.tests.json` ships the proof that the script works:\n\n```json\n{ \"version\": 1,\n  \"cases\": [\n    { \"id\": \"sample\", \"name\": \"sample\",\n      \"params\": { \"command\": \"npm test\" },\n      \"inputs\": { \"plan\": { \"text\": \"# Plan\" }, \"done\": { \"fired\": true } },\n      \"cwd\": { \"kind\": \"scratch\" },\n      \"expect\": { \"verdict\": \"clean\", \"fired\": [\"log\", \"pass\"] } } ] }\n```\n\nInputs are inline text; a void port takes `{ \"fired\": true }`. A shipped case must use\n`\"cwd\": { \"kind\": \"scratch\" }` — a case that names a project folder cannot travel, and is\nan install-blocking error. `expect` is optional: without it a case reports its result and\nis red only when the script could not run at all.\n\n```bash\nworca plugin validate .\u002Fmy-plugin --run-cases   # lint, then run every case. Exit 1 = a case failed.\n```\n\nThat is the command to put in CI. What each script prints streams to stderr as\n`[\u003Ckey>\u002F\u003Ccase>] …` lines, and Ctrl+C or a CI cancel stops the running script (exit 2).\nA `python` case needs python ≥ 3.8 on the CI host: without one the case FAILS with the\ninterpreter sentence — it is never skipped.\n\nKeys: a script key shares ONE namespace with agent keys, and a key that a built-in script or\na built-in agent holds (`shell`, `js`, `py`, `planner`, …) is never loaded from a plugin.\n`new-script` refuses those, the reserved names (`new`, `bench`, `runtimes`) and the Windows\ndevice names (`con`, `nul`, `com1`, …).\n\n## Common mistakes\n\n| Mistake | What happens |\n|---|---|\n| `console.log` anywhere in the connector | Corrupts the stdout frame → `PluginOpError('protocol')`. Use `ctx.log` |\n| Reading `process.env.MY_TOKEN` | Always undefined — env is `{PATH, HOME}`. Declare a `configSchema` field; users can point it at `{\"$env\":\"MY_TOKEN\"}` |\n| Zero or two `task-browser` inputs | Install-blocking validation error |\n| Calling a custom op from the pane without `optionsFrom` | 400 — the browser allowlist is derived from `inputs[]` |\n| `setup.node: true` with no `package-lock.json` | Install fails; `npm ci` requires a lockfile |\n| Relying on a `postinstall` script | Never runs — install uses `--ignore-scripts` |\n| Assuming `ctx.state.set` persisted after a throw | It doesn't. The delta is discarded unless the op returns `ok` |\n| Agent `.md` with no `.meta.json` sidecar | Registry silently ignores it (warn only) |\n| Workflow template referencing an agent key you don't ship | Template skipped at import |\n| Non-opaque task ids | `getTask(id)` receives exactly what `listTasks` emitted — keep them round-trippable |\n| Self-managed storage not keyed by `ctx.profile` | Two profiles share one cache\u002Fcookie jar\u002FCLI config dir → one instance silently answers with the other's data. Hang every path you own off the profile id |\n| `getTask().body` not markdown | It becomes the pipeline prompt verbatim |\n| Symlinks pointing outside the plugin dir | Deleted during export, reported as a warning |\n| A v1 sidecar (`consumes`\u002F`produces`\u002F`connectsTo`) | Ignored at load with a note under Marketplace › Installed — port it to `metaVersion: 2` |\n| A v1 `steps` workflow template | Ignored at load with a note under Marketplace › Installed — rewrite it as a graph (`version: 2`) |\n| `agentFile` pointing outside `agents\u002F` (`..\u002F`, absolute) | Install-blocking validation error; the loader also refuses to read it |\n| A template referencing a key whose sidecar was rejected | ONE line naming the sidecar — the template is not re-reported rule by rule |\n| An agent key that collides with a built-in or user agent | Yours is dropped; `plugin list`\u002F`doctor`\u002FMarketplace › Installed name it under \"contributions ignored\" |\n| Editing `workflows\u002F*.json` in a linked dir | The DB row is stale until `worca plugin reimport \u003Cname>` |\n| A shipped case with `\"cwd\": {\"kind\": \"project\"}` | Install-blocking validation error — a shipped case runs in a scratch folder |\n| `\u003Ckey>.tests.json` with no `\u003Ckey>.meta.json` beside it | Validation error — nothing would ever read it |\n| A `shell` script with `\u003Ckey>.sh` and no `win32` entry | Runs on macOS and Linux only — on Windows the file goes to `cmd.exe`, which cannot run a `.sh`. Ship the `.cmd` half |\n| A node\u002Fpython script that writes no value for a declared output | Execution error `output \"\u003Cport>\" was not written` |\n| A script key a built-in script or agent already holds (`shell`, `planner`, …) | Yours is dropped at load; `worca plugin new-script` refuses the key up front |\n| `process.stdout.write` in a `node` script | Corrupts the result frame. `console.*` is safe — it is routed to the run log |\n| An `ask` block on a plugin declaring API 3 | The block is ignored, the agent asks with generic questions; `plugin list`\u002F`doctor`\u002FMarketplace › Installed say so. Declare `\">=4 \u003C5\"` |\n| A form with no `example` | Validation error — `example` is what proves the declaration and what the Agents view previews |\n| A `type:'file'` with a wide `accept` | Every reviewer sees it on the consent card. Narrow it to what the form actually shows |\n| `mcpServers` on a plugin declaring API 4 | The block is ignored — no server reaches the catalog; `plugin list`\u002F`doctor`\u002FMarketplace › Installed say so. Declare `\">=5 \u003C6\"` |\n| A secret field referenced from `args` | Validation error — argv is readable by every local user. Pass it through `env` |\n\n## The example worth reading\n\n`plugins\u002Fgithub-source\u002F` — a complete, zero-dependency GitHub Issues source:\nETag revalidation via `ctx.state`, `remote-select` repo picker, a filter micro-syntax,\n`{\"$env\":\"GH_TOKEN\"}` token config, and write-back that comments and optionally closes the issue.\nCopy its shape for a plain HTTP-API source.\n\nPatterns it doesn't show, for connectors that need them: with `multiProfile`, key any\nself-managed on-disk storage by `ctx.profile`. When wrapping an **external CLI** as the\nbackend, keep a single subprocess seam with error-kind mapping, detach anything interactive\n(e.g. a browser login) so it outlives the 30s op timeout, and pin the CLI's config via an\nenv var so nothing depends on the server's cwd. For **per-run write-back**, add a\n`writeBack` select to `inputs` (default `no`); the host pins the run's inputs on the row and\npasses them to `capabilities({inputs})` \u002F `reportResult`, so only runs that opted in are\nreported. The key name `writeBack` is the host's reserved opt-out channel: when the\n`capabilities` probe errors, the host fails CLOSED (no report until retry) only for runs\nthat pinned a `writeBack` input — every other run keeps the fail-open default rather than\nsilently dropping the tracker comment on a transient blip.\n\n## Where the host logic lives\n\n| Concern | File |\n|---|---|\n| Manifest schema + validation | `src\u002Fcore\u002Fplugin-manifest.mjs` |\n| Install \u002F update \u002F uninstall lifecycle | `src\u002Fcore\u002Fplugin-store.mjs` |\n| Script registry + the runtime contract | `src\u002Fcore\u002Fscript-registry.mjs`, `src\u002Fcore\u002Fgraph\u002Fscript-runner.mjs` |\n| Script store + the test bench | `src\u002Fcore\u002Fscript-store.mjs`, `src\u002Fcore\u002Fscript-bench.mjs` |\n| Shipped script cases (`validate --run-cases`) | `src\u002Fcore\u002Fplugin-script-cases.mjs` |\n| Child-process protocol | `src\u002Fcore\u002Fplugin-shim.mjs`, `plugin-shim-child.mjs` |\n| Config \u002F secrets \u002F state (per-profile buckets) | `src\u002Fcore\u002Fplugin-config.mjs` |\n| Profile → project\u002Fworkspace binding resolution | `src\u002Fcore\u002Fsource-bindings.mjs` |\n| Widget rendering | `ui\u002Fpublic\u002Fsource-pane.mjs`, `ui\u002Fpublic\u002Fplugins-view.mjs` |\n| CLI | `src\u002Fcli\u002Fworca-cc.mjs` (`worca plugin help`) |\n| Ask-form dialect, the three gates (`validateFormDef`, `checkAskData`, `collectAnswer`) and the text projection | `src\u002Fshared\u002Fforms\u002F` |\n| Ask-form rendering (host-owned widgets) | `ui\u002Fpublic\u002Fask\u002Fform-renderer.mjs` |\n| MCP server rules, catalog, plugin lifecycle | `src\u002Fcore\u002Fmcp\u002Fdefinitions.mjs`, `src\u002Fcore\u002Fmcp\u002Fcatalog.mjs`, `src\u002Fcore\u002Fmcp\u002Fplugin-lifecycle.mjs` |\n\n## Before you ship\n\n```bash\nworca plugin validate .\u002Fmy-plugin --strict && worca plugin doctor my-plugin\n```\n\nBoth clean, plus at least one real (non-mock) `exec` per op.\nThen push and let users register the repo as a marketplace:\n`worca marketplace add \u003Crepo-url>` (or Marketplace › Add marketplace in the UI) →\ninstall from the Marketplace's Browse tab or `worca plugin install \u003Cname>`.\nRemoving a marketplace never removes installed plugins.\nFrom the UI or `worca workflow export \u003Cid> --format plugin --marketplace \u003Cid>`, Worca opens the PR for you:\n`plugins\u002F\u003Cname>\u002F` plus its `worca-cc-marketplace.json` entry (or `\u003Cname>\u002F` at the root when the repo has no index).\nInstalls are SHA-pinned; users see a consent inventory listing every agent's tools, every ask form it\ncan put on screen with the file types that form may display, every MCP server with its command or URL,\nand every secret you request — so keep all four minimal.\n","# Creating Worca CC Plugins\n\nA Worca CC plugin is a **git repo** (or a subdir one level deep) containing `worca-cc-plugin.json`.\nIt contributes up to six things to the host, ships **no code that runs in the browser**, and — from\nplugin API 4 — can ship the **declared forms** its agents ask questions with.\n\n| Dir | Contributes | Executed? |\n|---|---|---|\n| `connector\u002F*.mjs` (via `taskSources[].module`) | task-source connector | **Yes** — in an ephemeral child process |\n| `scripts\u002F\u003Ckey>.meta.json` + the program it names | pipeline scripts (node \u002F shell \u002F python) | **Yes** — worca spawns the program per execution |\n| `agents\u002F\u003Ckey>.md` + `\u003Ckey>.meta.json` | pipeline agents (meta v2 sidecar: typed input\u002Foutput ports; `ask.forms` from API 4) | No — prompt text fed to `claude -p`, forms drawn by the host |\n| `skills\u002F\u003Cname>\u002FSKILL.md` | agent skills | No — copied into the run worktree for an agent that requires it; a user can add any of them to a set, and runs and Chat then get it as `\u002F\u003Cset>:\u003Cname>` |\n| `workflows\u002F*.json` | pipeline templates (v2 graph JSON — one Task node, one End node) | No — validated into DB rows |\n| `mcpServers` in the manifest (API 5) | MCP servers for worca's registry | **Yes** — a stdio server is started per spawn once a user adds it to a set |\n\n**The connector, the scripts and stdio MCP servers are the executable seams.** Everything else is data.\nInternalize this before designing anything.\n\n## Start here — always scaffold\n\n```bash\nworca plugin init my-plugin --with task-source,agents,skills,workflows\n```\n\nProduces a plugin that already passes `validate --strict`. Edit it; don't hand-roll a manifest.\nDrop parts you don't need with `--with` (note: `workflows` requires `agents`).\n\n## Dev loop\n\n```bash\nworca plugin link .\u002Fmy-plugin                                  # current\u002F -> your working dir (imports workflows\u002F)\nWORCA_MOCK=1 worca plugin exec my-plugin main listTasks        # offline, canned frames\nworca plugin exec my-plugin main getTask --args '{\"id\":\"X-1\"}' # real call\nworca plugin exec my-plugin main listTasks --inspect           # --inspect-brk on the child\nworca plugin reimport my-plugin                                # re-read workflows\u002F*.json after an edit\nworca plugin validate .\u002Fmy-plugin --strict\nworca plugin new-script tidy --dir .\u002Fmy-plugin                 # scripts\u002Ftidy.{meta.json,mjs,tests.json}\nworca plugin validate .\u002Fmy-plugin --run-cases                  # lint, then RUN every shipped script case\nworca script test tidy                                         # one bench run of a linked\u002Finstalled script\nworca script test tidy --all                                   # its saved cases; exit 1 = a case failed\nworca plugin doctor my-plugin\n```\n\n`link` takes a **dir**, not a name — the name comes from the manifest. Linked plugins refuse `update`.\nEdits to a linked dir are live for the connector, agents and skills: no reinstall, the next op spawns\na fresh child. **Pipeline templates are the exception** — they are DB rows, imported once at `link`\n(and at `install`\u002F`update`), so after editing `workflows\u002F*.json` run `worca plugin reimport \u003Cname>`.\nReimport upserts: a template file you DELETE keeps its row until the plugin is removed.\n\n`plugin list`, `plugin doctor` and its row under Marketplace › Installed › Needs attention name every contribution worca **ignored** —\nan agent key that collides with an existing agent, a sidecar that fails the meta v2 gate, a template\nthat fails graph validation. If your agent or flow is missing, that line says why.\n\n## Manifest quick reference\n\nOnly `name` is required. Unknown fields are warnings (errors under `--strict`).\n\n| Field | Notes |\n|---|---|\n| `name` | kebab-case, ≤64 chars, machine-unique, used as a dir name |\n| `version` | optional — absent means the pinned SHA **is** the version; the Marketplace offers an update only when the marketplace lists a higher `x.y.z` on the branch your install follows |\n| `engines.worca-cc-api` | `\">=4 \u003C5\"` (what `plugin init` writes); `\">=5 \u003C6\"` to ship MCP servers. Integer host API. Unparseable → fails closed, won't install. Host APIs are a SET ([1, 2, 3, 4, 5]); the highest version your range admits is **negotiated**, and that is what decides which features you get. API 3 adds meta v2 sidecars and v2 graph templates; **API 4 honours an agent's `ask.forms`**; **API 5 honours the manifest's `mcpServers`** |\n| `setup.node` | `true` → `npm ci --ignore-scripts --omit=dev` at install. **Lockfile mandatory** |\n| `setup.python` | only `\"pyproject\"` → `uv sync`. Worca CC never *runs* python; your JS spawns it |\n| `taskSources[].id` | kebab-case |\n| `taskSources[].module` | must start `.\u002F`, no `..`, no backslashes |\n| `taskSources[].configSchema[]` | persistent config — `text` \\| `select`, plus `secret`\u002F`required`\u002F`default`\u002F`help`\u002F`options`\u002F`advanced` (`advanced: true` folds an optional tuning field under **More options**; hosts older than this ignore it with an unknown-field warning) |\n| `taskSources[].multiProfile` | `true` → one install holds several independent configurations (two Jira servers, two orgs), each with its own config\u002Fsecrets\u002Fstate. Users create profiles in the UI and bind each project\u002Fworkspace to one. Omit it and the source uses a single implicit `default` profile — identical to before profiles existed |\n| `taskSources[].inputs[]` | per-run UI — see next table. **Exactly one `task-browser` required** |\n| `models[]` | catalog entries: `id`, `label`, `efforts`, `env` (literal or `{\"secret\": \"\u003Ckey>\"}`), `cost` (`{free:true}` \\| `{perMtok:{…}}`), and `upstream` for a bridged model — `{provider: \"copilot\"\\|\"openai\"\\|\"anthropic\", api: \"anthropic\"\\|\"openai-chat\"\\|\"openai-responses\", model, baseUrl?, apiKey? (a `${VAR}` ref only, never a literal), headers?, capabilities? (toolCalls, vision, reasoning, maxPromptTokens, maxOutputTokens, reasoningEfforts)}`. A `copilot` entry resolves against each user's own sign-in |\n| `modelSecrets[]` | `{key, label}` — the secrets `models[].env` may reference; prompted for at install. With the credential broker on, each person adds the key on the key page instead (a per-person `p-\u003Cplugin>-\u003Ckey>` slot): keep `ANTHROPIC_BASE_URL` a literal URL and put the secret only in `ANTHROPIC_AUTH_TOKEN` or `ANTHROPIC_API_KEY` (docs\u002Fcredential-broker.md \"Plugin slots\") |\n| `mcpServers` | API 5: name → MCP server definition (`type`, `command`\u002F`args`\u002F`env` or `url`\u002F`headers`, `fields`, `description`) — see **MCP servers (API 5)** |\n\n## Marketplace manifest (repo-level, optional)\n\nA repo can declare itself a **marketplace** with `worca-cc-marketplace.json` at its root:\n\n```json\n{ \"name\": \"My Plugins\", \"description\": \"…\", \"plugins\": [\"plugins\u002Fone\", \"plugins\u002Ftwo\"] }\n```\n\nListed dirs (any depth, no `..`) each contain a `worca-cc-plugin.json`; when the file is\npresent it is the complete plugin list (the depth 0–1 auto-scan is skipped). Repos without\nit still work as implicit marketplaces via the scan, named `owner\u002Frepo` (a local folder by its folder name). The worca-cc repo itself is a\nmarketplace (its bundled plugins live under `plugins\u002F`), registered by default.\n\n## UI is schema-driven — pick from these widgets\n\nYou declare shapes; the host renders them. **No plugin code ever runs in the browser** — not for a\nsource pane, not for a question form. The two declarative surfaces are the source `inputs[]` below\nand an agent's `ask.forms` (see [Ask forms](#ask-forms-api-4)).\n\n| `inputs[].type` | Widget | Requires |\n|---|---|---|\n| `text` | text box | — |\n| `select` | static dropdown | `options[]` |\n| `remote-select` | dropdown, loaded on first focus by calling your connector | `optionsFrom` (a connector op name) |\n| `task-browser` | debounced search + result list + preview | exactly one per source |\n\n`configSchema[]` supports only `text` and `select`; `secret: true` renders `type=password` and is\nnever sent back to the browser (arrives redacted as `{set: true}`).\n\nSecrets are stored in the plugin's `data\u002Fsecrets.json` (mode 0600) under Worca's home and reach your\nconnector or chat worker on stdin, never in its env. That is not isolation between plugins: on a\nnative install every plugin child runs as Worca's own user and could open any plugin's\n`secrets.json`. Only the container with single-volume isolation runs connectors and chat workers\nas a separate `worca-plugin` user, with its own `HOME` and no access to `data\u002F` or Worca's home\n(docs\u002Fdocker.md). Don't promise users more, and on that container don't write into your own\ninstall folder (it is read-only to that user): keep caches under `HOME`.\n\n**`remote-select` + `optionsFrom` is the extensibility hatch.** Naming an op there is also what\nallowlists it for the browser — undeclared ops are rejected with 400 at `\u002Fapi\u002Fsources\u002Fcall`.\nThe data, filtering, and pagination semantics behind every widget are entirely yours.\n\n## Connector contract (unchanged through API 3)\n\nDefault-export a **factory**, not a class:\n\n```js\nexport default function createTaskSource(ctx) {\n  return { validateConfig, listTasks, getTask, reportResult, capabilities, \u002F* custom ops *\u002F };\n}\n```\n\n| Op | Signature | Returns |\n|---|---|---|\n| `validateConfig` | `()` | `{ok:true, identity?}` \\| `{ok:false, errors:[{field,message}]}` — gates the whole pane |\n| `listTasks` | `({inputs, search, cursor})` | `{tasks:[{id,title,url,state,labels,updatedAt}], cursor?}` |\n| `getTask` | `(id)` — **positional** | `{...summary, body \u002F* markdown *\u002F, meta}` |\n| `reportResult` | `(id, {status, summary, links, inputs, move?})` — **positional** | anything; with `move` (Ticket updates): `{moved: {from, to} \\| null, note}` |\n| `capabilities` | `({inputs})` — optional | `{writeBack, incrementalSync, export?, import?, ticketUpdates?}`; missing → `writeBack: true`; `export: true` turns on the export ops below, `import: true` the import ops, `ticketUpdates: true` the Ticket updates ops |\n| `exportOptions` | `({project?, issueType?})` — optional, export | `{projects:[{value,label}], issueTypes?, priorities?, criteriaFields?, doneStatus, tooOld?}` — `issueTypes` with a project, the last two with both |\n| `createTicket` | `({ticket})` — optional, export | `{key, url, fingerprint}` \\| `{refused:{field, message}}` |\n| `updateTicket` | `({key, ticket})` — optional, export | `{key, url, fingerprint}` \\| `{gone:true}` \\| `{refused}` |\n| `commentTicket` | `({key, body})` — optional, export | `{ok:true}` \\| `{gone:true}` |\n| `ticketState` | `({key})` — optional, export | `{exists:true, url, fingerprint}` \\| `{exists:false}` |\n| `findTicket` | `({project, label, marker})` — optional, export | `{key, url, fingerprint, lastLine, marker, labels}` \\| `null` |\n| `importOptions` | `({})` — optional, import | `{projects:[{value,label}]}` — may be the same list as `exportOptions({})`'s projects; it is its own op because a source may import without exporting |\n| `searchTickets` | `({project?, search?, cursor?})` — optional, import | `{tickets:[{key,title,url,type,status,updatedAt}], cursor?}` — no search: most recently updated first; a pasted key or ticket link finds that ticket in any project |\n| `importTicket` | `({key, criteriaField?})` — optional, import | `{key, url, title, description, criteria, comments, commentsTotal, restrictedComments, attachments, meta, fingerprint}` \\| `{gone:true}` |\n| `downloadAttachment` | `({key, id, maxBytes, dest})` — optional, import | the body written to `dest`, and `{name, mime, bytes}` \\| `{tooLarge:true, bytes}` \\| `{gone:true, forbidden?}` |\n| `listProjects` | `({})` — the project input's `optionsFrom` | `[{value, label, name?}]`; `name` (optional) is the project's name alone, for Ticket updates' chips; `value` is the project's key: at most one `\u002F` (GitHub's `owner\u002Frepo`), each part 1 to 100 characters and never `.` or `..`; control characters, `\\`, `?`, `#` and `%` are refused |\n| `listStatuses` | `({project})` — optional, Ticket updates | `[{value, label, category}]`, every status of the project once; `category` one of `todo`, `in_progress`, `done`, `cancelled` |\n| `legacyMove` | `({})` — optional, Ticket updates | `{field, target}`: your old \"on completion\" config key and what it means: `{category: 'done'}`, `{typed: '\u003Ctext>'}` or `null` |\n| custom | `(args)` | whatever the widget needs |\n\n**Ticket updates (`move`).** With `capabilities().ticketUpdates`, Worca decides what a finished run does to its ticket and\npasses it as `reportResult`'s `move`: `{category: 'done'}` (any status of the done category the ticket can reach, never a\ncancelled one), `{status: '\u003ClistStatuses value>', name?}` (one status; without `name` it is the typed text of your old\nsetting, matched as before: a transition's name first, then a target status's name) or `{none: true}`. Without `move`, keep\ndoing exactly what your old setting does. Move first, then post one comment ending with `note`, the line saying what happened\n(`''` when nothing was to be done), and answer `{moved, note}`. A move the tracker refuses (Jira: a 4xx other than 401 and\n429) is a `note` (\"Not moved: …\"), and the comment is still posted; throw on a refused token (401), a rate limit (429), a\nserver error, a network error or a timeout, so the write-back fails and can be retried. `getTask`'s `meta.project` names the\nticket's project as a `listProjects` value, so Worca can pick the project's rule without parsing your ids.\n\nThe export ops (Requirements' **Export to a tracker**) receive a tool-neutral ticket: `{project, issueType, title, description\n(Markdown), labels (already normalised, never with spaces), priority (id or null), criteria: {target:'description'} |\n{target:'field', field, items}, marker?}`. Write the description in your tracker's format, store `marker` invisibly on a\ncreate (Worca finds a ticket whose create answer was lost by it), add labels on an update without removing any, and return\n`fingerprint`: a hash of the description as your tracker stores it (read it back), normalised so the same stored text\nalways gives the same string. Worca compares fingerprints only. A field the tracker refuses and a ticket that is gone are\nresults (`refused`, `gone`), not throws; every call runs in the host, never from the browser, with a 60 s limit. The\nreference implementation is `plugins\u002Fjira-source`.\n\nThe import ops (Requirements' **New feature › From a ticket…**) only read. `importTicket` answers the ticket tool-neutrally:\n`description` and comment bodies as Markdown (never HTML), `criteria` only from a field (`{field:{id,name}, items}`, else\n`null`: Worca finds a criteria section in the description itself), the newest 50 comments oldest first with the author's\ndisplay name and `authorKind: 'person' | 'app'` only (never an email, account id or avatar; profile links and mentions become\nplain names), comments restricted to a group or role left out and counted in `restrictedComments`, attachments as metadata\n`{id, name, mime, bytes, created}`, `meta: {project, projectName, type:{id,name}, status, priority}` and the description's\n`fingerprint` as `ticketState` computes it. A ticket the connection cannot see is `{gone:true}`. `downloadAttachment` checks the\nattachment belongs to `key`, refuses before downloading when its size is over `maxBytes` (`{tooLarge}`), downloads only from the\nsite's own address (one redirect at most, `https:` only and without the Authorization header when it leaves the site), streams\nthe body into `dest` — a fixed file name inside a fresh private folder the host made — creating it exclusively, deletes what it\nwrote on any failure or once the body grows past `maxBytes`, and never writes anywhere else. Worca checks the file before it\ntrusts it.\n\n`ctx` = `{ apiVersion, profile, config, state: {get, set}, log }` — `apiVersion` is the negotiated highest version your range admits.\n\n- `ctx.config` — `configSchema` values, defaults applied, `{\"$env\":\"VAR\"}` already resolved\n- `ctx.state.get\u002Fset` — a KV bag; `set` only *records*, the **host** persists it after a successful frame\n- `ctx.profile` — which profile this op runs against (`'default'` unless `multiProfile`). `config` and `state` are *already* that profile's bucket; the id is here so a connector that keeps its own on-disk storage can key it the same way\n- `ctx.log(level, msg)` — the only legal output channel\n\nThrow `Object.assign(new Error(msg), { kind })` to pick the error kind:\n`auth | rate-limit | network | plugin | timeout | protocol`. The UI renders kind-keyed messages.\n\n## Runtime model — design around it\n\nOne `node` child process **per op**. No daemon, no reuse. Env is scrubbed to `{PATH, HOME}` only.\nPayload arrives on stdin, one JSON frame leaves on stdout, process exits. 30s timeout → SIGKILL.\n\n## Agents & templates (API 3)\n\nAn agent sidecar is meta v2: typed PORTS replace the v1 channel vocabulary.\n\n```json\n{\n  \"metaVersion\": 2,\n  \"displayName\": \"My Helper\",\n  \"runnerType\": \"producer\",\n  \"inputs\":  [{ \"id\": \"task\", \"type\": \"md\", \"required\": true }],\n  \"outputs\": [{ \"id\": \"plan\", \"type\": \"md\", \"filename\": \"plan.md\" }],\n  \"placeable\": true\n}\n```\n\n- `inputs[]`: `{ id, type, required?, loop?, expands?, as?, directive? }`\n- `outputs[]`: `{ id, type, when?, filename?, store?, artifactKind? }`\n- `runnerType`: `producer` | `verifier` | `clarifier`; a `verifier` also declares `verdict`.\n- `humanEffort` (optional): `{ \"factor\": \u003Cnumber ≥ 0> }` scales the human-hours estimate of this\n  agent's executions, `{ \"hours\": \u003Cnumber ≥ 0> }` fixes it per execution; `{ \"factor\": 0 }` opts out.\n  Absent → the heuristic (code delta, md\u002Fjson outputs, verifier reads). Invalid → ignored with a warning.\n- `progressStage` (optional): the stage of the run progress bar this agent advances; one of `plan`, `build`, or `review`. Omit for agents that don't fit the bar.\n- `placeable: false` keeps an agent off the composer canvas (off-pipeline scanners).\n- `agentFile`: optional; the prompt file for this agent. It is a **plain basename inside\n  `agents\u002F`** — no `\u002F`, no `..`, never absolute. Defaults to nothing (the scaffold writes\n  `\"\u003Ckey>.md\"`). The install sheet's Review step (and the Team policy consent) reads the tools of\n  exactly this file.\n\nA workflow template is a v2 graph, and `worca plugin init` scaffolds this shape:\n\n```json\n{\n  \"version\": 2,\n  \"name\": \"My Pipeline\",\n  \"domain\": \"coding\",\n  \"nodes\": [\n    { \"id\": \"n_task\",   \"kind\": \"task\", \"x\": 40,  \"y\": 200, \"config\": {} },\n    { \"id\": \"n_helper\", \"kind\": \"agent\", \"key\": \"myHelper\", \"x\": 320, \"y\": 200, \"config\": {} },\n    { \"id\": \"n_end\",    \"kind\": \"end\",  \"x\": 600, \"y\": 200, \"config\": {} }\n  ],\n  \"wires\": [\n    { \"id\": \"w1\", \"from\": { \"node\": \"n_task\",   \"port\": \"task\" }, \"to\": { \"node\": \"n_helper\", \"port\": \"task\" } },\n    { \"id\": \"w2\", \"from\": { \"node\": \"n_helper\", \"port\": \"plan\" }, \"to\": { \"node\": \"n_end\",    \"port\": \"result\" } }\n  ]\n}\n```\n\nNode ids must match `\u002F^n_[a-z0-9]{1,32}$\u002F`; exactly one `task` node and one `end` node are required.\n\n## Ask forms (API 4)\n\nAn agent that needs a human can ship the UI its question is asked with. The form is **JSON in the\nsidecar** — the host draws it from a fixed widget catalog, validates the answer, and resumes the\nagent. Nothing you write runs in the browser.\n\nYour manifest must **negotiate** API 4 or later (`\">=5 \u003C6\"` honours forms too) or the block is ignored:\n\n```json\n\"engines\": { \"worca-cc-api\": \">=4 \u003C5\" }\n```\n\nA plugin declaring `\">=3 \u003C4\"` keeps working: its agents load, its ports are intact, and it asks with\ngeneric questions. The ignored block is named in `worca plugin list`, `worca plugin doctor` and its\nrow under Marketplace › Installed › Needs attention, the same way an ignored sidecar is.\n\n### The declaration\n\n`ask.forms.\u003Cid>` in `agents\u002F\u003Ckey>.meta.json`. This is the form worca itself ships on its code\nreviewer — copy its shape:\n\n```json\n{\n  \"version\": 1,\n  \"title\": \"Confirm these findings\",\n  \"data\": {\n    \"type\": \"object\",\n    \"required\": [\"findings\"],\n    \"properties\": {\n      \"summary\": { \"type\": \"string\", \"maxLength\": 4000 },\n      \"findings\": {\n        \"type\": \"array\",\n        \"maxItems\": 20,\n        \"items\": {\n          \"type\": \"object\",\n          \"required\": [\"id\", \"title\"],\n          \"properties\": {\n            \"id\": { \"type\": \"string\", \"maxLength\": 64 },\n            \"severity\": { \"type\": \"string\", \"enum\": [\"critical\", \"major\", \"minor\", \"suggestion\"] },\n            \"title\": { \"type\": \"string\", \"maxLength\": 200 },\n            \"detail\": { \"type\": \"string\", \"maxLength\": 2000 }\n          }\n        }\n      }\n    }\n  },\n  \"answer\": {\n    \"type\": \"object\",\n    \"required\": [\"findings\"],\n    \"properties\": {\n      \"findings\": {\n        \"type\": \"array\",\n        \"items\": {\n          \"type\": \"object\",\n          \"required\": [\"id\", \"verdict\"],\n          \"properties\": {\n            \"id\": { \"type\": \"string\" },\n            \"verdict\": { \"type\": \"string\", \"enum\": [\"keep\", \"waive\"], \"default\": \"keep\" },\n            \"note\": { \"type\": \"string\", \"maxLength\": 2000 }\n          }\n        }\n      },\n      \"notes\": { \"type\": \"string\", \"maxLength\": 4000 }\n    }\n  },\n  \"layout\": [\n    { \"widget\": \"markdown\", \"bind\": \"data.summary\" },\n    { \"widget\": \"review-list\", \"bind\": \"data.findings\", \"field\": \"findings\", \"label\": \"Findings\" },\n    { \"widget\": \"textarea\", \"field\": \"notes\", \"label\": \"Notes\" }\n  ],\n  \"example\": {\n    \"summary\": \"Two findings I would waive if the deviation was intended.\",\n    \"findings\": [\n      { \"id\": \"f1\", \"severity\": \"major\", \"title\": \"Plan deviation: the retry lives in the caller\", \"detail\": \"The plan put it in the client. Was that intentional?\" },\n      { \"id\": \"f2\", \"severity\": \"minor\", \"title\": \"No unit test for the empty-list branch\", \"detail\": \"It is covered by the integration test only.\" }\n    ]\n  }\n}\n```\n\nThree parts, three owners: **`data`** is what your agent must supply at run time, **`answer`** is what\nthe human returns (the contract your prompt reads), **`layout`** is view only.\n\n### What the agent writes at run time\n\nInstead of the legacy `{\"questions\":[…]}` payload, your agent writes `{form, data}` to the questions\nfile and stops:\n\n```json\n{ \"form\": \"review-findings\",\n  \"data\": {\n    \"summary\": \"Two findings I would waive if the deviation was intended.\",\n    \"findings\": [\n      { \"id\": \"f1\", \"severity\": \"major\", \"title\": \"Plan deviation: the retry lives in the caller\",\n        \"detail\": \"The plan put it in the client. Was that intentional?\" }\n    ] } }\n```\n\n### What it receives back\n\nOn resume (or on a clarifier's `answers` port):\n\n```json\n{ \"form\": \"review-findings\", \"version\": 1,\n  \"values\": { \"findings\": [ { \"id\": \"f1\", \"verdict\": \"waive\", \"note\": \"Deliberate, see ADR-12.\" } ],\n              \"notes\": \"\" } }\n```\n\n`version` is the integer you declared; bump it when the `answer` contract changes so a resumed agent\ncan tell which shape it is reading.\n\n### Widget catalog (`askCatalog: 1`)\n\n| Class | Widgets |\n|---|---|\n| Input | `text`, `textarea`, `number`, `slider`, `toggle`, `date`, `select` (radio cards ≤ 6, else dropdown), `multiselect`, `rank`, `table-select`, `review-list`, `gallery` (with `field`) |\n| Display | `markdown`, `callout`, `image`, `gallery`, `compare`, `pdf`, `code`, `diff`, `table`, `json`, `file-list`, `media` |\n| Layout | `group`, `columns`, `tabs` |\n\nAn item may carry `\"requires\": { \"askCatalog\": 2 }` plus a `\"fallback\"` item for a widget a newer\nhost has; with no fallback the form fails validation. Display widgets contribute nothing to the\nanswer.\n\n### Layout item keys\n\nAn item may carry `widget`, `field`, `bind`, `label`, `help`, `when`, `requires`, `fallback` — plus\nits widget's own keys. Anything else is a validation error, so a misspelt `lables` is named instead\nof silently ignored.\n\n| Widget | Own keys |\n|---|---|\n| `text` | `placeholder`, `mono` |\n| `textarea` | `placeholder`, `rows` |\n| `number` | `unit`, `placeholder` |\n| `slider` | `unit`, `minLabel`, `maxLabel` |\n| `toggle`, `date`, `markdown`, `pdf`, `media`, `json` | — |\n| `select` | `style`, `options`, `labels`, `descriptions`, `tones`, **`suggest`** |\n| `multiselect` | `style`, `options`, `labels`, `descriptions` |\n| `rank` | `titleKey`, `metaKey` |\n| `table-select`, `table` | `columns` |\n| `review-list` | `titleKey`, `bodyKey`, `metaKey`, `labels`, `tones`, `notePlaceholder` |\n| `gallery` | `captionKey`, `fileKey` |\n| `callout` | `text`, `title`, `tone` |\n| `image` | `caption` |\n| `compare` | `before`, `after`, `beforeLabel`, `afterLabel` |\n| `code` | `name`, `lang` |\n| `diff` | `name` |\n| `file-list` | `fileKey`, `noteKey` |\n| `group` | `title`, `children` |\n| `columns` | `columns` |\n| `tabs` | `tabs` |\n\n`suggest` on a `select` is suggested answers **plus free text**: the field's schema stays a plain\n`{ \"type\": \"string\" }` with no `enum`, so the value is whatever the human types.\n\n### The dialect\n\nA closed JSON Schema subset: `type` (`string`, `number`, `integer`, `boolean`, `array`, `object`,\n`file`), `enum`, `enumFrom`, `default`, `defaultFrom`, `required`, `minimum`, `maximum`,\n`multipleOf`, `minLength`, `maxLength`, `pattern`, `patternHint`, `format` (`date`, `date-time`,\n`email`, `uri`), `items`, `minItems`, `maxItems`, `uniqueItems`, `properties`, `title`,\n`description`, `accept`. Nothing else — no `$ref`, `oneOf`, `anyOf`, `if`\u002F`then`;\n`additionalProperties` is always false; nesting stops at object → array → object.\n\n- `file` is **data-side only**: a run-relative path plus `accept` (mime patterns). worca snapshots\n  the file at ask time, sniffs its real type against your `accept` and a host allowlist, and serves\n  it by index — never by path. html and anything scriptable is refused.\n- An **opaque object** — `{ \"type\": \"object\" }` with no `properties` — is data-side only and never at\n  the root. It is how the `json` display widget shows an arbitrary blob your agent produced. The\n  answer side stays closed.\n- `enumFrom` \u002F `defaultFrom` are **answer-side only** and resolve against your data\n  (`data.images[].id`), so the human picks from a closed set your agent just produced and a field\n  like a suggested version number arrives prefilled. `enum` and `enumFrom` are mutually exclusive.\n- `patternHint` is the sentence shown when `pattern` fails. Write one: \"Does not match the expected\n  format\" tells nobody what a semver field wants.\n- `bind`, `enumFrom`, `defaultFrom` and `options.from` use one tiny path language: `data.a.b` and\n  `data.items[].id`. No expressions, no indexes, no functions.\n- `when` is the only conditional: `{ \"field\": \"value\" }` or `{ \"field\": [\"a\", \"b\"] }`, equality on\n  answer fields, and an item may not depend on its own field. A hidden field is dropped from the\n  answer and is not required while hidden.\n- `\"surface\": \"web\"` says a text answer is meaningless. Chat then prints the projection and keeps\n  waiting; the CLI refuses the run rather than pretend. Default is `\"any\"`.\n- `default` prefills the web form **and** feeds `--yes`: with no default, auto mode takes the first\n  `enum` value, a `rank` takes data order, and a `review-list` takes every item's default verdict.\n  Pick defaults that are safe to apply unattended.\n\n### Limits\n\nAt most 8 forms per agent, and the whole `ask` block stays under 64 KB:\n\n| Rule | Value |\n|---|---|\n| Form id | `^[a-z][a-z0-9-]{0,47}$` |\n| `title` | 1–120 characters, mandatory |\n| Forms per agent | 8 |\n| `ask` block size | 64 KB |\n| Files per ask | 24 |\n| Bytes per file \u002F per ask | 25 MB \u002F 100 MB |\n\n### Two gates you will meet\n\n**At load \u002F validate time**, a form must prove itself: `example` is mandatory, it must validate\nagainst `data`, every widget, `field`, `bind` and item key must be legal, every required answer field\nmust have an input in the layout — and the **auto answer built from `example` must be a valid\nanswer**. That last rule is the one that surprises authors: a *required*, always-visible free-text\nfield with no `default` and no `defaultFrom` **fails validation**, because `--yes` could never answer\nit. Give it a default, make it optional, or put it behind a `when`.\n\n**At ask time**, worca runs the same check against the data your agent actually wrote. Data that\npasses the schema but that an unattended run could not answer — an `enumFrom` that resolved to an\nempty list on a required choice, a `defaultFrom` whose source the agent left out — is **refused**,\nand your agent is resumed once with the error list so it can supply better data. A second failure\ndowngrades to a plain free-text question. A run is never crashed by a form.\n\n### Validate before you ship\n\nA form that fails is a **warning** (worca drops it and the agent keeps generic questions) and an\n**error** under `--strict`, which is the author's gate:\n\n```bash\nworca plugin validate .\u002Fmy-plugin --strict\n```\n\nErrors name the item by its reading position — `ask.forms.\"review-findings\" layout#2: …` — and every\nfailed rule is listed, not just the first.\n\nThe install sheet's Review step, the Team policy consent and `worca plugin install`'s receipt name, per agent, how many forms ship\nand which file types they may display from the run folder — on a host that will honour them, so only\nwhen your manifest negotiates API 4 (below that the line is absent and the ignored-contributions line\nnames the block instead). That list is read from your `accept` patterns alone, before anything is\ninstalled and without running a line of your code — so keep `accept` as narrow as the form really\nneeds.\n\n## Skills\n\nA plugin's `skills\u002F\u003Cname>\u002FSKILL.md` folders reach agents two ways:\n\n- **Required by an agent** (`requiresSkills` on its sidecar): copied into the run's checkout.\n- **Through sets** (`docs\u002Fskills.md`): installing adds every skill to the catalog (Connectors › Skills);\n  a user adds one to a set, and every run and Chat turn of that set's projects gets it as\n  `\u002F\u003Cset>:\u003Cname>` — one generated plugin per set, through `--plugin-dir`. A team policy can require one\n  (`skills.required: [{ \"plugin\": \"acme\", \"skill\": \"deploy-checklist\" }]`); each developer turns it on.\n\nFor a skill that works from a set:\n\n- The folder name is the skill name and equals the frontmatter `name`: `^[a-z0-9]+(-[a-z0-9]+)*$`, at most\n  64 characters, not `synced` or `anthropic-skills`. A skill that breaks a rule is listed invalid and never\n  mounted.\n- Refer to the skill's own files with `${CLAUDE_SKILL_DIR}`, never `${CLAUDE_PLUGIN_ROOT}`: from a set the\n  skill sits in a generated plugin that holds only `skills\u002F`, so a plugin-root path breaks (the catalog flags it).\n- At most 300 files, 1000 links and folders, 1 MB per file, 8 MB in all; no `.claude-plugin\u002F` folder inside.\n- Chat never runs inline shell blocks (`` !`cmd` ``). Pipeline runs DO run them, without guardrail checks:\n  Claude Code runs them when it renders the skill, not as a tool call a guardrail sees — so keep them read-only.\n  A `.sh` script is badged \"shell scripts — Windows\".\n- Updates list `new skill: x`; a skill a set holds reads `SKILL CHANGED: x — in \u003Csets>` or\n  `SKILL REMOVED: x — leaves \u003Csets>` (it leaves those sets); uninstalling the plugin takes its skills out of\n  every set.\n\n## MCP servers (API 5)\n\nA plugin can ship **MCP server definitions** for worca's own registry — never written into anyone's\nClaude Code config. Installing starts nothing: a user adds a server to one or more **sets** on\nthe Connectors page, fills in that set's values and secrets, and assigns sets to projects; pipeline\nagents and Chat then get one copy per (set, server). The consent card lists each server with its\ncommand or URL.\n\nYour manifest must **negotiate** API 5 or the block is ignored (and named as an ignored contribution):\n\n```json\n\"engines\": { \"worca-cc-api\": \">=5 \u003C6\" }\n```\n\n```json\n{\n  \"name\": \"acme-tools\",\n  \"version\": \"1.4.0\",\n  \"engines\": { \"worca-cc-api\": \">=5 \u003C6\" },\n  \"mcpServers\": {\n    \"sentry\": {\n      \"type\": \"http\",\n      \"url\": \"https:\u002F\u002Fmcp.sentry.dev\u002Fmcp\",\n      \"headers\": { \"Authorization\": { \"field\": \"token\", \"prefix\": \"Bearer \" },\n                   \"X-Sentry-Org\": { \"field\": \"org\" } },\n      \"fields\": [\n        { \"key\": \"token\", \"label\": \"Sentry token\", \"secret\": true, \"oauth\": true, \"required\": true },\n        { \"key\": \"org\",   \"label\": \"Organization\", \"required\": true }\n      ],\n      \"description\": \"Sentry issues and events\"\n    },\n    \"jira\": {\n      \"type\": \"stdio\", \"command\": \"node\", \"args\": [\".\u002Fmcp\u002Fjira.mjs\"],\n      \"env\": { \"JIRA_URL\": { \"field\": \"baseUrl\" }, \"JIRA_TOKEN\": { \"field\": \"token\" } },\n      \"fields\": [\n        { \"key\": \"baseUrl\", \"label\": \"Jira URL\", \"required\": true, \"default\": \"https:\u002F\u002Facme.atlassian.net\" },\n        { \"key\": \"token\",   \"label\": \"API token\", \"secret\": true, \"required\": true }\n      ],\n      \"description\": \"Search and read Jira issues\"\n    }\n  }\n}\n```\n\nRules — `worca plugin validate` checks every one, and an error blocks the install:\n\n- **Name** (the map key): `^[a-z][a-z0-9-]{0,19}$`; `worca` is reserved; no `_` (copy names use it).\n- **`type`**: `stdio` needs `command` (+ `args`, `env`); `http` \u002F `sse` need `url` — `https:`, or `http:`\n  only for `localhost`, `127.0.0.1`, `::1` — plus optional `headers`.\n- **`fields[]`** — what each set fills in: `key` `^[A-Za-z][A-Za-z0-9_]{0,31}$` (unique ignoring case),\n  `label`, `secret` (default false), `oauth` (secret only: a bearer token the user refreshes by hand),\n  `required` (default false), `default` (non-secret only).\n- **Field refs** `{ \"field\": \"\u003Ckey>\", \"prefix\"?: \"…\", \"suffix\"?: \"…\" }` go in an `env` value, a\n  `headers` value, an `args` element, or `url` (a string, one ref, or an array of strings and refs\n  joined in order). A secret field goes in `env`, `headers` or the path\u002Fquery of `url` — never in\n  `args` (argv is readable by every local user), never the whole `url`, its host or userinfo. A field\n  used in `url` must be `required`. A field behind a secret-sounding env\u002Fheader key (`TOKEN`, `KEY`,\n  `SECRET`, `Authorization`, …) or query parameter (`api_key`, `token`, …) must be `secret`.\n- **Env keys** `^[A-Za-z_][A-Za-z0-9_]{0,63}$`, unique ignoring case, never starting `MCPSECRET_` or\n  `MCPCHILD_`. **Header names** are RFC 7230 tokens, unique ignoring case; `Host`, `Content-Length`,\n  `Transfer-Encoding`, `Connection` and `Upgrade` are refused.\n- **No literal secrets.** Every literal (`command`, `args`, `url` parts, env and header values,\n  `prefix`\u002F`suffix`, `default`, `description`) refuses `${` and control characters; a `prefix` may not\n  end in `$` and a `suffix` may not start with `{`. A token-shaped literal (`Bearer ghp_…`, a JWT,\n  `?api_key=…`, a URL with a password) is an error: make it a secret field.\n- **Paths**: a `command` or `args` element starting `.\u002F` resolves against your plugin dir (the pinned\n  version; your working dir when linked) and must exist inside it — the `command` as a file, an `args`\n  element may name a directory; the consent card shows it as `\u003Cplugin-dir>\u002F…`. `\"command\": \"node\"`\n  runs worca's own Node. Python: `\"command\": \"uv\", \"args\": [\"run\", \"--directory\", \".\u002F\", \"server.py\"]`\n  — `uv run --directory .\u002F`, since no working directory is assumed.\n- **`description`**: at most 200 characters (it is flattened into prompts).\n\nA stdio server starts with only a keep-list of the environment (`HOME`, `PATH`, `LANG`, …) plus the\n`env` you declare: declare every variable it needs.\n\n**Updates** list each new, removed and changed server. A changed `type`, `command`, `args`, `url`,\n`headers` or `env`, a field added or removed, or a field's `default`, `secret` or `required` is a red\nline naming the sets that hold secrets for it; a `label`, `description` or `oauth` change is not.\nApplying keeps a set's value whose key and `secret` flag survive and drops the rest; a server you\ndrop, like an uninstall, leaves every set with its values and secrets.\n\n## Scripts (API 3)\n\nA script card runs **your program** instead of spawning Claude: worca hands it the bound\ninput paths and the allocated output paths in one JSON envelope on stdin and reads one\nJSON frame back on stdout. Cost is $0 and the result is repeatable.\n\n| File | Required |\n|---|---|\n| `scripts\u002F\u003Ckey>.meta.json` | yes — meta v2, `key` = filename stem |\n| `scripts\u002F\u003Ckey>.mjs` \u002F `.py` \u002F `.sh` (+ `.cmd`) | the program `file` names, per runtime |\n| `scripts\u002F\u003Ckey>.tests.json` | optional — saved test cases that travel with the script |\n\n```bash\nworca plugin new-script tidy --runtime node --dir .\u002Fmy-plugin\n```\n\nScaffolds all three, already valid. `--runtime shell` writes **both** `tidy.sh` and\n`tidy.cmd`: on Windows worca runs the `win32` entry under `cmd.exe`, which cannot run a `.sh`.\n\n### The three runtime contracts\n\n`node` — the default export receives one api object and returns a frame:\n\n```js\nexport default async function ({ inputs, outputs, params, ctx, log }) {\n  log('info', 'hello from a worca script');\n  return { summary: 'ok' };     \u002F\u002F plus { outputs: { \u003Cport>: { value } }, verdict }\n}\n```\n\n`shell` — the envelope arrives as environment variables, and whatever the command prints\nis captured into every md output it did not write itself. Exit `0` is clean, exit `1` is\nblocking, anything else is an execution error (`exitCodes` in the sidecar overrides).\n\n```sh\n#!\u002Fbin\u002Fsh\necho \"checking $WORCA_IN_PLAN\"     # WORCA_IN_\u003CPORT>, WORCA_OUT_\u003CPORT>, WORCA_PARAM_\u003CID>,\n                                   # WORCA_VERDICT, WORCA_CWD, WORCA_ENVELOPE\n```\n\n`python` — `main(api)`, where `api` exposes `inputs`, `outputs`, `params`, `ctx` and `log`\nboth as attributes and as keys. Standard library only, python ≥ 3.8.\n\n```python\ndef main(api):\n    api.log('info', 'hello from a worca script')\n    return { 'summary': 'ok' }\n```\n\n`stdout` carries the frame in `node` and `python`. `console.*` and `print` are re-routed to\nthe run log, so they are safe; a direct `process.stdout.write` (or a child process that\ninherits fd 1) corrupts the frame — use `log`, or write to stderr.\n\n### Test cases\n\n`\u003Ckey>.tests.json` ships the proof that the script works:\n\n```json\n{ \"version\": 1,\n  \"cases\": [\n    { \"id\": \"sample\", \"name\": \"sample\",\n      \"params\": { \"command\": \"npm test\" },\n      \"inputs\": { \"plan\": { \"text\": \"# Plan\" }, \"done\": { \"fired\": true } },\n      \"cwd\": { \"kind\": \"scratch\" },\n      \"expect\": { \"verdict\": \"clean\", \"fired\": [\"log\", \"pass\"] } } ] }\n```\n\nInputs are inline text; a void port takes `{ \"fired\": true }`. A shipped case must use\n`\"cwd\": { \"kind\": \"scratch\" }` — a case that names a project folder cannot travel, and is\nan install-blocking error. `expect` is optional: without it a case reports its result and\nis red only when the script could not run at all.\n\n```bash\nworca plugin validate .\u002Fmy-plugin --run-cases   # lint, then run every case. Exit 1 = a case failed.\n```\n\nThat is the command to put in CI. What each script prints streams to stderr as\n`[\u003Ckey>\u002F\u003Ccase>] …` lines, and Ctrl+C or a CI cancel stops the running script (exit 2).\nA `python` case needs python ≥ 3.8 on the CI host: without one the case FAILS with the\ninterpreter sentence — it is never skipped.\n\nKeys: a script key shares ONE namespace with agent keys, and a key that a built-in script or\na built-in agent holds (`shell`, `js`, `py`, `planner`, …) is never loaded from a plugin.\n`new-script` refuses those, the reserved names (`new`, `bench`, `runtimes`) and the Windows\ndevice names (`con`, `nul`, `com1`, …).\n\n## Common mistakes\n\n| Mistake | What happens |\n|---|---|\n| `console.log` anywhere in the connector | Corrupts the stdout frame → `PluginOpError('protocol')`. Use `ctx.log` |\n| Reading `process.env.MY_TOKEN` | Always undefined — env is `{PATH, HOME}`. Declare a `configSchema` field; users can point it at `{\"$env\":\"MY_TOKEN\"}` |\n| Zero or two `task-browser` inputs | Install-blocking validation error |\n| Calling a custom op from the pane without `optionsFrom` | 400 — the browser allowlist is derived from `inputs[]` |\n| `setup.node: true` with no `package-lock.json` | Install fails; `npm ci` requires a lockfile |\n| Relying on a `postinstall` script | Never runs — install uses `--ignore-scripts` |\n| Assuming `ctx.state.set` persisted after a throw | It doesn't. The delta is discarded unless the op returns `ok` |\n| Agent `.md` with no `.meta.json` sidecar | Registry silently ignores it (warn only) |\n| Workflow template referencing an agent key you don't ship | Template skipped at import |\n| Non-opaque task ids | `getTask(id)` receives exactly what `listTasks` emitted — keep them round-trippable |\n| Self-managed storage not keyed by `ctx.profile` | Two profiles share one cache\u002Fcookie jar\u002FCLI config dir → one instance silently answers with the other's data. Hang every path you own off the profile id |\n| `getTask().body` not markdown | It becomes the pipeline prompt verbatim |\n| Symlinks pointing outside the plugin dir | Deleted during export, reported as a warning |\n| A v1 sidecar (`consumes`\u002F`produces`\u002F`connectsTo`) | Ignored at load with a note under Marketplace › Installed — port it to `metaVersion: 2` |\n| A v1 `steps` workflow template | Ignored at load with a note under Marketplace › Installed — rewrite it as a graph (`version: 2`) |\n| `agentFile` pointing outside `agents\u002F` (`..\u002F`, absolute) | Install-blocking validation error; the loader also refuses to read it |\n| A template referencing a key whose sidecar was rejected | ONE line naming the sidecar — the template is not re-reported rule by rule |\n| An agent key that collides with a built-in or user agent | Yours is dropped; `plugin list`\u002F`doctor`\u002FMarketplace › Installed name it under \"contributions ignored\" |\n| Editing `workflows\u002F*.json` in a linked dir | The DB row is stale until `worca plugin reimport \u003Cname>` |\n| A shipped case with `\"cwd\": {\"kind\": \"project\"}` | Install-blocking validation error — a shipped case runs in a scratch folder |\n| `\u003Ckey>.tests.json` with no `\u003Ckey>.meta.json` beside it | Validation error — nothing would ever read it |\n| A `shell` script with `\u003Ckey>.sh` and no `win32` entry | Runs on macOS and Linux only — on Windows the file goes to `cmd.exe`, which cannot run a `.sh`. Ship the `.cmd` half |\n| A node\u002Fpython script that writes no value for a declared output | Execution error `output \"\u003Cport>\" was not written` |\n| A script key a built-in script or agent already holds (`shell`, `planner`, …) | Yours is dropped at load; `worca plugin new-script` refuses the key up front |\n| `process.stdout.write` in a `node` script | Corrupts the result frame. `console.*` is safe — it is routed to the run log |\n| An `ask` block on a plugin declaring API 3 | The block is ignored, the agent asks with generic questions; `plugin list`\u002F`doctor`\u002FMarketplace › Installed say so. Declare `\">=4 \u003C5\"` |\n| A form with no `example` | Validation error — `example` is what proves the declaration and what the Agents view previews |\n| A `type:'file'` with a wide `accept` | Every reviewer sees it on the consent card. Narrow it to what the form actually shows |\n| `mcpServers` on a plugin declaring API 4 | The block is ignored — no server reaches the catalog; `plugin list`\u002F`doctor`\u002FMarketplace › Installed say so. Declare `\">=5 \u003C6\"` |\n| A secret field referenced from `args` | Validation error — argv is readable by every local user. Pass it through `env` |\n\n## The example worth reading\n\n`plugins\u002Fgithub-source\u002F` — a complete, zero-dependency GitHub Issues source:\nETag revalidation via `ctx.state`, `remote-select` repo picker, a filter micro-syntax,\n`{\"$env\":\"GH_TOKEN\"}` token config, and write-back that comments and optionally closes the issue.\nCopy its shape for a plain HTTP-API source.\n\nPatterns it doesn't show, for connectors that need them: with `multiProfile`, key any\nself-managed on-disk storage by `ctx.profile`. When wrapping an **external CLI** as the\nbackend, keep a single subprocess seam with error-kind mapping, detach anything interactive\n(e.g. a browser login) so it outlives the 30s op timeout, and pin the CLI's config via an\nenv var so nothing depends on the server's cwd. For **per-run write-back**, add a\n`writeBack` select to `inputs` (default `no`); the host pins the run's inputs on the row and\npasses them to `capabilities({inputs})` \u002F `reportResult`, so only runs that opted in are\nreported. The key name `writeBack` is the host's reserved opt-out channel: when the\n`capabilities` probe errors, the host fails CLOSED (no report until retry) only for runs\nthat pinned a `writeBack` input — every other run keeps the fail-open default rather than\nsilently dropping the tracker comment on a transient blip.\n\n## Where the host logic lives\n\n| Concern | File |\n|---|---|\n| Manifest schema + validation | `src\u002Fcore\u002Fplugin-manifest.mjs` |\n| Install \u002F update \u002F uninstall lifecycle | `src\u002Fcore\u002Fplugin-store.mjs` |\n| Script registry + the runtime contract | `src\u002Fcore\u002Fscript-registry.mjs`, `src\u002Fcore\u002Fgraph\u002Fscript-runner.mjs` |\n| Script store + the test bench | `src\u002Fcore\u002Fscript-store.mjs`, `src\u002Fcore\u002Fscript-bench.mjs` |\n| Shipped script cases (`validate --run-cases`) | `src\u002Fcore\u002Fplugin-script-cases.mjs` |\n| Child-process protocol | `src\u002Fcore\u002Fplugin-shim.mjs`, `plugin-shim-child.mjs` |\n| Config \u002F secrets \u002F state (per-profile buckets) | `src\u002Fcore\u002Fplugin-config.mjs` |\n| Profile → project\u002Fworkspace binding resolution | `src\u002Fcore\u002Fsource-bindings.mjs` |\n| Widget rendering | `ui\u002Fpublic\u002Fsource-pane.mjs`, `ui\u002Fpublic\u002Fplugins-view.mjs` |\n| CLI | `src\u002Fcli\u002Fworca-cc.mjs` (`worca plugin help`) |\n| Ask-form dialect, the three gates (`validateFormDef`, `checkAskData`, `collectAnswer`) and the text projection | `src\u002Fshared\u002Fforms\u002F` |\n| Ask-form rendering (host-owned widgets) | `ui\u002Fpublic\u002Fask\u002Fform-renderer.mjs` |\n| MCP server rules, catalog, plugin lifecycle | `src\u002Fcore\u002Fmcp\u002Fdefinitions.mjs`, `src\u002Fcore\u002Fmcp\u002Fcatalog.mjs`, `src\u002Fcore\u002Fmcp\u002Fplugin-lifecycle.mjs` |\n\n## Before you ship\n\n```bash\nworca plugin validate .\u002Fmy-plugin --strict && worca plugin doctor my-plugin\n```\n\nBoth clean, plus at least one real (non-mock) `exec` per op.\nThen push and let users register the repo as a marketplace:\n`worca marketplace add \u003Crepo-url>` (or Marketplace › Add marketplace in the UI) →\ninstall from the Marketplace's Browse tab or `worca plugin install \u003Cname>`.\nRemoving a marketplace never removes installed plugins.\nFrom the UI or `worca workflow export \u003Cid> --format plugin --marketplace \u003Cid>`, Worca opens the PR for you:\n`plugins\u002F\u003Cname>\u002F` plus its `worca-cc-marketplace.json` entry (or `\u003Cname>\u002F` at the root when the repo has no index).\nInstalls are SHA-pinned; users see a consent inventory listing every agent's tools, every ask form it\ncan put on screen with the file types that form may display, every MCP server with its command or URL,\nand every secret you request — so keep all four minimal.\n",{"name":5,"description":7},"dev","0e006ee4d39ed3a1813eebe3a4fc7866de4ba98a",".claude\u002Fskills\u002Fcreating-worca-cc-plugins",28,"https:\u002F\u002Fgithub.com\u002FSinishaDjukic\u002Fworca-cc","https:\u002F\u002Fworca.dev","https:\u002F\u002Fgithub.com\u002FSinishaDjukic","2026-11-15 03:47:58",{"source":8,"skillName":5,"commands":58,"prompt":68,"zipAvailable":69},[59,62,65],{"tool":60,"command":61},"npx","npx skills add SinishaDjukic\u002Fworca-cc --skill creating-worca-cc-plugins",{"tool":63,"command":64},"bunx","bunx skills add SinishaDjukic\u002Fworca-cc --skill creating-worca-cc-plugins",{"tool":66,"command":67},"pnpm","pnpm dlx skills add SinishaDjukic\u002Fworca-cc --skill creating-worca-cc-plugins","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSinishaDjukic\u002Fworca-cc\u002Fblob\u002Fdev\u002F.claude\u002Fskills\u002Fcreating-worca-cc-plugins\u002FSKILL.md",true,[],[72,80,94,108,123,135],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":44},"01M6D2JBABNQGZ6CPPZSHWMDVF","gamma","Ships a plugin manifest a skill must not have.","https:\u002F\u002Fgithub.com\u002FSinishaDjukic\u002Fworca-cc\u002Fblob\u002Fdev\u002Ftest\u002Ffixtures\u002Fskills\u002Fgamma-bad\u002FSKILL.md",[],[74,79,42],"manifest",{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":44},"01M6D2J8NNQAB6REZGECCWPAKH","delta-plugin-root","Calls a helper that lives elsewhere in its plugin.","https:\u002F\u002Fgithub.com\u002FSinishaDjukic\u002Fworca-cc\u002Fblob\u002Fdev\u002Ftest\u002Ffixtures\u002Fskills\u002Fdelta-plugin-root\u002FSKILL.md",[],[42,87,88,89,90,91,92,93],"delta","root","delta plugin root","true","calls","helper","Bash",{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":44},"01M6D2J6X0XFHBD1E2VC4DENC3","beta-scripts","Collects build facts with a script and summarizes them.","https:\u002F\u002Fgithub.com\u002FSinishaDjukic\u002Fworca-cc\u002Fblob\u002Fdev\u002Ftest\u002Ffixtures\u002Fskills\u002Fbeta-scripts\u002FSKILL.md",[],[101,102,32,93,103,104,105,106,107],"beta scripts","beta","read","build","with","script","facts",{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":44},"01M6D2J5F1V0J6Q5VNB44NHNMN","alpha","Writes a short status note for the current branch.","https:\u002F\u002Fgithub.com\u002FSinishaDjukic\u002Fworca-cc\u002Fblob\u002Fdev\u002Ftest\u002Ffixtures\u002Fskills\u002Falpha\u002FSKILL.md",[],[110,115,116,117,118,119,120,121,30,122],"standup","branch","short","user","line","note","for","status",{"skillNo":124,"name":125,"nameZh":6,"description":126,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":127,"categories":128,"keywords":130,"publishedAt":44},"01M6D2J3TCJQVGAQ8DAQRFWC9T","mock-skill","Trivial helper skill shipped by the mock-source fixture plugin. Runs helper.sh.","https:\u002F\u002Fgithub.com\u002FSinishaDjukic\u002Fworca-cc\u002Fblob\u002Fdev\u002Ftest\u002Ffixtures\u002Fplugins\u002Fmock-source\u002Fskills\u002Fmock-skill\u002FSKILL.md",[129],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[131,132,133,42,134,92,31],"mock","mock skill","helper skill","fixture",{"skillNo":136,"name":25,"nameZh":6,"description":137,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":138,"categories":139,"keywords":141,"publishedAt":44},"01M6D2J11P57PQB8XTVVNB1JE0","Run the node-graph multi-agent orchestrator over a software task in the current project. Triggers on \"\u002Fworca\", \"\u002Fworca \u003Cprompt>\", \"\u002Fworca --ui\", and on requests to orchestrate, run the orchestration pipeline, or drive plan\u002Frefine\u002Fimplement\u002Freview for a task.","https:\u002F\u002Fgithub.com\u002FSinishaDjukic\u002Fworca-cc\u002Fblob\u002Fdev\u002Fskills\u002Fworca\u002FSKILL.md",[140],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[25,142,143,144,145,146,147,148,149,150,151,152,153,154,155,34,156,157,158,159,160,161,121,162],"drive","implement","orchestration","run","orchestrate","graph","ui","pipeline","plan","multi-agent","node","prompt","orchestrator","agent orchestrator","refine","project","triggers","-ui","multi","requests","review"]