Skip to content

Commit afbd903

Browse files
feat(skills): objectstack-project, a process skill for metadata-app projects (#35221)
<!-- claude-projects-attribution: {"github_login":"os-warren"} --> _Requested by **Warren** · [project thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8Na6HfgLSzUXJakidM4aJmV)_ Part of #35218 (the scaffold CI `pnpm test` step follows in its own PR; see Scope change) Clause-②: no Metadata-protocol: none ## 维护者速读 - **改了什么**:新增对外发布的技能 `objectstack-project`(207 行,2901 token):元数据应用项目怎么跑——先问「应用还是平台」「自用还是产品」,各阶段写什么,应用自己测什么、`os validate` / `os lint` / `os verify` 已经查了什么,平台缺陷不在应用里绕,给客户的变更说明,升平台版本与升级时的客户数据(回填脚本)。模板 AGENTS.md 用五行指向该技能替掉只列 9 个技能的手写表,加三行 PR 模板。 - **为什么改**:12 个技能只教怎么写元数据,没有一个教怎么跑一个元数据项目;平台技能教 `LiteKernel`、脚手架样板测试却用 `@objectstack/verify`,两边打架。范围按卡片 v1 和独立评审,分诊/分级附录留到以后。 - **风险与回滚**:只加文本和脚手架模板,不动运行时;脚手架 CI 不变。回滚即 revert。新技能每次客户会话多 2901 token,天花板行随本 PR 新增,是需要你批的定价动作。 - **先看**:`skills/objectstack-project/SKILL.md`(§0 两问与默认轻流程、§2 平台检查表、§5 回填写法);`packages/create-objectstack/src/templates/AGENTS.md`;`scripts/check-skills-token-ratchet.mjs` 末尾新行。 - **两分钟验证**:`node scripts/check-skills-token-ratchet.mjs` 末行全绿,`skills/objectstack-project/SKILL.md 2901 / 2901`;`pnpm --filter create-objectstack exec vitest run` 通过。 - **需要你做的**:受管面(`skills/**`)Tier H,需 os-zhuang 在 GitHub 上 Approve。 ## What changes **A new published process skill, `skills/objectstack-project/`** (`metadata.domain: process`, `SKILL.md` alone plus evals): - §0 Two opening questions: app or platform (the platform's own deciding question, generalised), and own use or product. Product-only steps are marked ★; the light path is the default, and a one-person label change is told explicitly not to grow a requirement record, design note or changeset. - §1 One stage × document table (requirement, design, issue, build, test, acceptance, user docs, release, upgrade), a design checklist, and a requirement template the skill creates the first time one is needed. No empty files are scaffolded. - §2 The test boundary. A table of what this version's `os validate`, `os lint`, `os verify` and `tsc` check, read from `packages/lint/src/authoring-rules.ts`, `packages/cli/src/commands/{validate,lint,verify,explain}.ts` and `packages/verify/README.md`; it says plainly that `os verify` runs nowhere by default. The app pins business facts with `bootStack`; a consistency check the table lacks is a platform gap, carried as a `// PLATFORM-GAP:` test and retired only after the platform command fails on the same injected defect. - §3 Platform gaps: no workaround in the app, file upstream, block the app issue (and exempt the label from stale bots), unblock only when the fix is installable. - §4 ★ Changesets written for the customer's administrator; a breaking change states FROM → TO, the minimum `@objectstack/*` version and the steps; `manifest.version` is what `os package publish` ships. - §5 Bumping `@objectstack/*` together and re-syncing skills; data already installed (`os migrate`, `renamedFrom`) and the backfill-script rules (old release, REST only, report by default, `--apply`, idempotent). - §6 Pointers to the 12 other skills. - Evals: `project-process.json` (platform defect, refuse a hand-written reference-integrity test, business-fact test, dropping a field in a product, pin bump, and the one-person counter-example) and `triggers.json` (8 should / 6 near misses). **Catalog wiring**: `DISPLAY` row in `packages/spec/scripts/build-skill-docs.ts`; regenerated index in `skills/README.md` and `content/docs/ai/skills-reference.mdx`; one routing line in `skills/README.md`; `objectstack-platform/references/operations.md` scopes `LiteKernel` to plugin tests and points app tests here, and `objectstack-data/references/data-hooks.md` routes an app's hook tests here (both inside their files' headroom). **Token ratchet**: an initial `CEILINGS` row for the new `SKILL.md`, pinned at its measurement, zero headroom, on the same terms as the `objectstack-ask` row. **Scaffold** (`create-objectstack`): the template `AGENTS.md` replaces its nine-row skill table with a pointer to this skill (Copilot and Cursor read only `AGENTS.md`); a three-line `.github/pull_request_template.md`. Out of scope, per the card: the triage/grading appendix, a growth guide, a docs-site guide, a tag-time changeset check, a reusable workflow; no fleet machinery and no hotcrm-specific standard is published. Trimming hotcrm's own `docs/PRIORITIES.md` to hotcrm-only content belongs to hotcrm's rollout. ## Scope change The card's scaffold item "CI runs `pnpm test`" is not in this PR. Added to the blank template's `ci.yml`, it failed Test Core on 5df09d0: `packages/cli/test/scaffold-ci-script-parity.test.ts` requires `os init -t app` and `-t empty` to declare every script that workflow runs, and `scaffold-test-script-passes.test.ts` requires every template declaring `test` to ship a passing starter test (an empty suite must fail, so `--passWithNoTests` is out). That needs starter tests in both scaffolders, which is its own change; it follows on this branch after this PR merges, and #35218 stays open for it. Until then the skill tells a project to add the step to its own `ci.yml`. ## Contract review round 1 (comment 6987080580, head c363bb7) PASS with six should-fixes and three nits, all addressed in ffab0f1: `os init` projects have no `test` script yet (S1); only errors fail `validate`/`lint`, `--strict` makes warnings fail (S2); `os explain` lists explained rules only, an injected defect settles whether a check exists (S3); backfill secrets come from the environment or a prompt (S6); `data-hooks.md` re-pointed (S5). S4 (description vs trigger negatives): the description and the scaffold `AGENTS.md` pointer now name the decision the skill serves ("deciding where a change belongs or what to write before building") instead of every feature start, so adding a field or a view does not load 2900 tokens; the three negatives stay. Delta review on the new head follows. ## Tests - `create-objectstack`: full vitest run, 25 files / 381 tests pass. - Skill gates, all green on the final tree: `check:skill-compatibility`, `check:skill-links`, `check:skill-identifier-liveness`, `check:skill-top-level-keys`, `check:skill-frame-sync`, `check:role-word`, `check-skills-token-ratchet` (+ `--self-test`), `check:skill-docs`, `check:skill-refs`, changeset gates. - The gate families `scripts/pm/dispatch-gates.mjs` derives for this file surface were run locally; results in Verification. ## Acceptance notes - **Does a re-sync bring a newly added skill into an already-installed app?** (the card's open item) Measured: a throwaway app depending on a local copy of `@objectstack/skills` without this skill, synced with `npx skills@1.7.2 experimental_sync --agent claude-code --copy -y` (12 skills), then moved to a copy with it and re-synced: `Synced 13 skills`, `.claude/skills/objectstack-project` present, and `skills-lock.json` names it. - Model tier: `dispatch-gates.mjs` marks `skills/**` MANDATORY fable. The skill text and evals were reviewed and revised by a fable-tier pass against the source files named above before this PR opened. ## Token readings (published bundle) | | before (main) | after | |:--|--:|--:| | `skills/objectstack-project/SKILL.md` | — | 2901 | | `skills/objectstack-platform/references/operations.md` | 3388 | 3389 (ceiling 3394, unchanged) | | `skills/objectstack-data/references/data-hooks.md` | 9996 | 10001 (ceiling 10011, unchanged) | | ratcheted authored total | 191936 | 194843 | | eval fixtures (not ratcheted) | 60854 | 63204 | ## Verification Local runs: - 54 of the 60 non-build gate families `dispatch-gates.mjs` derives: exit 0 on 5df09d0. - `check:role-word` reported one new reserved word in the skill; reworded ("who sees which records") and green. - Five families need built `dist/` trees (`check:doc-formula-expressions`, `check:doc-security-posture`, `check:docs`, `check:skill-examples`, `check:docs-transcript-drift`) and stopped at their prerequisite (exit 3, not a finding); CI runs them on this PR. - After the scope change (c363bb7): token ratchet, `check:role-word`, `check:skill-links`, `check:skill-compatibility`, `check:skill-identifier-liveness` and `check:skill-docs` green; `create-objectstack` 25 files / 381 tests pass. The blank template's `ci.yml` and `template-ci-workflow.test.ts` are byte-identical to `main`, so the cli scaffold parity pins see main's inputs. - After the review fixes (ffab0f1): the same skill gates plus `check:skill-top-level-keys`, `check:skill-frame-sync` and the ratchet `--self-test` green; `create-objectstack` 25 files / 381 tests pass. --- _Generated by [Claude Code](https://claude.ai/code/session_01JQwxbWfVxrJ6N3xZaG1Eoe)_ <!-- signed: epic:#35205#2 · os-warren · session_01JQwxbWfVxrJ6N3xZaG1Eoe --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent cdb327f commit afbd903

13 files changed

Lines changed: 483 additions & 23 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
'@objectstack/skills': patch
3+
'create-objectstack': patch
4+
---
5+
6+
feat(skills): a process skill for running a metadata-app project
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
The skills catalog gains `objectstack-project`. The domain skills teach how to write each kind of metadata; this one teaches how a change moves through an app project: whether it belongs in the app or the platform, what to write at each stage, what the app tests itself (with `bootStack` from `@objectstack/verify`) and what `os validate`, `os lint` and `os verify` already check, how a platform defect is handled without a workaround, how a change is described for customers, and how to bump `@objectstack/*` and carry customer data across an upgrade with a backfill. Steps that matter only to an app shipped to customers are marked, and the light path is the default.
12+
13+
A project that already syncs its skills gets the new one on its next `npx skills@1.7.2 experimental_sync --agent <runtime> --copy -y` after bumping `@objectstack/skills`.
14+
15+
`npm create objectstack` projects now:
16+
17+
- point `AGENTS.md` at `objectstack-project` in place of its hand-written skill table, which listed nine of the catalog's skills;
18+
- carry a three-line `.github/pull_request_template.md`: what a user can do now, how it was checked, which docs changed.
19+
20+
Existing projects are not changed.

‎content/docs/ai/skills-reference.mdx‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ npm create objectstack@latest my-app
4545

4646
{/* BEGIN GENERATED: skills (packages/spec/scripts/build-skill-docs.ts) — DO NOT EDIT */}
4747

48-
ObjectStack ships **12 skills** — one per authoring domain, plus process skills for how a project is delivered. Each is self-contained: an AI assistant loads only the ones a task needs.
48+
ObjectStack ships **13 skills** — one per authoring domain, plus process skills for how a project is delivered. Each is self-contained: an AI assistant loads only the ones a task needs.
4949

5050
## Quick Reference
5151

@@ -62,7 +62,8 @@ ObjectStack ships **12 skills** — one per authoring domain, plus process skill
6262
| 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. |
6363
| 10 | [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. |
6464
| 11 | [Ask](#ask) | `process` | `skills/objectstack-ask/` | Answer a business question over a live ObjectStack environment through its MCP tools (list_datasets, query_dataset, list_objects, describe_object, query_records, aggregate_records): find the governed metric the question names, compute it and cite its source, or fall back to an object query and say so. |
65-
| 12 | [ObjectUI](#objectui) | `ui` | `skills/objectui/` | Universal Server-Driven UI (SDUI) engine for building JSON-driven React interfaces with Shadcn design quality. |
65+
| 12 | [Project](#project) | `process` | `skills/objectstack-project/` | Run an ObjectStack metadata-app project: decide whether a change belongs in the app or the platform, what to write before building, what the app tests and what the platform already checks, how a change is described for customers, released and upgraded. |
66+
| 13 | [ObjectUI](#objectui) | `ui` | `skills/objectui/` | Universal Server-Driven UI (SDUI) engine for building JSON-driven React interfaces with Shadcn design quality. |
6667

6768
---
6869

@@ -220,6 +221,18 @@ Do not use for building or changing metadata (the domain skills cover that), or
220221

221222
---
222223

224+
### Project
225+
226+
**Domain** `process` · **Path** `skills/objectstack-project/`
227+
228+
Run an ObjectStack metadata-app project: decide whether a change belongs in the app or the platform, what to write before building, what the app tests and what the platform already checks, how a change is described for customers, released and upgraded.
229+
230+
Use when deciding where a change belongs or what to write before building, filing an issue, writing a test, opening a PR, releasing, or bumping `@objectstack/*`. Not for writing metadata (the domain skills) or crossing a protocol major (objectstack-upgrade).
231+
232+
**Tags:** `project`, `process`, `testing`, `verify`, `release`, `changeset`, `upgrade`, `backfill`, `platform-gap`
233+
234+
---
235+
223236
### ObjectUI
224237

225238
**Domain** `ui` · **Path** `skills/objectui/`

‎content/docs/getting-started/build-with-claude-code.mdx‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,9 +405,11 @@ roll-ups, name fields). Ask the agent to keep the project lint-clean — "run
405405
The loop above never changes; what changes is **which skill the agent loads**.
406406
The bundle ships one skill per metadata domain (the table below names them),
407407
plus `objectstack-platform` (runtime setup, plugins, the `os` CLI),
408-
`objectstack-upgrade` (moving a project across a protocol major) and `objectui`
409-
(the `@object-ui/*` renderer), and the agent picks by task
410-
context (the trigger table lives in your project's `AGENTS.md`). To grow the
408+
`objectstack-upgrade` (moving a project across a protocol major), `objectui`
409+
(the `@object-ui/*` renderer) and `objectstack-project` (how a change moves
410+
through the project: what the app tests, releases, platform bumps). The agent
411+
picks by task context, from each skill's own description; your project's
412+
`AGENTS.md` points it at `objectstack-project`. To grow the
411413
support desk into a full application, keep describing — each row is a real
412414
prompt you can give verbatim:
413415

‎packages/create-objectstack/src/templates/AGENTS.md‎

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -127,19 +127,15 @@ is not committed, so a fresh clone of the project has none.
127127
⛔ Do not use `--agent '*'`: it copies the catalog into dozens of agent
128128
directories at once, and all of them then land in your next commit.
129129

130-
Skills are triggered automatically based on task context:
131-
132-
| Skill | Trigger Context |
133-
|:------|:----------------|
134-
| **objectstack-platform** | Project setup, defineStack(), driver/adapter selection, plugin lifecycle, DI, services, kernel hooks/events |
135-
| **objectstack-data** | Define objects, fields, relationships, validations, indexes, lifecycle hooks, permissions/RLS, seed fixtures (`defineDataset`) |
136-
| **objectstack-query** | Filters, sorting, pagination, aggregation, ObjectQL |
137-
| **objectstack-ui** | Views, dashboards, apps, reports, actions, navigation |
138-
| **objectstack-api** | REST endpoints, authentication, service contracts |
139-
| **objectstack-automation** | Flows, workflows, triggers, approvals, state machines |
140-
| **objectstack-ai** | Agents, tools, skills, RAG pipelines, LLM config |
141-
| **objectstack-i18n** | Translation bundles, locale config, coverage detection |
142-
| **objectstack-formula** | CEL formula fields, predicates, conditions, dynamic seed values |
130+
## How this project runs
131+
132+
Read the **objectstack-project** skill (`.claude/skills/objectstack-project/SKILL.md`,
133+
or the same path under the runtime you synced to) before you decide where a
134+
change belongs or what to write first, write a test, open a PR, cut a release or
135+
bump `@objectstack/*`. It says
136+
whether a change belongs in this app or in the platform, what the app tests and
137+
what `validate`, `lint` and `verify` already check, and how a change reaches
138+
customers. Its last section names the skill for each kind of metadata.
143139

144140
## Learn More
145141

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- **A user can now:** <!-- one sentence, in the user's words -->
2+
- **Checked by:** <!-- the path walked, as which user; validate, lint, typecheck and test pass -->
3+
- **Docs:** <!-- the user docs this PR changed, or why none changed -->

‎packages/spec/scripts/build-skill-docs.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ const DISPLAY: Array<{ name: string; label: string }> = [
120120
{ name: 'objectstack-formula', label: 'Formula' },
121121
{ name: 'objectstack-upgrade', label: 'Upgrade' },
122122
{ name: 'objectstack-ask', label: 'Ask' },
123+
{ name: 'objectstack-project', label: 'Project' },
123124
{ name: 'objectui', label: 'ObjectUI' },
124125
];
125126

‎scripts/check-skills-token-ratchet.mjs‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1924,6 +1924,24 @@ export const CEILINGS = new Map([
19241924
// = 1779 (+29), the measured remainder only. Pinned AT the measurement, zero
19251925
// headroom; no other row moves.
19261926
['skills/objectstack-ask/SKILL.md', 1779],
1927+
1928+
// ── the objectstack-project skill joins the catalog ──
1929+
// A new published process skill: how a change moves through a metadata-app
1930+
// project (app or platform, what to write per stage, what the app tests
1931+
// against what `os validate` / `os lint` / `os verify` already check,
1932+
// platform gaps, customer-facing changesets, pin bumps and backfills). The
1933+
// maintainer ordered it into the catalog — 「这个skills是整个元数据项目的核心指引」
1934+
// and, on its decision card, 「p1,放进专题现在派」 (2026-11-18). The row is an
1935+
// INITIAL measurement of the new file on the PR that adds it, pinned AT it —
1936+
// zero headroom, on the same terms as the objectstack-ask row above. Its
1937+
// evals are unpriced (population 1b). No existing row moves: the pointer
1938+
// to it, in `objectstack-platform/references/operations.md`, lands inside that
1939+
// row's headroom (3388 -> 3389 of 3394), and the one in
1940+
// `objectstack-data/references/data-hooks.md` inside its own (9996 -> 10001 of
1941+
// 10011). The PR that adds the row is Tier H and lands only on an authorized
1942+
// approval, which is the pricing act the header reserves to the maintainer.
1943+
// ceil(($(wc -c < skills/objectstack-project/SKILL.md) - 20) / 4) == ceil(11603 / 4)
1944+
['skills/objectstack-project/SKILL.md', 2901],
19271945
]);
19281946

19291947
/**

‎skills/README.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ apps too).
5555
| [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. |
5656
| [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. |
5757
| [Ask](./objectstack-ask/SKILL.md) | `process` | Answer a business question over a live ObjectStack environment through its MCP tools (list_datasets, query_dataset, list_objects, describe_object, query_records, aggregate_records): find the governed metric the question names, compute it and cite its source, or fall back to an object query and say so. |
58+
| [Project](./objectstack-project/SKILL.md) | `process` | Run an ObjectStack metadata-app project: decide whether a change belongs in the app or the platform, what to write before building, what the app tests and what the platform already checks, how a change is described for customers, released and upgraded. |
5859
| [ObjectUI](./objectui/SKILL.md) | `ui` | Universal Server-Driven UI (SDUI) engine for building JSON-driven React interfaces with Shadcn design quality. |
5960

6061
<!-- END GENERATED: skills -->
@@ -129,6 +130,8 @@ A few common decision points where the right skill isn't obvious:
129130
**objectstack-data**.
130131
- **Labels vs. bundles** — a `label` you want translated is **objectstack-i18n**.
131132
- **Upgrade vs. platform** — a protocol-major move is **objectstack-upgrade**.
133+
- **Writing metadata vs. running the project** — where a change belongs, what
134+
the app tests, releases and pin bumps are **objectstack-project**.
132135
- **Rendering this metadata** — the consuming UI is the `@object-ui/*`
133136
packages, and their own skill is [`objectui`](./objectui/SKILL.md) in this catalog.
134137

‎skills/objectstack-data/references/data-hooks.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,6 +885,6 @@ export default defineHook({
885885
- `node_modules/@objectstack/spec/src/data/hook.zod.ts` — Hook schema definition, HookContext interface
886886
- [objectstack-platform/references/plugin-hooks.md](../../objectstack-platform/references/plugin-hooks.md) — plugin/kernel hooks (a different extension point)
887887
- [objectstack-automation](../../objectstack-automation/SKILL.md) — Flows and Workflows
888-
- [objectstack-platform/SKILL.md](../../objectstack-platform/SKILL.md) — hook test harnesses (vitest units, `LiteKernel`)
888+
- [objectstack-project/SKILL.md](../../objectstack-project/SKILL.md) — testing an app's hooks (`bootStack`); a plugin's: objectstack-platform
889889

890890
---

‎skills/objectstack-platform/references/operations.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,12 @@ Authoring stops at `kernel.use(plugin)`; these three make it distributable.
134134

135135
## Testing pattern
136136

137-
Use `LiteKernel` for unit / integration tests — it skips the cloud bits and
138-
plugin discovery, so tests run in milliseconds. Assemble the same plugins the
137+
Test a plugin with `LiteKernel` — it skips the cloud bits and plugin
138+
discovery. An app tests itself with `bootStack` (objectstack-project). Assemble the same plugins the
139139
CLI would auto-register (`use()` is synchronous and chainable):
140140
`new ObjectQLPlugin()`, `new DriverPlugin(new InMemoryDriver())` and
141-
`new AppPlugin(stack)` (`AppPlugin`: `@objectstack/runtime`; `stack`: the
142-
config's default export). The vitest shape: [Testing Plugins](./plugin-development.md#testing-plugins);
141+
`new AppPlugin(stack)` (`AppPlugin`: `@objectstack/runtime`; `stack`: a fixture
142+
config). The vitest shape: [Testing Plugins](./plugin-development.md#testing-plugins);
143143
the other imports: [Using Plugins](./plugin-development.md#using-plugins).
144144

145145
- **Reset between tests:** create a fresh `LiteKernel` per test, and there is no `reset()`.

0 commit comments

Comments
 (0)