You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* docs(skills): hook examples author with defineHook(), not bare `: Hook` literals (#4274)
#4273 shipped defineHook() and pointed docs + error prescriptions at it,
but skills/objectstack-data — the first thing an AI author reads — still
taught the bare-literal form in 18 places across SKILL.md,
rules/hooks.md, rules/validation.md, and references/data-hooks.md.
Mechanical rewrite: `const x: Hook = {…}` → `const x = defineHook({…})`
(imports switched to the value import), plus the factory-over-bare-literal
note in rules/hooks.md and references/data-hooks.md, phrased identically
to the schema.mdx note from #4273. Every rewritten block was scanned for
unknown top-level keys — HookSchema is strict, so a stray key inside a
defineHook() example would teach a crash — none found; the os:check gate
covers the tagged blocks (198 examples green).
Closes#4274
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* chore: empty changeset — docs-only PR, releases nothing
Same convention as #4279: the changeset gate wants an explicit statement
of release intent, and skills/ ships in no npm package.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
The `handler` above is the inline (in-process) form. The **preferred**,
@@ -433,7 +431,7 @@ Mirror these CRM-style patterns when designing enterprise metadata objects:
433
431
| Capability gating |`src/objects/*.object.ts`| Use `enable` flags (`trackHistory`, `apiMethods`, `files`, `feeds`, `activities`) per object |
434
432
| Index + validation pairing |`src/objects/*.object.ts`| Keep `indexes[]` aligned to common filters and enforce invariants with `validations[]`|
435
433
| Relationship constraints |`src/objects/*.object.ts`| Use `lookup` + `lookupFilters` (`[{ field, operator, value }]`) for constrained child selection |
436
-
| Lifecycle automation |`src/objects/*.hook.ts`| Use a lifecycle **hook** (a `Hook` object registered via `defineStack({ hooks })`) or a top-level `record_change` flow for field updates triggered by record changes. There is **no** object-level `workflows[]` field — authoring one is a build error (#1535). |
434
+
| Lifecycle automation |`src/objects/*.hook.ts`| Use a lifecycle **hook** (authored with `defineHook()`, registered via `defineStack({ hooks })` or the `*.hook.ts` convention scan) or a top-level `record_change` flow for field updates triggered by record changes. There is **no** object-level `workflows[]` field — authoring one is a build error (#1535). |
437
435
| State transitions |`src/objects/*.object.ts`| Prefer explicit `state_machine` validation rules (one per state field) — there is **no** separate `stateMachines` map |
438
436
439
437
For metadata authoring, keep expressions in CEL (`P\`...\``, `F\`...\``,
0 commit comments