Repository navigation
docs(skills): the AI skill teaches a skill's context key and its MCP record argument - #37674
Conversation
…record argument SKILL.md lists `context` among a skill's optional keys: a context pack's bare name, resolved in the skill's package and then its dependency closure, refused at parse unless `tools` binds get_record_context. references/context-packs.md says how such a skill is offered over MCP (an optional recordId; the message carries the instructions, a fixed line and the call's arguments as JSON, never the record) and names the two `os validate` warnings for it. Both files stay inside their token ratchet rows: the growth is paid by deletions in the same file. Claude-Session: https://claude.ai/code/session_01Utp6CYC7pf2mDNT5AVFPLL Co-authored-by: Claude <noreply@anthropic.com>
…or the skills catalog The reference keeps "give a list its where, orderBy and limit" and "give a long body headings". The new paragraph and the two lint rows are paid for by lines the file's own tables and bullets already carry. Claude-Session: https://claude.ai/code/session_01Utp6CYC7pf2mDNT5AVFPLL Co-authored-by: Claude <noreply@anthropic.com>
Case 12 of the ai skill's eval fixture asks for a skill over a shipped context pack that an external agent can start from a record over MCP. The expected answer declares `context` by the pack's bare name, binds get_record_context in `tools`, and says the prompt takes an optional recordId. The reference answer carries every token it requires and none it forbids. Claude-Session: https://claude.ai/code/session_01Utp6CYC7pf2mDNT5AVFPLL Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head 0c30388 · 2026-11-26T20:05Z |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract reviewServed-tier: Inputs read: card #37611 (body and its 5 comments), PR #37674 (body, 4-file list, net diff against ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentNo must-fix, no should-fix.
Security-touching: yes, and why. Changed hunks restate permission and scope behaviour: "reads every part as the caller: a pack grants nothing and hides nothing", "Over MCP it sits under Seat questions, in short:
Implemented-by: VERDICT: PASS |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X 维护者速读
席位意见:ACCEPT。教的内容都能在代码里找到出处,删掉的两句不影响含义,只剩 2 个 nit。 席位核对Head-sha:
|
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Adding |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Approval requested (Tier H, |
Requested by Bill · project thread
Fixes #37611
维护者速读
What changes
Three files of the published
objectstack-aiskill, plus apatchchangeset for@objectstack/skills.skills/objectstack-ai/SKILL.md, Skill Configuration: the optional-keys table gains acontextrow. It is the bare name of the context pack the skill works from, resolved in the skill's package and then its dependency closure, and the parse refuses the skill unlesstoolsbindsget_record_context, by name or wildcard. The Context packs pointer names "a skill'scontextover MCP" among what the reference holds.skills/objectstack-ai/references/context-packs.md, Serving and calling it: one paragraph on a skill'scontext. Where the name resolves to a pack and the server servesget_record_context, the skill's MCP prompt takes an optionalrecordId. With it the message is the instructions, a fixed line asking for that call and its arguments as JSON, and the record is never inlined. Without it the prompt is unchanged. Theos validatetable gains two rows:ai-skill-context-unknown(acontextno pack of the stack's own has; a dependency's pack is not read) andai-skill-context-omitted(a skill binding the tool withoutcontext, while an object has several packs). The table's second header becomes "Reported for", since two rows are now about a skill.skills/objectstack-ai/evals/skills-tools-knowledge.json: case 12 asks for a skill over a shipped context pack that an external agent can start from a record over MCP. The file joined the surface by claim amendment 7201200927, and the maintainer chose to carry the case in this pull request (decision card in the project thread, 2026-11-26T19:22Z).Both prose files sat at or within 3 tokens of their ratchet row, so the new words are paid for in the same file. No ceiling moves and no ratchet row is edited.
What
SKILL.mdgives upinstructionsrow: "for this skill's context"instructionsrow: "The one field the open edition serves:" becomes "On the open edition"tools,mcpPromptand nowcontextare read there too. Which keys are inert on the open edition is said under Platform agentsinstructionsrow: "is not listed as a prompt at all" becomes "is not listed"promptsprimitivetoolsrow's "every name must resolve"; "materialised from this stack's own Action" is rung 3 of the ladder above itWhat
context-packs.mdgives upfields,relatedandbodyrows400")namerow: "; what the tool'scontextargument names"contexttakes a pack's face"labelrow: ", and how the pack is listed when its object has several"label"objectrow: "A call reads one record of it"fieldsrow: "root"objectis "The root object"whererow: "Which rows:"limitrow: "20 is the default and the cap. A cut list says so in the answer" becomes "default 20"notessay what was withheld or cut" is under Serving and calling itanchor, and the model reads one section by calling again with thatanchor" becomes "the model reads one section by calling again with a heading'sanchor"409" becomes "or is refused409"os validatereports it as a warning:" becomes one sentenceKept on the area's word: the two pieces of authoring advice ("Give a list its
where,orderByandlimit…" and "…so give a long body headings") and ", as a skill is". An earlier draft cut them.Why
mainhas the key and the argument since the parent card's pull request landed (ADR-0160 D8; resolution by ADR-0150 D3). The published skill named neither, so an assistant that learns skill authoring from it could not tell an author that a skill can name its pack, that the binding is required, or what an MCP client gets for a record id.Read against
mainat6592546c:packages/spec/src/ai/skill.zod.ts:contextis an optional bare name (a face is refused by the name pattern);refuseUnboundRecordContextrefuses a skill that declares it withoutget_record_contextbound, by name or a matching wildcard (skillBindsRecordContextTool).packages/mcp/src/skill-prompts.ts:skillPromptRecordContextresolves the name from the skill's package, then its closure; a prompt whose pack resolves listsrecordId(optional);skillPromptResultbuilds the message as the instructions, a blank line, the fixed line, and the call as one JSON object. The stdio server offers the argument only where it registersget_record_context; the HTTP door serves the skill only where the server serves every tool it binds.packages/lint/src/validate-ai-tool-references.ts: the two rule ids, both warnings; the unknown-pack rule reads the stack's ownaiContextsonly.Tests
Documentation and an eval fixture only: no package source changes, so no package test suite is owed. No ablation: the diff changes no tested behaviour.
Readings for a
skills/**diff, base6592546cagainst head0c303888:SKILL.mdlinesSKILL.mdbytesSKILL.mdtokens (ceiling 6801)context-packs.mdlinescontext-packs.mdbytescontext-packs.mdtokens (ceiling 1454)skills-tools-knowledge.jsontokens (measured, not ratcheted)skills/*/SKILL.mdlines, summedThe bundle grows by 336 tokens: 1 in
SKILL.mdand 335 in the eval fixture, which the ratchet measures and does not price.The eval case's reference answer carries each of its five
must_containtokens and neithermust_not_containtoken (checked by script against the grader's literal match).Acceptance notes
mainhas them; the ratchet exits 0; skills gates andcheck:generatedgreen): see Why for the readings;node scripts/check-skills-token-ratchet.mjsexits 0 with both rows inside their ceiling;check:skill-docs,check:skill-refs,check:skill-examples(352 prose examples) and speccheck:generated(14 artifacts up to date) are green. No generated mirror moved.Clause-②: noandMetadata-protocol: noneare below and in the changeset.recordIdis refused (-32602); an environment skill resolves itscontextas a caller with no package; a host that hands the prompt surface no package closure resolves a package skill'scontextin its own package only; the omitted-context warning is one finding per object. None is something an author writes differently for.skills/**ships as@objectstack/skillsand the changeset check requires one; the level ispatch(Metadata-protocol: none).SKILL.mdcitespackages/spec/src/ai/skill.zod.ts:37-51, 139-202under Trigger Conditions. The merged change added an import to that file, so those ranges now sit one line low. A line citation in published prose drifts with every edit to the file it names.Claude-Sessiontrailer names this card thread's own session, as the harness stamps it, where the order printed the area's session. The trailer pair is model-free andcheck:commit-card-trailersaccepts it.Verification
Two-minute check:
node scripts/check-skills-token-ratchet.mjsprintsskills/objectstack-ai/SKILL.md is 6799 tokens (ceiling 6801; headroom 2)andcontext-packs.md is 1454 tokens (ceiling 1454; headroom 0), and exits 0.Read first, by risk: (1) the
contextrow inSKILL.mdagainstrefuseUnboundRecordContext; (2) the "A skill'scontext" paragraph and the two new table rows incontext-packs.mdagainstskill-prompts.tsand the lint rule; (3) the two cut tables above, for any line you would rather keep.Local gates at 0c30388 (derived by dispatch-gates --commands, all run after the last commit)
Clause-②: no
Metadata-protocol: none
Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintpasses. (no formatter ran; the repo-wide lint is CI's run)main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code