[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71GX3GAP1RE56N4AHSSNWTF":3,"skill-same:01M71GX3GAP1RE56N4AHSSNWTF":70},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":43,"commitSha":44,"skillDirectory":45,"forksCount":46,"repositoryHtmlUrl":47,"repositoryHomepageUrl":6,"ownerHtmlUrl":48,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":49,"install":50,"resources":63},"01M71GX3GAP1RE56N4AHSSNWTF","plasm-authoring",null,"Author and validate Plasm domain models (CGS, `domain.yaml`), capability mappings (CML, `mappings.yaml`: HTTP REST, GraphQL via `transport: graphql`, composed reads via `transport: view`), and `views:` DAGs. Test interactively with `plasm-repl` against Hermit mocks or live\u002Fsandbox backends. Use when extracting schemas from OpenAPI specs, writing or editing `domain.yaml` \u002F `mappings.yaml`, validating mappings, iteratively developing typed agent tooling, or driving Cursor \u002F Claude \u002F Codex \u002F other coding agents — point them at this skill as the full playbook; do not duplicate per-API runbooks into agent prompts.","PlasmTools\u002Fplasm-core","PlasmTools","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F281353390?v=4","01M71GWJFJFZQRD4NNTXY58ZQ8","01M71GWJG8F2ADWJDZCD57ZH94",9,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FPlasmTools\u002Fplasm-core\u002Fblob\u002Fmain\u002Fskills\u002Fplasm-authoring\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"authoring","plasm authoring","editing","view","domain","point","do","as","capability","coding","full","live","transport","playbook","at","api","when","writing","runbooks","extracting","2026-11-10 10:12:30",false,"---\nname: plasm-authoring\ndescription: >-\n  Author and validate Plasm domain models (CGS, `domain.yaml`), capability mappings (CML, `mappings.yaml`: HTTP REST, GraphQL via `transport: graphql`, composed reads via `transport: view`), and `views:` DAGs. Test interactively with `plasm-repl` against Hermit mocks or live\u002Fsandbox backends. Use when extracting schemas from OpenAPI specs, writing or editing `domain.yaml` \u002F `mappings.yaml`, validating mappings, iteratively developing typed agent tooling, or driving Cursor \u002F Claude \u002F Codex \u002F other coding agents — point them at this skill as the full playbook; do not duplicate per-API runbooks into agent prompts.\n---\n\n# Plasm Authoring\n\nIteratively author, validate, and test a **typed agent surface** (Python Program declarations + typed teaching) from an API specification. This skill is the **single source of truth** for CGS \u002F CML authoring inside `plasm-core`. The monorepo root delegates to this file; do not re-author CGS doctrine elsewhere.\n\nThe two authored files are:\n\n- **`domain.yaml`** — CGS, the semantic model. Entities, fields, relations, capability declarations (`query`, `get`, `search`, `create`, `update`, `delete`, `action`), top-level **`values:`** registry (semantic slots), optional top-level **`data_classes:`** (Guardians-style information-flow labels and sink roles), and optional top-level **`views:`** composed read DAGs.\n- **`mappings.yaml`** — CML, the transport wiring. HTTP \u002F GraphQL templates per capability, plus **`transport: view`** stubs that point at a **`views:`** key (no `method` \u002F `path` for those rows).\n- **Runtime query semantics** (no extra YAML file). **Pagination** lives on CML query mappings (`pagination:` block). **Hydration** (default concurrent GET per query row) applies when CGS declares **both** `query` and `get` for the same entity unless execution opts out. Continuations and page sizing are expressed in **Plasm** (typed Python declarations \u002F host continuation handles \u002F `.take(n)` where taught) — not by authoring synthetic CLI flags.\n\nFor complete schema reference (types, operators, CML grammar, variable resolution, pagination block, default query hydration, action output, views, auth schemes), read [reference.md](reference.md).\n\n## Companion skills\n\nThis skill is the authoring core. Use these companion skills for follow-on work:\n\n- [plasm-catalog-e2e-test](..\u002Fplasm-catalog-e2e-test\u002FSKILL.md) — Hermit-first then live \u002F sandbox transport testing.\n- [plasm-catalog-adversarial-verify](..\u002Fplasm-catalog-adversarial-verify\u002FSKILL.md) — programming-agent adversarial prove loop (AppWorld-first): teaching audit, twin-query compression, dry\u002Flive Plasm crawl, evidence under `apis\u002F...\u002Fe2e\u002F`.\n- [plasm-catalog-polish](..\u002Fplasm-catalog-polish\u002FSKILL.md) — autonomous diagnostic \u002F fix loop for an existing catalog.\n- [plasm-catalog-score](..\u002Fplasm-catalog-score\u002FSKILL.md) — rubric scoring of catalog quality.\n- [plasm-catalog-reprint](..\u002Fplasm-catalog-reprint\u002FSKILL.md) — full-cutover regeneration of a weak catalog.\n- [plasm-catalog-retro](..\u002Fplasm-catalog-retro\u002FSKILL.md) — post-authoring retrospective for systemic press improvements.\n\nThe companion Cursor agent at [`.cursor\u002Fagents\u002Fplasm-forge.md`](..\u002F..\u002F.cursor\u002Fagents\u002Fplasm-forge.md) wraps this skill for autonomous catalog runs.\n\n## Domain authoring is not deterministic\n\n**`domain.yaml` is not produced by a correct-by-construction pipeline.** There is no supported \"OpenAPI → CGS\" generator crate or script in this repo, and you must not add one as a substitute for human or LLM **semantic** judgement. Reasonable authors disagree on entity boundaries, which operations merge under one capability, relation shapes, `abstract` entities, and what belongs in the prompt-facing surface versus the wire-only edge. The same applies to **`values:`** identity: each key is a **semantic slot** for the catalog (gloss, prompts, validation intent) — **not** something you derive by collapsing every field that shares a primitive wire shape. Whether two slots **share** one `values` key or get **distinct** keys is an authoring judgement; default toward **separate keys** unless the domain meaning is intentionally one shared space (one enum, one id space, one taxonomy).\n\n**What *is* deterministic (after the YAML exists):** `CGS::validate`, CML template parsing, compilation to HTTP, decoding against declared shapes, `plasm-eval coverage`, and similar checks. Those prove **internal consistency** of an authored model — not that the model is the *right* abstraction for an API.\n\n**Implication:** Expanding an API (e.g. \"full GitHub REST\") is **iterative authoring** — repeated passes through the loop below — not flipping a codegen switch. If you need a huge RPC-shaped surface for experiments (e.g. MCP prompt size baselines), treat that as a **separate artifact or fork** with its own trade-offs; do not pretend it replaces a curated CGS.\n\n## The Loop\n\n```\n1. READ spec  →  2. AUTHOR domain.yaml  →  3. AUTHOR mappings.yaml  →  4. VALIDATE  →  5. E2E TEST (Hermit, then live\u002Fsandbox)  →  6. EVAL COVERAGE\n      ↑                                                                                                                                  │\n      └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘\n```\n\n### Authoring with an agent (Cursor \u002F Claude \u002F Codex)\n\nPoint the agent at **this skill** ([SKILL.md](SKILL.md) + [reference.md](reference.md)) as the single source of truth. The agent prompt should be minimal — for example: read the OpenAPI spec the user provides, then follow the loop above until `domain.yaml` and `mappings.yaml` cover the API surface the user asked for, validating and testing as in Steps 4–6.\n\n**Do not** paste parallel API-specific runbooks (phased tag lists, per-vendor checklists, or duplicate rules) into the prompt; large specs are handled by **repeated passes through the same loop** (read a slice of the spec, extend the two YAML files, validate, test, repeat).\n\n## File Structure\n\nCanonical API catalogs live under `apis\u002F` in this repo (the monorepo `apis\u002F` is only a symlink to `plasm-oss\u002Fapis\u002F`):\n\n```\napis\u002F\u003Capi-name>\u002F\n  domain.yaml      # entities, fields, relations, capabilities (WHAT)\n  mappings.yaml    # CML templates per capability (HOW)\n  README.md        # commands, auth env vars, scope, sandbox info\n  eval\u002Fcases.yaml  # natural-language eval cases for plasm-eval\n```\n\n`fixtures\u002Fschemas\u002F` holds **test-only** split catalog dirs (e.g. `capability_with_input\u002F`, `plasm_language_matrix*`); do not use it for new REST API authoring unless you are intentionally adding a tiny fixture for tests.\n\n### NL eval cases (`plasm-eval`)\n\nGoal-oriented harness cases live in **`apis\u002F\u003Capi>\u002Feval\u002Fcases.yaml`** with **`schema: \u003Capi>`** matching the directory name. Each case has a natural-language **`goal`**, soft **`expect:`** scoring, and optional **`covers:`** — a list of **expression-form buckets** this case is meant to exercise (e.g. `query_filtered`, `get`, `chain`, `multi_step`). Bucket IDs are snake_case and align with CGS-derived requirements.\n\n- **Coverage (deterministic, no LLM):** `plasm-eval coverage --schema apis\u002F\u003Capi> --cases apis\u002F\u003Capi>\u002Feval\u002Fcases.yaml` prints a human- and LLM-readable report: required buckets derived from **CGS** vs the union of per-case **`covers`**. Exit code is non-zero if any required bucket is missing (`--warn-only` to soften). Use **`--format json`** for scripts or agent consumption.\n- **Optional `apis\u002F\u003Capi>\u002Feval\u002Fcoverage.yaml`:** only **`required_extra:`** is implemented — it adds buckets beyond the CGS-derived set. There is **no** `exclude:` override.\n- **Scaffold:** `plasm-eval scaffold --schema apis\u002F\u003Capi>` emits a commented YAML fragment (CGS-derived buckets + one example case). Use `--write` to create `apis\u002F\u003Capi>\u002Feval\u002Fcases.yaml`; `--force` overwrites.\n\n## Step 1: Read the OpenAPI Spec (or GraphQL SDL \u002F vendor docs)\n\nRead the spec file directly. For large specs, read section by section — paths first, then schemas, then descriptions. Use `wc -l` to gauge size, then `grep \"^  \u002F\"` to list all paths before diving in.\n\n**IMPORTANT: Do not write scripts, binaries, or \"generator crates\" to emit `domain.yaml` \u002F `mappings.yaml` from OpenAPI (or any spec) as if the mapping were unique or mechanical.** There is no single deterministic reduction from RPC to CGS. You must read the spec and **author** the domain — merging endpoints, naming entities, choosing relations, classifying parameters, and deciding scope for agents. Mechanical dumps mirror the RPC surface and bypass the judgements this skill is for; they are explicitly out of scope for canonical `apis\u002F\u003Cname>\u002F` trees. **A GraphQL mutation\u002Fquery list is not a capability list** — compress to user tasks per [reference.md — Task-oriented catalogs](reference.md#task-oriented-catalogs-mandatory).\n\n**Query parameters in particular are a non-deterministic inference step.** OpenAPI specs vary enormously in how they document query semantics:\n\n- Some use standard `parameters:` with `in: query`\n- Some put params in `requestBody` JSON schemas (e.g. Tavily `\u002Fsearch`)\n- Some use vendor extension fields (`x-*`)\n- Some rely entirely on `description` prose and examples\n- Some leave parameters undocumented and rely on external docs\n\nYou must read **all of the above** — not just the canonical OpenAPI `parameters` array — to classify each vendor input into a **capability input lane** (`scope` \u002F `selection` \u002F `controls` \u002F `arguments` \u002F `payload`) and decide how CML transmits it (`path:` \u002F `query:` \u002F `body` \u002F `pagination:`). Flat CGS `parameters:` \u002F `role:` is a **hard load error**. A spec where params live in extension fields or request bodies is a harder but equally valid authoring exercise.\n\n**From the spec, identify:**\n\n- **Schemas** (components\u002Fschemas): these become entities. Note field names, types, required fields, enums, and `$ref` links.\n- **Operations** (paths): these become capabilities. Note HTTP method, path, parameters (path\u002Fquery\u002Fbody), request body schema, response schema, extension fields, and `description` prose.\n- **Relations**: `$ref` fields (Pet.category → Category), foreign key patterns (Order.petId → Pet), path nesting (\u002Fpet\u002F{id}\u002Ftags).\n- **Shared enums**: the same enum values appearing in both a schema field and a query parameter (Pet.status and findByStatus?status= are the same `PetStatus` type).\n\n**Also identify:**\n\n- **Authentication**: check `securitySchemes` in `components` and `security:` at the operation or global level. Common patterns:\n  - `apiKey` (in: `query`) → `api_key_query`\n  - `apiKey` (in: `header`) → `api_key_header`\n  - `http` (scheme: `bearer`) → `bearer_token`\n  - `oauth2` (clientCredentials flow) → `oauth2_client_credentials`\n  - Genuinely public → `scheme: none`\n\n**Key principle:** An OpenAPI spec describes RPC operations. You are extracting the **domain model** — the business entities, how they relate, and what operations exist on them. Multiple endpoints operate on the same entity. A field like `petId: integer` is a relation, not just a number.\n\n## Step 1.5: Task inventory (before entities)\n\nBefore naming entities or capabilities, list **agent tasks in user language** (what would a consolidated MCP or product UI expose?). Examples: \"show my open bugs\", \"what's ENG-42 and its comments\", \"create a bug on Backend\", \"project status this week\".\n\nEach task must map to **`kind: search`**, a **`views:`** composed read, or a small set of write verbs (`create` \u002F `update` \u002F `delete`). Flag any task that would require chaining multiple capabilities without a view — that task needs a `views:` entry or a merged capability.\n\nSee [reference.md — Task-oriented catalogs](reference.md#task-oriented-catalogs-mandatory).\n\n## Step 2: Author domain.yaml\n\nWrite the domain model. No HTTP details here — only what exists and what you can do.\n\n**Value registry:** under **`values:`**, each stable key defines a **named semantic slot** (kernel or profile `type:` plus optional `target`, `enum:`, `constraints:`, `description`, …). Entity **fields** and capability **lane slots** only **`value_ref:`** that slot — slot-level keys (`required`, `path`, …) say how *this* use site differs. Treat **one key ↔ one intended meaning** in the domain; sharing a key across sites is a **deliberate** merge (same gloss \u002F semantics), never a mechanical \"all strings dedupe\" shortcut. See [reference.md — Value domains](reference.md#value-domains-values-and-value_ref). **Obsolete** `string_semantics` \u002F `value_format` \u002F `allowed_values` \u002F `type: select|date|multi_select` — rejected by the loader; see [reference.md — Obsolete](reference.md#obsolete-or-unsupported-do-not-teach).\n\n### CRITICAL: Versioning is mandatory\n\n- Every `apis\u002F\u003Capi>\u002Fdomain.yaml` **must** declare top-level `version: \u003Cn>` with `n > 0`.\n- **Never rely on defaults.** Omitted\u002Fzero versions are invalid for authoring and packaging.\n- When you change domain semantics (entities, fields, relations, capability signatures, parameter types\u002Froles, auth contract, output\u002Fprovides behavior, **information-flow annotations**), you **must increment** `version`.\n- Treat any change that can affect prompt shape, compile\u002Fdecode behavior, or runtime dispatch as a version bump event.\n- If you only change prose \u002F comments with no semantic \u002F runtime impact, keep `version` unchanged.\n\n**`description` strings:** On entities, capabilities, and `output` for side-effect actions, write **concise language for an agentic surface**: what the **entity** or operation is **for** in the task (goal, anchor, decision), not an inventory of typed fields and relations — the schema and teaching table already show those. Avoid tabular jargon (**\"row\"**) in Teaching-table-facing prose. Avoid embedding REST paths, methods, status codes, bare **`http:\u002F\u002F`** \u002F **`https:\u002F\u002F`** links, or \"see GET \u002F…\" notes — those belong in **`mappings.yaml`** comments or vendor docs, not in the CGS. **`auth.token_url`** in `domain.yaml` is the intentional exception (machine OAuth endpoint string). **Do not** repeat shapes already taught by **`value_ref`**, projection **`provides:`**, **`input_schema`** unions, or parameter names — omit field \u002F parameter descriptions when types carry the story (see [reference.md — Gloss: do not restate typed structure](reference.md#gloss-do-not-restate-typed-structure)).\n\n**No cross-catalog prose (compositional CGS):** Each `apis\u002F\u003Cname>\u002Fdomain.yaml` is a **closed** semantic surface. Teaching text (`description`, value glosses, discovery `names` \u002F terms that read as instructions) must **never** name another registry catalog, its `entry_id`, or its entity\u002Fcapability ids (e.g. do not tell Venmo login to “use Supervisor.email \u002F AccountPassword”). Sessions compose catalogs at runtime; authors annotate **role semantics inside this catalog only** (“account holder’s email”, “this service’s password”, “payment recipient ≠ login identity”). Cross-catalog orchestration belongs in product docs \u002F eval harnesses — not CGS strings. Same-catalog entity names are fine when they teach composition **within** this file.\n\n**Agentic teaching table copy (execute \u002F MCP teaching):** The prompt renderer attaches **entity `description`** to the symbolic teaching table (projection witness \u002F banner). Treat it as **imperative surface**, not a manual or vendor doc: **one or two short sentences** on **purpose** (why an agent would focus this **entity**) — **never** name **relations** or **fields** that already show up as **wire-name** columns, bracket projections, or typed columns (that duplicates the graph and confuses \"banner\" with \"nav map\"). **Do not** summarize projection contents (\"includes refs to …\", \"typed booleans plus …\") — wire names, relations, and types already do that. **Do not** name other capability ids, spell out call sequences (\"use X then Y\"), cite **`transport:`**, document HTTP error semantics, or tell agents how to seed MCP — **`discovery:`** blocks (**`operation_terms`**, **`target_terms`**, **`qualifier_terms`** on entities\u002Fcapabilities), **`apis\u002F\u003Capi>\u002FREADME.md`**, and eval cases carry that operational guidance. Capability **`description:`** should state **effect** or **when to use** in domain terms; move cross-capability playbooks into **`discovery`** on the relevant capability. See [reference.md — Teaching-table-facing descriptions](reference.md#teaching-table-facing-descriptions-entities-and-capabilities).\n\n```yaml\nvalues:\n  nv_pet_id:\n    type: integer\n  nv_pet_name:\n    type: string\n  nv_pet_status:\n    type: enum\n    enum: [available, pending, sold]\n  nv_category_id:\n    type: integer\n  nv_category_name:\n    type: string\n  nv_pet_find_by_status_status:\n    type: enum\n    enum: [available, pending, sold]\n  nv_created_at:\n    type: rfc3339\n\nentities:\n  Pet:\n    id_field: id\n    fields:\n      id:\n        value_ref: nv_pet_id\n        required: true\n      name:\n        value_ref: nv_pet_name\n        required: true\n      status:\n        value_ref: nv_pet_status\n      created_at:\n        value_ref: nv_created_at\n    relations:\n      category:\n        target: Category\n        cardinality: one\n      tags:\n        target: Tag\n        cardinality: many\n\n  Category:\n    id_field: id\n    fields:\n      id:\n        value_ref: nv_category_id\n        required: true\n      name:\n        value_ref: nv_category_name\n\n  # Include ALL entities referenced by relations, even simple ones\n\ncapabilities:\n  pet_findByStatus:\n    kind: query\n    entity: Pet\n    selection:\n      - name: status\n        value_ref: nv_pet_find_by_status_status\n        required: true\n  pet_get:\n    kind: get\n    entity: Pet\n  pet_create:\n    kind: create\n    entity: Pet\n  pet_delete:\n    kind: delete\n    entity: Pet\n```\n\n**Teaching projection:** Python entity declarations expose typed catalog fields; use `.select(...)` for an explicit row projection. Primary read capabilities and `provides:` still describe materialization. Historical `domain_projection_examples` only affects the internal native teaching oracle.\n\n**String \u002F text profiles:** use kernel `type: string` or profile types (`markdown`, `document`, `html`, `json_text`, `email`, `url`, …) on the **`values:`** row — not `string_semantics:`.\n\n**Field \u002F lane wire types:** the vocabulary is kernel names (`string`, `integer`, `number`, `boolean`, `array`, `json`, `entity_ref`, `blob`, `money`) or core profiles (`enum`, `multi_enum`, `rfc3339`, `iso8601_date`, `unix_ms`, `unix_sec`, `uuid`, …) on a **`values:`** row, not inline `field_type` on the slot. For **`entity_ref`**, set **`target: EntityName`** on the value row. For **`blob`**, see [reference.md — Blob \u002F binary](reference.md). For **`array`**, the value row has **`type: array`** and **`items: { value_ref: \u003Celement_key> }`**. **`enum` \u002F `multi_enum`** require non-empty **`enum:`** on the value row.\n\n**Temporal profiles:** use `type: rfc3339` \u002F `iso8601_date` \u002F `unix_ms` \u002F `unix_sec` directly — no separate `value_format` key. Do **not** put evaluation `now` or harness calendar dates in `values:` descriptions — the language card states `evaluation_now` (PLP-9) when temporal slots are taught.\n\n### CGS field typing checklist (strict)\n\nUse this on every new or edited entity (and on capability lane \u002F `input_schema` fields) so the model does not collapse to \"stringly typing.\"\n\n1. **Instants and calendar dates** — If the wire is a timestamp or date, use a **`values:`** row with the matching temporal profile (`rfc3339`, `iso8601_date`, `unix_ms`, `unix_sec`). **Do not** use bare `string` for fields named like `date_created`, `date_updated`, `last_modified`, `*expires*`, `*_on`, or `last_*` when the API returns a normal machine date\u002Ftime.\n2. **Enumerations** — If the set of values is closed and known, use **`enum`** \u002F **`multi_enum`** with **`enum:`** on the value row. If the vendor reuses a field across resources with inconsistent or extensible lifecycles, keep **`string`** and do not force a narrow enum that rejects valid future wire values.\n3. **Foreign keys** — If the value is another resource's id and that resource is in the CGS, use **`type: entity_ref`** and **`target:`**.\n4. **Reverse list edges (many)** — When a child has `entity_ref` to a parent and the child's primary list query accepts a parameter that filters by that parent's id, declare a **`cardinality: many` relation on the parent** with **`materialize: { kind: query_scoped, capability: \u003Cchild_query>, param: \u003Cparent_id_param> }`**. Do **not** add a `relations` key with the same name as an `entity_ref` field on the same entity.\n5. **Opaque bytes and file bodies** — Use **`type: blob`**.\n6. **Human text and opaque tokens** — Use **`type: string`** or a text profile (`markdown`, `document`, …).\n\nApply the same rules to lane **`value_ref`** targets.\n\n**Capability kinds:** `query` (collection filter), `search` (free-text relevance), `get` (by ID), `create`, `update`, `delete`, `action` (anything else).\n\n### Composed read models (`views:`)\n\nWhen the agent-facing concept is a **single read row** that **no single vendor endpoint returns**, but it **decomposes** into several **`query` \u002F `get`** capabilities you already modeled, you **must** express it in CGS:\n\n1. Add an **`entities:`** row for that concept (often **`abstract: true`** so discovery does not attach it to parent graphs until explicitly seeded).\n2. Declare a **`kind: query`** capability on that entity; **lanes** (`scope` \u002F `selection` \u002F …) are the scope inputs the composition needs.\n3. Add **`views:\u003Ckey>`** with ordered **`nodes`** (each runs an existing capability), **`bind`** maps for node inputs, and **`output`** maps that shape entity fields.\n4. In **`mappings.yaml`**, wire that capability with **`transport: view`** and **`view: \u003Ckey>`** only.\n\n**Anti-pattern:** Long playbook text that says \"call A, then B, then aggregate\" **without** a **`views:`** entry leaves agents without a single **`query`** symbol for the composed row. Canonical example: **`apis\u002Fcloudflare`** — **`SecurityOverview`** + **`security_overview_query`** + **`views.security_overview`**. Full grammar: [reference.md — Composed read views](reference.md#composed-read-views).\n\n### Runtime schema overlay (`schema_overlay:`)\n\nWhen the API has **workspace-defined columns** on generic rows (Fibery databases, Notion database properties, Jira custom fields per project\u002Fissue type, ClickUp custom fields on tasks), add a top-level **`schema_overlay:`** block **after** the bootstrap entity and schema-fetch capability exist. Do **not** mirror every column statically in `entities:` when the schema is fetched at runtime.\n\n- **Static vendor schema** (GitHub, Slack, PokéAPI) → **no overlay**\n- **Multi-hop reads without dynamic columns** → **`views:`**, not overlay\n- **Per-scope typed entities** → `projection.mode: per_scope_entity` (Fibery, Notion, Jira)\n- **Shared entity + extra columns** → `projection.mode: augment_base` ([ClickUp](..\u002Fapis\u002Fclickup\u002Fdomain.yaml); Linear deferred until GraphQL exposes custom-field defs)\n\nAuthoring details, spec table, checklists, and reference catalogs: [reference.md — Runtime schema overlay](reference.md#runtime-schema-overlay-schema_overlay). Runtime behavior: monorepo [docs\u002Fschema-overlay.md](..\u002F..\u002F..\u002Fdocs\u002Fschema-overlay.md).\n\n**`kind: action` output:** Every action must declare either non-empty **`provides:`** or **`output:`** with **`type: side_effect`** and a non-empty `description:` that states **what** the operation changes. There is no `output.type: none`. See [reference.md — Action output](reference.md#action-output-provides-vs-outputside_effect).\n\n### Information-flow annotations (Guardians \u002F plan flow typing)\n\nAfter the relational model is stable, annotate **data classes**, **sinks**, and **sanitizers** so the host can verify agent plans before execute (`plasm` dry-run → `verify_plan_flow`). Conformance map: monorepo [docs\u002Fguardians-alignment.md](..\u002F..\u002F..\u002Fdocs\u002Fguardians-alignment.md). Full vocabulary: [reference.md — Information-flow annotations](reference.md#information-flow-annotations-guardians--plan-flow-typing).\n\n**Catalog declares facts; tenant policy enforces rules.** Register classes in **`data_classes:`**, label sensitive **entity fields** with **`data_class:`**, mark exfiltration\u002Fdestructive **input_schema** params with **`sink_class:`**, and list taint breakers on **`sanitizes:`** capabilities. Output labels are **derived** from `effective_provides` × field `data_class` — do not duplicate on capabilities.\n\n**Annotation pass (minimum for mutating APIs):**\n\n1. Add `data_classes:` entries for every label and sink role you reference (`untrusted`, `pii_*`, `external_send`, `destructive_delete`, …).\n2. Label user-generated text and PII on entity fields agents read (`body`, `description`, `comment`, email fields, …).\n3. On send\u002Fpublish\u002Fpost\u002Freply\u002Fshare\u002Fdelete capabilities, set `sink_class:` on the payload field in `input_schema`.\n4. On redact\u002Fscrub\u002Fsanitize capabilities, declare `sanitizes:` for the classes they clear.\n5. Increment `version:` when flow annotations change.\n\nWitness catalog: `plasm-oss\u002Ffixtures\u002Fschemas\u002Fflow_matrix\u002F`. Unlabeled catalogs remain flow-permissive until tenant policy is pinned active.\n\n### Authentication — top-level `auth:` block\n\nPlace a single `auth:` block at the end of `domain.yaml`. The runtime reads secrets at execution time from the named environment variables — no secrets go in schema files. Use `scheme: none` for genuinely public APIs.\n\n```yaml\n# API key in query string (e.g. RAWG ?key=..., OMDb ?apikey=..., NYT ?api-key=...)\nauth:\n  scheme: api_key_query\n  param: key\n  env: RAWG_API_KEY\n\n# API key as a request header (e.g. X-Api-Key)\nauth:\n  scheme: api_key_header\n  header: X-Api-Key\n  env: MY_SERVICE_API_KEY\n\n# Bearer token (e.g. ClickUp, Notion, Tavily)\nauth:\n  scheme: bearer_token\n  env: CLICKUP_API_TOKEN\n\n# OAuth 2.0 client credentials (e.g. Spotify)\nauth:\n  scheme: oauth2_client_credentials\n  token_url: https:\u002F\u002Faccounts.spotify.com\u002Fapi\u002Ftoken\n  client_id_env: SPOTIFY_CLIENT_ID\n  client_secret_env: SPOTIFY_CLIENT_SECRET\n  scopes: []\n\n# Public API with no outbound credentials\nauth:\n  scheme: none\n```\n\n### Query capability input lanes\n\n**Critical rule: only declare lane slots the API endpoint actually accepts as HTTP inputs.** Read the OpenAPI operation's `parameters` list and `description` fields. Never invent **`selection:`** \u002F **`scope:`** keys from entity fields — entity fields describe the domain object, not what the query endpoint accepts.\n\n**No selection?** If the endpoint is a plain paginated resource index (e.g. PokéAPI `\u002Fpokemon\u002F` — no server-side filters, just offset\u002Flimit), declare **no `selection:`**. Pagination belongs in **`mappings.yaml`** (`pagination:` \u002F page controls).\n\n#### `kind: query` vs `kind: search`\n\nUse **`kind: search`** when the endpoint's primary interface is a **required** free-text relevance query (`q`, `query`, `search`) that returns ranked results rather than field-filtered rows. The free-text **selection** param **must** be `required: true` — optional free-text list filters use **`kind: query`**. Required non-text selection (e.g. AppWorld `access_token`) is taught on the primary `e~\"\u003Cquery>\"{…}` row; an optional-filter twin is emitted only when other optional selection slots exist. If the endpoint filters by concrete field values (`status`, `archived`, `team_id`), use `kind: query`.\n\n#### Classification: OpenAPI params → lanes\n\n| OpenAPI \u002F vendor examples | Lane | CML transmission |\n|---------------------------|------|------------------|\n| `offset`, `limit`, `page`, `cursor`, `after`, `before` | *(omit from CGS)* or `controls` when taught | CML `pagination` block; not brace WHERE |\n| `status`, `tags[]`, `assignees[]`, `archived`, `type`, shelf discriminants | **`selection`** | CML `query:` \u002F path branch vars |\n| `q`, `query`, `search` (required free-text) | **`selection`** on `kind: search` | CML `query:` var |\n| `order_by`, `sort_by`, `direction`, `embed`, `fields`, `locale` | **`controls`** | CML `query:` var; not brace WHERE |\n| `team_id` in `GET \u002Fteam\u002F{team_id}\u002Fspace` | **`scope`** | CML `path:` var; pair with relation `materialize` |\n| Create\u002Fupdate\u002Faction body fields | **`payload`** | CML `body` |\n| Non-body method args (token on a get\u002Faction) | **`arguments`** | CML `query:` \u002F header \u002F path as mapped |\n\n**Same-type list compression:** Competing `kind: query` caps that return the **same entity** (identical or sibling brace shapes, different HTTP path only — including scoped+unscoped twins) are **RPC residue** and a **hard CGS validate error**. Collapse to **one** query with a **selection discriminant** (enum\u002Fprofile) and CML path branching (`type: if`), fold scoped lists into optional `scope` on that query + relation **`materialize`**, **or** a real entity split when polarity is a different domain object. Do **not** teach twin brace forms or raise teaching-line caps to \"escape\" brace-dedupe. Full law: [reference.md — Same-type list compression](reference.md#same-type-list-compression).\n\n**Scoped sub-resource lists:** When an API has endpoints like `GET \u002Fclasses\u002F{class_index}\u002Fspells` alongside `GET \u002Fspells`, declare **one** `kind: query` with optional class scope (CML path branch). Pair the parent relation with **`materialize`** against that single query — never a second competing query on the child entity.\n\n**Range filters** like ClickUp's `due_date_gt` \u002F `due_date_lt` are **separate named selection slots** — declare each one individually, not as one field with operator suffixes.\n\n**Array \u002F multi-value params** (e.g. `genres`, `assignees[]`, `embed[]`): use a **`values:`** row with **`type: multi_enum`** or **`type: array`** with **`items: { value_ref: \u003Celement_key> }`**. In mappings.yaml:\n\n- **Repeated key** (`?embed=a&embed=b`) — plain `{ type: var, name: embed }`; HTTP layer expands arrays.\n- **CSV** (`?genres=1,2,3`) — `{ type: join, sep: \",\", expr: { type: var, name: genres } }`.\n- **Pipe** (`?ids=1|2|3`) — `{ type: join, sep: \"|\", expr: { type: var, name: ids } }`.\n\nSee [reference.md](reference.md) for the full pattern catalogue (index-only, filter, rich filter, search, sort + response control).\n\n**Rows without a top-level id:** Some list endpoints return objects with no `id` key (only nested URLs or names). Set optional **`id_from`** to a path of object keys (YAML list or dotted string, e.g. `location_area.url`) so decoding can still build stable `_ref`s.\n\n**Checklist before proceeding:**\n\n- [ ] Every relation target is a defined entity\n- [ ] Every `values:` row with `type: enum` (or `multi_enum`) has non-empty `enum:`\n- [ ] Every required selection \u002F scope \u002F argument slot has `required: true`\n- [ ] No twin same-arity queries on the same entity (compress or split — see Same-type list compression)\n- [ ] Capability names are unique and follow `entity_operation` convention\n- [ ] Every entity has either a declared `fields` entry for `id_field` or a non-empty `id_from` path\n- [ ] If an entity should **not** teach projection brackets in teaching table, set `domain_projection_examples: false`\n- [ ] Any multi-endpoint read summary is modeled with `views:` + synthetic `query` + `transport: view` (not prose-only runbooks)\n- [ ] User-defined \u002F workspace schema uses `schema_overlay:` (not hundreds of static custom-field columns) — see [reference.md — Runtime schema overlay](reference.md#runtime-schema-overlay-schema_overlay)\n- [ ] Every list\u002Ffilter agent intent has `kind: search` where the vendor supports filter DSL (not a fleet of scoped `query` caps for the same entity)\n- [ ] Human-visible keys are `id_field` where the vendor accepts them on get\u002Fcreate\n- [ ] Write surface uses domain verbs, not per-input-field mutation explosion\n- [ ] Mutating APIs: `data_classes:` registry + field `data_class:` on sensitive reads + `sink_class:` on outbound\u002Fdestructive inputs (see [Information-flow annotations](reference.md#information-flow-annotations-guardians--plan-flow-typing))\n- [ ] Semantic annotation review: inspect inherited field\u002Flane glosses for type-only filler; verify scope, polarity and units from the API. Check authored meaning in retrieval documents, selector evidence and full\u002Fincremental teaching, including Get operation descriptions. Follow [Semantic annotation review](reference.md#semantic-annotation-review).\n- [ ] Teachability proof: dump the teaching card under realistic seeds; every task-critical list polarity and mutator is expressible from the card (discriminant or other entity) — not a phantom second query line\n- [ ] Token \u002F auth args on actions\u002Fgets do not look like list filters on sibling entities (document in entity\u002Fcap descriptions)\n\n### Scoped relation traversal (`materialize`)\n\nWhen an API uses sub-resource URLs (`\u002Fparent\u002F{id}\u002Fchildren`), set **`materialize`** on the **many** relation so chain traversal fills the target query's scope parameter(s). See [reference.md — Scoped many-relations](reference.md#scoped-many-relations--materialize-query_scoped--query_scoped_bindings).\n\n### EntityRef fields\n\nWhen a field stores another entity's ID, use **`type: entity_ref`** with **`target:`** on the value row. This enables FK navigation, reverse traversal, and cross-entity predicates. Audit every `string`\u002F`integer` field ending in `_id`, `Id`, `_key` — if a matching entity exists with a `get` capability, it should be `entity_ref`. See [reference.md — Foreign key fields](reference.md#foreign-key-fields-entity_ref).\n\n## Step 3: Author mappings.yaml\n\nWrite the transport wiring for each capability. Default is REST (`method` + `path`). GraphQL uses top-level **`transport: graphql`** with `endpoint` \u002F `operation` \u002F variables. Composed views use **`transport: view`** + **`view: \u003Ckey>`** matching `domain.yaml`'s `views:`.\n\n```yaml\npet_findByStatus:\n  method: GET\n  path:\n    - type: literal\n      value: pet\n    - type: literal\n      value: findByStatus\n  query:\n    type: object\n    fields:\n      - - status\n        - type: var\n          name: status\n\npet_get:\n  method: GET\n  path:\n    - type: literal\n      value: pet\n    - type: var\n      name: id\n\npet_create:\n  method: POST\n  path:\n    - type: literal\n      value: pet\n  body:\n    type: var\n    name: input\n```\n\n**Path segments:** `{type: literal, value: \"pet\"}` (static) or `{type: var, name: \"id\"}` (resolved at runtime).\n\n**Variables the engine provides:**\n\n- `id` — entity ID (for get\u002Fdelete\u002Fupdate\u002Faction)\n- Predicate field names — from query predicates in the Plasm program\n- `input` — full input object (create\u002Fupdate with body)\n- Path variables: see [reference.md](reference.md) (primary `id`, optional `path_vars`, multi-segment, create `input` keys merged into CML env)\n\n### Pagination & hydration\n\n**Pagination** — declare only in **`mappings.yaml`** (`pagination` block on **query** capabilities). Infer `style`, wire param names, and JSON paths per [reference.md — Pagination](reference.md#pagination-cml--mappingsyaml-only). The runtime merges **`pagination.params`** into follow-up HTTP requests; **`pagination:`** in CML is the single authoring surface for paging behavior.\n\n**Hydration** — after a query, if the entity has both `query` and `get`, the runtime **by default** fetches full rows via `get` unless `QueryExpr.hydrate = Some(false)` or the engine disables hydrate. No extra CGS flag. See [reference.md — Query result hydration](reference.md#query-result-hydration-runtime).\n\n## Step 4: Validate\n\nFor split `domain.yaml` + `mappings.yaml`, pass the **catalog directory** `apis\u002F\u003Capi>\u002F` to `schema validate`. Pointing at `domain.yaml` alone skips `mappings.yaml` and can falsely fail.\n\n```bash\n# CGS validation (catalog directory for split domain+mappings)\ncargo run -p plasm-cli --bin plasm-cgs -- schema validate apis\u002F\u003Capi>\n\n# Optional: exhaustive mapping exercise against an OpenAPI spec\ncargo run -p plasm-cli --bin plasm-cgs -- validate --spec path\u002Fto\u002Fopenapi.json apis\u002F\u003Capi>\n\n# Smoke-load REPL + help\ncargo run -p plasm-repl -- --schema apis\u002F\u003Capi> --backend http:\u002F\u002Flocalhost:1080 --help\n```\n\n### Contract completeness is distinct from schema validity\n\nBefore claiming a catalogue complete, audit the pinned backend contract in both directions:\n\n- Every supported operation and selector has an explicit mapping or a documented exclusion.\n- Every domain-relevant response field, nested person, collection and relationship is preserved in typed CGS or explicitly excluded with a reason. A scalar-only projection of a rich response is not complete.\n- List\u002Fdetail variants preserve truthful identity and cardinality. Parent-scoped children use compound identities; embedded-only rows must be executable without an invented Get endpoint.\n- Advertised fields actually occur in the response or have a declared derivation. Never fabricate a thread-level field merely because its messages contain it.\n- Typed temporal and numeric inputs are encoded at the CML boundary according to the backend's documented wire format.\n- Validation exercises every Query and Search, secondary capabilities, and nested traversal. Record skips and separate structural validity, operation coverage, mock conformance and pinned-backend execution evidence.\n\nDo not attribute agent failures to reasoning limits while necessary catalogue evidence is absent or unverified. Preserve an auditable list of remaining gaps; passing YAML\u002Fschema validation alone cannot close it.\n\n## Step 5: End-to-End Testing\n\nHand off to [plasm-catalog-e2e-test](..\u002Fplasm-catalog-e2e-test\u002FSKILL.md), which is the operational source of truth for the testing ladder:\n\n1. **Hermit** against the OpenAPI spec when one exists in the README or source docs.\n2. **Live API** when credentials and rate-limit headroom exist.\n3. **Vendor sandbox \u002F test mode** as a substitute when live calls would mutate real data or are otherwise unsafe.\n\nSkips must be recorded with a reason; representative Plasm expressions and outcomes belong in the evidence the e2e skill emits.\n\n## Step 6: Eval Coverage\n\n```bash\ncargo run -p plasm-eval -- coverage --schema apis\u002F\u003Capi> --cases apis\u002F\u003Capi>\u002Feval\u002Fcases.yaml\n```\n\nFix missing buckets by adding eval cases (not by softening coverage). For LLM conformance runs, see `plasm-oss\u002Fcrates\u002Fplasm-eval\u002FREADME.md`.\n\n## Failure Modes (quick reference)\n\nWhen transport tests fail, check:\n\n- `CmlError::VariableNotFound` → mapping var name doesn't match the engine env. Fix `name` in mappings.yaml.\n- `DecodeError` → response shape mismatch. The engine normalizes bare arrays automatically; check `path:` \u002F `derive:` on entity fields.\n- `404` → path doesn't match spec. Check `--backend` includes the server prefix.\n- `401` \u002F `403` → wrong `auth:` scheme or missing env var.\n\nThen fix `domain.yaml` or `mappings.yaml` and re-run from Step 4.\n\n## When you cannot model the API faithfully\n\nIf the desired API shape **cannot** be modeled with today's CGS + CML + runtime (missing expressiveness, not just tediousness), **stop**. Document the gap as a short blocker note (what shape is needed, which capability\u002Fentity breaks, which validator or runtime behavior is insufficient). **Do not** patch `plasm-core`, `plasm-cml`, `plasm-runtime`, or validators yourself to \"unstick\" the mapping unless explicitly directed in a separate task.\n\nAfter a difficult or interesting catalog, run [plasm-catalog-retro](..\u002Fplasm-catalog-retro\u002FSKILL.md) to capture systemic improvements.\n\n\n**Embedded execution gate:** follow [Embedded identity proof and observation ownership](reference.md#embedded-identity-proof-and-observation-ownership).\nRequire pack\u002Fcodec identity checks and an abstract direct\u002Fscoped\u002Fhydrated relation witness.\nReport backend-schema evidence, mock evidence and real-backend evidence separately;\noperation coverage alone never establishes complete response or mutation semantics.\n\nWhen a catalogue declares prerequisites, verify the deployment manifest covers every requirement and exercise federated discovery bootstrap. Direct engine\u002Fcatalogue tests do not establish deployment closure.\n","# Plasm Authoring\n\nIteratively author, validate, and test a **typed agent surface** (Python Program declarations + typed teaching) from an API specification. This skill is the **single source of truth** for CGS \u002F CML authoring inside `plasm-core`. The monorepo root delegates to this file; do not re-author CGS doctrine elsewhere.\n\nThe two authored files are:\n\n- **`domain.yaml`** — CGS, the semantic model. Entities, fields, relations, capability declarations (`query`, `get`, `search`, `create`, `update`, `delete`, `action`), top-level **`values:`** registry (semantic slots), optional top-level **`data_classes:`** (Guardians-style information-flow labels and sink roles), and optional top-level **`views:`** composed read DAGs.\n- **`mappings.yaml`** — CML, the transport wiring. HTTP \u002F GraphQL templates per capability, plus **`transport: view`** stubs that point at a **`views:`** key (no `method` \u002F `path` for those rows).\n- **Runtime query semantics** (no extra YAML file). **Pagination** lives on CML query mappings (`pagination:` block). **Hydration** (default concurrent GET per query row) applies when CGS declares **both** `query` and `get` for the same entity unless execution opts out. Continuations and page sizing are expressed in **Plasm** (typed Python declarations \u002F host continuation handles \u002F `.take(n)` where taught) — not by authoring synthetic CLI flags.\n\nFor complete schema reference (types, operators, CML grammar, variable resolution, pagination block, default query hydration, action output, views, auth schemes), read [reference.md](reference.md).\n\n## Companion skills\n\nThis skill is the authoring core. Use these companion skills for follow-on work:\n\n- [plasm-catalog-e2e-test](..\u002Fplasm-catalog-e2e-test\u002FSKILL.md) — Hermit-first then live \u002F sandbox transport testing.\n- [plasm-catalog-adversarial-verify](..\u002Fplasm-catalog-adversarial-verify\u002FSKILL.md) — programming-agent adversarial prove loop (AppWorld-first): teaching audit, twin-query compression, dry\u002Flive Plasm crawl, evidence under `apis\u002F...\u002Fe2e\u002F`.\n- [plasm-catalog-polish](..\u002Fplasm-catalog-polish\u002FSKILL.md) — autonomous diagnostic \u002F fix loop for an existing catalog.\n- [plasm-catalog-score](..\u002Fplasm-catalog-score\u002FSKILL.md) — rubric scoring of catalog quality.\n- [plasm-catalog-reprint](..\u002Fplasm-catalog-reprint\u002FSKILL.md) — full-cutover regeneration of a weak catalog.\n- [plasm-catalog-retro](..\u002Fplasm-catalog-retro\u002FSKILL.md) — post-authoring retrospective for systemic press improvements.\n\nThe companion Cursor agent at [`.cursor\u002Fagents\u002Fplasm-forge.md`](..\u002F..\u002F.cursor\u002Fagents\u002Fplasm-forge.md) wraps this skill for autonomous catalog runs.\n\n## Domain authoring is not deterministic\n\n**`domain.yaml` is not produced by a correct-by-construction pipeline.** There is no supported \"OpenAPI → CGS\" generator crate or script in this repo, and you must not add one as a substitute for human or LLM **semantic** judgement. Reasonable authors disagree on entity boundaries, which operations merge under one capability, relation shapes, `abstract` entities, and what belongs in the prompt-facing surface versus the wire-only edge. The same applies to **`values:`** identity: each key is a **semantic slot** for the catalog (gloss, prompts, validation intent) — **not** something you derive by collapsing every field that shares a primitive wire shape. Whether two slots **share** one `values` key or get **distinct** keys is an authoring judgement; default toward **separate keys** unless the domain meaning is intentionally one shared space (one enum, one id space, one taxonomy).\n\n**What *is* deterministic (after the YAML exists):** `CGS::validate`, CML template parsing, compilation to HTTP, decoding against declared shapes, `plasm-eval coverage`, and similar checks. Those prove **internal consistency** of an authored model — not that the model is the *right* abstraction for an API.\n\n**Implication:** Expanding an API (e.g. \"full GitHub REST\") is **iterative authoring** — repeated passes through the loop below — not flipping a codegen switch. If you need a huge RPC-shaped surface for experiments (e.g. MCP prompt size baselines), treat that as a **separate artifact or fork** with its own trade-offs; do not pretend it replaces a curated CGS.\n\n## The Loop\n\n```\n1. READ spec  →  2. AUTHOR domain.yaml  →  3. AUTHOR mappings.yaml  →  4. VALIDATE  →  5. E2E TEST (Hermit, then live\u002Fsandbox)  →  6. EVAL COVERAGE\n      ↑                                                                                                                                  │\n      └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘\n```\n\n### Authoring with an agent (Cursor \u002F Claude \u002F Codex)\n\nPoint the agent at **this skill** ([SKILL.md](SKILL.md) + [reference.md](reference.md)) as the single source of truth. The agent prompt should be minimal — for example: read the OpenAPI spec the user provides, then follow the loop above until `domain.yaml` and `mappings.yaml` cover the API surface the user asked for, validating and testing as in Steps 4–6.\n\n**Do not** paste parallel API-specific runbooks (phased tag lists, per-vendor checklists, or duplicate rules) into the prompt; large specs are handled by **repeated passes through the same loop** (read a slice of the spec, extend the two YAML files, validate, test, repeat).\n\n## File Structure\n\nCanonical API catalogs live under `apis\u002F` in this repo (the monorepo `apis\u002F` is only a symlink to `plasm-oss\u002Fapis\u002F`):\n\n```\napis\u002F\u003Capi-name>\u002F\n  domain.yaml      # entities, fields, relations, capabilities (WHAT)\n  mappings.yaml    # CML templates per capability (HOW)\n  README.md        # commands, auth env vars, scope, sandbox info\n  eval\u002Fcases.yaml  # natural-language eval cases for plasm-eval\n```\n\n`fixtures\u002Fschemas\u002F` holds **test-only** split catalog dirs (e.g. `capability_with_input\u002F`, `plasm_language_matrix*`); do not use it for new REST API authoring unless you are intentionally adding a tiny fixture for tests.\n\n### NL eval cases (`plasm-eval`)\n\nGoal-oriented harness cases live in **`apis\u002F\u003Capi>\u002Feval\u002Fcases.yaml`** with **`schema: \u003Capi>`** matching the directory name. Each case has a natural-language **`goal`**, soft **`expect:`** scoring, and optional **`covers:`** — a list of **expression-form buckets** this case is meant to exercise (e.g. `query_filtered`, `get`, `chain`, `multi_step`). Bucket IDs are snake_case and align with CGS-derived requirements.\n\n- **Coverage (deterministic, no LLM):** `plasm-eval coverage --schema apis\u002F\u003Capi> --cases apis\u002F\u003Capi>\u002Feval\u002Fcases.yaml` prints a human- and LLM-readable report: required buckets derived from **CGS** vs the union of per-case **`covers`**. Exit code is non-zero if any required bucket is missing (`--warn-only` to soften). Use **`--format json`** for scripts or agent consumption.\n- **Optional `apis\u002F\u003Capi>\u002Feval\u002Fcoverage.yaml`:** only **`required_extra:`** is implemented — it adds buckets beyond the CGS-derived set. There is **no** `exclude:` override.\n- **Scaffold:** `plasm-eval scaffold --schema apis\u002F\u003Capi>` emits a commented YAML fragment (CGS-derived buckets + one example case). Use `--write` to create `apis\u002F\u003Capi>\u002Feval\u002Fcases.yaml`; `--force` overwrites.\n\n## Step 1: Read the OpenAPI Spec (or GraphQL SDL \u002F vendor docs)\n\nRead the spec file directly. For large specs, read section by section — paths first, then schemas, then descriptions. Use `wc -l` to gauge size, then `grep \"^  \u002F\"` to list all paths before diving in.\n\n**IMPORTANT: Do not write scripts, binaries, or \"generator crates\" to emit `domain.yaml` \u002F `mappings.yaml` from OpenAPI (or any spec) as if the mapping were unique or mechanical.** There is no single deterministic reduction from RPC to CGS. You must read the spec and **author** the domain — merging endpoints, naming entities, choosing relations, classifying parameters, and deciding scope for agents. Mechanical dumps mirror the RPC surface and bypass the judgements this skill is for; they are explicitly out of scope for canonical `apis\u002F\u003Cname>\u002F` trees. **A GraphQL mutation\u002Fquery list is not a capability list** — compress to user tasks per [reference.md — Task-oriented catalogs](reference.md#task-oriented-catalogs-mandatory).\n\n**Query parameters in particular are a non-deterministic inference step.** OpenAPI specs vary enormously in how they document query semantics:\n\n- Some use standard `parameters:` with `in: query`\n- Some put params in `requestBody` JSON schemas (e.g. Tavily `\u002Fsearch`)\n- Some use vendor extension fields (`x-*`)\n- Some rely entirely on `description` prose and examples\n- Some leave parameters undocumented and rely on external docs\n\nYou must read **all of the above** — not just the canonical OpenAPI `parameters` array — to classify each vendor input into a **capability input lane** (`scope` \u002F `selection` \u002F `controls` \u002F `arguments` \u002F `payload`) and decide how CML transmits it (`path:` \u002F `query:` \u002F `body` \u002F `pagination:`). Flat CGS `parameters:` \u002F `role:` is a **hard load error**. A spec where params live in extension fields or request bodies is a harder but equally valid authoring exercise.\n\n**From the spec, identify:**\n\n- **Schemas** (components\u002Fschemas): these become entities. Note field names, types, required fields, enums, and `$ref` links.\n- **Operations** (paths): these become capabilities. Note HTTP method, path, parameters (path\u002Fquery\u002Fbody), request body schema, response schema, extension fields, and `description` prose.\n- **Relations**: `$ref` fields (Pet.category → Category), foreign key patterns (Order.petId → Pet), path nesting (\u002Fpet\u002F{id}\u002Ftags).\n- **Shared enums**: the same enum values appearing in both a schema field and a query parameter (Pet.status and findByStatus?status= are the same `PetStatus` type).\n\n**Also identify:**\n\n- **Authentication**: check `securitySchemes` in `components` and `security:` at the operation or global level. Common patterns:\n  - `apiKey` (in: `query`) → `api_key_query`\n  - `apiKey` (in: `header`) → `api_key_header`\n  - `http` (scheme: `bearer`) → `bearer_token`\n  - `oauth2` (clientCredentials flow) → `oauth2_client_credentials`\n  - Genuinely public → `scheme: none`\n\n**Key principle:** An OpenAPI spec describes RPC operations. You are extracting the **domain model** — the business entities, how they relate, and what operations exist on them. Multiple endpoints operate on the same entity. A field like `petId: integer` is a relation, not just a number.\n\n## Step 1.5: Task inventory (before entities)\n\nBefore naming entities or capabilities, list **agent tasks in user language** (what would a consolidated MCP or product UI expose?). Examples: \"show my open bugs\", \"what's ENG-42 and its comments\", \"create a bug on Backend\", \"project status this week\".\n\nEach task must map to **`kind: search`**, a **`views:`** composed read, or a small set of write verbs (`create` \u002F `update` \u002F `delete`). Flag any task that would require chaining multiple capabilities without a view — that task needs a `views:` entry or a merged capability.\n\nSee [reference.md — Task-oriented catalogs](reference.md#task-oriented-catalogs-mandatory).\n\n## Step 2: Author domain.yaml\n\nWrite the domain model. No HTTP details here — only what exists and what you can do.\n\n**Value registry:** under **`values:`**, each stable key defines a **named semantic slot** (kernel or profile `type:` plus optional `target`, `enum:`, `constraints:`, `description`, …). Entity **fields** and capability **lane slots** only **`value_ref:`** that slot — slot-level keys (`required`, `path`, …) say how *this* use site differs. Treat **one key ↔ one intended meaning** in the domain; sharing a key across sites is a **deliberate** merge (same gloss \u002F semantics), never a mechanical \"all strings dedupe\" shortcut. See [reference.md — Value domains](reference.md#value-domains-values-and-value_ref). **Obsolete** `string_semantics` \u002F `value_format` \u002F `allowed_values` \u002F `type: select|date|multi_select` — rejected by the loader; see [reference.md — Obsolete](reference.md#obsolete-or-unsupported-do-not-teach).\n\n### CRITICAL: Versioning is mandatory\n\n- Every `apis\u002F\u003Capi>\u002Fdomain.yaml` **must** declare top-level `version: \u003Cn>` with `n > 0`.\n- **Never rely on defaults.** Omitted\u002Fzero versions are invalid for authoring and packaging.\n- When you change domain semantics (entities, fields, relations, capability signatures, parameter types\u002Froles, auth contract, output\u002Fprovides behavior, **information-flow annotations**), you **must increment** `version`.\n- Treat any change that can affect prompt shape, compile\u002Fdecode behavior, or runtime dispatch as a version bump event.\n- If you only change prose \u002F comments with no semantic \u002F runtime impact, keep `version` unchanged.\n\n**`description` strings:** On entities, capabilities, and `output` for side-effect actions, write **concise language for an agentic surface**: what the **entity** or operation is **for** in the task (goal, anchor, decision), not an inventory of typed fields and relations — the schema and teaching table already show those. Avoid tabular jargon (**\"row\"**) in Teaching-table-facing prose. Avoid embedding REST paths, methods, status codes, bare **`http:\u002F\u002F`** \u002F **`https:\u002F\u002F`** links, or \"see GET \u002F…\" notes — those belong in **`mappings.yaml`** comments or vendor docs, not in the CGS. **`auth.token_url`** in `domain.yaml` is the intentional exception (machine OAuth endpoint string). **Do not** repeat shapes already taught by **`value_ref`**, projection **`provides:`**, **`input_schema`** unions, or parameter names — omit field \u002F parameter descriptions when types carry the story (see [reference.md — Gloss: do not restate typed structure](reference.md#gloss-do-not-restate-typed-structure)).\n\n**No cross-catalog prose (compositional CGS):** Each `apis\u002F\u003Cname>\u002Fdomain.yaml` is a **closed** semantic surface. Teaching text (`description`, value glosses, discovery `names` \u002F terms that read as instructions) must **never** name another registry catalog, its `entry_id`, or its entity\u002Fcapability ids (e.g. do not tell Venmo login to “use Supervisor.email \u002F AccountPassword”). Sessions compose catalogs at runtime; authors annotate **role semantics inside this catalog only** (“account holder’s email”, “this service’s password”, “payment recipient ≠ login identity”). Cross-catalog orchestration belongs in product docs \u002F eval harnesses — not CGS strings. Same-catalog entity names are fine when they teach composition **within** this file.\n\n**Agentic teaching table copy (execute \u002F MCP teaching):** The prompt renderer attaches **entity `description`** to the symbolic teaching table (projection witness \u002F banner). Treat it as **imperative surface**, not a manual or vendor doc: **one or two short sentences** on **purpose** (why an agent would focus this **entity**) — **never** name **relations** or **fields** that already show up as **wire-name** columns, bracket projections, or typed columns (that duplicates the graph and confuses \"banner\" with \"nav map\"). **Do not** summarize projection contents (\"includes refs to …\", \"typed booleans plus …\") — wire names, relations, and types already do that. **Do not** name other capability ids, spell out call sequences (\"use X then Y\"), cite **`transport:`**, document HTTP error semantics, or tell agents how to seed MCP — **`discovery:`** blocks (**`operation_terms`**, **`target_terms`**, **`qualifier_terms`** on entities\u002Fcapabilities), **`apis\u002F\u003Capi>\u002FREADME.md`**, and eval cases carry that operational guidance. Capability **`description:`** should state **effect** or **when to use** in domain terms; move cross-capability playbooks into **`discovery`** on the relevant capability. See [reference.md — Teaching-table-facing descriptions](reference.md#teaching-table-facing-descriptions-entities-and-capabilities).\n\n```yaml\nvalues:\n  nv_pet_id:\n    type: integer\n  nv_pet_name:\n    type: string\n  nv_pet_status:\n    type: enum\n    enum: [available, pending, sold]\n  nv_category_id:\n    type: integer\n  nv_category_name:\n    type: string\n  nv_pet_find_by_status_status:\n    type: enum\n    enum: [available, pending, sold]\n  nv_created_at:\n    type: rfc3339\n\nentities:\n  Pet:\n    id_field: id\n    fields:\n      id:\n        value_ref: nv_pet_id\n        required: true\n      name:\n        value_ref: nv_pet_name\n        required: true\n      status:\n        value_ref: nv_pet_status\n      created_at:\n        value_ref: nv_created_at\n    relations:\n      category:\n        target: Category\n        cardinality: one\n      tags:\n        target: Tag\n        cardinality: many\n\n  Category:\n    id_field: id\n    fields:\n      id:\n        value_ref: nv_category_id\n        required: true\n      name:\n        value_ref: nv_category_name\n\n  # Include ALL entities referenced by relations, even simple ones\n\ncapabilities:\n  pet_findByStatus:\n    kind: query\n    entity: Pet\n    selection:\n      - name: status\n        value_ref: nv_pet_find_by_status_status\n        required: true\n  pet_get:\n    kind: get\n    entity: Pet\n  pet_create:\n    kind: create\n    entity: Pet\n  pet_delete:\n    kind: delete\n    entity: Pet\n```\n\n**Teaching projection:** Python entity declarations expose typed catalog fields; use `.select(...)` for an explicit row projection. Primary read capabilities and `provides:` still describe materialization. Historical `domain_projection_examples` only affects the internal native teaching oracle.\n\n**String \u002F text profiles:** use kernel `type: string` or profile types (`markdown`, `document`, `html`, `json_text`, `email`, `url`, …) on the **`values:`** row — not `string_semantics:`.\n\n**Field \u002F lane wire types:** the vocabulary is kernel names (`string`, `integer`, `number`, `boolean`, `array`, `json`, `entity_ref`, `blob`, `money`) or core profiles (`enum`, `multi_enum`, `rfc3339`, `iso8601_date`, `unix_ms`, `unix_sec`, `uuid`, …) on a **`values:`** row, not inline `field_type` on the slot. For **`entity_ref`**, set **`target: EntityName`** on the value row. For **`blob`**, see [reference.md — Blob \u002F binary](reference.md). For **`array`**, the value row has **`type: array`** and **`items: { value_ref: \u003Celement_key> }`**. **`enum` \u002F `multi_enum`** require non-empty **`enum:`** on the value row.\n\n**Temporal profiles:** use `type: rfc3339` \u002F `iso8601_date` \u002F `unix_ms` \u002F `unix_sec` directly — no separate `value_format` key. Do **not** put evaluation `now` or harness calendar dates in `values:` descriptions — the language card states `evaluation_now` (PLP-9) when temporal slots are taught.\n\n### CGS field typing checklist (strict)\n\nUse this on every new or edited entity (and on capability lane \u002F `input_schema` fields) so the model does not collapse to \"stringly typing.\"\n\n1. **Instants and calendar dates** — If the wire is a timestamp or date, use a **`values:`** row with the matching temporal profile (`rfc3339`, `iso8601_date`, `unix_ms`, `unix_sec`). **Do not** use bare `string` for fields named like `date_created`, `date_updated`, `last_modified`, `*expires*`, `*_on`, or `last_*` when the API returns a normal machine date\u002Ftime.\n2. **Enumerations** — If the set of values is closed and known, use **`enum`** \u002F **`multi_enum`** with **`enum:`** on the value row. If the vendor reuses a field across resources with inconsistent or extensible lifecycles, keep **`string`** and do not force a narrow enum that rejects valid future wire values.\n3. **Foreign keys** — If the value is another resource's id and that resource is in the CGS, use **`type: entity_ref`** and **`target:`**.\n4. **Reverse list edges (many)** — When a child has `entity_ref` to a parent and the child's primary list query accepts a parameter that filters by that parent's id, declare a **`cardinality: many` relation on the parent** with **`materialize: { kind: query_scoped, capability: \u003Cchild_query>, param: \u003Cparent_id_param> }`**. Do **not** add a `relations` key with the same name as an `entity_ref` field on the same entity.\n5. **Opaque bytes and file bodies** — Use **`type: blob`**.\n6. **Human text and opaque tokens** — Use **`type: string`** or a text profile (`markdown`, `document`, …).\n\nApply the same rules to lane **`value_ref`** targets.\n\n**Capability kinds:** `query` (collection filter), `search` (free-text relevance), `get` (by ID), `create`, `update`, `delete`, `action` (anything else).\n\n### Composed read models (`views:`)\n\nWhen the agent-facing concept is a **single read row** that **no single vendor endpoint returns**, but it **decomposes** into several **`query` \u002F `get`** capabilities you already modeled, you **must** express it in CGS:\n\n1. Add an **`entities:`** row for that concept (often **`abstract: true`** so discovery does not attach it to parent graphs until explicitly seeded).\n2. Declare a **`kind: query`** capability on that entity; **lanes** (`scope` \u002F `selection` \u002F …) are the scope inputs the composition needs.\n3. Add **`views:\u003Ckey>`** with ordered **`nodes`** (each runs an existing capability), **`bind`** maps for node inputs, and **`output`** maps that shape entity fields.\n4. In **`mappings.yaml`**, wire that capability with **`transport: view`** and **`view: \u003Ckey>`** only.\n\n**Anti-pattern:** Long playbook text that says \"call A, then B, then aggregate\" **without** a **`views:`** entry leaves agents without a single **`query`** symbol for the composed row. Canonical example: **`apis\u002Fcloudflare`** — **`SecurityOverview`** + **`security_overview_query`** + **`views.security_overview`**. Full grammar: [reference.md — Composed read views](reference.md#composed-read-views).\n\n### Runtime schema overlay (`schema_overlay:`)\n\nWhen the API has **workspace-defined columns** on generic rows (Fibery databases, Notion database properties, Jira custom fields per project\u002Fissue type, ClickUp custom fields on tasks), add a top-level **`schema_overlay:`** block **after** the bootstrap entity and schema-fetch capability exist. Do **not** mirror every column statically in `entities:` when the schema is fetched at runtime.\n\n- **Static vendor schema** (GitHub, Slack, PokéAPI) → **no overlay**\n- **Multi-hop reads without dynamic columns** → **`views:`**, not overlay\n- **Per-scope typed entities** → `projection.mode: per_scope_entity` (Fibery, Notion, Jira)\n- **Shared entity + extra columns** → `projection.mode: augment_base` ([ClickUp](..\u002Fapis\u002Fclickup\u002Fdomain.yaml); Linear deferred until GraphQL exposes custom-field defs)\n\nAuthoring details, spec table, checklists, and reference catalogs: [reference.md — Runtime schema overlay](reference.md#runtime-schema-overlay-schema_overlay). Runtime behavior: monorepo [docs\u002Fschema-overlay.md](..\u002F..\u002F..\u002Fdocs\u002Fschema-overlay.md).\n\n**`kind: action` output:** Every action must declare either non-empty **`provides:`** or **`output:`** with **`type: side_effect`** and a non-empty `description:` that states **what** the operation changes. There is no `output.type: none`. See [reference.md — Action output](reference.md#action-output-provides-vs-outputside_effect).\n\n### Information-flow annotations (Guardians \u002F plan flow typing)\n\nAfter the relational model is stable, annotate **data classes**, **sinks**, and **sanitizers** so the host can verify agent plans before execute (`plasm` dry-run → `verify_plan_flow`). Conformance map: monorepo [docs\u002Fguardians-alignment.md](..\u002F..\u002F..\u002Fdocs\u002Fguardians-alignment.md). Full vocabulary: [reference.md — Information-flow annotations](reference.md#information-flow-annotations-guardians--plan-flow-typing).\n\n**Catalog declares facts; tenant policy enforces rules.** Register classes in **`data_classes:`**, label sensitive **entity fields** with **`data_class:`**, mark exfiltration\u002Fdestructive **input_schema** params with **`sink_class:`**, and list taint breakers on **`sanitizes:`** capabilities. Output labels are **derived** from `effective_provides` × field `data_class` — do not duplicate on capabilities.\n\n**Annotation pass (minimum for mutating APIs):**\n\n1. Add `data_classes:` entries for every label and sink role you reference (`untrusted`, `pii_*`, `external_send`, `destructive_delete`, …).\n2. Label user-generated text and PII on entity fields agents read (`body`, `description`, `comment`, email fields, …).\n3. On send\u002Fpublish\u002Fpost\u002Freply\u002Fshare\u002Fdelete capabilities, set `sink_class:` on the payload field in `input_schema`.\n4. On redact\u002Fscrub\u002Fsanitize capabilities, declare `sanitizes:` for the classes they clear.\n5. Increment `version:` when flow annotations change.\n\nWitness catalog: `plasm-oss\u002Ffixtures\u002Fschemas\u002Fflow_matrix\u002F`. Unlabeled catalogs remain flow-permissive until tenant policy is pinned active.\n\n### Authentication — top-level `auth:` block\n\nPlace a single `auth:` block at the end of `domain.yaml`. The runtime reads secrets at execution time from the named environment variables — no secrets go in schema files. Use `scheme: none` for genuinely public APIs.\n\n```yaml\n# API key in query string (e.g. RAWG ?key=..., OMDb ?apikey=..., NYT ?api-key=...)\nauth:\n  scheme: api_key_query\n  param: key\n  env: RAWG_API_KEY\n\n# API key as a request header (e.g. X-Api-Key)\nauth:\n  scheme: api_key_header\n  header: X-Api-Key\n  env: MY_SERVICE_API_KEY\n\n# Bearer token (e.g. ClickUp, Notion, Tavily)\nauth:\n  scheme: bearer_token\n  env: CLICKUP_API_TOKEN\n\n# OAuth 2.0 client credentials (e.g. Spotify)\nauth:\n  scheme: oauth2_client_credentials\n  token_url: https:\u002F\u002Faccounts.spotify.com\u002Fapi\u002Ftoken\n  client_id_env: SPOTIFY_CLIENT_ID\n  client_secret_env: SPOTIFY_CLIENT_SECRET\n  scopes: []\n\n# Public API with no outbound credentials\nauth:\n  scheme: none\n```\n\n### Query capability input lanes\n\n**Critical rule: only declare lane slots the API endpoint actually accepts as HTTP inputs.** Read the OpenAPI operation's `parameters` list and `description` fields. Never invent **`selection:`** \u002F **`scope:`** keys from entity fields — entity fields describe the domain object, not what the query endpoint accepts.\n\n**No selection?** If the endpoint is a plain paginated resource index (e.g. PokéAPI `\u002Fpokemon\u002F` — no server-side filters, just offset\u002Flimit), declare **no `selection:`**. Pagination belongs in **`mappings.yaml`** (`pagination:` \u002F page controls).\n\n#### `kind: query` vs `kind: search`\n\nUse **`kind: search`** when the endpoint's primary interface is a **required** free-text relevance query (`q`, `query`, `search`) that returns ranked results rather than field-filtered rows. The free-text **selection** param **must** be `required: true` — optional free-text list filters use **`kind: query`**. Required non-text selection (e.g. AppWorld `access_token`) is taught on the primary `e~\"\u003Cquery>\"{…}` row; an optional-filter twin is emitted only when other optional selection slots exist. If the endpoint filters by concrete field values (`status`, `archived`, `team_id`), use `kind: query`.\n\n#### Classification: OpenAPI params → lanes\n\n| OpenAPI \u002F vendor examples | Lane | CML transmission |\n|---------------------------|------|------------------|\n| `offset`, `limit`, `page`, `cursor`, `after`, `before` | *(omit from CGS)* or `controls` when taught | CML `pagination` block; not brace WHERE |\n| `status`, `tags[]`, `assignees[]`, `archived`, `type`, shelf discriminants | **`selection`** | CML `query:` \u002F path branch vars |\n| `q`, `query`, `search` (required free-text) | **`selection`** on `kind: search` | CML `query:` var |\n| `order_by`, `sort_by`, `direction`, `embed`, `fields`, `locale` | **`controls`** | CML `query:` var; not brace WHERE |\n| `team_id` in `GET \u002Fteam\u002F{team_id}\u002Fspace` | **`scope`** | CML `path:` var; pair with relation `materialize` |\n| Create\u002Fupdate\u002Faction body fields | **`payload`** | CML `body` |\n| Non-body method args (token on a get\u002Faction) | **`arguments`** | CML `query:` \u002F header \u002F path as mapped |\n\n**Same-type list compression:** Competing `kind: query` caps that return the **same entity** (identical or sibling brace shapes, different HTTP path only — including scoped+unscoped twins) are **RPC residue** and a **hard CGS validate error**. Collapse to **one** query with a **selection discriminant** (enum\u002Fprofile) and CML path branching (`type: if`), fold scoped lists into optional `scope` on that query + relation **`materialize`**, **or** a real entity split when polarity is a different domain object. Do **not** teach twin brace forms or raise teaching-line caps to \"escape\" brace-dedupe. Full law: [reference.md — Same-type list compression](reference.md#same-type-list-compression).\n\n**Scoped sub-resource lists:** When an API has endpoints like `GET \u002Fclasses\u002F{class_index}\u002Fspells` alongside `GET \u002Fspells`, declare **one** `kind: query` with optional class scope (CML path branch). Pair the parent relation with **`materialize`** against that single query — never a second competing query on the child entity.\n\n**Range filters** like ClickUp's `due_date_gt` \u002F `due_date_lt` are **separate named selection slots** — declare each one individually, not as one field with operator suffixes.\n\n**Array \u002F multi-value params** (e.g. `genres`, `assignees[]`, `embed[]`): use a **`values:`** row with **`type: multi_enum`** or **`type: array`** with **`items: { value_ref: \u003Celement_key> }`**. In mappings.yaml:\n\n- **Repeated key** (`?embed=a&embed=b`) — plain `{ type: var, name: embed }`; HTTP layer expands arrays.\n- **CSV** (`?genres=1,2,3`) — `{ type: join, sep: \",\", expr: { type: var, name: genres } }`.\n- **Pipe** (`?ids=1|2|3`) — `{ type: join, sep: \"|\", expr: { type: var, name: ids } }`.\n\nSee [reference.md](reference.md) for the full pattern catalogue (index-only, filter, rich filter, search, sort + response control).\n\n**Rows without a top-level id:** Some list endpoints return objects with no `id` key (only nested URLs or names). Set optional **`id_from`** to a path of object keys (YAML list or dotted string, e.g. `location_area.url`) so decoding can still build stable `_ref`s.\n\n**Checklist before proceeding:**\n\n- [ ] Every relation target is a defined entity\n- [ ] Every `values:` row with `type: enum` (or `multi_enum`) has non-empty `enum:`\n- [ ] Every required selection \u002F scope \u002F argument slot has `required: true`\n- [ ] No twin same-arity queries on the same entity (compress or split — see Same-type list compression)\n- [ ] Capability names are unique and follow `entity_operation` convention\n- [ ] Every entity has either a declared `fields` entry for `id_field` or a non-empty `id_from` path\n- [ ] If an entity should **not** teach projection brackets in teaching table, set `domain_projection_examples: false`\n- [ ] Any multi-endpoint read summary is modeled with `views:` + synthetic `query` + `transport: view` (not prose-only runbooks)\n- [ ] User-defined \u002F workspace schema uses `schema_overlay:` (not hundreds of static custom-field columns) — see [reference.md — Runtime schema overlay](reference.md#runtime-schema-overlay-schema_overlay)\n- [ ] Every list\u002Ffilter agent intent has `kind: search` where the vendor supports filter DSL (not a fleet of scoped `query` caps for the same entity)\n- [ ] Human-visible keys are `id_field` where the vendor accepts them on get\u002Fcreate\n- [ ] Write surface uses domain verbs, not per-input-field mutation explosion\n- [ ] Mutating APIs: `data_classes:` registry + field `data_class:` on sensitive reads + `sink_class:` on outbound\u002Fdestructive inputs (see [Information-flow annotations](reference.md#information-flow-annotations-guardians--plan-flow-typing))\n- [ ] Semantic annotation review: inspect inherited field\u002Flane glosses for type-only filler; verify scope, polarity and units from the API. Check authored meaning in retrieval documents, selector evidence and full\u002Fincremental teaching, including Get operation descriptions. Follow [Semantic annotation review](reference.md#semantic-annotation-review).\n- [ ] Teachability proof: dump the teaching card under realistic seeds; every task-critical list polarity and mutator is expressible from the card (discriminant or other entity) — not a phantom second query line\n- [ ] Token \u002F auth args on actions\u002Fgets do not look like list filters on sibling entities (document in entity\u002Fcap descriptions)\n\n### Scoped relation traversal (`materialize`)\n\nWhen an API uses sub-resource URLs (`\u002Fparent\u002F{id}\u002Fchildren`), set **`materialize`** on the **many** relation so chain traversal fills the target query's scope parameter(s). See [reference.md — Scoped many-relations](reference.md#scoped-many-relations--materialize-query_scoped--query_scoped_bindings).\n\n### EntityRef fields\n\nWhen a field stores another entity's ID, use **`type: entity_ref`** with **`target:`** on the value row. This enables FK navigation, reverse traversal, and cross-entity predicates. Audit every `string`\u002F`integer` field ending in `_id`, `Id`, `_key` — if a matching entity exists with a `get` capability, it should be `entity_ref`. See [reference.md — Foreign key fields](reference.md#foreign-key-fields-entity_ref).\n\n## Step 3: Author mappings.yaml\n\nWrite the transport wiring for each capability. Default is REST (`method` + `path`). GraphQL uses top-level **`transport: graphql`** with `endpoint` \u002F `operation` \u002F variables. Composed views use **`transport: view`** + **`view: \u003Ckey>`** matching `domain.yaml`'s `views:`.\n\n```yaml\npet_findByStatus:\n  method: GET\n  path:\n    - type: literal\n      value: pet\n    - type: literal\n      value: findByStatus\n  query:\n    type: object\n    fields:\n      - - status\n        - type: var\n          name: status\n\npet_get:\n  method: GET\n  path:\n    - type: literal\n      value: pet\n    - type: var\n      name: id\n\npet_create:\n  method: POST\n  path:\n    - type: literal\n      value: pet\n  body:\n    type: var\n    name: input\n```\n\n**Path segments:** `{type: literal, value: \"pet\"}` (static) or `{type: var, name: \"id\"}` (resolved at runtime).\n\n**Variables the engine provides:**\n\n- `id` — entity ID (for get\u002Fdelete\u002Fupdate\u002Faction)\n- Predicate field names — from query predicates in the Plasm program\n- `input` — full input object (create\u002Fupdate with body)\n- Path variables: see [reference.md](reference.md) (primary `id`, optional `path_vars`, multi-segment, create `input` keys merged into CML env)\n\n### Pagination & hydration\n\n**Pagination** — declare only in **`mappings.yaml`** (`pagination` block on **query** capabilities). Infer `style`, wire param names, and JSON paths per [reference.md — Pagination](reference.md#pagination-cml--mappingsyaml-only). The runtime merges **`pagination.params`** into follow-up HTTP requests; **`pagination:`** in CML is the single authoring surface for paging behavior.\n\n**Hydration** — after a query, if the entity has both `query` and `get`, the runtime **by default** fetches full rows via `get` unless `QueryExpr.hydrate = Some(false)` or the engine disables hydrate. No extra CGS flag. See [reference.md — Query result hydration](reference.md#query-result-hydration-runtime).\n\n## Step 4: Validate\n\nFor split `domain.yaml` + `mappings.yaml`, pass the **catalog directory** `apis\u002F\u003Capi>\u002F` to `schema validate`. Pointing at `domain.yaml` alone skips `mappings.yaml` and can falsely fail.\n\n```bash\n# CGS validation (catalog directory for split domain+mappings)\ncargo run -p plasm-cli --bin plasm-cgs -- schema validate apis\u002F\u003Capi>\n\n# Optional: exhaustive mapping exercise against an OpenAPI spec\ncargo run -p plasm-cli --bin plasm-cgs -- validate --spec path\u002Fto\u002Fopenapi.json apis\u002F\u003Capi>\n\n# Smoke-load REPL + help\ncargo run -p plasm-repl -- --schema apis\u002F\u003Capi> --backend http:\u002F\u002Flocalhost:1080 --help\n```\n\n### Contract completeness is distinct from schema validity\n\nBefore claiming a catalogue complete, audit the pinned backend contract in both directions:\n\n- Every supported operation and selector has an explicit mapping or a documented exclusion.\n- Every domain-relevant response field, nested person, collection and relationship is preserved in typed CGS or explicitly excluded with a reason. A scalar-only projection of a rich response is not complete.\n- List\u002Fdetail variants preserve truthful identity and cardinality. Parent-scoped children use compound identities; embedded-only rows must be executable without an invented Get endpoint.\n- Advertised fields actually occur in the response or have a declared derivation. Never fabricate a thread-level field merely because its messages contain it.\n- Typed temporal and numeric inputs are encoded at the CML boundary according to the backend's documented wire format.\n- Validation exercises every Query and Search, secondary capabilities, and nested traversal. Record skips and separate structural validity, operation coverage, mock conformance and pinned-backend execution evidence.\n\nDo not attribute agent failures to reasoning limits while necessary catalogue evidence is absent or unverified. Preserve an auditable list of remaining gaps; passing YAML\u002Fschema validation alone cannot close it.\n\n## Step 5: End-to-End Testing\n\nHand off to [plasm-catalog-e2e-test](..\u002Fplasm-catalog-e2e-test\u002FSKILL.md), which is the operational source of truth for the testing ladder:\n\n1. **Hermit** against the OpenAPI spec when one exists in the README or source docs.\n2. **Live API** when credentials and rate-limit headroom exist.\n3. **Vendor sandbox \u002F test mode** as a substitute when live calls would mutate real data or are otherwise unsafe.\n\nSkips must be recorded with a reason; representative Plasm expressions and outcomes belong in the evidence the e2e skill emits.\n\n## Step 6: Eval Coverage\n\n```bash\ncargo run -p plasm-eval -- coverage --schema apis\u002F\u003Capi> --cases apis\u002F\u003Capi>\u002Feval\u002Fcases.yaml\n```\n\nFix missing buckets by adding eval cases (not by softening coverage). For LLM conformance runs, see `plasm-oss\u002Fcrates\u002Fplasm-eval\u002FREADME.md`.\n\n## Failure Modes (quick reference)\n\nWhen transport tests fail, check:\n\n- `CmlError::VariableNotFound` → mapping var name doesn't match the engine env. Fix `name` in mappings.yaml.\n- `DecodeError` → response shape mismatch. The engine normalizes bare arrays automatically; check `path:` \u002F `derive:` on entity fields.\n- `404` → path doesn't match spec. Check `--backend` includes the server prefix.\n- `401` \u002F `403` → wrong `auth:` scheme or missing env var.\n\nThen fix `domain.yaml` or `mappings.yaml` and re-run from Step 4.\n\n## When you cannot model the API faithfully\n\nIf the desired API shape **cannot** be modeled with today's CGS + CML + runtime (missing expressiveness, not just tediousness), **stop**. Document the gap as a short blocker note (what shape is needed, which capability\u002Fentity breaks, which validator or runtime behavior is insufficient). **Do not** patch `plasm-core`, `plasm-cml`, `plasm-runtime`, or validators yourself to \"unstick\" the mapping unless explicitly directed in a separate task.\n\nAfter a difficult or interesting catalog, run [plasm-catalog-retro](..\u002Fplasm-catalog-retro\u002FSKILL.md) to capture systemic improvements.\n\n\n**Embedded execution gate:** follow [Embedded identity proof and observation ownership](reference.md#embedded-identity-proof-and-observation-ownership).\nRequire pack\u002Fcodec identity checks and an abstract direct\u002Fscoped\u002Fhydrated relation witness.\nReport backend-schema evidence, mock evidence and real-backend evidence separately;\noperation coverage alone never establishes complete response or mutation semantics.\n\nWhen a catalogue declares prerequisites, verify the deployment manifest covers every requirement and exercise federated discovery bootstrap. Direct engine\u002Fcatalogue tests do not establish deployment closure.\n",{"name":5,"description":7},"main","8f036e9443513eb615ca40218052395b4f489eba","skills\u002Fplasm-authoring",3,"https:\u002F\u002Fgithub.com\u002FPlasmTools\u002Fplasm-core","https:\u002F\u002Fgithub.com\u002FPlasmTools","2026-11-15 00:34:44",{"source":8,"skillName":5,"commands":51,"prompt":61,"zipAvailable":62},[52,55,58],{"tool":53,"command":54},"npx","npx skills add PlasmTools\u002Fplasm-core --skill plasm-authoring",{"tool":56,"command":57},"bunx","bunx skills add PlasmTools\u002Fplasm-core --skill plasm-authoring",{"tool":59,"command":60},"pnpm","pnpm dlx skills add PlasmTools\u002Fplasm-core --skill plasm-authoring","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FPlasmTools\u002Fplasm-core\u002Fblob\u002Fmain\u002Fskills\u002Fplasm-authoring\u002FSKILL.md",true,[64],{"path":65,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":69},"reference.md","REFERENCE","参考文档",126530,"https:\u002F\u002Fgithub.com\u002FPlasmTools\u002Fplasm-core\u002Fblob\u002Fmain\u002Fskills\u002Fplasm-authoring\u002Freference.md",[71,93,100,108,115,123],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":38},"01M71GXN906T8EMB9G6PZ5XA38","plasm-forge","OSS entry skill for Plasm CGS \u002F CML catalog authoring — points at the canonical skill suite under `skills\u002F` in plasm-core. Use when agents need the authoring playbook; pair with `.cursor\u002Fagents\u002Fplasm-forge.md` (Cursor) for autonomous catalog work.","https:\u002F\u002Fgithub.com\u002FPlasmTools\u002Fplasm-core\u002Fblob\u002Fmain\u002Fskills\u002Fplasm-forge\u002FSKILL.md",[],[78,79,80,81,82,83,18,31,84,32,85,86,87,34,88,89,90,91,92],"plasm forge","forge","pair","oss","canonical","suite","entry","cursor","work","with","use","autonomous","catalog","for","core",{"skillNo":94,"name":95,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":38},"01M71GXKKSBRV99VB8JHXTSZ5V","plasm-catalog-score","https:\u002F\u002Fgithub.com\u002FPlasmTools\u002Fplasm-core\u002Fblob\u002Fmain\u002Fskills\u002Fplasm-catalog-score\u002FSKILL.md",[],[99,90],"plasm catalog score",{"skillNo":101,"name":102,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":38},"01M71GXHASQBWNG6R5CTDJEZZW","plasm-catalog-retro","https:\u002F\u002Fgithub.com\u002FPlasmTools\u002Fplasm-core\u002Fblob\u002Fmain\u002Fskills\u002Fplasm-catalog-retro\u002FSKILL.md",[],[106,107,90],"retro","plasm catalog retro",{"skillNo":109,"name":110,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":38},"01M71GXFM75YTJDHM24BY9ERHA","plasm-catalog-reprint","https:\u002F\u002Fgithub.com\u002FPlasmTools\u002Fplasm-core\u002Fblob\u002Fmain\u002Fskills\u002Fplasm-catalog-reprint\u002FSKILL.md",[],[114,90],"plasm catalog reprint",{"skillNo":116,"name":117,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":118,"categories":119,"keywords":120,"publishedAt":38},"01M71GXDC86B9XJHTZ385K4F5E","plasm-catalog-polish","https:\u002F\u002Fgithub.com\u002FPlasmTools\u002Fplasm-core\u002Fblob\u002Fmain\u002Fskills\u002Fplasm-catalog-polish\u002FSKILL.md",[],[121,122,90],"polish","plasm catalog polish",{"skillNo":124,"name":125,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":126,"categories":127,"keywords":128,"publishedAt":38},"01M71GXBJV6YV7H86Y4T9CBXK3","plasm-catalog-e2e-test","https:\u002F\u002Fgithub.com\u002FPlasmTools\u002Fplasm-core\u002Fblob\u002Fmain\u002Fskills\u002Fplasm-catalog-e2e-test\u002FSKILL.md",[],[90,129,130,131,132],"e2e test","plasm catalog e2e test","test","e2e"]