# AANCER builder quick reference (every rule here is a real import error) Small on purpose, so every AI assistant can fetch it. Read it fully before writing any AANCER file. ## Pack manifest - `"v": 2`, `"kind": "bundle"`, `id` like `.`, strict `version` (`1.0.0`), `items` array. - Each item: `kind`, `schemaVersion` (an integer such as `1`, never `"1"` or `"1.0"`), `id`, `scope`, `spec: { "$ref": "content/.json" }`. - Every file under `content/` must be referenced by an item or listed in `assets`, or the signature check fails. - No `name` and no `schemaVersion` at the top of a manifest or a template file. - `publisher` is an object: `{ "name": "Acme Example Ltd", "keyId": "pub-0123456789ab" }`, never a string. `scope` is exactly `install` or `workspace`. - `"scope": "workspace"` needs `"workspace": "{{param.target_workspace}}"` and a manifest parameter `target_workspace` of type `workspace`. Every `{{param.}}` must be declared in `parameters`. ## Workflow template - File: `id`, `version` (integer), `record`. - `record.industry`: healthcare, legal, financial, hr, manufacturing, retail, saas, marketing, operations, devops. `record.complexity`: starter, intermediate, advanced. - `record.aiAct`: `riskClass`, `annexIiiCategory`, `intendedPurpose`, `humanOversight`, `transparencyNote`. `record.compliance`: `dataCategories`, `dataSubjects`, `lawfulBasis` (`""`, `contract`, `consent`, `legitimate-interest`, `legal-obligation`), `retentionDays`. - Step `type` is exactly one of `trigger`, `aancer-ai`, `rag`, `agent`, `connector`, `approval`. Never `human_approval`, `connector_action` or anything else. - Steps chain with `nextStepId`; the last step has no `nextStepId` at all (never `null`). - Bindings: `parameterId`, `stepId`, `path` (`connectorAuth`, `approvers`, or `connectorInputs.`). - Connector step: `connectorName`, `connectorAction`. Connector trigger: `triggerType: "connector"`, `triggerConnector`, `triggerName`. - Any step that writes, sends or deletes gets an `approval` step before it. ## Connector (TypeScript) - Import only from `@aancer/connector-framework`: `createConnector`, `createAction`, `createTrigger`, `ConnectorAuth`, `Property`, `TriggerStrategy`. Never `createPiece`, `PieceAuth` or any other framework's API. - Auth lives on `ConnectorAuth`, never on `Property`. `Property.SecretText` does not exist. ```ts import { createConnector, createAction, ConnectorAuth, Property } from '@aancer/connector-framework'; export const auth = ConnectorAuth.SecretText({ displayName: 'API key', required: true }); // or, with more fields: // 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 }) } }); // SecretText: ctx.auth.secret_text CustomAuth: ctx.auth.props.apiKey ``` - Pass `auth` to `createConnector` and to every `createAction` and `createTrigger`. - `createConnector` takes `displayName`, `logoUrl`, `authors`, `auth`, `actions`, `triggers`; no `name` (it comes from `package.json`). - `pack.json`: `displayName`, `description`, `category`, `egressHosts`. `category` exactly one of: `AI`, `Comms`, `Commerce`, `Core`, `Business`, `Finance`, `Productivity`, `Content`, `Developer`, `Support`, `Forms`, `HR`, `Payments`, `Marketing`, `Sales`, `Other` (case-sensitive). - Package `@aancer/connector-`, strict `x.y.z` version. ## Theme A theme pack is `manifest.json` plus `content/theme.json` (plus `content/fonts/*.woff2` and logos if used). Exact shape: ```json { "v": 2, "kind": "bundle", "id": "acme.ci", "version": "1.0.0", "title": "Acme corporate identity", "publisher": { "name": "Acme Example Ltd", "keyId": "pub-0123456789ab" }, "requires": { "platform": ">=1.0.0", "points": { "theme": "2" } }, "parameters": [], "items": [ { "kind": "theme", "schemaVersion": 2, "id": "acme-ci", "scope": "install", "spec": { "$ref": "content/theme.json" } } ] } ``` ```json { "id": "acme-ci", "platformName": "Acme AI", "tagline": "Your data. Your 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", "--ac": "#0f6e76", "--aci": "#ffffff" }, "dark": { "--bg": "#0d1417" } }, "login": { "backgroundColor": "#12313a", "tagline": "Welcome to Acme AI", "legalFooter": "Copyright Acme Example Ltd" }, "email": { "headerBackground": "#12313a", "bodyBackground": "#ffffff", "textColor": "#33454f", "buttonColor": "#0f6e76" } } ``` - `theme.json` top-level keys are only: id, platformName (required), tagline, defaultTheme, fonts, typography, logos, themes (required), login, email. No schemaVersion, title, description or branding inside it. - `typography` keys are only ui, display, label, mono. A font `weight` is a string (`"400"`). - Set only these 35 tokens in `themes.`: --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. Never invent names such as --gold, --ring, --ac-hover or --shadow-md. - Blocks: `light` (required), `dark`, `midnight`, `high-contrast`, `trust-authority`, `legal`, `terminal`. - Colours: `#rgb`, `#rrggbb`, `rgb()`, `rgba()`. No `var()`, `hsl()` or colour names. - Every family named in `typography` must be declared in `fonts` (with a woff2 file under `content/fonts/`, lower-case name) or be generic: system-ui, sans-serif, serif, monospace, ui-monospace, ui-sans-serif, -apple-system, segoe ui, roboto, helvetica neue, arial, menlo, consolas. - No `http:`, `https:`, `//`, `data:` or `url(` anywhere in the theme, including tagline and footer. - Import is refused below 1.5:1 for --t0 on --bg, --t0 on --s2, --aci on --ac, --ink-on-anchor on --anchor. Aim for 4.5:1 on text pairs and 3:1 for --ac, --pr, --re, --am, --te on --s1. ## Self-check before you answer 1. Every name you used appears in this file or in the fetched page for the type; nothing guessed from another framework. 2. `schemaVersion` and template `version` are integers. 3. Enum values copied exactly (step types, category, industry, lawfulBasis). 4. Auth via `ConnectorAuth`, passed to connector, actions and triggers. 5. Theme: only the 35 tokens, every font declared or generic, no URLs. 6. Every file under `content/` is referenced. If the AANCER MCP server is connected, run `validate_pack` and fix every error.