docs/skill/ is the skill an agent loads to use SimpleCADAPI. This file is the contract its pages follow. The rules here
are checked by python tools/skillbuild.py --check (see "Checks"), so a page that breaks one fails the build.
- Few agent turns. An agent reads what a step needs in one parallel batch and then works. Pages are small and have one job so they can be loaded separately, and the router tells the agent which pages belong together.
- A small reading budget. The first batch of any route is at most 1,200 compiled lines (router, the two
always-read pages, the workflow page and its
Read nowfiles); every later batch stays under the same bound. (Measured before this design: a median of 1,493 lines and 7 files read before the first write, p90 2,501 lines and 20 files.) - One home for each rule. A rule is stated once, with its reason; other pages link to it.
- Two modes. Every workflow runs interactive or unattended (
references/discipline/operating-modes.md). - Four curated targets. The skill compiles to seven harness targets;
zcode,opencode,claudecodeandcodexare written for.omp,dshandkimicodeare compiled from the same sources and must pass the checks, with generic wording.
SKILL.md router: start here, route table with read sets, always-on rules (<= 130 lines)
references/workflows/ one lifecycle per task; each has Read now / Read when / Unattended mode
references/workflows/<name>/ the role or stage pages of a long workflow, loaded when the role starts
references/domains/ capabilities (what the SDK offers for a kind of task)
references/discipline/ reasoning, invariants, rules (core-rules, operating-modes, the notebook rules ...)
references/docs/guides/ how the runtime works
references/docs/api|stdlib|core/ generated signatures (never hand-edited)
Every hand-written page (everything but docs/api, docs/stdlib, docs/core) is at most 300 lines (SKILL.md
at most 130). A longer page is split by job, not trimmed. The one exception is a versioned run contract (its first lines
say Contract ID:), which an external harness reads whole.
Domain and discipline pages open, within their first 8 lines, with **Read when:** <the trigger>. Nothing else is
required of their body.
Workflow pages (references/workflows/*.md) have these sections, with exactly these headings:
## Read now (one parallel batch)
| File | Why |
| --- | --- |
| `domains/requirement-refinement.md` | ... |
## Read when
| When | File |
| --- | --- |
| a Role starts | `workflows/<name>/role-1-....md` |
## Unattended mode
| Interactive gate | Unattended replacement |
| --- | --- |
| Role 1 consent gate | ... |Read nowlists every file the first batch needs besides the always-read pages, including the workflow's own role-1/first-stage page; paths are written relative toreferences/(for exampledomains/part-modeling.md) and in backticks, one per table row.Read whenlists everything else with its trigger; nothing is read "just in case".Unattended modehas one row for every place the workflow asks a person, waits for one, or needs a second reviewer (search the old text for⛔, "ask", "user", "consent", "confirm", "question", "review"), using the replacements indiscipline/operating-modes.md. A workflow with no such place says so in one sentence.core-rules.mdandoperating-modes.mdare read on every route (the router says so), soRead nowdoes not list them.- The compiled lines of
SKILL.md+core-rules.md+operating-modes.md+ the workflow page + itsRead nowfiles are at most 1,200 (checked per target; the lint prints the sizes with--read-budget).
The router's route table repeats the workflow page plus its Read now set in its own column, so an agent can issue the batch
straight from the table without opening the workflow first. The two must agree (checked).
The router tells the agent to read a batch in one go. How is per target (compile blocks in SKILL.md):
claudecode,zcode: allReadcalls of the batch in one message.opencode: allreadcalls of the batch in one response.codex: one shell command that prints the batch:cd <skill dir> && tail -n +1 a.md b.md c.md(each file is preceded by a==> name <==header).omp,dsh,kimicode: the generic sentence ("request the whole batch together if your tools allow it").
Pages that name API pages for a step list them as one batch too (Read now / a Read when row), never "read as needed".
- Move, do not rewrite. When a long page is split, each rule, table row, example, checklist item and
skill:ifblock survives in exactly one new page (or is deleted as a verbatim duplicate of text kept elsewhere, and the report says where). Changing meaning is a separate, labelled edit. - The old page's name stays as the outline (workflow or guide) so links keep working; the outline links to the new pages.
- Stable file names are in the file map below. Cross-links between owners only use the names listed there.
Names in bold are new.
SKILL.md
references/README.md generated tables + this layering
references/SDK_OVERVIEW.md, ql-playbook.md, scadpkg-format.md
**references/ql-recipes.md** the recipes split out of ql-playbook.md
references/workflows/
single-part-modeling.md outline, Role 5 (export), failure routes
single-part-modeling/**role-1-requirements.md, requirements-template.md, role-2-plan.md,
role-3-verifier.md, verifier-contract-patterns.md, role-4-build.md**
assembly-product-build.md step-reconstruction.md engineering-drawing.md export-and-translation.md
**scan-reconstruction.md** a mesh, point cloud or images as the source
drawing-reconstruction.md outline
drawing-reconstruction/**(role / stage pages, the owner chooses the names)**
references/domains/ the 11 existing pages (drawing-inspection may gain a template page)
references/discipline/
**core-rules.md** **operating-modes.md** feature-tree-convention.md notebook-cell-design.md feature-ordering.md
geometric-validation.md datums-and-coordinate-systems.md mechanical-modeling.md manufacturing-boundaries.md
assembly-positioning.md failure-and-repair.md requirement-and-cad-brief.md verifier-scripts.md
references/docs/guides/
notebook-runtime.md run, parameters (<= 300 lines)
**notebook-composition-and-cache.md** composing notebooks, the cell cache, library parts
**product-export.md** package export, downstream targets
- every path a page names (backticked or in a link, under
references/) exists; references/README.mdlists exactly the workflows, domains and discipline pages that exist;- every hand-written page is reachable from
SKILL.mdthrough links; - line limits (300 per page, 130 for
SKILL.md); - every workflow has the three sections above and every domain/discipline page has
**Read when:**; - the route table's read set equals the workflow's
Read nowset; - the read budget (1,200 compiled lines, see "Workflow pages") for each route and each target;
- the four curated targets' compiled
SKILL.mdcontains the parallel-read instruction; - no unresolved
skill:if/skill:endif.
Run python tools/skillbuild.py --check. To see what a harness gets, python tools/skillbuild.py --target opencode
(output goes to skills/simplecadapi-opencode/, which git ignores). Behaviour is measured, not assumed: the
agents' traces (Langfuse) give the lines read before the first write and the rules broken; a change that adds reading
needs a reason in its commit message.