Skip to content

feat(autonumber): document tokens in data skill + lint unrecognized format tokens#2046

Merged
os-zhuang merged 1 commit into
mainfrom
claude/autonumber-authoring-guardrails
Jun 19, 2026
Merged

feat(autonumber): document tokens in data skill + lint unrecognized format tokens#2046
os-zhuang merged 1 commit into
mainfrom
claude/autonumber-authoring-guardrails

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Follow-up to #2043. The runtime guards landed there; this closes the AI-authoring gap, per the AI-authoring-guardrails north star (templates are AI-written, so the fix belongs in the skill the AI reads + a deterministic build lint).

Why

After #2043 the objectstack-data skill's field-types rules still documented autonumber as just CASE-{0000} — no mention of the new date / {field} / per-scope tokens, and none of the rules that prevent silent mis-numbering. An AI modeling from that skill would neither use the new capability nor avoid the footguns.

Changes

Skill rules (skills/objectstack-data/rules/field-types.md) — expanded the autonumber section:

  • token table ({0000} counter, {YYYY}/{MM}/{DD}/{YYYYMMDD} date, {field} interpolation) + per-scope reset explanation
  • four authoring rules: interpolated {field} must be required; delimiter between adjacent variable tokens; pad width is a minimum (grows, never wraps); date tokens are exact & case-sensitive
  • an incorrect → correct example
  • updated the field-type summary table row

Compile lint (lint-autonumber-formats.ts) — new advisory rule autonumber-unrecognized-token: an autonumber {...} group that is not a counter/date/{field} token renders literally into the record number. The existing {field}-reference checks catch identifier-shaped typos (they parse as "unknown field" errors), but miss non-identifier cases — { YYYY } (spaces), {YYYY-MM} (punctuation), and a second {0..0} slot. These now warn.

Scope notes

  • No new skill and no separate docs-site page — the deterministic build lint + existing skill rules are the right mechanism (guardrails in the build, not just advisory), matching lintFlowPatterns / lintLivenessProperties.
  • Warnings only (fragile, not broken) — they never fail the build.

Tests

lint-autonumber-formats.test.ts: +3 cases (unrecognized token, second sequence slot, valid date tokens stay clean). CLI suite 496/496; package builds (tsc) clean.

🤖 Generated with Claude Code

…rmat tokens

Follow-up to #2043 — close the AI-authoring gap on top of the runtime guards:

- skills/objectstack-data field-types rules: the autonumber section only showed
  `CASE-{0000}`. Expanded with the date / {field} / per-scope tokens and the
  authoring rules that prevent silent mis-numbering — interpolated fields must be
  required, put a delimiter between adjacent variable tokens, pad width is a
  minimum, date tokens are exact/case-sensitive — plus an incorrect/correct example.

- compile lint: warn when an autonumber `{...}` token is not a counter/date/{field}
  token. Unrecognized groups (wrong case, spaces, a second {0..0} slot) render
  LITERALLY into the record number; the field-reference checks miss the
  non-identifier cases. New advisory rule `autonumber-unrecognized-token`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 19, 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 19, 2026 10:39am

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests tooling labels Jun 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/cli.

15 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/concepts/cloud-artifact-api.mdx (via packages/cli)
  • content/docs/concepts/implementation-status.mdx (via @objectstack/cli)
  • content/docs/concepts/packages.mdx (via @objectstack/cli)
  • content/docs/getting-started/cli.mdx (via @objectstack/cli)
  • content/docs/getting-started/quick-start.mdx (via @objectstack/cli)
  • content/docs/guides/authentication.mdx (via @objectstack/cli)
  • content/docs/guides/client-sdk.mdx (via @objectstack/cli)
  • content/docs/guides/hook-bodies.mdx (via packages/cli)
  • content/docs/guides/packages.mdx (via @objectstack/cli)
  • content/docs/guides/project-scoping.mdx (via @objectstack/cli)
  • content/docs/guides/runtime-services/data-service.mdx (via packages/cli)
  • content/docs/guides/runtime-services/index.mdx (via packages/cli)
  • content/docs/guides/skills.mdx (via packages/cli)
  • content/docs/protocol/objectos/plugin-spec.mdx (via @objectstack/cli)
  • content/docs/protocol/objectos/realtime-protocol.mdx (via @objectstack/cli)

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

@os-zhuang
os-zhuang merged commit c651f38 into main Jun 19, 2026
16 checks passed
@os-zhuang
os-zhuang deleted the claude/autonumber-authoring-guardrails branch June 19, 2026 10:55
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 tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant