Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .changeset/34770-platform-skill-router.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
'@objectstack/skills': patch
---

docs(skills): the objectstack-platform entry file becomes a router

Clause-②: no
Metadata-protocol: none

`skills/objectstack-platform/SKILL.md` goes from 24.7 KB to 9.0 KB (421 lines to 105). It now holds three things: four first checks (the installed `@objectstack/spec` version, what the project already has, the contract, `os validate`), the traps that pass `os validate` and then fail at run time, and a table that says which file to open for the task at hand. No rule's teaching changes. Text moved, and this entry says where it went. The skill's files are 2.1 KB smaller together (107.5 KB to 105.5 KB).

**What the entry keeps.** Five traps: no driver in `plugins:`, an installed package is customized from its paired `.custom` package, who owns the HTTP server (`createHonoApp` or `HonoServerPlugin`), `manifest.engines.protocol`, and `manifest.namespace`. Then the full list of `defineStack()` top-level keys with the rule that an undeclared key is refused, the `requires:` provider table with the three rules that bite most often, and `Seed Data` (the three import modes; a seed cannot create a person, `demoStaff` does).

**What left, and where it is now.**

- `references/bootstrap.md` now also holds `Strict Validation` (`#strict-validation`), the manifest notes the entry's two traps do not repeat (`#manifest`), `Project Structure Conventions`, what the `blank` template scaffolds (under `#scaffolding-command`), `Runtime Boot Sequence` (`#runtime-boot-sequence`), the `requires:` tokens that have no provider row and the remaining rules (`#requires-in-detail`), `onEnable`, `Customizing an installed package` in full (`#customizing-an-installed-package`), and `demoStaff` with its example (`#demo-accounts--demostaff-vs-devlogins`).
- `references/operations.md` now also holds `Driver Selection Guide` (`#driver-selection-guide`), when to construct `DriverPlugin` yourself (`#wiring-a-driver-yourself`), `HTTP Layer (Hono)` (`#http-layer-hono`), and the note that `os compile` writes `dist/objectstack.json`.
- Anchors that no longer exist in `SKILL.md`: `#definestack--the-core-configuration` (now `#definestack-keys`), `#full-configuration-reference`, `#strict-validation`, `#compile-artifact-and-runtime-metadata-boundary`, `#manifest-reference`, `#the-app--platform-boundary`, `#the-template`, `#project-structure-conventions`, `#naming-conventions`, `#driver-selection-guide`, `#wiring-a-driver--you-usually-do-not`, `#http-layer-hono`, `#usage-pattern-hono`, `#architecture`, `#runtime-boot-sequence`, `#onenable--where-an-app-binds-runtime-code`, `#demo-accounts--demostaff-vs-devlogins`, `#references`. `#requires--which-service-plugins-boot` and `#seed-data` still do.

**Not carried over, because another file already says it.** The `App / Platform Boundary` section (objectstack-project owns that decision; `references/bootstrap.md#app-or-platform` keeps the two sentences it does not have), the naming-convention table (objectstack-data's naming rules), the annotated manifest example (every key is in `kernel/manifest.zod.ts`, which the entry's third check points at; the barrel example in `references/bootstrap.md` now shows `engines`), the Hono usage snippet, and the closing list of the other files (the routing table replaces it). In `references/plugin-development.md`, the `Plugin` interface block and the hook example are now one pointer each to `rules/plugin-lifecycle.md` and `references/plugin-hooks.md`, which carry the same text.
70 changes: 66 additions & 4 deletions scripts/check-skills-token-ratchet.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,38 @@ export const CEILINGS = new Map([
// row adds 20 bytes, so the LANDED priced text is 24632 bytes -> 6158
// tokens: the ceiling moves 6153 -> 6158 (+5). Pinned AT the measurement.
// ceil(($(wc -c < skills/objectstack-platform/SKILL.md) - 27) / 4) == ceil(24632 / 4)
['skills/objectstack-platform/SKILL.md', 6158],
// 6158 -> 2241 (#34770, the entry file becomes a router; authority as the
// `skills/objectstack-data/SKILL.md` row): LOWERED. The entry keeps four first checks, five
// traps that pass `os validate` and fail at run time (a driver in `plugins:`, customizing an
// installed package from its pair, who owns the HTTP server, `manifest.engines.protocol`,
// `manifest.namespace`), the routing table, and the three sections a gate binds to this file:
// the `defineStack()` key enumeration (`check-skill-top-level-keys`), the `requires:` provider
// table and `## Seed Data` (both Leg 2 of `check-skill-identifier-liveness`), each cut to the
// enumeration and what fails silently. What left, and its home: Strict Validation, the
// manifest notes, Project Structure Conventions, the template paragraph, Runtime Boot
// Sequence, the `requires:` detail, `onEnable`, Customizing an installed package and Demo
// accounts -> `references/bootstrap.md`; Driver Selection Guide, HTTP Layer (Hono) and the
// compile / alias paragraph -> `references/operations.md`. Gone, each restating a file the
// entry now names: the App / Platform Boundary section (objectstack-project), the naming
// table (objectstack-data), the annotated manifest example (`manifest.zod.ts`), the Hono
// usage block, the References list. 24659 bytes (24632 priced) -> 8991 (8964 priced) -> 2241
// tokens; the ceiling follows the file down to the measurement, which also pins the 9 KB
// budget from here on.
// ceil(($(wc -c < skills/objectstack-platform/SKILL.md) - 27) / 4) == ceil(8964 / 4)
// 2241 -> 2250 (#34770, the parity round): trap 1 names again the package the CLI resolves
// for a SQL database URL (`@objectstack/driver-sql`), the literal the entry's driver table
// carried before the split; without it a deployment plan described the driver and did not
// name it. Nothing else in the entry is cut to pay for it, on the owning seat's choice: the
// file is 8991 -> 9027 bytes (8964 -> 9000 priced), +36, 27 bytes over the 9 KB target the
// row above pinned, -> 2250 tokens, pinned AT the measurement. The row still falls 3908 from
// the 6158 before this change, so no raise path is spent.
// ceil(($(wc -c < skills/objectstack-platform/SKILL.md) - 27) / 4) == ceil(9000 / 4)
// 2250 stays (#34770, the review round): the AI-door rule names the gated call again (an
// action declaring `ai.requiresConfirmation: true`) and `pinyin-search` its `zh-*` locale
// condition, both paid inside the entry: 9027 -> 9025 bytes (9000 -> 8998 priced), 25 over
// the 9 KB target, the same 2250 tokens, still AT the measurement.
// ceil(($(wc -c < skills/objectstack-platform/SKILL.md) - 27) / 4) == ceil(8998 / 4)
['skills/objectstack-platform/SKILL.md', 2250],
// `skills/objectstack-pm-dispatch/SKILL.md` (9708) and its
// `rules/dev-template.md` (1838) left this table on 2026-09-10 with the files:
// the maintainer deleted the published PM skill whole (verbatim:
Expand Down Expand Up @@ -2403,7 +2434,25 @@ export const CEILINGS = new Map([
['skills/objectstack-data/references/seeds.md', 1895], // -3 to the measurement (was 1898)
// 1351 -> 1343: the body-pin values left the count (#31115, ruling B; see
// BODY_PIN_REPIN); the file's count fell by the same 8, headroom unchanged.
['skills/objectstack-platform/references/bootstrap.md', 1340], // -3 to the measurement (was 1343)
// 1340 -> 4389 (#34770): RECEIVES from SKILL.md, no new teaching: `### Strict Validation`,
// `### Manifest`, `### Project Structure Conventions`, the template paragraph under
// Scaffolding Command, `## Runtime Boot Sequence`, `### requires: in detail`, `### onEnable`,
// `## Customizing an installed package`, `## Demo accounts` and `## App or platform`. PAID
// DOWN FIRST: the manifest, `requires:` and demo-account sections arrive as the complement of
// what the entry still states, and the template paragraph without its three counts. The file
// is 5425 -> 17621 bytes (+12196; 5360 -> 17556 priced, the five body pins excluded) -> 4389
// tokens, zero headroom before, ceiling +3049, pinned AT the measurement.
// Authority: the decision record that orders the entry file down to router size (as the
// `skills/objectstack-data/SKILL.md` row) and the maintainer's ruling of 2026-11-24 (ruling
// record 7128031203, fork 4 = A), which names "later moves of the same kind": a ceiling
// raised because text MOVED between files is accepted when each raised row equals the
// measured bytes moved in, with zero headroom, and the sum of ceilings does not rise. Both
// hold: the four objectstack-platform rows this change moves are each pinned AT their
// measurement and sum to 13498, under the 14014 before it (-3908 entry, +3049 here, +630
// `references/operations.md`, -287 `references/plugin-development.md`); the sum of all
// ceilings goes 200510 -> 199994.
// ceil(($(wc -c < skills/objectstack-platform/references/bootstrap.md) - 65) / 4) == ceil(17556 / 4)
['skills/objectstack-platform/references/bootstrap.md', 4389],
// 3108 -> 3287: `os deploy`, the managed-package dev loop — when to deploy
// rather than publish a release, its entry points, how it picks the
// environment, its flags, and how to read its exit 1 (refusal before any
Expand Down Expand Up @@ -2460,8 +2509,21 @@ export const CEILINGS = new Map([
// pinned at the measurement. Same maintainer ruling, verbatim and
// untranslated: 「A:先削重复,余额按实测提高」 (ruling record 6513306068 on
// #27847).
['skills/objectstack-platform/references/operations.md', 3389], // -5 to the measurement (was 3394)
['skills/objectstack-platform/references/plugin-development.md', 3127], // -10 to the measurement (was 3137)
// 3389 -> 4019 (#34770): RECEIVES from SKILL.md, no new teaching: `## Driver Selection
// Guide` (the table whole; of the wiring section only what the entry's trap no longer says),
// `## HTTP Layer (Hono)` (the two-package table whole, the remainder in three sentences, the
// usage block cut) and the compile / alias paragraph above Verify your work. The file is
// 13556 -> 16075 bytes (+2519) -> 4019 tokens, zero headroom before, ceiling +630, pinned AT
// the measurement. Authority and the sum as the `references/bootstrap.md` row.
// ceil($(wc -c < skills/objectstack-platform/references/operations.md) / 4) == ceil(16075 / 4)
['skills/objectstack-platform/references/operations.md', 4019],
// 3127 -> 2840 (#34770): LOWERED, the deletion that pays part of the two rows above. Two
// blocks restated a sibling file and are now one pointer each: the `Plugin` interface
// (`rules/plugin-lifecycle.md` § Plugin Interface carries the same block) and the hook
// example with its event list (`references/plugin-hooks.md`); the `data:*` warning keeps the
// silent failure and links the rest. 12505 -> 11360 bytes (-1145) -> 2840 tokens.
// ceil($(wc -c < skills/objectstack-platform/references/plugin-development.md) / 4) == ceil(11360 / 4)
['skills/objectstack-platform/references/plugin-development.md', 2840],
['skills/objectstack-upgrade/references/examples-upgrade.md', 1193], // -4 to the measurement (was 1197)
// NEW FILE, pinned AT the measurement: the context pack (`ai_context`, ADR-0160)
// is a metadata kind no published skill taught beyond its key name. Card #37177
Expand Down
Loading
Loading