Skip to content

Commit 693e921

Browse files
feat(skills): objectstack-mcp-build, the order of work for a client that builds through the MCP draft door (#35665)
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DK3yGUPi8j7HBaXCzoa37AN)_ Part of #34778 This PR delivers the skill, its evals and its catalog registration. The card's Done-when is a live round (a build scenario through the draft door, with the skill and without it), and no model is called here, so the card stays open for that round after this lands. Clause-②: no Metadata-protocol: none ## 维护者速读 - **用户能看到什么变化**:只用 AI 客户端连着运行中的环境搭应用、手里没有项目代码的人,他的 AI 助手多了一份干活顺序(先看现有内容,再查写法,存成草稿,把发布预检指出的问题改到通过,最后把审核入口交给人),此前助手只有各类元数据的写法。 - **为什么做**:属于「MCP 二期与问数」专题,替只通过 MCP 搭应用的用户解决助手不知道这扇门只存草稿、也不知道该按什么顺序做的问题,写法知识仍然只保留一份。 - **出错会怎样**:这份说明写错的话,助手可能漏改预检指出的问题,或把还没发布的草稿说成已经上线,撤回这次改动即可恢复原样。 - **要你做什么**:审阅并批准这份新增的对外技能(受管内容,你点头后才由席位落地)。 ## What changes - **New skill `skills/objectstack-mcp-build/SKILL.md`** (94 lines, 1226 priced tokens). Its reader is a client connected to an environment over MCP with no project files. It gives the order of work at a door that only saves drafts: 1. Check the door: the five tools as `packages/runtime/src/domains/mcp-authoring.ts` registers them (`list_metadata_items`, `get_metadata_item`, `list_drafts`, `save_metadata_draft`, `delete_metadata_draft`). Not listed: say so and stop. A call refused `PERMISSION_DENIED`: relay its message and stop what it refuses. 2. Read what exists, with `describe_object` where the connection lists it. 3. Load the type's domain skill: a six-row table sends each type to its domain skill (`objectstack-data`, `objectstack-ui`, `objectstack-automation`, `objectstack-ai`, `objectstack-i18n`, `objectstack-formula`). That skill's text is the contract; its `node_modules` pointers are followed only where files can be read, and a published item of the same type and the save's own reply stand in otherwise. 4. Save, then read the verdict: a three-row table for `verdict.refusals`, `verdict.publishable: true` and `verdict: null`. 5. Hand over: never say a draft is live, report each draft the client saved, give the reply's `review` routes as written. - **It restates no shape and no tool argument** (ruling S3 = A on the decision card of this epic, record 6943107981: "one copy of the shape knowledge, two thin procedures"; "pointers to the contract instead of restated lists"). The first paragraph says each tool's own description is the authority on its arguments and reply. The members it does name (`verdict.refusals`, `rule`, `path`, `hint`, `verdict.advisories`, `verdictWithheld`, `verdictError`, `review`) are the ones the procedure branches on. - **Tool names: the card's are older than the code.** The card and the design table say `list_metadata` and `get_metadata`. The door registers `list_metadata_items` and `get_metadata_item`, because `list_metadata` is a hosted platform tool (the file's own header, "The names"). The skill uses the registered names. `describe_object` is a data tool: a connection granted only `metadata:write` does not list it, so the skill says "where the connection lists it". - **Evals** in `skills/objectstack-mcp-build/evals/`, in the shape of `skills/objectstack-ask/evals/*.json`: - `draft-door-procedure.json`, four behaviour cases: (1) a `record_change` flow draft whose start node has no `triggerType`, refused by `flow-trigger-unroutable` in the verdict (expect: read the verdict, repair as the hint says, save again, hand the Studio routes to a person, no claim that it is live); (2) add a field to an existing object (expect: read first, load `objectstack-data`, save the whole object); (3) a publishable verdict with one advisory (expect: the hand-over reply); (4) a connection that lists no authoring tool (expect: say so and stop). - `triggers.json`, six trigger cases: three that should load the skill and three that should not (a project-file edit, a question for `objectstack-ask`, a metadata question for `objectstack-ai`). - **Catalog registration.** One `DISPLAY` row in `packages/spec/scripts/build-skill-docs.ts`; `skills/README.md`'s index and `content/docs/ai/skills-reference.mdx` regenerated by `gen:skill-docs`. One hand-written routing bullet in `skills/README.md`. One ceiling row in `scripts/check-skills-token-ratchet.mjs`: the new file's measurement, pinned at it with zero headroom, citing ruling S3 = A (record 6943107981). No existing row moves and no other skill file is edited. - **Changeset** `.changeset/34778-mcp-build-skill.md`: `@objectstack/skills` at `patch`, as the two earlier new-skill changesets were (`objectstack-ask`, `objectstack-project`). - Nothing under `packages/runtime/**` or `packages/mcp/**`. `packages/spec/scripts/` is not in that package's `files`, so the one row there publishes nothing. Net added lines outside generated files: 220 (budget 250). The generated ones are `content/docs/ai/skills-reference.mdx` (+18 −3) and one index row in `skills/README.md`. ### Fix round on the contract review (record 7024514720, PASS with two should-fixes and four nits) One commit, `98d947251d`, on top of the reviewed head `08223b6d90`. Each item, where it landed, before and after: | Item | Where | Before | After | |:--|:--|:--|:--| | S1 | `SKILL.md` section 3, heading and first paragraph; frontmatter `description` | "Read the type's contract": "follow its pointer to the contract. Never write a key from memory." The domain skills' pointers lead to `node_modules/@objectstack/spec/src/` (their `references/_index.md`; `objectstack-ui` also names a REST route), which a client holding only the door's tools and the skill loader cannot read. | "Load the type's domain skill": "its text is your contract. Follow its pointers into `node_modules` only where you can read files. Where you cannot, read a published item of the same type, and let the save check you (step 4). Never write a key none of these shows." Every target is reachable with the door's tools and a loaded skill. | | S2 | `evals/draft-door-procedure.json`, `must_not_contain` of cases 1, 3 and 4 | Case 4 held `has been added`, which the right answer "no field has been added" contains. Cases 1, 3 and 4 held `is now live`, which "nothing is now live" contains. Case 3 held `is now available`, which "the draft is now available for review" contains. | Tokens bound to a subject or a first person, which a right answer does not write: case 1 `flow is now live` / `active` / `published` and the same three on the flow's backticked name; case 3 `dataset is now live` / `published`, the same two on the dataset's backticked name, and `now available to query`; case 4 `I added`, `I have added`, `I've added`, `field is now live` and the field's backticked name with `is now live`. `successfully published` stays in cases 1 and 3. | | N1 | `SKILL.md` section 1 | "Not listed, or refused `PERMISSION_DENIED`: say you cannot author here and stop." | Two bullets: not listed, stop; refused `PERMISSION_DENIED`, "relay its message and stop what it refuses, the door or one type or item." | | N2 | `evals/draft-door-procedure.json` case 2, `expected_output` (prose, not graded) | `get_metadata_item` reads "the package it belongs to". | The package is read off the list entry's `packageId`; the field's shape comes from the domain skill's text and the object that was read, as S1 now says. | | N3 | `SKILL.md` sections 4 and 5 | "`list_drafts` before you report: every pending draft with its verdict."; "Report each draft's type, name and package". | "every pending draft in the environment, each with its verdict. Not all are yours."; "Report each draft you saved". | | N4 | `SKILL.md` frontmatter `compatibility` | "Requires an environment served by @objectstack/mcp 18.x, on a connection granted metadata:write" | "Requires an environment whose @objectstack/runtime 18.x serves the MCP draft door (none through 18.6.0 does), on a connection granted metadata:write" | - **N4, measured.** The five tools are registered by `packages/runtime/src/domains/mcp-authoring.ts`. On the tree of the release tag of `@objectstack/runtime` 18.6.0 (commit `958ee03594`) that file does not exist and `git grep save_metadata_draft` over `packages/runtime` and `packages/mcp` answers exit 1; the positive control `describe_object` hits on the same tree. Their two changesets are still pending on `main`. The changeset of this PR never named a package version, so only one phrase in it moved (it no longer says "read its contract"). The eval prompts still abridge each finding (no `where` member); that has no effect on grading and is left as it was. - **Token ratchet row, re-measured on this same PR under the same ruling (S3 = A, record 6943107981).** `SKILL.md` went 4622 to 4921 bytes (+299) and 90 to 94 lines; less the 20-byte stamp line, `ceil(4901 / 4)` is 1226. The row moves 1151 to 1226, **+75 tokens**, the measured delta only, still zero headroom. No other row moves. - **Generated pages.** `gen:skill-docs` rewrote the description in `skills/README.md` (one index row) and `content/docs/ai/skills-reference.mdx` (two lines); `gen:skill-refs` changed nothing. - **Not changed.** `skills/objectstack-ask/**` is untouched. `triggers.json` and the `DISPLAY` row are as reviewed. ### Read first 1. `skills/objectstack-mcp-build/SKILL.md`, section 3's first paragraph: what stands in for a contract the reader cannot open. Then section 4's table and section 5: the wording that keeps a client from calling a draft live, and the `verdict: null` row. 2. `scripts/check-skills-token-ratchet.mjs`, the new row and its comment (the pricing act is the maintainer's). 3. `skills/objectstack-mcp-build/evals/draft-door-procedure.json`, the `must_contain` and `must_not_contain` tokens of cases 1 and 4. ### Two-minute check `node scripts/check-skills-token-ratchet.mjs`: exit 0, with the line "skills/objectstack-mcp-build/SKILL.md is 1226 tokens (ceiling 1226; headroom 0)" and "60 authored bundle file(s) within their ceilings". ## Skills size readings | Reading | Before (`2495486fd5`) | Reviewed head (`08223b6d90`) | After the fix round (`98d947251d`) | |:--|--:|--:|--:| | `skills/objectstack-mcp-build/SKILL.md` lines | no file | 90 | 94 | | `skills/objectstack-mcp-build/SKILL.md` bytes | no file | 4622 | 4921 | | `skills/objectstack-mcp-build/SKILL.md` priced tokens (ceiling) | no file | 1151 (1151) | 1226 (1226) | | `SKILL.md` files in the catalog | 13 | 14 | 14 | | All `SKILL.md` files, lines summed | 4853 | 4943 | 4947 | | Whole shipped bundle, tokens | 274972 | 278179 | 278372 | | of which the two new eval files (measured, not ratcheted) | 0 | 1706 + 350 | 1824 + 350 | Tokens are the ratchet's own convention, `ceil(utf8 bytes / 4)` with the 20-byte release-stamp line unpriced. The before column was read on `cf6bb70e2d`; `skills/**` is byte-identical between that commit and `2495486fd5` (`git diff --quiet`, exit 0). ## Tests All readings are on head `98d947251d`, with the working tree clean. | Command | Result | |:--|:--| | `node scripts/check-skills-token-ratchet.mjs` and `--self-test` | exit 0 both; row 1226 / 1226 (+0); "104 cases pass" | | `pnpm --filter @objectstack/spec run check:skill-docs` and `check:skill-refs` | exit 0 both; "Skill docs in sync"; "9 generated files in sync" | | `pnpm check:skill-links`, `check:skill-identifier-liveness`, `check:skill-compatibility` | exit 0 each; 269 relative links resolve; 487 citations checked; the `@objectstack/runtime 18.x` pin reconciles | | `pnpm --filter @objectstack/spec run check:skill-examples` | exit 0 after the `@objectstack/client-react` closure was built; "346 prose examples type-check" (the first run, before that build, exited 3, prerequisite not met) | | `pnpm --filter @objectstack/scenarios skill-evals --self-test` | exit 0; "30 rows pass" | | `pnpm --filter @objectstack/scenarios skill-evals --dry-run --skills objectstack-mcp-build` | exit 0; "10 case(s)": 4 behaviour cases on 2 arms and 6 trigger cases, 14 turns planned; no refusal from the case reader | | Eval self-consistency and token probes, a one-off script, not committed | 4 behaviour cases, 0 violations: every `must_contain` token is in its `expected_output`, and no `must_not_contain` token is. Probe sentences: "No field has been added, and nothing is now live", "Nothing is now live", "The draft is now available for review in Studio" hit no token; "The flow is now live", "I've added the `renewal_date` field", "The dataset is now live and now available to query" each hit at least one | | Token ratchet on the merge of this head with `origin/main` `03865ae995` (a `merge-tree` tree extracted to a scratch directory) | exit 0; this row 1226 / 1226, `objectstack-project` 2990 / 2990 | No ablation: the diff changes no behaviour that a test pins. The catalog tests of the first round (`create-objectstack`, `@objectstack/scenarios`, the `@objectstack/spec` repo project) were not re-run locally: this round changes no file name, no skill count and no frontmatter key, and CI runs them. ## Acceptance notes - **The Done-when round is not run here, and the merge does not end the card.** The card's Done-when ("a build scenario through the draft door passes more often with the skill than without it") is a live with-skill and without-skill round. No model was called for this PR. The round is handed to the seat for an eval-domain run: door mode with `--modes door --door-skills` over the repository's `skills/` directory, and the same with `--door-skill-omit objectstack-mcp-build`; the four behaviour cases and six trigger cases run with `skill-evals --skills objectstack-mcp-build`. - **Governed.** `check-governed-merges --branch HEAD` answers GOVERNED, landing tier H, from the `skills/**` hit (exit 3). The PR stays draft and is never readied, queued or armed by the author. The contract review record 7024514720 is on head `08223b6d90`; this push moves the head. - **Claim.** This branch is claimed by comment 7013718135 on the card. - **File surface, one addition to declare.** The claim lists the new skill directory, `skills/README.md`, the ratchet row, the generated pages and the changeset. The generated pages cannot be produced without the `DISPLAY` row in `packages/spec/scripts/build-skill-docs.ts` (the generator exits 1 on a `SKILL.md` with no row), so that one line is in the diff too. Both earlier new-skill PRs carry the same line. - **Not touched, on purpose.** `packages/create-objectstack/src/created-summary.test.ts` holds a list of skill names as a scaffold fixture; `objectstack-project` is not in it either and its tests pass, so no check asks for the new name. No other skill gains a pointer line to this one: each would be priced against another file's ceiling, and the claim's surface is the new directory. - **Overlap.** `overlap-check` first answered exit 1 at `18b917cb13`: the ceiling row sat directly under the `objectstack-project` row, which open PR 35572 rewrites. The row moved up beside the `objectstack-ask` row (same text, same number). Re-run at `98d947251d` before the push: VERDICT clean, exit 0, against `origin/main` `03865ae995` and 0 PR heads (the tool found no open PR sharing a file with this branch). - **Not merged with `main`.** The branch is 16 commits behind `origin/main`; two files the gate derivation reads changed there (`scripts/check-skills-token-ratchet.mjs`, `scripts/pm/check-governed-merges.mjs`). GitHub reported the PR mergeable and clean before the push, the text merge is clean, and the ratchet is green on the merged tree (Tests), so no merge commit was added. - **Eval tokens that the skill does not spell.** Case 1 requires `record-after-create` and case 3 requires `synonyms`: both come from the hint in the case's own prompt, which is what the skill tells the client to follow. The route tokens come from the prompt's `review` member. - **Read-only note from the fix round, not filed.** Now that section 4 says `list_drafts` lists other people's drafts too, the skill still does not say to discard only a draft the client saved. The review record did not ask for that line, and it would be priced, so it is left for the seat to weigh. The door has no schema read; whether it should serve one is the seat's card to open, as the record says under S1. - **Read-only note, not filed.** The door's refusal for an unreadable package list says to "list them with list_metadata_items, type "package"". A list entry carries `name`, `label`, `packageId` and `draft`, and no `writable`. The skill therefore sends a client with no package named to the save's own refusal, which names the writable packages. Not reproduced against a running server. ## Verification <details><summary>Build closure and locked runs</summary> - `pnpm --filter @objectstack/spec build` under the verify lock: `VERDICT command-exit 0`. - `pnpm exec turbo run build` filtered to the `@objectstack/scenarios` dependencies and to the `@objectstack/client-react` closure, `--concurrency=2`, under the verify lock: 16 and 43 tasks successful, all from cache, `VERDICT command-exit 0` both. </details> <details><summary>Derived gates (dispatch-gates --commands, no paths, then --ran)</summary> - At `98d947251d`: 114 derived; 113 exit 0. Among them: `check-skills-token-ratchet.mjs` and its `--self-test`, `check:skill-docs`, `check:skill-examples` (346 prose examples, on its second run), `check:skill-links`, `check:skill-identifier-liveness`, `check:skill-compatibility`, `check:skill-frame-sync`, `check-changeset-no-major.mjs`, `check-adr-0087-registration.mjs`, `check-empty-changeset.mjs`, `check:nul-bytes`, `check:doc-authoring`, `check:issue-citations`, `check:pm-dispatch-gates` (365 s), `check:pm-governed-merges`. - 1 NOT MEASURED: `pnpm check:dual-build-cjs-loads` exit 3, "Run `pnpm build` first": it reads every package's `dist/`, and a whole-workspace build was not run here. CI runs this gate. - `--ran`: "114 derived famil(ies) accounted for — 113 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)". `check:skill-refs` was run beyond the derived set. - The derivation printed a stale-tree note: the branch is at least 16 commits behind `origin/main`, and two files it derives from changed in that range (Acceptance notes). - CI check-runs on `98d947251d`: started by the push, not concluded at the time of writing. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_016WV4d1Dv2AVwokgRqfdKp2)_ <!-- signed: repo:objectstack#4 · os-elon-musk · session_016WV4d1Dv2AVwokgRqfdKp2 --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent ed4649c commit 693e921

