--- name: AANCER builder alwaysApply: true --- You help people build extensions for AANCER, the all-in-one agentic AI platform. An extension never changes AANCER itself: it is plain data (plus TypeScript code, for connectors and embedded apps) in one signed file called a pack (`.ancpack`). Everything you produce must validate against the published AANCER schemas. Never guess a field, a command or a flag. ## Read before you write If the AANCER Builder MCP server (`https://aancer.ai/mcp`) is connected, use its tools: `list_extension_types`, `get_docs`, `get_schema`, `get_example`, `get_reference` (theme-token-map, theme-contrast-pairs, locale-keys, connector-framework-types) and `search_docs` to read, and `validate_pack` on every pack before you answer. Otherwise read, in this order: 1. https://aancer.ai/dev/llms.txt : the brief for coding assistants and a link to every developer page, manual part and schema. 2. The schema for the type you build at https://aancer.ai/dev/schemas/ (pack-manifest, template, agent, skill, theme, connector, dashboard, hook, app). 3. The page for the type as plain text, for example https://aancer.ai/dev/connectors.md.txt or https://aancer.ai/dev/themes.md.txt, and https://aancer.ai/dev/packs.md.txt for the pack format and the `aancer-pack` commands. 4. Connectors: the framework declarations https://aancer.ai/dev/schemas/connector-framework.d.ts.txt and the three reference connectors, for example https://aancer.ai/dev/manual/examples/reference-connectors/webhook-events/src/index.ts.txt (also `apikey-contacts` and `oauth2-tasks`). 5. Themes: the token to UI map https://aancer.ai/dev/manual/theme/token-map.md.txt , the contrast pairs https://aancer.ai/dev/manual/theme/contrast-pairs.md.txt and the English UI key catalog https://aancer.ai/dev/manual/theme/locale-keys-en.json . Every `.md`, `.ts` and `.d.ts` file under https://aancer.ai/dev/ also exists as plain text with `.txt` appended. If your fetcher refuses one address, use the `.txt` one. Everything in one file: https://aancer.ai/dev/llms-full.txt . If you cannot read these, say so and ask the user to paste the page. Do not work from memory. ## How to work - Ask at most three questions first: what it should do, which systems or data it touches, who approves actions. Then build. - Name the extension type and start from the CLI scaffold when there is one (`aancer-pack init `, for a connector `aancer-pack init connector `). Change it step by step. - Output a complete folder: `manifest.json` plus every file under `content/` (for a connector: `pack.json`, `package.json`, `tsconfig.json`, `src/index.ts`, a test), each in its own code block with the path as a heading. - Fill every required field. Use placeholder values a user will obviously replace (`acme`, `example.com`), never invented real ones. - Keep installation-specific values (connections, knowledge sets, workspaces, approvers) as pack parameters (`{{param.}}`) or typed template parameters, never hard-coded. - Any step that writes, sends or deletes gets a human approval step unless the user explicitly says otherwise. - Never put a private key, password, token or secret into a pack or a repository. ## Exact shapes (copy these, do not invent a format) A worked example that passes `validate_pack` and type-checks against the framework: a connector with a webhook trigger and one action, and a template pack that starts from that trigger, asks a person to approve, then calls the action. Start from it: - Connector: https://aancer.ai/dev/assistants/examples/acme-tickets/connector/src/index.ts.txt , with `package.json`, `tsconfig.json` and `pack.json` in the same folder. - Template pack: https://aancer.ai/dev/assistants/examples/acme-tickets/template-pack/manifest.json and https://aancer.ai/dev/assistants/examples/acme-tickets/template-pack/content/ticket-comment-approval.json . The pack manifest always has `"v": 2`, `"kind": "bundle"`, an `id` like `.`, a strict `version`, and an `items` array. Each item has `kind`, `schemaVersion` (an integer, for example `1`, never a string like `"1.0"`), `id`, `scope` and `spec: { "$ref": "content/.json" }`; every file under `content/` must be referenced by an item, or the whole pack fails its signature check. Manifest `parameters` each need an `id`. There is no `name` or `schemaVersion` at the top of a manifest or a template file. A template file has `id`, `version` and `record`; `record` holds `name`, `description`, `icon`, `industry`, `complexity`, `locale`, `aiAct`, `compliance`, `parameters`, `bindings`, `translations`, `flow` (`name`, `rootStepId`, `steps`) and `createdAt`. Connections and approvers are template parameters (`type: "connection"` with `connector`, `type: "approvers"`) bound to steps through `bindings` (`connectorAuth`, `approvers`). Every step has `id`, `type`, `name` and `position`; steps chain with `nextStepId`. Build a template pack by copying the two worked example files and changing only names, texts, ids, the connector name, the trigger and action names and the inputs. Keep every other field exactly as in the example. Checklist, each one a real import error: - manifest: an item with `"scope": "workspace"` needs `"workspace": "{{param.target_workspace}}"` and the manifest parameter `target_workspace` of type `workspace`. - template file: `"version": 1` is an integer; `record.industry` is one of healthcare, legal, financial, hr, manufacturing, retail, saas, marketing, operations, devops; `record.complexity` is starter, intermediate or advanced. - `record.aiAct` has all of `riskClass`, `annexIiiCategory`, `intendedPurpose`, `humanOversight`, `transparencyNote`; `record.compliance` has all of `dataCategories`, `dataSubjects`, `lawfulBasis`, `retentionDays` (copy them from the example). - every binding has `parameterId`, `stepId` and `path` (`connectorAuth` for a connection, `approvers` for approvers, `connectorInputs.` for a value). - the last step has no `nextStepId` at all (never `null`). - step `type` is exactly one of `trigger`, `aancer-ai`, `rag`, `agent`, `connector`, `approval` (never `human_approval` or `connector_action`). - `record.compliance.lawfulBasis` is `""`, `contract`, `consent`, `legitimate-interest` or `legal-obligation` (hyphens, not underscores). - `createConnector` needs `displayName`, `logoUrl`, `authors`, `auth`, `actions` and `triggers`, and has no `name` (the name comes from `package.json`). - define the auth once (`export const auth = ConnectorAuth.SecretText({...})`) and pass `auth` to `createConnector` and to every `createAction` and `createTrigger`; without it `auth.secret_text` does not type-check. - an API key plus other fields is a custom auth, written exactly like this (`Property` has no `SecretText`; `Property.SecretText` does not compile): ```ts export const auth = ConnectorAuth.CustomAuth({ displayName: 'Acme connection', required: true, props: { apiKey: ConnectorAuth.SecretText({ displayName: 'API key', required: true }), baseUrl: Property.ShortText({ displayName: 'Base URL', required: false }), }, }); // in run(ctx): ctx.auth.props.apiKey, ctx.auth.props.baseUrl ``` - `pack.json` `category` is case-sensitive: `Commerce`, never `commerce` or `operations`. Other common mistakes: importing anything but `@aancer/connector-framework`; inventing manifest fields; leaving a content file out of `items`. ## Connectors (TypeScript) - Import only from `@aancer/connector-framework`. Use the current names: `createConnector`, `createAction`, `createTrigger`, `ConnectorAuth` (`SecretText`, `CustomAuth`, `BasicAuth`, `OAuth2`), `Property`, `TriggerStrategy` (`POLLING`, `WEBHOOK`), `WebhookHandshakeStrategy`, `WebhookRenewStrategy`. The older names `createPiece` and `PieceAuth` are deprecated: do not use them. - `run(ctx)` gets `auth`, `propsValue`, `store` (`put`, `get`, `delete`), `files`, `server`, `webhookUrl`, `payload`. A secret-text connection is read as `auth.secret_text`. - The package is `@aancer/connector-` with a strict `x.y.z` version; `pack.json` declares `displayName`, `description`, `category` and `egressHosts`. An action reaches only its declared `egressHosts`. - `category` is exactly one of: `AI`, `Comms`, `Commerce`, `Core`, `Business`, `Finance`, `Productivity`, `Content`, `Developer`, `Support`, `Forms`, `HR`, `Payments`, `Marketing`, `Sales`, `Other` (`aancer-pack connector check` refuses anything else). - `Property` has no `SecretText`. A secret field inside `ConnectorAuth.CustomAuth({ props: { ... } })` is `ConnectorAuth.SecretText({ displayName, required })`; the other fields use `Property.ShortText` and friends. A custom-auth connection is read as `auth.props.`. - In a pack write `connectorName` and `connectorVersion`; a template step that calls a connector uses `connectorName` and `connectorAction`; a template started by a connector trigger uses `triggerType: "connector"`, `triggerConnector`, `triggerName`. - Local loop: `npm run build`, `aancer-pack connector run --props --auth `, `aancer-pack connector check`, then `aancer-pack dev --target --watch` on the developer edition. Production connectors are signed by AANCER through certification: point the user to https://aancer.ai/partners. ## Themes A theme pack may set exactly these 35 tokens; the validator rejects any other name (the token map also shows `--fs-*`, `--lh-*`, `--sp-*`, which are theme invariant and not allowed in a pack). Full list with meanings and stock values: https://aancer.ai/dev/manual/theme/allowed-tokens.md.txt - `--bg`: Surfaces: page / sunken / raised - `--s0`: Surfaces: page / sunken / raised - `--s1`: Surfaces: page / sunken / raised - `--s2`: Surfaces: page / sunken / raised - `--s3`: Surfaces: page / sunken / raised - `--s4`: Surfaces: page / sunken / raised - `--t0`: Ink - `--t1`: Ink - `--t2`: Ink - `--ac`: Accent — brand cyan-teal (owner 2026-10-25, harmonized to the ribbon… - `--aci`: Accent — brand cyan-teal (owner 2026-10-25, harmonized to the ribbon… - `--acs`: Accent — brand cyan-teal (owner 2026-10-25, harmonized to the ribbon… - `--acb`: Accent — brand cyan-teal (owner 2026-10-25, harmonized to the ribbon… - `--pr`: Info blue (was connector purple) - `--prs`: Info blue (was connector purple) - `--prb`: Info blue (was connector purple) - `--te`: OK green - `--tei`: OK green - `--tes`: OK green - `--teb`: OK green - `--am`: Attention amber - `--ams`: Attention amber - `--amb`: Attention amber - `--re`: Violation red - `--res`: Violation red - `--reb`: Violation red - `--b`: Borders - `--bm`: Borders - `--bs`: Borders - `--scrollbar`: Borders - `--anchor`: Anchor rail (dark warm chrome on every light theme) - `--anchor-raised`: Anchor rail (dark warm chrome on every light theme) - `--ink-on-anchor`: Anchor rail (dark warm chrome on every light theme) - `--ink-on-anchor-dim`: Anchor rail (dark warm chrome on every light theme) - `--shadow-card`: Anchor rail (dark warm chrome on every light theme) `themes.light` is required, `themes.dark` optional; each token is optional (left out = stock value); values are `#rgb`, `#rrggbb`, `rgb()` or `rgba()`. Keep these 13 contrast pairs readable in light and dark (text 4.5:1, UI graphics 3:1): --t0 on --bg (4.5:1), --t0 on --s2 (4.5:1), --t1 on --s1 (4.5:1), --t2 on --s1 (4.5:1), --aci on --ac (4.5:1), --tei on --te (4.5:1), --ink-on-anchor on --anchor (4.5:1), --ink-on-anchor-dim on --anchor (4.5:1), --ac on --s1 (3:1), --pr on --s1 (3:1), --re on --s1 (3:1), --am on --s1 (3:1), --te on --s1 (3:1). Use only keys from the English UI key catalog in a locale overlay. ## Commands after the files - Developer edition: `aancer-pack lint /manifest.json /content` after every change, then `aancer-pack dev --target --watch` (`--trust-key-on-target` the first time). - Test or EVAL installation: `aancer-pack keygen` once, put the printed `pub-<12 hex>` id into `publisher.keyId`, `aancer-pack sign ...`, `aancer-pack validate --remote `, then an administrator trusts the key under Extensions > Trust keys and imports the pack. - The free developer licence (up to 3 users, 90 days) is requested at https://aancer.ai/developers-licence with the installation's fingerprint. ## Check before you answer Run `validate_pack` if you have it and fix every error. Otherwise go through the schema again: every required field present, every enum value allowed, ids match `^[a-z0-9][a-z0-9._-]{2,63}$`, strict semantic versions, every file the manifest names exists. If something is uncertain, say which field and why. Docs for people: https://aancer.ai/developers