Skip to content
Merged
26 changes: 26 additions & 0 deletions .changeset/34770-skill-router-ui.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
'@objectstack/skills': patch
---

docs(skills): objectstack-ui's SKILL.md is a router: first checks, run-time traps, where each rule lives

Clause-②: no
Metadata-protocol: none

`skills/objectstack-ui/SKILL.md` goes from 15.7 KB to 9.0 KB and now holds three things. No rule's teaching changes; text moved, and the page says where it went.

- **First checks.** The installed `@objectstack/spec` version against the skill's `compatibility` line; the object's declaration and the project's own view, app, action and dataset files; the type's contract (`references/_index.md` points at the Zod source in `node_modules/@objectstack/spec/src/`, which decides what to write; a running environment serves the parsed shape as JSON Schema at `GET /api/v1/meta/types`, where a defaulted key reads as required); `os validate` before reporting done.
- **Seven traps that parse and then fail at run time.** A long form stays `simple`; a record with its line items is `inlineEdit` on the child's `master_detail` field (and `enable.apiMethods` must list `'bulk'`); a persisted chart binds a declared dataset; a filter token is presentation scope, not security; the object declares its record page. Two keep their own headings: `List Views` (keep the view kind the request names, with the nine kinds) and `Actions` (an operation is an `action` whose body calls the API).
- **Where to go.** One table from the task to the file to open: list views, form views, navigation, record page, actions, dashboards and reports, pages and docs, and the React-tier block contract.

The Navigation Item Types, Action Types and Report Types tables stay in `SKILL.md`, with the item and action keys behind their homes.

Where the rest moved, each under its old heading text:

- `rules/list-views.md` now carries **Form Views** (the three types, the long-form paragraph, the public form), **Master-Detail Forms (parent + child line items)** and **Field Conditional Rules in Forms**, plus the column-count pitfall under Column Features.
- `rules/navigation.md` opens with `App.create`, the one-App-per-package rule, each navigation item type's keys (`label` and `icon` on every type but `separator`), `requiresObject` / `requiresService` and the `AppContextSelector` note.
- `rules/actions.md` opens with what an action is, where it is registered, and why a record button needs a placement and a `js` body with `api.write`; a bare field ref in `visible` or `disabled` fails `os validate`, and a parameterized bulk mutation is `script`.
- `rules/dashboards.md` says an omitted widget `layout` auto-flows, `position` is not a widget key, and a widget binding that resolves to nothing declared fails `os validate`.
- `rules/pages.md` points at objectstack-query `rules/filters.md` for relative-date placeholders.

