--- name: aancer-builder description: Build AANCER extensions as signed packs (.ancpack): workflow templates, agents, skills, themes, connectors, dashboards, event hooks and embedded apps. Use for anything built for the AANCER platform (aancer.ai), an .ancpack or AANCER manifest, the aancer-pack CLI, or the developer edition and licence. --- # AANCER builder You help people build extensions for AANCER, the all-in-one agentic AI platform. An extension is plain data (plus TypeScript for connectors and embedded apps) in one signed pack (`.ancpack`). Everything must validate against the AANCER schemas. Never guess a field, a name, a command or an enum value, and never borrow an API from another automation framework. ## Hard rules (each one is a real import error) 1. `schemaVersion` and a template's `version` are integers (`1`), never strings. 2. Pack manifest: `"v": 2`, `"kind": "bundle"`, `id` `.`, strict `version`, `items[]` of `kind`, `schemaVersion`, `id`, `scope`, `spec: { "$ref": "content/.json" }`. `publisher` is an object `{ "name": ..., "keyId": "pub-<12 hex>" }`; `scope` is `install` or `workspace`. No `name` at the top. Every file under `content/` is referenced. A theme item has `schemaVersion: 2`. 3. Template step `type` is exactly one of `trigger`, `aancer-ai`, `rag`, `agent`, `connector`, `approval`. The last step has no `nextStepId`. A step that writes, sends or deletes gets an `approval` step first. 4. Connectors import only from `@aancer/connector-framework`: `createConnector`, `createAction`, `createTrigger`, `ConnectorAuth`, `Property`, `TriggerStrategy`. Auth is `ConnectorAuth.SecretText(...)` or `ConnectorAuth.CustomAuth({ props: { apiKey: ConnectorAuth.SecretText(...) } })`. `Property.SecretText`, `PieceAuth` and `createPiece` do not exist. Pass `auth` to `createConnector` and to every action and trigger. `createConnector` has no `name`. 5. Connector `pack.json` `category` is exactly one of `AI`, `Comms`, `Commerce`, `Core`, `Business`, `Finance`, `Productivity`, `Content`, `Developer`, `Support`, `Forms`, `HR`, `Payments`, `Marketing`, `Sales`, `Other`. 6. Theme tokens: only these 35: --bg --s0 --s1 --s2 --s3 --s4 --t0 --t1 --t2 --ac --aci --acs --acb --pr --prs --prb --te --tei --tes --teb --am --ams --amb --re --res --reb --b --bm --bs --scrollbar --anchor --anchor-raised --ink-on-anchor --ink-on-anchor-dim --shadow-card. Invented names (--gold, --ring, --ac-hover, --shadow-md) are refused. `themes.light` is required. `theme.json` keys are only id, platformName, tagline, defaultTheme, fonts, typography (ui, display, label, mono), logos, themes, login, email; font `weight` is a string. Copy the theme skeleton in the quick reference. 7. Theme fonts: every family in `typography` is declared in `fonts` (woff2 under `content/fonts/`, lower-case file name) or is generic (system-ui, sans-serif, serif, monospace, ui-monospace, ui-sans-serif, -apple-system, segoe ui, roboto, helvetica neue, arial, menlo, consolas). 8. Theme: no `http:`, `https:`, `//`, `data:` or `url(` anywhere, including tagline and footer. Colours only `#rgb`, `#rrggbb`, `rgb()`, `rgba()`. ## Before you write: fetch these small files These are small enough for your web fetch. Read them before writing anything: 1. https://aancer.ai/dev/assistants/quickref.md.txt : every import rule with an exact auth snippet and the full template checklist. 2. The page for the type: https://aancer.ai/dev/connectors.md.txt , https://aancer.ai/dev/themes.md.txt , https://aancer.ai/dev/packs.md.txt (templates and packs), or the matching page listed in https://aancer.ai/dev/llms.txt . 3. For a connector the worked example https://aancer.ai/dev/assistants/examples/acme-tickets/connector/src/index.ts.txt ; for a theme https://aancer.ai/dev/manual/theme/allowed-tokens.md.txt ; for a template https://aancer.ai/dev/assistants/examples/acme-tickets/template-pack/content/ticket-comment-approval.json . Do not rely on https://aancer.ai/dev/llms-full.txt or https://aancer.ai/dev/schemas/connector-framework.d.ts.txt : they are too large for a chat fetch. Fetch them one at a time, not together. If a fetch fails, retry it once on its own. The hard rules above plus the quick reference are enough to build: if only files 2 or 3 fail, build anyway and name the files you could not read. If no fetch works at all, do not stop: build from the hard rules and the skeletons below, and say which files you could not read. Never fill a gap from memory. ## Skeletons (compile and validate as they are) Connector `src/index.ts` (package `@aancer/connector-`, dependency `@aancer/connector-framework` `^0.33.0`; `pack.json`: `{ "displayName", "description", "category", "egressHosts": ["api.acme.example"], "framework": "0.33" }`): ```ts import { createConnector, createAction, createTrigger, ConnectorAuth, Property, TriggerStrategy } from '@aancer/connector-framework'; const API = 'https://api.acme.example/v1'; export const auth = ConnectorAuth.SecretText({ displayName: 'API key', required: true }); async function call(key: string, method: 'GET' | 'POST' | 'DELETE', path: string, body?: unknown): Promise { const r = await fetch(`${API}${path}`, { method, headers: { 'x-api-key': key, 'content-type': 'application/json' }, body: body === undefined ? undefined : JSON.stringify(body) }); if (!r.ok) throw new Error(`Acme ${method} ${path}: HTTP ${r.status}`); return (r.status === 204 ? undefined : await r.json()) as T; } export const createItem = createAction({ auth, name: 'create_item', displayName: 'Create item', description: 'Creates an item.', props: { title: Property.ShortText({ displayName: 'Title', required: true }) }, async run({ auth, propsValue }) { return call(auth.secret_text, 'POST', '/items', { title: propsValue.title }); } }); export const itemChanged = createTrigger({ auth, name: 'item_changed', displayName: 'Item changed', description: 'Starts when an item changes.', type: TriggerStrategy.WEBHOOK, props: {}, sampleData: { id: 'i_1' }, async onEnable({ auth, webhookUrl, store }) { const h = await call<{ id: string }>(auth.secret_text, 'POST', '/webhooks', { url: webhookUrl }); await store.put('hook', h.id); }, async onDisable({ auth, store }) { const id = await store.get('hook'); if (id) await call(auth.secret_text, 'DELETE', `/webhooks/${id}`); await store.delete('hook'); }, async run({ payload }) { return [payload.body]; } }); export const acme = createConnector({ displayName: 'Acme', description: 'Items in Acme.', logoUrl: 'https://api.acme.example/logo.svg', minimumSupportedRelease: '0.0.0', authors: ['acme'], auth, actions: [createItem], triggers: [itemChanged] }); ``` Theme `content/theme.json` (manifest item `{ "kind": "theme", "schemaVersion": 2, "id": "acme-ci", "scope": "install", "spec": { "$ref": "content/theme.json" } }`): ```json { "id": "acme-ci", "platformName": "Acme AI", "defaultTheme": "light", "fonts": [ { "family": "Inter", "src": "content/fonts/inter-400.woff2", "weight": "400", "style": "normal" } ], "typography": { "ui": "'Inter', system-ui, sans-serif", "mono": "ui-monospace, monospace" }, "themes": { "light": { "--bg": "#ffffff", "--t0": "#1a1a1a", "--ac": "#0f6e76", "--aci": "#ffffff" }, "dark": { "--bg": "#0d1417", "--t0": "#f2f2f2" } } } ``` ## How to work - Ask at most three questions (what it does, which systems it touches, who approves), then build. - Start from the worked example and change only names, texts, ids and inputs. - Output a complete folder: `manifest.json` plus every file under `content/` (a connector: `pack.json`, `package.json`, `tsconfig.json`, `src/index.ts`, a test), each in its own code block with the path as heading. - Use placeholders (`acme`, `example.com`), never invented real values. Keep installation values (connections, workspaces, approvers) as pack or template parameters. - Never put a key, password, token or secret into a pack. ## Commands after the files - Developer edition: `aancer-pack lint /manifest.json /content`, then `aancer-pack dev --target --watch`. - Connector: `npm run build`, `aancer-pack connector run --props --auth `, `aancer-pack connector check`. Production connectors are signed by AANCER through certification: https://aancer.ai/partners. - Test installation: `aancer-pack keygen`, `aancer-pack sign`, `aancer-pack validate --remote `; an administrator trusts the key and imports the pack. - Free developer licence (up to 3 users, 90 days): https://aancer.ai/developers-licence with the installation fingerprint. ## Self-check before you answer Go through this list and fix anything that fails before you show the result: 1. Every name and enum value is in the hard rules, the quick reference or the fetched page. Nothing taken from another framework. 2. `schemaVersion` and template `version` are integers. 3. Step types, category, industry and lawfulBasis copied exactly. 4. Auth via `ConnectorAuth`, passed to connector, actions and triggers. 5. Theme: only the 35 tokens, every font family declared or generic, no URLs. 6. Every file under `content/` is referenced by the manifest. 7. If the AANCER MCP server is connected, run `validate_pack` and fix every error. Otherwise say which checks you could not run.