Skip to content

docs(skills): author the 16 factory domains via defineX, not bare literals (#2035)#2124

Merged
xuyushun441-sys merged 1 commit into
mainfrom
docs/skills-factory-migration
Jun 21, 2026
Merged

docs(skills): author the 16 factory domains via defineX, not bare literals (#2035)#2124
xuyushun441-sys merged 1 commit into
mainfrom
docs/skills-factory-migration

Conversation

@xuyushun441-sys

Copy link
Copy Markdown
Contributor

Follow-up to the #2035 epic. The examples were migrated to defineX factories (#2088/#2095) and a lint guard keeps them clean — but the skills and hand-written docs still taught the old bare-literal pattern. Since skills are the corpus AI authors from, that directly undercut the whole point: AI would keep copying : Action = {} (the output-type footgun) from the very guide meant to teach the right way.

What changed

Converted every bare metadata literal for the 16 factory domains to its defineX(...) call:

File conversions
skills/objectstack-ui/SKILL.md 8 — Page / Action / Report / Cube
content/docs/guides/security.mdx 8 — PermissionSet / SharingRule
content/docs/guides/standards.mdx 2
content/docs/concepts/index.mdx 2
content/docs/concepts/architecture.mdx, getting-started/architecture.mdx, protocol/objectui/record-alert.mdx 1 each

Block-aware migration: imports are rewritten in place (preserving each block's import source — root @objectstack/spec vs subpath) or injected where the snippet had none. Pre-existing defineView/defineFlow examples are left untouched.

Verification

  • 0 bare : <Domain> = { literals remain in skills/ or content/docs/.
  • 23 conversions, all closers balanced; multi-imports (ConvertLeadAction, P) preserved.
  • pnpm --filter @objectstack/spec check:skill-docs → ✅ in sync (generated references come from frontmatter, unchanged).
  • examples/apps were already clean (lint guard) — confirmed 0 there.

Notes

  • Docs-only — no package code, no changeset (the gate's pending-changeset count is already > 0).
  • Root cause: MDX/skill code blocks are not type-checked by any gate, so they drifted while examples (which are) stayed clean. A lightweight MDX code-block lint would prevent recurrence — noted as a separate follow-up, not in this PR.

🤖 Generated with Claude Code

…erals (#2035)

The example apps were migrated to the `defineX` factories in #2088/#2095 and a
lint guard keeps them clean — but the skills and hand-written docs still taught
the old bare-literal pattern (`: Page = {}`, `: Action = {}`, `: PermissionSet
= {}`, …). Skills are the corpus AI authors from, so this directly undercut the
#2035 north star: leaving the unsafe pattern as the thing AI copies.

Converts every bare output/Input-type metadata literal for the 16 factory
domains to its `defineX(...)` factory call, across:
  - skills/objectstack-ui/SKILL.md (8: Page/Action/Report/Cube)
  - content/docs/guides/security.mdx (8: PermissionSet/SharingRule)
  - content/docs/{guides/standards,concepts/index,concepts/architecture,
    getting-started/architecture,protocol/objectui/record-alert}.* (7)

Imports are rewritten in place (preserving each block's import source — root vs
subpath) or injected where the snippet had none. Pre-existing `defineView` /
`defineFlow` examples are untouched. `check:skill-docs` stays green (generated
references come from frontmatter, unchanged).

Docs-only — no package code, no changeset. Code blocks in MDX/skills are not
type-checked by any gate, which is why they drifted; a lightweight MDX code-block
lint is noted as a separate follow-up.
@vercel

vercel Bot commented Jun 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 21, 2026 11:14am

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation size/m labels Jun 21, 2026
@xuyushun441-sys
xuyushun441-sys merged commit 2e8fa44 into main Jun 21, 2026
15 checks passed
@xuyushun441-sys
xuyushun441-sys deleted the docs/skills-factory-migration branch June 21, 2026 11:17
xuyushun441-sys added a commit that referenced this pull request Jun 21, 2026
…2127)

Closes the drift root cause found while updating the docs (#2124): TypeScript
code blocks in Markdown/MDX are not type-checked or ESLinted, so skills/ and
content/docs/ silently drifted back to teaching the bare `: Page = {}` literal
while the example apps — which the ESLint guard polices — stayed clean. Skills
are the corpus AI authors from, so a stale sample there is the worst place for it.

`scripts/check-doc-authoring.mjs` (dependency-free) scans every ```ts/typescript/
tsx fenced block under skills/ and content/ for an exported metadata literal
annotated with one of the 16 factory domains (or its Input alias) instead of the
`defineX(...)` factory, and fails with file:line + guidance. Generated files
(references/, the frontmatter-generated skills.mdx) are skipped.

Wired into lint.yml's ESLint job via `pnpm check:doc-authoring` (no build, no new
dep). Verified: 160 files clean on current main (#2124 migration holds); teeth
confirmed — flags a bare `: Page` block, ignores `definePage({...})`.

CI-only — no package code, no changeset.

Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
os-zhuang added a commit that referenced this pull request Jul 1, 2026
feat(fields): inline-edit structured-value fields (color/address/location/geo/code/qrcode) (#2124)

objectui@69d6b94419bcae9d3a200268bb3b74371906f4ae
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants