Skip to content
Draft
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
10 changes: 10 additions & 0 deletions .changeset/37895-skills-action-examples-no-location-key.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@objectstack/skills': patch
---

docs(skills): the checked action examples no longer carry a `locations` key

Clause-②: no
Metadata-protocol: none

Seven examples drop their `locations` key: the Ask AI example in `skills/objectstack-ai/SKILL.md`, the "Mark as done" JSON in `skills/objectstack-ui/SKILL.md` (Actions), and five `defineAction` examples in `skills/objectstack-ui/rules/actions.md` (`crm_reassign_lead`, `crm_convert_lead`, `crm_print_a3`, `crm_open_invoice_pdf`, `crm_add_invoice_line`). Nothing an author can write changes, and the text around the examples is as it was: an action still draws only where its `locations` or a list view places it, so an action copied from one of these examples needs its `locations` added. Three token ceilings follow their files down to the measurement (6795 to 6787, 2264 to 2256, 3890 to 3844).
13 changes: 10 additions & 3 deletions scripts/check-skills-token-ratchet.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,9 @@ export const CEILINGS = new Map([
// 6799 -> 6795 (#37797): LOWERED to the measurement on that PR's head merged
// with `main`. Two retired-key rows name their replacements; one sample
// instruction line left the skill example and over-paid by 4 tokens.
['skills/objectstack-ai/SKILL.md', 6795], // -18 (was 6824), then -5 A2′ (was 6806)
// 6795 -> 6787: the Ask AI example drops its `locations` line (32 bytes), so it compiles
// under both action location vocabularies; the row follows the measurement down.
['skills/objectstack-ai/SKILL.md', 6787], // -18 (was 6824), then -5 A2′ (was 6806)
// -12 (was 6331): the `http.server` decision-table row dropped a trailing
// clause that taught `contributes.routes` as a key that "parses but serves
// nothing". The key is retired — an authored entry is now REFUSED, carrying
Expand Down Expand Up @@ -1086,7 +1088,9 @@ export const CEILINGS = new Map([
// (-41 bytes). Net shrink, so no raise: the ceiling follows the file down to the
// measurement, 9133 bytes (9113 priced) -> 9107 (9087 priced) -> 2272 tokens.
// ceil(($(wc -c < skills/objectstack-ui/SKILL.md) - 20) / 4) == ceil(9087 / 4)
['skills/objectstack-ui/SKILL.md', 2264], // -8 to the measurement (was 2272)
// 2264 -> 2256: the Actions JSON fence drops its `locations` key (32 bytes), so it parses
// under both action location vocabularies; the row follows the measurement down.
['skills/objectstack-ui/SKILL.md', 2256], // -8 to the measurement (was 2264)
// 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 @@ -1655,7 +1659,10 @@ export const CEILINGS = new Map([
// measured remainder only. Same ruling (2026-10-27, tap A): 「A:先削重复,余额按实测提高」
// (ruling record 6513306068, letter B).
// ceil($(wc -c < skills/objectstack-ui/rules/actions.md) / 4) == ceil(15559 / 4)
['skills/objectstack-ui/rules/actions.md', 3890],
// 3890 -> 3844: five checked examples drop their `locations` line (186 bytes), so each
// compiles under both action location vocabularies; the row follows the measurement down.
// ceil($(wc -c < skills/objectstack-ui/rules/actions.md) / 4) == ceil(15373 / 4)
['skills/objectstack-ui/rules/actions.md', 3844],
// 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 Down
1 change: 0 additions & 1 deletion skills/objectstack-ai/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ export default defineAction({
label: 'Ask AI',
objectName: 'contract',
type: 'ask_ai',
locations: ['record_header'],
});
```

Expand Down
2 changes: 1 addition & 1 deletion skills/objectstack-ui/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ reports success and changes nothing. Call the API, with the option `value`,
never its label ([Actions](./rules/actions.md)):

```json
{ "name": "mark_done", "label": "Mark as done", "objectName": "task", "locations": ["record_header"],
{ "name": "mark_done", "label": "Mark as done", "objectName": "task",
"type": "script", "body": { "language": "js", "capabilities": ["api.write"],
"source": "await ctx.api.object('task').update({ id: ctx.recordId, status: 'done' });" } }
```
Expand Down
5 changes: 0 additions & 5 deletions skills/objectstack-ui/rules/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ export const ReassignLeadAction = defineAction({
objectName: 'lead',
type: 'api',
target: 'lead',
locations: ['record_header', 'list_item'],
disabled: P`record.status == "converted"`,
disabledReason: 'A converted lead is reassigned from its opportunity.',
params: [{ field: 'owner_id', required: true }],
Expand All @@ -93,7 +92,6 @@ export const ConvertLeadAction = defineAction({
icon: 'arrow-right-circle',
type: 'flow',
target: 'crm_lead_conversion',
locations: ['record_header', 'list_item'],
visible: P`record.status == "qualified" && record.is_converted == false`,
confirmText: 'Convert this lead?',
successMessage: 'Lead converted.',
Expand Down Expand Up @@ -177,7 +175,6 @@ export const PrintA3Action = defineAction({
type: 'url',
target: '/print/a3?id=${ctx.recordId}', // interpolated at click
openIn: 'new-tab',
locations: ['record_header'],
});
```

Expand All @@ -202,7 +199,6 @@ export const OpenInvoicePdfAction = defineAction({
target: 'crm_open_invoice_pdf',
opensInNewTab: true,
newTabUrl: '/api/v1/invoice/{recordId}/pdf',
locations: ['record_header'],
});
```

Expand Down Expand Up @@ -236,7 +232,6 @@ export const AddInvoiceLineAction = defineAction({
label: 'Add Line',
objectName: 'invoice',
type: 'script',
locations: ['record_header'],
params: [
{ field: 'product', objectOverride: 'invoice_line', required: true },
{ field: 'quantity', objectOverride: 'invoice_line', required: true },
Expand Down
Loading