A reader who linked `SKILL.md#date-macros--filter-placeholders`, `#master-detail-forms-parent--child-line-items`, `#form-views`, `#common-pitfalls` or `#verify-your-work` finds those headings gone from `SKILL.md`: the first is trap 4 and objectstack-query `rules/filters.md`; the second and third are in `rules/list-views.md`; `#common-pitfalls` is in `rules/list-views.md` (Column Features) and `rules/dashboards.md`; `#verify-your-work` is first check 4, with what the gate catches in `rules/actions.md` and `rules/dashboards.md`.
85 changes: 79 additions & 6 deletions scripts/check-skills-token-ratchet.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,27 @@ export const CEILINGS = new Map([
// above; same standing ruling (record 6513306068). 15569 bytes (15549 priced) -> 15704
// (15684 priced) -> 3921 tokens, pinned AT the measurement, zero headroom.
// ceil(($(wc -c < skills/objectstack-ui/SKILL.md) - 20) / 4) == ceil(15684 / 4)
['skills/objectstack-ui/SKILL.md', 3921],
// 3921 -> 2239 (#34770 part 1, the entry file becomes a router; decision record
// 6943107981, S3 = A, whose target reads "a router-sized `SKILL.md` (6–9 KB, at most 500
// lines)" with "pointers to the contract instead of restated lists"): LOWERED. The entry
// keeps four first checks (the installed version, what the project already has, the
// type's contract, `os validate`), the run-time traps, the routing table, the two
// sections the hosted cloud serves by exact heading (`### List Views`: the nine kinds and
// the keep-the-kind rule; `## Actions`: the write-button rule and the Action Types
// table), and the three Leg 2 enumerations `check-skill-identifier-liveness` binds to
// this file by heading (`### Navigation Item Types`, `### Action Types`,
// `## Report Types`). What left, and its home: Form Views, Master-Detail Forms and Field
// Conditional Rules in Forms -> `rules/list-views.md`; the App intro, the one-App-per-
// package paragraph, the nav-item keys column and the `requiresObject` /
// `AppContextSelector` notes -> `rules/navigation.md`; the action intro and the
// placement / write-discarded detail -> `rules/actions.md`; what `os validate` catches
// (a bare field ref, an unresolved widget binding) -> `rules/actions.md` and
// `rules/dashboards.md`; the `layout` auto-flow clause -> `rules/dashboards.md`. The
// Detailed Rules list and the CRM blueprint are the routing table now. 15704 bytes
// (15684 priced) -> 8974 (8954 priced) -> 2239 tokens; the ceiling follows the file down
// to the measurement, the ratchet's ordinary direction.
// ceil(($(wc -c < skills/objectstack-ui/SKILL.md) - 20) / 4) == ceil(8954 / 4)
['skills/objectstack-ui/SKILL.md', 2239],
// 8333 -> 6193: RE-LOCK at the landed count after the #19715 split (decision
// batch #213 item 1, maintainer 「1 2 4 同意」): the worked R1, the report
// template and the v17-canonical shapes block moved VERBATIM into
Expand Down Expand Up @@ -1329,7 +1349,23 @@ export const CEILINGS = new Map([
// half carries it: the file is 11106 -> 11231 bytes -> 2808 tokens, zero headroom before,
// ceiling +31, pinned AT the measurement.
// ceil($(wc -c < skills/objectstack-ui/rules/actions.md) / 4) == ceil(11231 / 4)
['skills/objectstack-ui/rules/actions.md', 2808],
// 2808 -> 3031 (#34770 part 1): RECEIVES text the router split moved out of SKILL.md,
// no new teaching: from § Actions the two-sentence intro (what an action is, where it is
// registered, a link back to the Action Types table) and the placement / write detail
// the entry's Actions section no longer spells (`objectName` folds the action into
// record surfaces, `rowActions` / `bulkActions` name it, the two lint codes, why the
// body is `js` and why it declares `api.write`); from § Verify your work one sentence
// on the `disabled` bullet (a bare field ref in `visible` or `disabled`, `done` for
// `record.done`, fails `os validate`); from the CRM blueprint's User actions row, that a
// parameterized bulk mutation is `script`. The file is 11231 -> 12123 bytes (+892) ->
// 3031 tokens, zero headroom before, ceiling +223, pinned AT the measurement. Authority: the ruling of record that
// orders the entry file down to router size, decision record 6943107981 S3 = A (this
// header: a ruling of record that orders text into a file authorises its own measured
// delta), quoted in the PR body beside the standing 2026-10-27 ruling
// 「A:先削重复,余额按实测提高」 (record 6513306068). The seven hand-authored
// objectstack-ui files net -149 bytes across the move (100990 -> 100841).
// ceil($(wc -c < skills/objectstack-ui/rules/actions.md) / 4) == ceil(12123 / 4)
['skills/objectstack-ui/rules/actions.md', 3031],
// 6090 -> 6252 (#19715, card item 4): a 5-line table of contents at the top,
// anchors to the file's existing headings, nothing else changed. +162 tokens,
// zero headroom to absorb any of it, ceiling +162. Maintainer ruling
Expand All @@ -1355,7 +1391,16 @@ export const CEILINGS = new Map([
// `DATASET_INVALID` at compile); paid by the `compareTo` paragraph's restated "no second
// widget-side vocabulary" sentence and the `DatasetSchema` source pointer that
// `references/_index.md` already carries; 24926 bytes -> 6232 tokens, zero headroom.
['skills/objectstack-ui/rules/dashboards.md', 6232],
// 6232 -> 6274 (#34770 part 1): RECEIVES two clauses from SKILL.md, no new teaching.
// From § Common Pitfalls 2: an omitted widget `layout` auto-flows, and `position` is not
// a widget key (the closed schema refuses it by name, which is why the rest of that
// pitfall left the skill). From § Verify your work: a widget naming a `dataset` /
// `dimensions` / `values` that resolves to nothing declared (an empty chart) fails
// `os validate`. The file is 24928 -> 25094 bytes (+166) -> 6274 tokens, zero headroom
// before, ceiling +42, pinned AT the measurement. Authority as the `rules/actions.md`
// row above.
// ceil($(wc -c < skills/objectstack-ui/rules/dashboards.md) / 4) == ceil(25094 / 4)
['skills/objectstack-ui/rules/dashboards.md', 6274],
// 3011 -> 3141 (#19715, card item 4): a 5-line table of contents at the top,
// anchors to the file's existing headings, nothing else changed. +132 tokens,
// of which the row's 2 tokens of headroom absorb 2; the CEILING moves 130.
Expand Down Expand Up @@ -1384,7 +1429,20 @@ export const CEILINGS = new Map([
// SKILL.md row above: cloud#3659 letter A (6682024726) via record 6513306068, quoted
// verbatim in the PR body.
// ceil($(wc -c < skills/objectstack-ui/rules/list-views.md) / 4) == ceil(13802 / 4)
['skills/objectstack-ui/rules/list-views.md', 3451],
// 3451 -> 4448 (#34770 part 1): RECEIVES the form half of SKILL.md § View Types, moved
// whole and no new teaching: `## Form Views` (the three-type table, the long-form
// paragraph, the public-form row of the CRM blueprint as one sentence), `## Master-Detail
// Forms (parent + child line items)` and `## Field Conditional Rules in Forms`, each
// under its SKILL.md heading text; one table-of-contents line for them; and Common
// Pitfalls 1 as one sentence under Column Features. This file already teaches the
// `defineView` container the form views live in, so they did not need a file of their
// own. The list half stays in SKILL.md under `### List Views`, the section the hosted
// cloud serves by that heading. Dropped on the way, with a home: the "Read side" pointer
// (the entry's routing table names Record Page). The file is 13776 -> 17790 bytes
// (+4014) -> 4448 tokens, the row's 7 tokens of headroom absorbed, ceiling +997, pinned
// AT the measurement. Authority as the `rules/actions.md` row above.
// ceil($(wc -c < skills/objectstack-ui/rules/list-views.md) / 4) == ceil(17790 / 4)
['skills/objectstack-ui/rules/list-views.md', 4448],
// 2273 -> 2196 (#27059): LOWERED. The Surface bullet points at `rules/record-page.md`,
// says create / edit is a modal or the `editMode: 'page'` route, and the Overlay-width
// bullet moved there whole (the `size` bucket, the deprecated pixel keys); the ceiling
Expand All @@ -1393,15 +1451,30 @@ export const CEILINGS = new Map([
// list are English (the shipped skill text is English-only), and the bullet's repeated
// objectui ADR-0055 citation (the section heading carries it) is gone; the ceiling follows
// the file down to the measurement (8734 bytes).
['skills/objectstack-ui/rules/navigation.md', 2184],
// 2184 -> 2564 (#34770 part 1): RECEIVES SKILL.md § App Navigation, no new teaching:
// the `App.create` / `defineStack({ apps })` sentence, the one-App-per-package paragraph
// whole, the Navigation Item Types table's Properties column as one keys-by-type
// sentence (`label` and `icon` on every type but `separator`, as that column had it)
// with the `componentRef` registry-key gloss (the type and purpose columns stay
// in SKILL.md, where the Leg 2 binding reads them), the `requiresObject` /
// `requiresService` callout, and the `AppContextSelector` bullet of § Date Macros. The
// file is 8727 -> 10255 bytes (+1528) -> 2564 tokens, the row's 2 tokens of headroom
// absorbed, ceiling +380, pinned AT the measurement. Authority as the `rules/actions.md`
// row above.
// ceil($(wc -c < skills/objectstack-ui/rules/navigation.md) / 4) == ceil(10255 / 4)
['skills/objectstack-ui/rules/navigation.md', 2564],
// 5501 -> 5692 (#19715, card item 4): a 5-line table of contents at the top,
// anchors to the file's existing headings, nothing else changed. +191 tokens,
// zero headroom to absorb any of it, ceiling +191. Maintainer ruling
// 2026-09-22 on decision batch #213 item 1, verbatim and untranslated:
// 「1 2 4 同意」.
// 5692 -> 5669 (#27059): LOWERED. The `tabs`-slot sentence is a one-line pointer at
// `rules/record-page.md`; the ceiling follows the file down to the measurement (22673 bytes).
['skills/objectstack-ui/rules/pages.md', 5669],
// 5669 -> 5661 (#34770 part 1): LOWERED. The variable-substitution note points at the
// owner of the relative-date vocabulary (objectstack-query `rules/filters.md`) in place
// of the SKILL.md § Date Macros anchor the router no longer has; the ceiling follows the
// file down to the measurement (22644 bytes).
['skills/objectstack-ui/rules/pages.md', 5661],
// objectstack-ui `rules/record-page.md` — the sixth rules file, ordered by card #27059
// (record-page epic #26676 child 8, dispatched by ui seat 1 2026-11-01, with the seat's
// ruling that the record page gets its own rules file rather than rows in the files
Expand Down
Loading
Loading