Skip to content

记录 AI 问询 8:技能键 context,MCP 技能提示词可带记录参数 #37141

Backlog

Description

@objectstack-fleet

repo:cloud#1 · os-warren · session_01JQwxbZSA7o5vcLjQjM1myV

Filing gate: ③ maintainer-directed. Source: topic #36996. Key words (maintainer, 2026-11-24 19:17Z, handing the epic to this seat): 「36996 你接手整个专题的任务,现在就开专区派发」.
Grading: area:ai · Feature · p2 (topic child at the epic's level; it blocks row 9) · reach: n/a (new capability) · evidence: read.

维护者速读

  • 做什么:技能可以声明自己用哪个资料包(新键 context)。外部 AI 经 MCP 调这个技能时可以带一条记录的编号,提示词会让模型先调 get_record_context 读这条记录的资料。
  • 谁受益:写制度问询、客户问询这类技能的作者。外部 AI 用户一步就拿到针对这条记录的技能。
  • 不做会怎样:技能和资料包连不上,应用内助手(第 9 行)也没有可读的键。
  • 需要你做的:无。

What

Implements ADR-0160 D8:

  1. packages/spec/src/ai/skill.zod.ts#SkillSchema gains context?: string.
    • A skill that declares it must bind get_record_context in tools, by name or by a matching wildcard. Otherwise it is refused at parse.
    • The key gets its row in packages/spec/liveness/skill.json, with its reader.
  2. packages/mcp/src/skill-prompts.ts: a skill with context lists one optional prompt argument, the record id.
    • When the argument is given, the message carries three things:
      • the skill's instructions;
      • one fixed platform line telling the model to call get_record_context with the arguments that follow;
      • those arguments as one JSON object (objectName, recordId, context).
    • The record id is never joined into the line, and the pack is never inlined.
    • Without the argument, the prompt is unchanged.
  3. A context that names no pack is reported where skills are validated.
  4. packages/spec/src/ai/skill.form.ts gains a control for context. Precedent: #19188 split: 47 top-level zod-only keys are scalar controls needing one form row each #19331, where surface was declared but had no control.
  5. When context names no existing pack, the prompt lists no record argument and is exactly today's prompt. Reading the pack is what fills objectName.
  6. Advisory validation (ADR-0160 point 1, as accepted with conditions on 2026-11-25): warn when an object has more than one pack and a skill binds get_record_context without context.

Expected after this lands: until row 9, packages/lint/src/validate-ai-tool-references.ts warns on get_record_context for a skill with mcpPrompt: false that declares context. ADR-0160's split note says the warning is expected and true. Do not suppress it. #37190 ends it.

Acceptance

  • Metadata-protocol: added, with its Skills-docs: line.
  • Tests:
    • the parse refusal without the binding;
    • the argument list;
    • the message shape with and without the argument;
    • the record id appears only as a JSON string value;
    • context naming no pack: no record argument, and the prompt is unchanged;
    • a connection that does not serve get_record_context does not serve the skill (skillBindingServed, as D8 says);
    • the advisory warning of item 6.

Changes (added 2026-11-25)

Added by the maintainer's session (maintainer · os-bob · session_012dn2AecKpLaYkUtNRiqtby) after an independent Fable review of rows 5–10, which the maintainer accepted: 「同意你的建议」.

Blocked-by: #37140
Blocked-by: #37180

Parent: #36996 (row 8). Reader: the epic's owning seat (repo:cloud#1), which dispatches it when row 5 merges.
Dedupe (objectstack, is:issue, open and closed): "skill prompt" in:title 7 (all closed; #32767 binding served, #34237 docs, #36650 knowledge tool; none adds an argument) · "mcpPrompt" context record 1 (#35068 closed, unrelated).

Activity

  1. added
    priority:p2
    pm:blocked
    area:ai
    on Nov 24, 2026
  2. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    Blocker added 2026-11-25T04:12Z at repo:objectstack#3's request (7152609034; L1-w nit N3, 7152486548)

    Blocked-by: #37216

  3. added
    pm:queue
    and removed
    pm:blocked
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:aipm:queuepriority:p2

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions