Skip to content

Commit 85b26c8

Browse files
committed
docs(skills): cut restatement in rules/actions.md and the i18n SKILL.md; the actions.md token row moves 2982 to 2957
rules/actions.md: four more same-file restatements cut (98 bytes), each with its surviving home named in the ratchet row's comment. The file is 11828 bytes, 2957 tokens; the row follows the measurement down, so the raise from 2808 is +149 where it was +174. objectstack-i18n/SKILL.md: the Shipped examples lines no longer repeat the file names the File Organization table lists (63 bytes). The row stays 6333; merged with origin/main the file measures 6327 tokens. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgwLiKcfujYUug7sPs
1 parent ce9156c commit 85b26c8

3 files changed

Lines changed: 26 additions & 18 deletions

File tree

‎scripts/check-skills-token-ratchet.mjs‎

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,20 +1328,28 @@ export const CEILINGS = new Map([
13281328
// another passage (the 85 bytes above were what there was), so the same ruling's second
13291329
// half carries it: the file is 11106 -> 11231 bytes -> 2808 tokens, zero headroom before,
13301330
// ceiling +31, pinned AT the measurement.
1331-
// 2808 -> 2982: an action body refuses by code. One paragraph under the `ctx` section (which
1331+
// 2808 -> 2957: an action body refuses by code. One paragraph under the `ctx` section (which
13321332
// action may declare `refusals`; that the catalogue, the throws and the checks are a hook's,
13331333
// taught in objectstack-data and only pointed at here; the bundle key the sentence is translated
13341334
// at; that an authored `errorMessage` replaces the sentence in the console's toast), and the
13351335
// Add Line example declares one entry and throws its code where it threw a sentence. PAID DOWN
1336-
// FIRST by 26 bytes of true restatement in this file: the label line "**Script-typed action**:"
1337-
// above the Add to Campaign example (the block's own `type: 'script'` says it, under the H2
1338-
// "Examples"). Two reads of the file found no other passage restating another, so the same
1339-
// ruling's second half carries the rest. Arithmetic: the text adds 721 bytes, the cut removes
1340-
// 26, so the file is 11231 -> 11926 bytes -> 2982 tokens, zero headroom before, ceiling +174,
1341-
// the measured remainder only, pinned AT the measurement. Same ruling as the lines above
1336+
// FIRST by 124 bytes of true restatement in this file, five cuts: the label line
1337+
// "**Script-typed action**:" above the Add to Campaign example (26; the block's own
1338+
// `type: 'script'` says it, under the H2 "Examples"); the label "**Flow-typed action**" and the
1339+
// parentheses it held the `onSuccess` note in (19 net, the note now says "the flow run"; the
1340+
// block's own `type: 'flow'` says it); "`openIn: 'new-tab'` opens it in a new tab," (35 net,
1341+
// `'self'` now spelled `openIn: 'self'`; the H3 "`openIn: 'new-tab'`" under the H2 "Opening in
1342+
// a New Tab" and the example's `openIn: 'new-tab'` line say it); " on success / failure" on
1343+
// the `successMessage` / `errorMessage` bullet (21; the two key names, that bullet's
1344+
// "Action completed" half and the refusals paragraph's "failure toast … `errorMessage`" say
1345+
// it); "(`{ field: 'email' }`)" beside "field-backed params" (23; the `{ field: … }` params of
1346+
// the Reassign Lead, Add to Campaign and Add Line examples show the shape). The same ruling's
1347+
// second half carries the rest. Arithmetic: the text adds 721 bytes, the cuts remove 124, so
1348+
// the file is 11231 -> 11828 bytes -> 2957 tokens, zero headroom before, ceiling +149, the
1349+
// measured remainder only, pinned AT the measurement. Same ruling as the lines above
13421350
// (2026-10-27, tap A): 「A:先削重复,余额按实测提高」 (ruling record 6513306068).
1343-
// ceil($(wc -c < skills/objectstack-ui/rules/actions.md) / 4) == ceil(11926 / 4)
1344-
['skills/objectstack-ui/rules/actions.md', 2982],
1351+
// ceil($(wc -c < skills/objectstack-ui/rules/actions.md) / 4) == ceil(11828 / 4)
1352+
['skills/objectstack-ui/rules/actions.md', 2957],
13451353
// 6090 -> 6252 (#19715, card item 4): a 5-line table of contents at the top,
13461354
// anchors to the file's existing headings, nothing else changed. +162 tokens,
13471355
// zero headroom to absorb any of it, ceiling +162. Maintainer ruling

‎skills/objectstack-i18n/SKILL.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,8 @@ every plugin contributes its own `objects.*` slice.
482482

483483
## Shipped examples
484484

485-
`examples/app-crm` — the bundled layout (one `crm.translation.ts`, `en` + `zh-CN`).
486-
`examples/app-todo` — the per-locale layout (`{en,zh-CN,ja-JP}.ts` + `index.ts`).
485+
`examples/app-crm` — the bundled layout (`en` + `zh-CN`).
486+
`examples/app-todo` — the per-locale layout.
487487

488488
---
489489

‎skills/objectstack-ui/rules/actions.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
- `confirmText` — set for any destructive or irreversible operation; the confirm dialog of a param-less action. A registered action is refused it beside a non-empty `params` (put the question on `description`); a view's `bulkActionDefs` entry pairs the two by its own contract.
2121
- `submitText` — the verb on the param dialog's submit button ("Send", "Log Call") in place of "Confirm": an I18nLabel, refused blank and refused without a non-empty `params` (no dialog opens); `submitLabel` / `confirmLabel` are refused naming this key.
2222
- `preflight` — a read the param dialog shows above the params before submit: `{ read: { url }, path?, fields?, seed? }` sends one `GET` (no other `method`, no body or credentials) to a same-origin API path (one leading `/`) whose only holes are `${param.NAME}` (a declared param; re-read when it changes), `${ctx.recordId}` and `${ctx.record.FIELD}`. `path` selects the answer's sub-tree (`data`); `fields` rows are `resultDialog.fields`' `{ path, label?, format? }` (omitted: JSON). Each `seed: [{ param, path }]` entry fills a declared param, drawn read-only and submitted as shown: seeded once, no `defaultValue` / `defaultFromRow` / `carryOver`, read by no hole; mark it `required` so Confirm waits for the answer. Refused without a non-empty `params` and beside `execution: 'aggregate'`. UX, not authorization: the endpoint still checks a seeded value.
23-
- `successMessage` / `errorMessage` — toast copy on success / failure; without `successMessage` the UI shows a generic "Action completed" toast.
23+
- `successMessage` / `errorMessage` — toast copy; without `successMessage` the UI shows a generic "Action completed" toast.
2424
- Copy holes are `{{ }}`: `confirmText`, `description` (`'Choose the new owner of {{ record.name }}.'`) and a param's `helpText` read `record`; `successMessage` and each `outcomeMessages` entry (`resent: 'Invitation resent to {{ result.email }}'`) read `result` (the handler's answer) and `record`; `errorMessage` takes none. A `bulkActionDefs` entry's `confirmText` reads `{{ count }}` and its params by bare name (`{{ tier }}`). In all of them `${record.name}`, `{name}`, logic in a hole and a blank sentence fail `os validate`.
2525
- A param's `helpText`, like `description`, is a sentence or an inline locale map (`{ en: 'Why {{ record.name }} is paused', 'zh-CN': '暂停原因' }`); the map is how a page button's inline `action` (no bundle reaches it) writes its hint per locale.
2626
- `undoable: true` — an **Undo** in the success toast (and `Ctrl+Z`). Snapshot: runtime on `operation: 'update'`, console on `type: 'api'`; else refused.
@@ -49,7 +49,7 @@ export const ReassignLeadAction = defineAction({
4949

5050
## Examples
5151

52-
**Flow-typed action** (`onSuccess` hops once the run completes, not when it pauses at a screen; its URL template reads an `isOutput` variable as `${result.output.NAME}`):
52+
`onSuccess` hops once the flow run completes, not when it pauses at a screen; its URL template reads an `isOutput` variable as `${result.output.NAME}`:
5353

5454
<!-- os:check -->
5555
```typescript
@@ -130,9 +130,9 @@ failure toast shows it unless the action authors `errorMessage`.
130130

131131
### `openIn: 'new-tab'`
132132

133-
A **static** `target` URL on a `type: 'url'` action: `openIn: 'new-tab'` opens
134-
it in a new tab, `'self'` forces in-place navigation; omitted, absolute URLs open
135-
in a new tab and relative ones navigate in place.
133+
A **static** `target` URL on a `type: 'url'` action: `openIn: 'self'` forces
134+
in-place navigation; omitted, absolute URLs open in a new tab and relative ones
135+
navigate in place.
136136

137137
<!-- os:check -->
138138
```typescript
@@ -181,8 +181,8 @@ export const OpenInvoicePdfAction = defineAction({
181181
182182
## Action Parameter Patterns
183183

184-
Prefer **field-backed** params (`{ field: 'email' }`): label (i18n), type,
185-
validation, options, placeholder and widget come from the object metadata
184+
Prefer **field-backed** params: label (i18n), type, validation, options,
185+
placeholder and widget come from the object metadata
186186
(`widget` only while the param keeps or restates the field's `type`; a param
187187
that overrides `type` names its own `widget`);
188188
`objectOverride` borrows a field of another object, and `defaultFromRow: true`

0 commit comments

Comments
 (0)