Skip to content

Commit 2f2a0b2

Browse files
os-litantclaude
andauthored
skills(formula): optimization flight — cut the cron/template quickrefs and section-5 narration, teach virtual formula fields and fault-open form predicates (net −844 tokens) (#14563)
* skills(formula): collapse cron + template surfaces to one row each (FRM-F-06 / A-01 / G-05 / B-04 / F-07) The frontmatter routes cron away ("Do not use for ... cron schedules") while the body taught it across four sections; the corpus authors zero of it (`cron` 0, `tmpl` 0, any formatter 0). Both are live surfaces, so each keeps ONE schema-pointing row with its carriers; the two quick-reference sections and the formatter table go. - FRM-F-06 / A-01: `### Cron surfaces`, `### Template surfaces`, `## Cron quick reference` and `## Template quick reference` collapse into one `### Cron and template surfaces` table, two rows, pointing at `shared/expression.zod.ts` for the full carrier list. - FRM-G-05: the deprecated `visibleOn` / `visibility` alias row leaves the CEL surfaces table; the two `Object.titleFormat` notes dedupe to one carrier cell. - FRM-B-04: the third "no js dialect" restatement goes; the canonical one in Core contract stays. - FRM-F-07: the view-list-filter prohibition now names the alternative it was withholding — date macro tokens, with the pointer to objectstack-query `rules/filters.md`. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LraLgQVGq8egUwfYZpbYt1 * skills(formula): diet section 5 — drop cost narration and the pre-17 history (FRM-D-05 / D-04 / B-03) Section 5 was 20.7% of the file (1,241 tok). The rules in it are load-bearing; the narration around them was not. - FRM-D-04: the pre-protocol-17 `logger.warn` history goes. Two rules were buried in it and survive in one sentence: `before*` and `after*` abort alike with no `onError` escape, and a condition that does not compile aborts the same way. - FRM-D-05: the `before*` exception restated the table row above it at 165 tokens — it is now one clause pointing back at that row. The per-row bulk semantics keep their ADR-0058 statement; the query-count and fetch-cost narration goes. - FRM-B-03: the `has()`-on-a-declared-field rule was stated once for `record` and again for `previous`. It is now one statement covering both, in the `has()` section where the rule lives. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LraLgQVGq8egUwfYZpbYt1 * skills(formula): cut retired history, roadmap and self-restatement (FRM-D-01 / B-07 / B-06 / D-09 / D-07 / D-02 / B-05 / D-03 / G-03 / G-01 / G-02 / G-04 / E-03) - FRM-D-01 / B-07: "Strategic context" — why CEL was picked over the deleted Salesforce-flavor engine — was the first content after the H1. An author emitting a predicate does not need the engine-selection history. - FRM-B-06: ADR-0032 was stated three times, and "Verify your work" cross-refs the top-of-file note that carried it. One statement now, in "Verify your work", and it keeps both halves the callout had: build fails with a located did-you-mean, and the runtime throws. - FRM-D-09: the `type Expression` block transcribed `shared/expression.zod.ts`. One sentence and the pointer replace it. - FRM-D-07 / D-02: "you do not learn three languages" and the roadmap for emitting `ast` go; the envelope rule they both carried survives once. The auto-wrap fact moved to the cron/template row in the previous commit. - FRM-B-05: "Determinism contract" restated the seed pattern's own note. The three numbered conditions fold into that note. - FRM-D-03 / G-03: "Open questions" cited `CelExprSchema` twice; the symbol exists nowhere in the repo (0 hits outside this file). - FRM-G-01: the CLI is `os`, not `objectstack` — 5 mentions, now 0. - FRM-G-02: the frontmatter pins 17.x; the retired milestone numbers are gone. - FRM-G-04: a CEL string literal takes either quote; the corpus writes double quotes inside P` ` more than ten times, so "(always)" was false. - FRM-E-03: `* 100.0` was a cel-js workaround. `registerNumericCoercions` (`packages/formula/src/stdlib.ts`) registers the mixed `double op int` / `int op double` overloads, so `* 100` is correct now. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LraLgQVGq8egUwfYZpbYt1 * skills(formula): teach the three contract facts the package omitted (FRM-F-01 / F-03 / F-02 / F-04 / B-01 / B-02 / E-01 / D-08) The corpus measurement behind these: `type: 'formula'` fields have zero live usages and the only hits are a removal test; flow/trigger conditions are authored five times and the scope was taught wrong; field conditional rules are the second-commonest task and two of their roots were missing. - FRM-F-01: a `formula` field is virtual — `where` / `orderBy` / `searchableFields` on one are refused `400 INVALID_FIELD` at both doors (`packages/spec/src/migrations/entries/semantic/17.engine-find-formula-filter-refused.ts`; `packages/objectql/src/filter-comparand-shape.ts`). The filter and sort axes were taught nowhere in the catalog. Remedy is the stored column, in the same words the sort and search axes already use. - FRM-F-03: a form-view `visibleWhen` is client-side only and faults OPEN (`packages/spec/src/ui/view.zod.ts` `FormFieldSchema` / `FormSectionSchema`; `packages/metadata-core/src/form-predicate-root-policy.ts`). The package taught fault-closed globally, so the note says where each holds. - FRM-F-02: the `parent` root (line-item cell `readonlyWhen` / `requiredWhen`, `packages/spec/src/data/field.zod.ts`) and the `data` root (metadata-editing forms, `BOUND_FORM_VIEW_PREDICATE_ROOTS`) join the cheat-sheet. - FRM-F-04: flow conditions bind bare identifiers — the automation engine spreads the record's variables to top level (`packages/services/service-automation/src/engine.ts`). The translation table's first row implied the opposite universally. - FRM-B-02 / B-01: the `node_modules/@objectstack/formula/` pointer named a package that ships `dist` only, which this file already says is unreadable. Its slot goes to `references/_index.md`, which every other domain package links and this one orphaned. - FRM-E-01: the predicate pattern block is now type-checked. Both previously marked blocks were the cron and template quick references, so no "Mandatory pattern" was checked at all. - FRM-D-08: the no-date-arithmetic rule carried five prescriptions as prose. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LraLgQVGq8egUwfYZpbYt1 * skills(formula): say this is the companion package, and stop routing cron away (FRM-A-02 / A-01) Four host skills end their description with "load objectstack-formula alongside" (objectstack-data, -ui, -api, -automation); this one never said it was that companion, so an author reading it cold had no way to know why it had been loaded. FRM-A-01: the description also said "Do not use for ... cron schedules" while the body taught cron across four sections. The body now carries one schema-pointing cron row, so the exclusion goes and the Skill Boundaries table keeps the routing to objectstack-automation. `skills/README.md` and `content/docs/ai/skills-reference.mdx` are the generator output of `pnpm --filter @objectstack/spec gen:skill-docs` — both move, and nothing in them is hand-edited. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LraLgQVGq8egUwfYZpbYt1 * skills(formula): regenerate skill docs after merging main Generator output only (`pnpm --filter @objectstack/spec gen:skill-docs`), re-run after the merge so it derives from all 11 SKILL.md files at the merged tree rather than at the pre-merge one. The whole diff is the FRM-A-02 description edit; nothing here is hand-written. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LraLgQVGq8egUwfYZpbYt1 * skills(formula): correct the sort refusal code and the cron/template pointer (contract review round 1) Two spans failed in-seat contract review; both were verified at source before editing and both are paid in-file — the file lands back on 5,158 tokens exactly, no growth. FAIL 1 (FRM-F-01, the query-axis note). The three axes do not share one error code. `where` and `searchableFields` answer `400 INVALID_FIELD`, but `orderBy` answers `400 INVALID_SORT` — `assertOrderByIsMaterializable` sets `err.code = 'INVALID_SORT'` at the engine seam (`packages/objectql/src/engine.ts`), and `assertSortFieldsExist` does the same at the ingress. An agent branching on the code would have branched wrong on the sort refusal. Both codes are now named. FAIL 2 (the cron/template pointer). The paragraph sent readers to `shared/expression.zod.ts` for "the formatter whitelist and the cron alias set", and that file carries neither. Worse, the sets used to live in the quick references this flight deleted, so the pointer was the last mention of both — and this same file correctly says `@objectstack/formula` ships `dist` only, so "go read it" resolves to nothing. Now: the seven aliases are inlined in the cron row from `packages/formula/src/cron-engine.ts`, the template row names `TEMPLATE_FORMATTERS` (really exported from `@objectstack/formula`, derived from the formatter table in `packages/formula/src/template-engine.ts`) as the introspectable whitelist, and the `expression.zod.ts` pointer is narrowed to the carrier lists it does declare. Paid by cutting narration of the same class this flight exists to remove: the `asc`/`desc` anecdote from the new note, and the Skill Boundaries cron parenthetical now that the surfaces table names `Job.schedule.expression` and the dialect. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LraLgQVGq8egUwfYZpbYt1 --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 1007134 commit 2f2a0b2

3 files changed

Lines changed: 105 additions & 207 deletions

File tree

content/docs/ai/skills-reference.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ ObjectStack ships **11 skills** — one per authoring domain, plus process skill
5151
| 6 | [AI](#ai) | `ai` | `skills/objectstack-ai/` | Design ObjectStack AI skills, tools, knowledge sources, conversations, model registry entries, and MCP integrations. |
5252
| 7 | [API](#api) | `api` | `skills/objectstack-api/` | Design the server-side API surface that an ObjectStack runtime exposes — REST endpoints, auth providers, realtime channels, error envelopes, batch contracts. |
5353
| 8 | [i18n](#i18n) | `i18n` | `skills/objectstack-i18n/` | Author ObjectStack translation bundles — object/field labels, view text, app navigation strings, automation messages — and configure locale fallback, coverage reporting, and the per-locale source layout. |
54-
| 9 | [Formula](#formula) | `expression` | `skills/objectstack-formula/` | Author CEL expressions used across ObjectStack — formula fields, field conditional rules (`visibleWhen`, `readonlyWhen`, `requiredWhen`), validation / sharing / visibility predicates, flow conditions, and dynamic seed values. |
54+
| 9 | [Formula](#formula) | `expression` | `skills/objectstack-formula/` | Author CEL expressions used across ObjectStack — formula fields, field conditional rules (`visibleWhen`, `readonlyWhen`, `requiredWhen`), validation / sharing / visibility predicates, flow conditions, and dynamic seed values. This is the companion skill that objectstack-data, -ui, -api and -automation each tell you to load alongside them. |
5555
| 10 | [PM Dispatch](#pm-dispatch) | `process` | `skills/objectstack-pm-dispatch/` | Run a project-manager dispatch loop over a GitHub backlog: triage and queue ready issues, claim each one, dispatch it to a parallel developer agent that returns a structured JSON report, review the results against GitHub, and drive accepted pull requests to landing — escalating to the maintainer only what genuinely needs a human decision. Ships the developer-agent operating template the loop injects into every dispatch (no custom agent types required). |
5656
| 11 | [Upgrade](#upgrade) | `process` | `skills/objectstack-upgrade/` | Upgrade an ObjectStack metadata project across a protocol major — run the deterministic conversion chain, then work the semantic residue the chain cannot express (intent choices, custom code on retired APIs, stale prose) to a decision with the project's owner, and finish with a green `validate` plus a human-readable upgrade report. |
5757

@@ -173,11 +173,11 @@ Do not use for general i18n library questions unrelated to ObjectStack bundles.
173173

174174
**Domain** `expression` · **Path** `skills/objectstack-formula/`
175175

176-
Author CEL expressions used across ObjectStack — formula fields, field conditional rules (`visibleWhen`, `readonlyWhen`, `requiredWhen`), validation / sharing / visibility predicates, flow conditions, and dynamic seed values.
176+
Author CEL expressions used across ObjectStack — formula fields, field conditional rules (`visibleWhen`, `readonlyWhen`, `requiredWhen`), validation / sharing / visibility predicates, flow conditions, and dynamic seed values. This is the companion skill that objectstack-data, -ui, -api and -automation each tell you to load alongside them.
177177

178178
Use when the user is writing an `F`, `P`, or `cel` tagged-template literal, or asks "how do I express X as a formula / predicate".
179179

180-
Do not use for SQL fragments (driver-native), cron schedules (cron dialect), or L2 hook bodies (those belong in objectstack-data).
180+
Do not use for SQL fragments (driver-native) or L2 hook bodies (those belong in objectstack-data).
181181

182182
**Tags:** `cel`, `formula`, `predicate`, `condition`, `validation`, `visibility`, `seed-dynamic`
183183

skills/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ apps too).
3737
| [AI](./objectstack-ai/SKILL.md) | `ai` | Design ObjectStack AI skills, tools, knowledge sources, conversations, model registry entries, and MCP integrations. |
3838
| [API](./objectstack-api/SKILL.md) | `api` | Design the server-side API surface that an ObjectStack runtime exposes — REST endpoints, auth providers, realtime channels, error envelopes, batch contracts. |
3939
| [i18n](./objectstack-i18n/SKILL.md) | `i18n` | Author ObjectStack translation bundles — object/field labels, view text, app navigation strings, automation messages — and configure locale fallback, coverage reporting, and the per-locale source layout. |
40-
| [Formula](./objectstack-formula/SKILL.md) | `expression` | Author CEL expressions used across ObjectStack — formula fields, field conditional rules (`visibleWhen`, `readonlyWhen`, `requiredWhen`), validation / sharing / visibility predicates, flow conditions, and dynamic seed values. |
40+
| [Formula](./objectstack-formula/SKILL.md) | `expression` | Author CEL expressions used across ObjectStack — formula fields, field conditional rules (`visibleWhen`, `readonlyWhen`, `requiredWhen`), validation / sharing / visibility predicates, flow conditions, and dynamic seed values. This is the companion skill that objectstack-data, -ui, -api and -automation each tell you to load alongside them. |
4141
| [PM Dispatch](./objectstack-pm-dispatch/SKILL.md) | `process` | Run a project-manager dispatch loop over a GitHub backlog: triage and queue ready issues, claim each one, dispatch it to a parallel developer agent that returns a structured JSON report, review the results against GitHub, and drive accepted pull requests to landing — escalating to the maintainer only what genuinely needs a human decision. Ships the developer-agent operating template the loop injects into every dispatch (no custom agent types required). |
4242
| [Upgrade](./objectstack-upgrade/SKILL.md) | `process` | Upgrade an ObjectStack metadata project across a protocol major — run the deterministic conversion chain, then work the semantic residue the chain cannot express (intent choices, custom code on retired APIs, stale prose) to a decision with the project's owner, and finish with a green `validate` plus a human-readable upgrade report. |
4343

0 commit comments

Comments
 (0)