Files
writing-agent/docs/worker-skill-format.md
moran 6392af54b4 完善配方驱动的创作编排
为可重复技能补充参数校验与展示,统一配方、编排器和执行单元术语。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-30 17:59:20 +08:00

3.3 KiB
Raw Blame History

Worker Skill 格式

文档层级Worker / 声明契约格式(非系统架构)。
上下文编译原则见 architecture.mdcontext-assembly.md
现行包落地skills/dialogue/world-simulator/README.md

1. 定位(现行:声明驱动)

默认包 world-simulator

play 时执行契约 = accept 后的 设计.worker集 某条 workers[](实例 Worker 声明)
可选模板       = worker-templates/{ref}.yamldesign 缺省合并默认值)
磁盘 SKILL.md  = 仅创作阶段必要 workerdesign-flow / design-step / opening-generator
技能正文       = modules/{id}/prompt.md由 design-step 注入,不是独立 worker

编排器 run_worker(id) → Runtime 校验 id ∈ Worker 声明 → 从 Worker 集条目+ 可选模板合并)拼 prompt → 写声明的 outputs

不要为每个 play ref 预置 workers/narrator/SKILL.md;实例差异写在 Worker 集里。

规格见 docs/tag-blackboard.mddocs/context-assembly.mdskills/dialogue/world-simulator/worker-templates/


2. 创作阶段 Worker磁盘 SKILL.md

仅包内 design 专用 worker 用磁盘文件:

skills/dialogue/world-simulator/
├── orchestrator.md
├── modules/{id}/prompt.md     # 能力切片(非 SKILL.md
├── worker-templates/          # 可选模板,非执行文件
└── workers/
    ├── design-flow/SKILL.md
    ├── design-step/SKILL.md
    └── opening-generator/SKILL.md
  • 目录名 = worker id。
  • 文件名固定 SKILL.md

design-intake / design-core / design-fixed / design-worker / design-refine 已移除


3. Design Worker Frontmatter示例

---
id: design-step
skill: world-simulator
name: 创作 · 执行能力步
stage: design
inputTags:
  - "用户.需求"
  - "设计.创作流程"
outputTags:
  - "设计.worker集.草稿"
inputMerge: latest
---
字段 用途
id worker id
skill 所属包 name
inputTags / outputTags 黑板读写白名单
contextSegments 可选;上下拼接

3.1 contextSegments

docs/context-assembly.md


4. 实例声明字段(写入 设计.worker集

refine 能力 / design 收口产出的每条 worker

workers:
  - ref: narrator          # 能力库 idnull = gap
    role: transcription
    duty: 
    when: 
    rationale: 
    context:
      static: [设计.worker集]
      dynamic: [运行.本轮.裁决]
    outputs: [输出.用户展示]
    presentation:
      tone: 

未写全的 context/outputs 可由 worker-templates/{ref}.yaml 合并。


5. 执行要点

  • Agent 指定 inputTags读 Worker 声明 / 模板。
  • ref: null + gap:声明了职责但无模板 / SKILL需补声明或 temp worker。
  • 验收design-flow / design-step 默认需用户确认play 中间 worker 可 no_confirmation

相关

文档 关系
creation-playbook.md 创作流
world-simulator-modules.md 能力 / 编排器清单
worker-declaration.ts Runtime 声明校验
worker-templates/README.md 可选模板