Repository navigation
Commit 693e921
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
- .changeset
- content/docs/ai
- packages/spec/scripts
- scripts
- skills
- objectstack-mcp-build
- evals
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| |||
209 | 210 | | |
210 | 211 | | |
211 | 212 | | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
212 | 227 | | |
213 | 228 | | |
214 | 229 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2046 | 2046 | | |
2047 | 2047 | | |
2048 | 2048 | | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
| 2057 | + | |
| 2058 | + | |
| 2059 | + | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
| 2064 | + | |
| 2065 | + | |
| 2066 | + | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
2049 | 2072 | | |
2050 | 2073 | | |
2051 | 2074 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
| 136 | + | |
| 137 | + | |
135 | 138 | | |
136 | 139 | | |
137 | 140 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
0 commit comments