diff --git a/.changeset/37895-skills-action-examples-no-location-key.md b/.changeset/37895-skills-action-examples-no-location-key.md new file mode 100644 index 00000000000..b35a789bda7 --- /dev/null +++ b/.changeset/37895-skills-action-examples-no-location-key.md @@ -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). diff --git a/scripts/check-skills-token-ratchet.mjs b/scripts/check-skills-token-ratchet.mjs index ad5205a8f82..b901c86e9bc 100644 --- a/scripts/check-skills-token-ratchet.mjs +++ b/scripts/check-skills-token-ratchet.mjs @@ -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 @@ -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 @@ -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 diff --git a/skills/objectstack-ai/SKILL.md b/skills/objectstack-ai/SKILL.md index 3215031f60e..f155dfe5b13 100644 --- a/skills/objectstack-ai/SKILL.md +++ b/skills/objectstack-ai/SKILL.md @@ -185,7 +185,6 @@ export default defineAction({ label: 'Ask AI', objectName: 'contract', type: 'ask_ai', - locations: ['record_header'], }); ``` diff --git a/skills/objectstack-ui/SKILL.md b/skills/objectstack-ui/SKILL.md index 2c9d8a83e8a..2c14f9ea962 100644 --- a/skills/objectstack-ui/SKILL.md +++ b/skills/objectstack-ui/SKILL.md @@ -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' });" } } ``` diff --git a/skills/objectstack-ui/rules/actions.md b/skills/objectstack-ui/rules/actions.md index 182d6f87868..03c49d94aed 100644 --- a/skills/objectstack-ui/rules/actions.md +++ b/skills/objectstack-ui/rules/actions.md @@ -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 }], @@ -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.', @@ -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'], }); ``` @@ -202,7 +199,6 @@ export const OpenInvoicePdfAction = defineAction({ target: 'crm_open_invoice_pdf', opensInNewTab: true, newTabUrl: '/api/v1/invoice/{recordId}/pdf', - locations: ['record_header'], }); ``` @@ -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 },