8 files changed

Lines changed: 239 additions & 3 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
feat(skills): objectstack-mcp-build, the order of work for a client that builds through the MCP draft door
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The skills catalog gains `objectstack-mcp-build`, a short process skill for a client that builds or changes an app's metadata through an environment's MCP draft door, with no project files. It gives the order of work: read what exists (`list_metadata_items`, `get_metadata_item`, and `describe_object` where the connection lists it), load the domain skill for the type, save with `save_metadata_draft`, read the publish verdict in the reply and repair the item until no refusal is left, then report the drafts and give a person the Studio review routes the reply names. The door has no publish tool, so the skill tells the client never to say a draft is live.
11+
12+
It restates no shape and no tool argument: the domain skills (`objectstack-data`, `objectstack-ui`, `objectstack-automation` and the others) stay the one copy of each type's keys and traps, for a project author and an MCP client alike.
13+
14+
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`.

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

Lines changed: 18 additions & 3 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 **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.
48+
ObjectStack ships **14 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,8 +62,9 @@ ObjectStack ships **13 skills** — one per authoring domain, plus process skill
6262
| 9 | [Formula](#formula) | `expression` | `skills/objectstack-formula/` | Write a CEL expression wherever ObjectStack takes one, in a project or through MCP: formula fields, `visibleWhen` / `requiredWhen` rules, validation, sharing and visibility predicates, flow conditions, seed values, Salesforce formulas ported to CEL. |
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 | [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. |
65+
| 12 | [MCP Build](#mcp-build) | `process` | `skills/objectstack-mcp-build/` | Build or change an ObjectStack app's metadata through its MCP draft door (list_metadata_items, get_metadata_item, save_metadata_draft, list_drafts, delete_metadata_draft), with no project files: read what exists, load the type's domain skill, save a draft, read the publish verdict the save answers, repair it, and hand the Studio review route to a person. |
66+
| 13 | [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. |
67+
| 14 | [ObjectUI](#objectui) | `ui` | `skills/objectui/` | Universal Server-Driven UI (SDUI) engine for building JSON-driven React interfaces with Shadcn design quality. |
6768

6869
---
6970

@@ -209,6 +210,20 @@ Do not use for building or changing metadata (the domain skills cover that), or
209210

210211
---
211212

213+
### MCP Build
214+
215+
**Domain** `process` · **Path** `skills/objectstack-mcp-build/`
216+
217+
Build or change an ObjectStack app's metadata through its MCP draft door (list_metadata_items, get_metadata_item, save_metadata_draft, list_drafts, delete_metadata_draft), with no project files: read what exists, load the type's domain skill, save a draft, read the publish verdict the save answers, repair it, and hand the Studio review route to a person.
218+
219+
Use when connected to an environment over MCP and asked to add or change an object, field, view, page, dashboard, flow, action or permission there, before the first save ("build an app", "add a field", "建一个应用", "加个字段", "做个审批流").
220+
221+
Do not use for metadata written in a project's files (the domain skills cover that) or to answer a question from the app's records (objectstack-ask).
222+
223+
**Tags:** `mcp`, `build`, `draft`, `save_metadata_draft`, `verdict`, `studio`, `no-project`, `草稿`
224+
225+
---
226+
212227
### Project
213228

214229
**Domain** `process` · **Path** `skills/objectstack-project/`

‎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-mcp-build', label: 'MCP Build' },
123124
{ name: 'objectstack-project', label: 'Project' },
124125
{ name: 'objectui', label: 'ObjectUI' },
125126
];

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2046,6 +2046,29 @@ export const CEILINGS = new Map([
20462046
// headroom; no other row moves.
20472047
['skills/objectstack-ask/SKILL.md', 1877],
20482048

2049+
// ── the objectstack-mcp-build skill joins the catalog — ruling #34691 S3 = A ──
2050+
// (decision record: comment 6943107981 on #34691, "one copy of the shape
2051+
// knowledge, two thin procedures"). A new published process skill for a
2052+
// client that builds through the open MCP draft door: the order of work
2053+
// (read what exists, load the type's domain skill, save a draft, read the
2054+
// publish verdict, repair, hand the Studio review route to a person). It
2055+
// names the door's five tools, restates none of their arguments, and points
2056+
// to the domain skills for every shape. The row is an INITIAL measurement of
2057+
// the new file on the PR that adds it, pinned AT it — zero headroom, on the
2058+
// same terms as the objectstack-ask row above and the objectstack-project row
2059+
// below. Its evals are unpriced (population 1b). No existing row moves: no
2060+
// other skill file is edited. The PR that adds the row is Tier H and lands
2061+
// only on an authorized approval, which is the pricing act the header
2062+
// reserves to the maintainer.
2063+
// Re-measured before landing, on that same PR and under the same ruling: its
2064+
// contract review (record 7024514720) had the file say what stands in for a
2065+
// contract a client with no file tool cannot read, what one
2066+
// `PERMISSION_DENIED` refuses, whose drafts `list_drafts` lists, and which
2067+
// package serves the door. 4622 -> 4921 bytes, less the 20-byte stamp line:
2068+
// 1151 -> 1226 (+75), the measured remainder only, still zero headroom.
2069+
// ceil(($(wc -c < skills/objectstack-mcp-build/SKILL.md) - 20) / 4) == ceil(4901 / 4)
2070+
['skills/objectstack-mcp-build/SKILL.md', 1226],
2071+
20492072
// ── the objectstack-project skill joins the catalog ──
20502073
// A new published process skill: how a change moves through a metadata-app
20512074
// project (app or platform, what to write per stage, what the app tests

‎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` | Write a CEL expression wherever ObjectStack takes one, in a project or through MCP: formula fields, `visibleWhen` / `requiredWhen` rules, validation, sharing and visibility predicates, flow conditions, seed values, Salesforce formulas ported to CEL. |
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+
| [MCP Build](./objectstack-mcp-build/SKILL.md) | `process` | Build or change an ObjectStack app's metadata through its MCP draft door (list_metadata_items, get_metadata_item, save_metadata_draft, list_drafts, delete_metadata_draft), with no project files: read what exists, load the type's domain skill, save a draft, read the publish verdict the save answers, repair it, and hand the Studio review route to a person. |
5859
| [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. |
5960
| [ObjectUI](./objectui/SKILL.md) | `ui` | Universal Server-Driven UI (SDUI) engine for building JSON-driven React interfaces with Shadcn design quality. |
6061

@@ -132,6 +133,8 @@ A few common decision points where the right skill isn't obvious:
132133
- **Upgrade vs. platform** — a protocol-major move is **objectstack-upgrade**.
133134
- **Writing metadata vs. running the project** — where a change belongs, what
134135
the app tests, releases and pin bumps are **objectstack-project**.
136+
- **Building over MCP, with no project files** — the order of work at the
137+
draft door is **objectstack-mcp-build**; the shapes stay in the domain skills.
135138
- **Rendering this metadata** — the consuming UI is the `@object-ui/*`
136139
packages, and their own skill is [`objectui`](./objectui/SKILL.md) in this catalog.
137140

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
---
2+
name: objectstack-mcp-build
3+
description: >
4+
Build or change an ObjectStack app's metadata through its MCP draft door
5+
(list_metadata_items, get_metadata_item, save_metadata_draft, list_drafts,
6+
delete_metadata_draft), with no project files: read what exists, load the
7+
type's domain skill, save a draft, read the publish verdict the save answers,
8+
repair it, and hand the Studio review route to a person. Use when connected
9+
to an environment over MCP and asked to add or change an object, field, view,
10+
page, dashboard, flow, action or permission there, before the first save
11+
("build an app", "add a field", "建一个应用", "加个字段", "做个审批流"). Do not
12+
use for metadata written in a project's files (the domain skills cover
13+
that) or to answer a question from the app's records (objectstack-ask).
14+
license: Apache-2.0
15+
compatibility: Requires an environment whose @objectstack/runtime 18.x serves the MCP draft door (none through 18.6.0 does), on a connection granted metadata:write
16+
metadata:
17+
author: objectstack-ai
18+
version: "18.6.0"
19+
domain: process
20+
tags: mcp, build, draft, save_metadata_draft, verdict, studio, no-project, 草稿
21+
---
22+
23+
# Building an ObjectStack app through the MCP draft door
24+
25+
This door saves drafts only: it has no publish tool, and a person reviews and
26+
publishes them in Studio. This skill is the order of work. Each type's keys,
27+
values and traps stay in its domain skill, and each tool's own description is
28+
the authority on its arguments and its reply.
29+
30+
## 1. Check the door
31+
32+
- The tools are `list_metadata_items`, `get_metadata_item`, `list_drafts`,
33+
`save_metadata_draft` and `delete_metadata_draft`. A connection lists them
34+
only with the `metadata:write` scope, for a user who may manage metadata.
35+
- Not listed: say you cannot author here and stop.
36+
- Refused `PERMISSION_DENIED`: relay its message and stop what it refuses,
37+
the door or one type or item. Never write records instead.
38+
39+
## 2. Read what exists
40+
41+
- `list_metadata_items` for each type you will write, then `get_metadata_item`
42+
for every item you will change or name (an object before a view or flow on
43+
it). `describe_object` reads an object's fields where the connection lists it.
44+
- Change an item by reading it whole, editing that, and saving the whole item.
45+
Reuse the names that exist, their namespace prefix included; never guess one.
46+
- A save names a package. An item you change stays in the one its list entry
47+
names. For a new item with none named, a save without one is refused with
48+
the writable packages listed: use the only one, or ask which of several.
49+
50+
## 3. Load the type's domain skill
51+
52+
Load the type's domain skill before you write it: its text is your contract.
53+
Follow its pointers into `node_modules` only where you can read files. Where
54+
you cannot, read a published item of the same type, and let the save check
55+
you (step 4). Never write a key none of these shows.
56+
57+
| You write | Skill |
58+
|:--|:--|
59+
| An object, field, validation, permission set or seed | objectstack-data |
60+
| A view, app, page, dashboard, report, dataset or action | objectstack-ui |
61+
| A flow, approval, job or webhook | objectstack-automation |
62+
| An agent skill, tool or knowledge source | objectstack-ai |
63+
| A translation | objectstack-i18n |
64+
| Any expression: a formula, condition or filter | objectstack-formula |
65+
66+
An item is JSON: the literal a TypeScript project passes to its `define…`
67+
helper.
68+
69+
## 4. Save, then read the verdict
70+
71+
- `save_metadata_draft`, one item a call, an object before what reads it.
72+
- A refused save saved nothing: fix what its `error` names and save again.
73+
- An accepted save parsed, and its reply says what a publish would answer:
74+
75+
| The reply shows | What you do |
76+
|:--|:--|
77+
| `verdict.refusals` not empty | A publish would refuse the draft. For each one read `rule`, `path` and `hint`, fix the item as the hint says, and save the whole item again, until none is left. |
78+
| `verdict.publishable: true` | The item is done. Tell the user what `verdict.advisories` say. |
79+
| `verdict: null` | The draft is saved and not judged; `verdictWithheld` or `verdictError` says why. Say so, and do not call it publishable. |
80+
81+
- Never clear a refusal by dropping what the user asked for. Where the hint
82+
leaves a choice only the user can make, ask.
83+
- `list_drafts` before you report: every pending draft in the environment,
84+
each with its verdict. Not all are yours. `delete_metadata_draft` discards
85+
a draft, never a published item.
86+
87+
## 5. Hand over to a person
88+
89+
- Nothing you saved is live. Never say an item is published, live or in use,
90+
and never look for another way to publish.
91+
- Report each draft you saved: its type, name and package, whether its
92+
verdict is publishable, and any refusal you could not repair.
93+
- Give the save reply's `review` routes as written (`changes` for the package,
94+
`item` for one draft): Console routes where a person reviews and publishes.

0 commit comments

Comments
 (0)