Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .changeset/34778-mcp-build-skill.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
'@objectstack/skills': patch
---

feat(skills): objectstack-mcp-build, the order of work for a client that builds through the MCP draft door

Clause-②: no
Metadata-protocol: none

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.

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.

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`.
21 changes: 18 additions & 3 deletions content/docs/ai/skills-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ npm create objectstack@latest my-app

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

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.
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.

## Quick Reference

Expand All @@ -62,8 +62,9 @@ ObjectStack ships **13 skills** — one per authoring domain, plus process skill
| 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. |
| 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. |
| 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. |
| 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. |
| 13 | [ObjectUI](#objectui) | `ui` | `skills/objectui/` | Universal Server-Driven UI (SDUI) engine for building JSON-driven React interfaces with Shadcn design quality. |
| 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. |
| 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. |
| 14 | [ObjectUI](#objectui) | `ui` | `skills/objectui/` | Universal Server-Driven UI (SDUI) engine for building JSON-driven React interfaces with Shadcn design quality. |

---

Expand Down Expand Up @@ -221,6 +222,20 @@ Do not use for building or changing metadata (the domain skills cover that), or

---

### MCP Build

**Domain** `process` · **Path** `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.

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", "建一个应用", "加个字段", "做个审批流").

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).

**Tags:** `mcp`, `build`, `draft`, `save_metadata_draft`, `verdict`, `studio`, `no-project`, `草稿`

---

### Project

**Domain** `process` · **Path** `skills/objectstack-project/`
Expand Down
1 change: 1 addition & 0 deletions packages/spec/scripts/build-skill-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ const DISPLAY: Array<{ name: string; label: string }> = [
{ name: 'objectstack-formula', label: 'Formula' },
{ name: 'objectstack-upgrade', label: 'Upgrade' },
{ name: 'objectstack-ask', label: 'Ask' },
{ name: 'objectstack-mcp-build', label: 'MCP Build' },
{ name: 'objectstack-project', label: 'Project' },
{ name: 'objectui', label: 'ObjectUI' },
];
Expand Down
23 changes: 23 additions & 0 deletions scripts/check-skills-token-ratchet.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2031,6 +2031,29 @@ export const CEILINGS = new Map([
// headroom; no other row moves.
['skills/objectstack-ask/SKILL.md', 1877],

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

// ── the objectstack-project skill joins the catalog ──
// A new published process skill: how a change moves through a metadata-app
// project (app or platform, what to write per stage, what the app tests
Expand Down
3 changes: 3 additions & 0 deletions skills/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ apps too).
| [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. |
| [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. |
| [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. |
| [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. |
| [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. |
| [ObjectUI](./objectui/SKILL.md) | `ui` | Universal Server-Driven UI (SDUI) engine for building JSON-driven React interfaces with Shadcn design quality. |

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

Expand Down
94 changes: 94 additions & 0 deletions skills/objectstack-mcp-build/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
---
name: objectstack-mcp-build
description: >
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. 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", "建一个应用", "加个字段", "做个审批流"). 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).
license: Apache-2.0
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
metadata:
author: objectstack-ai
version: "18.6.0"
domain: process
tags: mcp, build, draft, save_metadata_draft, verdict, studio, no-project, 草稿
---

# Building an ObjectStack app through the MCP draft door

This door saves drafts only: it has no publish tool, and a person reviews and
publishes them in Studio. This skill is the order of work. Each type's keys,
values and traps stay in its domain skill, and each tool's own description is
the authority on its arguments and its reply.

## 1. Check the door

- The tools are `list_metadata_items`, `get_metadata_item`, `list_drafts`,
`save_metadata_draft` and `delete_metadata_draft`. A connection lists them
only with the `metadata:write` scope, for a user who may manage metadata.
- Not listed: say you cannot author here and stop.
- Refused `PERMISSION_DENIED`: relay its message and stop what it refuses,
the door or one type or item. Never write records instead.

## 2. Read what exists

- `list_metadata_items` for each type you will write, then `get_metadata_item`
for every item you will change or name (an object before a view or flow on
it). `describe_object` reads an object's fields where the connection lists it.
- Change an item by reading it whole, editing that, and saving the whole item.
Reuse the names that exist, their namespace prefix included; never guess one.
- A save names a package. An item you change stays in the one its list entry
names. For a new item with none named, a save without one is refused with
the writable packages listed: use the only one, or ask which of several.

## 3. Load the type's domain skill

Load the type's domain skill before you write it: 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.

| You write | Skill |
|:--|:--|
| An object, field, validation, permission set or seed | objectstack-data |
| A view, app, page, dashboard, report, dataset or action | objectstack-ui |
| A flow, approval, job or webhook | objectstack-automation |
| An agent skill, tool or knowledge source | objectstack-ai |
| A translation | objectstack-i18n |
| Any expression: a formula, condition or filter | objectstack-formula |

An item is JSON: the literal a TypeScript project passes to its `define…`
helper.

## 4. Save, then read the verdict

- `save_metadata_draft`, one item a call, an object before what reads it.
- A refused save saved nothing: fix what its `error` names and save again.
- An accepted save parsed, and its reply says what a publish would answer:

| The reply shows | What you do |
|:--|:--|
| `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. |
| `verdict.publishable: true` | The item is done. Tell the user what `verdict.advisories` say. |
| `verdict: null` | The draft is saved and not judged; `verdictWithheld` or `verdictError` says why. Say so, and do not call it publishable. |

- Never clear a refusal by dropping what the user asked for. Where the hint
leaves a choice only the user can make, ask.
- `list_drafts` before you report: every pending draft in the environment,
each with its verdict. Not all are yours. `delete_metadata_draft` discards
a draft, never a published item.

## 5. Hand over to a person

- Nothing you saved is live. Never say an item is published, live or in use,
and never look for another way to publish.
- Report each draft you saved: its type, name and package, whether its
verdict is publishable, and any refusal you could not repair.
- Give the save reply's `review` routes as written (`changes` for the package,
`item` for one draft): Console routes where a person reviews and publishes.
Loading
Loading