From bf74fc2e2e893f216a633d0cee123cbda3b56f6a Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 13 Nov 2026 23:20:38 +0000 Subject: [PATCH 1/4] docs(spec,skills): SkillSchema.tools decides whether MCP offers the skill The class JSDoc, the tools JSDoc and its describe text, the agents guide and the objectstack-ai skill still called the tool binding inert in the open framework. registerSkillPrompts offers a skill on prompts/list and prompts/get only when the server it is installed on lists every tool the skill binds, so each text now states that rule. Claude-Session: https://claude.ai/code/session_01L9qibwQwWBkRyhGGhaPUST Co-authored-by: Claude --- content/docs/ai/agents.mdx | 19 ++++++++- packages/spec/src/ai/skill.zod.ts | 64 ++++++++++++++++++++++--------- skills/objectstack-ai/SKILL.md | 12 ++++-- 3 files changed, 72 insertions(+), 23 deletions(-) diff --git a/content/docs/ai/agents.mdx b/content/docs/ai/agents.mdx index 2c9845cad47..ca0412c0fae 100644 --- a/content/docs/ai/agents.mdx +++ b/content/docs/ai/agents.mdx @@ -252,8 +252,23 @@ itself (a different LLM-facing description, fewer exposed parameters). | Half | Keys | Where it runs | |---|---|---| -| **Judgment** | `instructions` | **Everywhere.** On the open framework `@objectstack/mcp` serves it as an MCP **prompt** — any connected client can `prompts/list` it by name and `prompts/get` the text ([Connect an MCP client](/docs/ai/connect-mcp#prompts-your-skills-served-to-the-client)). On **ObjectOS** it is injected into the active agent's system prompt. | -| **Wiring** | `tools`, `surface`, `triggerConditions` | **ObjectOS only.** Composing an agent's tool set and deciding when a skill activates are properties of an in-product agent loop. Over MCP the model lives in the client and drives one flat tool list, and your AI-exposed Actions already reach it as `action_` via `list_actions` / `run_action`. | +| **Judgment** | `instructions` | **Both editions.** On the open framework `@objectstack/mcp` serves it as an MCP **prompt** — a connected client can `prompts/list` it by name and `prompts/get` the text ([Connect an MCP client](/docs/ai/connect-mcp#prompts-your-skills-served-to-the-client)), on a server that serves the tools the skill binds (below). On **ObjectOS** it is injected into the active agent's system prompt. | +| **Wiring** | `tools`, `surface`, `triggerConditions` | **Bound on ObjectOS only.** Composing an agent's tool set and deciding when a skill activates are properties of an in-product agent loop. Over MCP the model lives in the client and drives one flat tool list, and your AI-exposed Actions already reach it through `list_actions` / `run_action`. `surface` and `triggerConditions` are inert there; `tools` is read, and decides whether the skill is offered. | + +**Over MCP, `tools` decides whether the skill is offered.** The prompt surface +`registerSkillPrompts` (`@objectstack/mcp`) installs lists and gets a skill only +when the server it is installed on lists every tool the skill binds, read from +that server's own tool list when the prompt request is answered. A plain name is +served by a tool of that name, a trailing wildcard (`describe_*`) by any listed +tool it matches, and an `action_` entry (or `action_*`) also by +`run_action`. A skill that binds no tool is offered as before, and `prompts/get` +answers a withheld skill as it answers an unknown prompt name. This holds on the +HTTP endpoint and on any host that drives its own MCP server and calls +`registerSkillPrompts`, stdio included; the plugin's own long-lived stdio +server, which projects skills through `MCPServerRuntime.bridgePrompts` instead, +applies no such filter. So bind a skill only to tools its intended connections +serve: one that names a tool no MCP tool family serves is offered on no such +connection unless a host registers that tool. Both halves are still **validated everywhere** — a skill naming a tool that does not exist is an authoring error in either distribution. So a skill written diff --git a/packages/spec/src/ai/skill.zod.ts b/packages/spec/src/ai/skill.zod.ts index 42029768192..42bf9715d20 100644 --- a/packages/spec/src/ai/skill.zod.ts +++ b/packages/spec/src/ai/skill.zod.ts @@ -225,16 +225,23 @@ export type SkillTriggerCondition = z.input; * different runtimes, and the schema says which is which rather than implying * both work everywhere: * - * - **`instructions`** — served **everywhere**. `@objectstack/mcp` projects it - * onto the MCP `prompts` primitive, so any connected MCP client can + * - **`instructions`** — runs in **both** distributions. `@objectstack/mcp` + * projects it onto the MCP `prompts` primitive, so a connected MCP client can * `prompts/list` / `prompts/get` a skill authored in the open framework. - * - **`tools` / `surface` / `triggerConditions`** — **cloud-runtime-only**. - * Tool binding and skill↔agent affinity are read by the in-product `ask` / - * `build` agent runtime, which ships in the cloud / Enterprise distribution. - * In the open framework there is no agent loop to bind tools to (the client's - * own model drives a flat MCP tool list), so these keys are authored for - * cloud and inert here. They are still validated — a skill naming a tool that - * does not exist is an authoring error in both distributions. + * Where `registerSkillPrompts` installs that prompt surface, the skill is + * offered only on a server that serves every tool it binds (see `tools`). + * - **`tools`** — **bound** by the cloud runtime, **read** by MCP. The + * in-product `ask` / `build` agent runtime, which ships in the cloud / + * Enterprise distribution, composes an agent's tool set from it. In the open + * framework there is no agent loop to bind tools to (the client's own model + * drives a flat MCP tool list), so nothing is bound there; the binding + * decides instead whether the skill's prompt is offered at all. + * - **`surface` / `triggerConditions`** — **cloud-runtime-only**. Skill↔agent + * affinity and activation are read by that same in-product agent runtime, so + * these keys are authored for cloud and inert here. + * + * All three are still validated — a skill naming a tool that does not exist is + * an authoring error in both distributions. * * NOTE — there is deliberately NO per-skill `permissions` field. Access to AI * capability is gated at the AGENT level (`agent.access` / `agent.permissions`, @@ -337,8 +344,9 @@ export const SkillSchema = lazySchema(() => strictObject({ * cloud agent runtime it is injected into the active agent's system prompt; * in the open framework `@objectstack/mcp` projects it onto the MCP `prompts` * primitive, so a connected client can list this skill by name and fetch this - * text. A skill with no `instructions` has nothing to project and is not - * listed as a prompt at all. + * text, on a server that serves the tools the skill binds (see `tools`). A + * skill with no `instructions` has nothing to project and is not listed as a + * prompt at all. */ instructions: z.string().optional().describe('LLM instructions when skill is active — also served as an MCP prompt'), @@ -364,15 +372,35 @@ export const SkillSchema = lazySchema(() => strictObject({ * path the executable, its authz and its audit stay on the action/flow the * app already ships. * - * **CLOUD-RUNTIME-ONLY** (#3905). Tool binding is consumed by the in-product - * agent runtime, which composes an agent's tool set from its + * **Bound by the cloud runtime, read by MCP** (#3905). The in-product agent + * runtime consumes the binding: it composes an agent's tool set from its * surface-compatible skills. Over MCP the model lives client-side and the - * server exposes one flat tool list, so there is nothing here to bind: an - * AI-exposed Action is already reachable as `action_` through - * `list_actions` / `run_action`. The references are still checked at - * authoring time in both distributions (`ai-skill-tool-unresolved`). + * server exposes one flat tool list, so nothing is bound there. The binding + * decides instead whether the skill is offered: the prompt surface + * `registerSkillPrompts` (`@objectstack/mcp`) installs answers + * `prompts/list` and `prompts/get` with a skill only when the server it is + * installed on lists every tool named here, read from that server's own + * tool registry when the prompt request is answered. + * + * - A plain name is served when the server lists a tool of that name; a + * trailing wildcard when any listed tool matches it. + * - An `action_` entry (and `action_*`) is also served when + * `run_action` is listed: the native MCP families serve AI-exposed Actions + * through `list_actions` / `run_action`, never as `action_` tools. + * - A skill that binds no tool is offered as before, and `prompts/get` + * answers a withheld skill as it answers a prompt name no skill derives. + * + * That is the reach of `registerSkillPrompts`: `MCPServerRuntime`'s HTTP + * door, and any host that drives its own `McpServer` and calls it, stdio + * included, each narrowed by that server's own tool list. + * `MCPServerRuntime.bridgePrompts`, which projects skills onto the + * long-lived server without `registerSkillPrompts`, applies no such filter. + * So a skill binding a tool no MCP family serves (a `stack.tools` name + * nothing registers, say) is offered on no such server unless a host + * registers that tool. The references are still checked at authoring time in + * both distributions (`ai-skill-tool-unresolved`). */ - tools: z.array(z.string().regex(/^[a-z_][a-z0-9_]*\*?$/)).describe('Tool names belonging to this skill (supports trailing wildcard, e.g. `action_*`) — bound by the cloud agent runtime only'), + tools: z.array(z.string().regex(/^[a-z_][a-z0-9_]*\*?$/)).describe('Tool names belonging to this skill (supports trailing wildcard, e.g. `action_*`) — bound by the cloud agent runtime; an MCP server whose prompts `registerSkillPrompts` installs offers the skill only when it serves every tool named here (an `action_` entry also through `run_action`)'), /** * Programmatic conditions for skill activation. diff --git a/skills/objectstack-ai/SKILL.md b/skills/objectstack-ai/SKILL.md index ac31811474d..53462c773eb 100644 --- a/skills/objectstack-ai/SKILL.md +++ b/skills/objectstack-ai/SKILL.md @@ -57,7 +57,7 @@ conditions. |:---------|:--------| | `surface` | `'ask' \| 'build' \| 'both'` — which platform agent may bind this skill (default `'ask'`). Enforced in `resolveActiveSkills` at load: an incompatible binding is a **fast load error** (ADR-0063 §3) | | `description` | What the skill does — the agent reads it to decide when to use the skill | -| `instructions` | Prompt guidance for this skill's context. **The one field the open edition reads**: `@objectstack/mcp` projects it onto the MCP `prompts` primitive, so a skill with blank `instructions` — or `active: false` — is not listed as a prompt at all | +| `instructions` | Prompt guidance for this skill's context. **The one field the open edition serves**: `@objectstack/mcp` projects it onto the MCP `prompts` primitive, so a skill with blank `instructions` — or `active: false` — is not listed as a prompt at all | | `triggerConditions` | Programmatic activation rules (below) | | `active` | Enabled (default `true`) | @@ -378,8 +378,14 @@ every agent referencing it. The built-in skills: | `metadata_authoring` + `solution_design` | `build` | metadata draft / verify / publish + blueprint propose / apply | All four are cloud-runtime skills — none resolves on the open edition, so -`surface` / `tools` / `triggerConditions` on your own skills are authored for -cloud and inert there; their `instructions` are what MCP serves. +`surface` / `triggerConditions` on your own skills are authored for cloud and +inert there; their `instructions` are what MCP serves. `tools` binds nothing +there but is read: `registerSkillPrompts` offers a skill on `prompts/list` / +`prompts/get` only when the server it is installed on (the HTTP door, or a +host's own server, stdio included) lists every tool the skill binds — a plain +name by a tool of that name, a wildcard by any match, an `action_*` entry also +by `run_action`. A skill binding a tool no MCP family serves is offered on no +such server; one binding no tool is offered as before. `visualize_data` is the only built-in that draws a chart (an inline `data-chart` part), auto-registered **only** when an analytics service (`IAnalyticsService`) is wired — `query_data` / `aggregate_data` return numbers, not charts. From 0b716b6c19e5f405468bdee73594021d54875d58 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 13 Nov 2026 23:23:40 +0000 Subject: [PATCH 2/4] docs(spec): regenerate the skill reference page and add the changeset Claude-Session: https://claude.ai/code/session_01L9qibwQwWBkRyhGGhaPUST Co-authored-by: Claude --- .changeset/32885-skill-tools-binding-prose.md | 15 +++++++++++++++ content/docs/references/ai/skill.mdx | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 .changeset/32885-skill-tools-binding-prose.md diff --git a/.changeset/32885-skill-tools-binding-prose.md b/.changeset/32885-skill-tools-binding-prose.md new file mode 100644 index 00000000000..353421bdfa2 --- /dev/null +++ b/.changeset/32885-skill-tools-binding-prose.md @@ -0,0 +1,15 @@ +--- +'@objectstack/spec': patch +'@objectstack/skills': patch +--- + +docs(spec,skills): `SkillSchema.tools` is described as what it now does on an MCP server, not as inert in the open framework + +Clause-②: no +Metadata-protocol: none + +Since 18.4.0 the prompt surface `registerSkillPrompts` (`@objectstack/mcp`) installs offers a skill on `prompts/list` and `prompts/get` only when the server it is installed on lists every tool the skill binds. Three published texts still said the binding was authored for the cloud runtime and inert in the open framework. They now state the rule; no schema, accept set or behaviour changes. + +- **`@objectstack/spec`**: the `SkillSchema` class JSDoc, the `tools` JSDoc and its describe text (so the generated JSON Schema description and the skill reference page), plus one clause on the `instructions` JSDoc. `tools` is bound by the cloud agent runtime and read by MCP: a plain name is served by a tool of that name, a trailing wildcard by any listed tool it matches, and an `action_` entry (or `action_*`) also by `run_action`. A skill that binds no tool is offered as before, and `prompts/get` answers a withheld skill as it answers a prompt name no skill derives. The rule reaches every server `registerSkillPrompts` is installed on, `MCPServerRuntime`'s HTTP door and a host's own `McpServer` alike, stdio included; `MCPServerRuntime.bridgePrompts`, which projects skills onto the long-lived server without it, applies no such filter. `surface` and `triggerConditions` stay cloud-runtime-only. +- **`@objectstack/skills`** (`objectstack-ai`): the built-in-skills note says the same, and the `instructions` row calls it the one field the open edition serves, since the open edition now reads `tools` as well. +- The agents guide (`content/docs/ai/agents.mdx`) carries the rule under its two-halves table and advises binding a skill only to tools its intended connections serve. diff --git a/content/docs/references/ai/skill.mdx b/content/docs/references/ai/skill.mdx index 4da4f3b7afe..7e024b14924 100644 --- a/content/docs/references/ai/skill.mdx +++ b/content/docs/references/ai/skill.mdx @@ -38,7 +38,7 @@ const result = SkillSchema.parse(data); | **description** | `string` | optional | Skill description | | **surface** | `Enum<'ask' \| 'build' \| 'both'>` | optional (default: `"ask"`) | Agent surface this skill binds to ('ask' \| 'build' \| 'both') — ADR-0063 §3; read by the cloud agent runtime only | | **instructions** | `string` | optional | LLM instructions when skill is active — also served as an MCP prompt | -| **tools** | `string[]` | ✅ | Tool names belonging to this skill (supports trailing wildcard, e.g. `action_*`) — bound by the cloud agent runtime only | +| **tools** | `string[]` | ✅ | Tool names belonging to this skill (supports trailing wildcard, e.g. `action_*`) — bound by the cloud agent runtime; an MCP server whose prompts `registerSkillPrompts` installs offers the skill only when it serves every tool named here (an `action_` entry also through `run_action`) | | **triggerConditions** | `{ field: string; operator: Enum<'eq' \| 'neq' \| 'in' \| 'not_in' \| 'contains'>; value: string \| string[] }[]` | optional | Programmatic activation conditions — evaluated by the cloud agent runtime only | | **active** | `boolean` | optional (default: `true`) | Whether the skill is enabled | | **protection** | `{ lock: Enum<'none' \| 'no-overlay' \| 'no-delete' \| 'full'>; reason: string; docsUrl?: string }` | optional | Package author protection block — lock policy for this skill. | From f58d610ee1e0dd5ac7253f72ef2e06990c544b5f Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 13 Nov 2026 23:26:41 +0000 Subject: [PATCH 3/4] docs(skills): name which MCP servers apply the skill tool-binding filter Claude-Session: https://claude.ai/code/session_01L9qibwQwWBkRyhGGhaPUST Co-authored-by: Claude --- skills/objectstack-ai/SKILL.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/skills/objectstack-ai/SKILL.md b/skills/objectstack-ai/SKILL.md index 53462c773eb..6c2fe8e2659 100644 --- a/skills/objectstack-ai/SKILL.md +++ b/skills/objectstack-ai/SKILL.md @@ -381,11 +381,11 @@ All four are cloud-runtime skills — none resolves on the open edition, so `surface` / `triggerConditions` on your own skills are authored for cloud and inert there; their `instructions` are what MCP serves. `tools` binds nothing there but is read: `registerSkillPrompts` offers a skill on `prompts/list` / -`prompts/get` only when the server it is installed on (the HTTP door, or a -host's own server, stdio included) lists every tool the skill binds — a plain -name by a tool of that name, a wildcard by any match, an `action_*` entry also -by `run_action`. A skill binding a tool no MCP family serves is offered on no -such server; one binding no tool is offered as before. +`prompts/get` only when its server lists every tool the skill binds — a plain +name by that tool, a wildcard by any match, an `action_*` entry also by +`run_action`. That covers the HTTP door and any host server that calls it; the +plugin's own stdio transport lists every skill. Bind a tool no MCP family +serves (the MCP table above) and no filtering server offers the skill. `visualize_data` is the only built-in that draws a chart (an inline `data-chart` part), auto-registered **only** when an analytics service (`IAnalyticsService`) is wired — `query_data` / `aggregate_data` return numbers, not charts. From 63201e823f8db029a3525d239cc9525e9d49e210 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Nov 2026 00:37:28 +0000 Subject: [PATCH 4/4] docs(mcp,spec): state the skill tool-binding rule in the connection guide, the mcp README and the liveness ledger The MCP connection guide and the mcp README still said every skill with instructions is served to any connected client, the liveness ledger named only cloud readers for SkillSchema.tools, and a runtime comment called the binding cloud-runtime-only. Each now says that registerSkillPrompts offers a skill only when its server lists every tool the skill binds. Claude-Session: https://claude.ai/code/session_01L9qibwQwWBkRyhGGhaPUST Co-authored-by: Claude --- .changeset/32885-skill-tools-binding-prose.md | 7 +++-- content/docs/ai/connect-mcp.mdx | 26 ++++++++++++++----- packages/mcp/README.md | 12 ++++++++- packages/runtime/src/domains/mcp.ts | 4 ++- packages/spec/liveness/skill.json | 6 ++--- 5 files changed, 42 insertions(+), 13 deletions(-) diff --git a/.changeset/32885-skill-tools-binding-prose.md b/.changeset/32885-skill-tools-binding-prose.md index 353421bdfa2..833929cf45c 100644 --- a/.changeset/32885-skill-tools-binding-prose.md +++ b/.changeset/32885-skill-tools-binding-prose.md @@ -1,6 +1,7 @@ --- '@objectstack/spec': patch '@objectstack/skills': patch +'@objectstack/mcp': patch --- docs(spec,skills): `SkillSchema.tools` is described as what it now does on an MCP server, not as inert in the open framework @@ -8,8 +9,10 @@ docs(spec,skills): `SkillSchema.tools` is described as what it now does on an MC Clause-②: no Metadata-protocol: none -Since 18.4.0 the prompt surface `registerSkillPrompts` (`@objectstack/mcp`) installs offers a skill on `prompts/list` and `prompts/get` only when the server it is installed on lists every tool the skill binds. Three published texts still said the binding was authored for the cloud runtime and inert in the open framework. They now state the rule; no schema, accept set or behaviour changes. +Since 18.4.0 the prompt surface `registerSkillPrompts` (`@objectstack/mcp`) installs offers a skill on `prompts/list` and `prompts/get` only when the server it is installed on lists every tool the skill binds. The published texts still said the binding was authored for the cloud runtime and inert in the open framework, or that every skill with instructions is served to any connected client. They now state the rule; no schema, accept set or behaviour changes. - **`@objectstack/spec`**: the `SkillSchema` class JSDoc, the `tools` JSDoc and its describe text (so the generated JSON Schema description and the skill reference page), plus one clause on the `instructions` JSDoc. `tools` is bound by the cloud agent runtime and read by MCP: a plain name is served by a tool of that name, a trailing wildcard by any listed tool it matches, and an `action_` entry (or `action_*`) also by `run_action`. A skill that binds no tool is offered as before, and `prompts/get` answers a withheld skill as it answers a prompt name no skill derives. The rule reaches every server `registerSkillPrompts` is installed on, `MCPServerRuntime`'s HTTP door and a host's own `McpServer` alike, stdio included; `MCPServerRuntime.bridgePrompts`, which projects skills onto the long-lived server without it, applies no such filter. `surface` and `triggerConditions` stay cloud-runtime-only. - **`@objectstack/skills`** (`objectstack-ai`): the built-in-skills note says the same, and the `instructions` row calls it the one field the open edition serves, since the open edition now reads `tools` as well. -- The agents guide (`content/docs/ai/agents.mdx`) carries the rule under its two-halves table and advises binding a skill only to tools its intended connections serve. +- **`@objectstack/spec`**, liveness ledger (`liveness/skill.json`): the `tools` entry cites its in-repo reader, `skillBindingServed` in `packages/mcp/src/skill-prompts.ts`, beside the cloud readers, and its note no longer calls the key cloud-runtime-only. +- **`@objectstack/mcp`**: the README's Prompts section says which servers apply the rule. `bridgePrompts` lists every skill that carries instructions on the long-lived server; the HTTP door and any server a host installs `registerSkillPrompts` on offer a skill only when that server lists every tool it binds. +- The agents guide (`content/docs/ai/agents.mdx`) carries the rule under its two-halves table and advises binding a skill only to tools its intended connections serve. The MCP connection guide (`content/docs/ai/connect-mcp.mdx`) says a skill is offered only where its tools are: its example skill, bound to `query_records` and `action_resolve_case`, is not offered to a token without the `actions:execute` scope, which lists no `run_action`. diff --git a/content/docs/ai/connect-mcp.mdx b/content/docs/ai/connect-mcp.mdx index 057f82a70b4..c26194fc896 100644 --- a/content/docs/ai/connect-mcp.mdx +++ b/content/docs/ai/connect-mcp.mdx @@ -448,10 +448,10 @@ to typed per-action tools) is the planned next step, consistent with ADR-0097's ## Prompts: your skills, served to the client -Tools are not the only primitive. Every **skill** you author (`*.skill.ts`, +Tools are not the only primitive. A **skill** you author (`*.skill.ts`, `defineSkill`) that carries `instructions` is served as an MCP **prompt** — so a connected client can list your app's playbooks by name and pull one into the -conversation: +conversation, on a connection that serves the tools the skill binds (below): ```typescript export const CaseTriageSkill = defineSkill({ @@ -477,15 +477,29 @@ prompts in their own picker. Nothing to enable — the surface appears as soon a the app has a skill with instructions, and `prompts/list` simply returns an empty list until then. +**A skill is offered only where its tools are.** A skill's instructions teach +the model to call the tools it binds, so `prompts/list` and `prompts/get` offer +a skill only when the connection's own tool list carries every entry of its +`tools`: a plain name by a tool of that name, a trailing wildcard (`describe_*`) +by any listed tool it matches, and an `action_` entry (or `action_*`) also +by `run_action`. `case_triage` above is offered on a connection that lists +`query_records` and `run_action`. A token without the `actions:execute` scope +lists no `run_action`, so it is not offered `case_triage`, and `prompts/get` +answers it as it answers an unknown prompt name. A skill that binds no tool is +offered as before. When a prompt you expect is missing, connect with a grant +that registers the skill's tools, or bind the skill only to tools its intended +connections serve. + **Only the instructions half projects.** A skill's `tools` / `surface` / -`triggerConditions` are read by the **in-product agent runtime** (the `ask` / +`triggerConditions` are bound by the **in-product agent runtime** (the `ask` / `build` agents, cloud / Enterprise), which is the thing that composes a tool set and decides when a skill activates. MCP has neither step: the model lives in *your* client, driving one flat tool list, and your AI-exposed actions are already reachable there as `list_actions` / `run_action`. So on the open -framework a skill contributes its judgment (as a prompt), not its wiring — and -the same skill file keeps its full meaning when the app runs on the cloud -runtime. See [AI Agents](/docs/ai/agents#you-extend-the-platform-with-skills-not-agents). +framework a skill contributes its judgment (as a prompt), not its wiring — its +`tools` are read only to decide the offer above — and the same skill file keeps +its full meaning when the app runs on the cloud runtime. See +[AI Agents](/docs/ai/agents#you-extend-the-platform-with-skills-not-agents). **Two different "skills" again.** These are **agent skills** — `defineSkill` diff --git a/packages/mcp/README.md b/packages/mcp/README.md index c860b3559aa..d08fedbaf8e 100644 --- a/packages/mcp/README.md +++ b/packages/mcp/README.md @@ -227,13 +227,23 @@ Two prompt families are bridged — there is no per-item prompt registration cal and its `agentName` argument names agents that boot holds; the open framework registers none, so there it is not listed. 2. **One prompt per authored skill** that carries `instructions` (#3905). Write - a `*.skill.ts`, and its instructions become a prompt any connected MCP client + a `*.skill.ts`, and its instructions become a prompt a connected MCP client can list and fetch. The skill **list** is a snapshot taken when the bridge runs; each prompt's **body** is re-read from metadata at `prompts/get` time, so an edited skill serves fresh text without a restart. +`bridgePrompts` lists every such skill on the long-lived server. The HTTP door, +and any server a host installs `registerSkillPrompts` on, offers a skill on +`prompts/list` and `prompts/get` only when that server lists every tool the +skill binds (`SkillSchema.tools`), read from the server's own tool registry when +the prompt request is answered: a plain name by a tool of that name, a trailing +wildcard by any listed tool it matches, and an `action_` entry (or +`action_*`) also by `run_action`. A skill that binds no tool is offered as +before, and `prompts/get` answers a withheld skill as it answers an unknown +prompt name. + ## Extending the server from a host ⚠️ There is **no** imperative `registerTool()` / `registerResource()` / diff --git a/packages/runtime/src/domains/mcp.ts b/packages/runtime/src/domains/mcp.ts index f22b3778a4a..3b86afac888 100644 --- a/packages/runtime/src/domains/mcp.ts +++ b/packages/runtime/src/domains/mcp.ts @@ -1100,7 +1100,9 @@ export function buildMcpBridge( // and the open distribution is MCP-only (BYO-AI): without this read the // type is authorable, lint-validated and consumed by nothing here. The // MCP runtime projects each skill's `instructions` onto the `prompts` - // primitive; the tool-binding half stays cloud-runtime-only. + // primitive. The tool-binding half binds nothing here, but it is read: + // `registerSkillPrompts` offers a skill only when this request's + // server lists every tool the skill binds. // // Resolved through THIS request's per-environment services — the same // seam `listObjects` / `describeObject` use — so a multi-tenant host diff --git a/packages/spec/liveness/skill.json b/packages/spec/liveness/skill.json index 6e4069170f7..3efeb504088 100644 --- a/packages/spec/liveness/skill.json +++ b/packages/spec/liveness/skill.json @@ -1,6 +1,6 @@ { "type": "skill", - "_note": "SkillSchema. Seeded from docs/audits/archive/2026-06/2026-06-skillschema-property-liveness.md. skill-registry.ts + agent-runtime.ts are the runtime consumers. ⚠ EVIDENCE LIVES IN CLOUD/EE: the `cloud @: packages/service-ai/...` paths cited below are the closed `@objectstack/service-ai` runtime in the CLOUD repo, NOT git-tracked framework code. 2026-08-30 (#13272): the previous wording of this sentence was false in BOTH halves. (a) It called the framework's own service-ai tree “a stale build artifact with no src/” — there is no tree at all: `packages/services/` holds every sibling service EXCEPT service-ai, and `git ls-files | grep -ic service-ai` returns 0. Absent, not stale. (b) The citations spelled `packages/services/service-ai/...`, a path present in NEITHER repo; cloud's real layout, measured at cloud@15f55df (commit c19035e97), is `packages/service-ai/...`. Every citation below now carries the explicit `cloud` realm marker, so it is attributed by the marker `scanEvidence` reads rather than riding the `FOREIGN_PATH_PREFIXES` special case that silently exempted the stale spelling from resolution — which is why 22 dead pointers sat green. ✅ RE-VERIFIED 2026-09-15 (#13272): the re-verification half this entry parked is discharged. All eight cloud consumers cited below were re-read in a cloud checkout at cloud @cb8ee7ff60c097cc21a584fe9caf8ef4391cc0e8 and all eight are CONFIRMED; every row now carries `verifiedAt`, `evidenceScope: cross-repo`, and a `#symbol` anchor instead of a line number. The `verifiedAt: 2026-08-06` these eight used to carry was worse than no stamp at all — it was taken while the citation still named `packages/services/service-ai/…`, a path present in NEITHER repo, so it was false confidence that the 180-day staleness clock in verification.mts is structurally unable to see: 40 days old, never flagged, resting on nothing. The anchors are the load-bearing half, and they are why the DATE matters: `scanEvidence` never collects an anchor while a foreign realm marker is in force, so CI cannot re-derive a single one of the cloud anchors — each rests on that dated reading alone. ⛔ Never re-stamp `verifiedAt` here without re-reading cloud; a bare re-stamp restores exactly the unfalsifiable pointer this entry's history is made of. The FRAMEWORK half is the one CI can falsify, and it is now written so it does: `packages/mcp/src/skill-prompts.ts#projectSkillPrompt` sits after a `;`, which ends the cloud realm's scope, so the anchor is LOCAL and `checkEvidenceAnchors` resolves it against the file on every run — where the old parenthesised `(projectSkillPrompt)` was prose the gate never read. ⚠ `instructions` used to cite `(skillPromptResult)`, one hop too far downstream: that function consumes the PROJECTED value, while the record's own `instructions` key is read in `projectSkillPrompt`, which is what the anchor now names. 2026-08-06 (#3905): that used to be the WHOLE story — the open framework consumed nothing here. It now consumes the INSTRUCTIONS half: `packages/mcp/src/skill-prompts.ts` projects every active skill carrying `instructions` onto the MCP `prompts` primitive (name/label/description/instructions/active are read there, in-repo and testable). The TOOL-BINDING half (`tools`, `surface`, `triggerConditions`) stays cloud-runtime-only and now says so in the schema's own JSDoc. See content/docs/ai for the open/cloud boundary. 2026-07-30 (#3896 close-out sweep): the dead authoring keys were REMOVED — tombstoned at the schema with prescriptions (retiredKey) and stripped by the protocol-17 close-out conversions; entries deleted per the #3715 precedent.", + "_note": "SkillSchema. Seeded from docs/audits/archive/2026-06/2026-06-skillschema-property-liveness.md. skill-registry.ts + agent-runtime.ts are the runtime consumers. ⚠ EVIDENCE LIVES IN CLOUD/EE: the `cloud @: packages/service-ai/...` paths cited below are the closed `@objectstack/service-ai` runtime in the CLOUD repo, NOT git-tracked framework code. 2026-08-30 (#13272): the previous wording of this sentence was false in BOTH halves. (a) It called the framework's own service-ai tree “a stale build artifact with no src/” — there is no tree at all: `packages/services/` holds every sibling service EXCEPT service-ai, and `git ls-files | grep -ic service-ai` returns 0. Absent, not stale. (b) The citations spelled `packages/services/service-ai/...`, a path present in NEITHER repo; cloud's real layout, measured at cloud@15f55df (commit c19035e97), is `packages/service-ai/...`. Every citation below now carries the explicit `cloud` realm marker, so it is attributed by the marker `scanEvidence` reads rather than riding the `FOREIGN_PATH_PREFIXES` special case that silently exempted the stale spelling from resolution — which is why 22 dead pointers sat green. ✅ RE-VERIFIED 2026-09-15 (#13272): the re-verification half this entry parked is discharged. All eight cloud consumers cited below were re-read in a cloud checkout at cloud @cb8ee7ff60c097cc21a584fe9caf8ef4391cc0e8 and all eight are CONFIRMED; every row now carries `verifiedAt`, `evidenceScope: cross-repo`, and a `#symbol` anchor instead of a line number. The `verifiedAt: 2026-08-06` these eight used to carry was worse than no stamp at all — it was taken while the citation still named `packages/services/service-ai/…`, a path present in NEITHER repo, so it was false confidence that the 180-day staleness clock in verification.mts is structurally unable to see: 40 days old, never flagged, resting on nothing. The anchors are the load-bearing half, and they are why the DATE matters: `scanEvidence` never collects an anchor while a foreign realm marker is in force, so CI cannot re-derive a single one of the cloud anchors — each rests on that dated reading alone. ⛔ Never re-stamp `verifiedAt` here without re-reading cloud; a bare re-stamp restores exactly the unfalsifiable pointer this entry's history is made of. The FRAMEWORK half is the one CI can falsify, and it is now written so it does: `packages/mcp/src/skill-prompts.ts#projectSkillPrompt` sits after a `;`, which ends the cloud realm's scope, so the anchor is LOCAL and `checkEvidenceAnchors` resolves it against the file on every run — where the old parenthesised `(projectSkillPrompt)` was prose the gate never read. ⚠ `instructions` used to cite `(skillPromptResult)`, one hop too far downstream: that function consumes the PROJECTED value, while the record's own `instructions` key is read in `projectSkillPrompt`, which is what the anchor now names. 2026-08-06 (#3905): that used to be the WHOLE story — the open framework consumed nothing here. It now consumes the INSTRUCTIONS half: `packages/mcp/src/skill-prompts.ts` projects every active skill carrying `instructions` onto the MCP `prompts` primitive (name/label/description/instructions/active are read there, in-repo and testable). The TOOL-BINDING half (`tools`, `surface`, `triggerConditions`) stays cloud-runtime-only and now says so in the schema's own JSDoc. 2026-11-14: `tools` left that half when the MCP prompt surface began reading it to decide whether a skill is offered (its entry below cites the reader); `surface` and `triggerConditions` remain cloud-runtime-only. See content/docs/ai for the open/cloud boundary. 2026-07-30 (#3896 close-out sweep): the dead authoring keys were REMOVED — tombstoned at the schema with prescriptions (retiredKey) and stripped by the protocol-17 close-out conversions; entries deleted per the #3715 precedent.", "props": { "name": { "status": "live", @@ -41,8 +41,8 @@ "status": "live", "verifiedAt": "2026-09-15", "evidenceScope": "cross-repo", - "evidence": "cloud @cb8ee7ff: packages/service-ai/src/skill-registry.ts#flattenToTools — resolved against the registered tool set, with a trailing star subscribing to a family such as action_*; cloud @cb8ee7ff: packages/service-ai/src/skill-registry.ts#composeInstructionsBlock — also listed to the model by name.", - "note": "tool-contribution path incl. action_* wildcard. CLOUD-RUNTIME-ONLY (#3905): MCP exposes one flat tool list to a client-side model, so there is nothing to bind server-side; still validated at authoring time in both distributions." + "evidence": "cloud @cb8ee7ff: packages/service-ai/src/skill-registry.ts#flattenToTools — resolved against the registered tool set, with a trailing star subscribing to a family such as action_*; cloud @cb8ee7ff: packages/service-ai/src/skill-registry.ts#composeInstructionsBlock — also listed to the model by name; packages/mcp/src/skill-prompts.ts#skillBindingServed — read by registerSkillPrompts when a prompt request is answered: a skill is listed and got only when the server's own tool list serves every entry, a plain name by that tool, a trailing star by any match, an action_ entry also by run_action.", + "note": "tool-contribution path incl. action_* wildcard: the cloud runtime composes an agent's tool set from it. In the open framework nothing is bound (MCP exposes one flat tool list to a client-side model), but the binding is read: the prompt surface `registerSkillPrompts` installs offers the skill only on a server that lists every bound tool, on the HTTP door and on any host server that calls it; `MCPServerRuntime.bridgePrompts` projects skills onto the long-lived server without that filter. Still validated at authoring time in both distributions." }, "triggerConditions": { "status": "live",