重构世界模拟器为模块化配方架构,完善创作编排、会话运行时与 Web UI,并清理过时技能。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-30 00:39:32 +08:00
parent 2b74c30d36
commit e670a5129c
167 changed files with 22955 additions and 5659 deletions

View File

@@ -1,37 +1,41 @@
# 总管 Skill 格式Orchestrator / Manifest
> **文档层级Skill 包 manifest 格式(非系统架构)。**
> 总管与相位机边界见 [`architecture.md`](./architecture.md)、[`runtime-state-machine.md`](./runtime-state-machine.md)。
## 1. 定位
**orchestrator.md** = 本包的 **manifest**:注册有哪些 skill、如何验收、如何声明 instance ready。
**不**写逐步流水线剧本**不**写「总管思维链」逐步调度
**orchestrator.md** = 本包的 **manifest**:注册有哪些 capability、如何验收、何时可进 play。
**不**写逐步流水线剧本。
**创作方法**见 **`design-orchestrator-guide.md`**(三大步、表、自检)。
```text
用户选
→ designagent 按需 invoke instantiate skill
declare ready → playagent invoke run skill
done归档 Book
新建作品 → 默认
→ designdesign-intake → 设计.worker集 JSON实例声明
用户验收 → 用户手动进 play
playAgent 按 Worker 声明 invoke worker
```
| 谁决定 | 什么 |
|--------|------|
| **Agent** | 何时 invoke 哪个 skilltool loop |
| **Manifest** | 可用 skill 列表、验收策略、readiness 规则 |
| **Worker SKILL.md** | inputTags、contextSegments、怎么做 |
| **Agent** | 何时 invoke 哪个 worker idtool loop |
| **Manifest** | design worker 列表、验收策略、readiness |
| **Worker ** | 本实例启哪些 worker、表、常驻上下文、副作用 |
| **templates** | design-intake 合并用的可选默认契约(非运行时权威) |
`shared-context.md`:包级 **固定上下文上半**,注入各 worker prompt。总管不读
`architecture.md``skill-design-guide.md``context-assembly.md`
`architecture.md``creation-playbook.md``design-orchestrator-guide.md`
---
## 2. 存储位置
```text
skills/novel/weird-rules-short/
skills/dialogue/world-simulator/
├── orchestrator.md
├── shared-context.md # 可选
├── worker-templates/ # 可选 ref 模板design 缺省)
└── workers/
└── write-rules/SKILL.md
└── design-intake/SKILL.md
```
- 文件固定名 **`orchestrator.md`**。
@@ -43,142 +47,74 @@ skills/novel/weird-rules-short/
```yaml
---
name: weird-rules-short
description: >-
何时选用:用户要写规则怪谈、守则类短篇。
category: novel
bookKind: novel
name: world-simulator
description: >
默认能力库Worker 集即实例声明…
category: dialogue
bookKind: dialogue
workers:
- write-rules
- review-infer
- review-author
sharedContext: shared-context.md
- design-intake
demandTag: 用户.需求
startupMode: agent-first
uiPrompt: |
---
```
| 字段 | 用途 |
|------|------|
| `description` | 何时选本包 |
| `workers` | run / design 可调度 skill id 白名单loader 用) |
| `bookKind` | Book 存储形态 |
---
## 4. 正文章节(推荐)
```markdown
# 标题
## 启动询问 # 最小 intake
## Skill 注册表 # instantiate + run skill 清单与说明(见 §5
## 验收策略 # 哪些 skill 产出需 user_confirmed / approve
## Instance Ready # 按 run_skill清单 的动态最低可行性
## contextProfile # 可选 variant 说明(见 context-assembly.md
## 用户回合 # user-turn 等(可选)
## 禁用行为
```
**不应出现:**
- 逐步 **Worker 编排表** / **总管思维链**(已废弃为主流程)
- `inputTags` / `outputTags` 列表 → 在 `workers/*/SKILL.md`
- 写作细则 → Worker SKILL 正文
---
## 5. Skill 注册表(替代编排表)
列出本包 **能力库**,供 agent `list_workers` 与 manifest 校验:
## 4. Manifest 正文应有的节
```markdown
## Skill 注册表
### Instantiatedesign stage
| id | 说明 | 典型 outputTags |
|----|------|-----------------|
| interaction-paradigm | 定交互范式与 run_skill清单 | 设计.run_skill清单 |
| world-blueprint | 世界背景 | 设计.世界.蓝图 |
| persona-draft | 角色卡草稿 | 角色卡.草稿 |
### Runplay stage
| id | 说明 | 默认 acceptance |
|----|------|-----------------|
| write-rules | 写规则 | user_confirmed |
| review-infer | 读者视角验收 | programmatic_review |
## Instance Ready / 进入游玩
## 验收策略
## 总管优先行为
## 禁用行为
```
agent **按需 invoke**,不必按表顺序跑全。
**不应包含:** 「第 N 步必须跑某 worker」管道剧本。
方法细节指向 `design-orchestrator-guide.md`,勿在 manifest 重复长文。
---
## 6. 启动询问与 Instance Ready
## 5. Skill 注册表
**启动询问:** 只收集 agent 无法从空推断的最小信息 → `用户.需求` 等。
### Design
**Instance Ready** 不写死「14 步全完成」,而写:
| id | 说明 |
|----|------|
| design-intake | 产出 设计.worker集 JSON |
| (可选)开局赋初值 | 创作末尾可选,非每轮 |
### Play
不在 manifest 写死清单。Agent 只调度 **`设计.worker集` 声明内的 ref**。
---
## 6. Instance Ready
```markdown
## Instance Ready
`设计.run_skill清单` 已 accepted且清单中每个 run skill 的
**最低 input 要求**(见各 SKILL.md已在黑板存在或已记录跳过理由。
由 agent `declare_instance_ready` + Runtime 校验。
`设计.worker集` 已 accepted进 play 由用户手动决定。
```
---
## 7. 验收策略
```markdown
## 验收策略
| skill | requiresApproval | acceptanceMode |
|-------|------------------|----------------|
| setup-scenario | true | user_confirmed |
| world-engine | false | no_confirmation |
| present-round | false | user_confirmed |
```
| design-intake | true | user_confirmed |
agent 通过 `run_worker(..., requiresApproval)` 触发;默认值也可写在 manifest 供 Runtime 填充
play**无**每轮强制验收;用户新输入 = 认可上轮终稿;重 roll 替代 reject
---
## 8. contextProfile
若同一 skill 有多种游玩/创作模式,在 manifest 列出 variant 名与含义;实例化写入 Book。
格式见 `context-assembly.md`
---
## 9. 与 Worker SKILL 的关系
## 8. 与 Worker 声明的关系
```text
orchestrator.md 注册 + 验收 + readiness
workers/*/SKILL.md 能力 + 上下文契约contextSegments
accept 设计.worker集 → Runtime 构建 InstanceWorkerDeclaration
play仅允许声明内 activeWorkerIds
表维护 / 副作用按规格边沿触发(见 design-orchestrator-guide §5
```
Prompt 注入:
```text
Agentsession 摘要 + tool可用 read_blackboard
Workershared-context + SKILL + assembleWorkerContext上固定下动态
```
---
## 10. 迁移说明
旧包中的 `## Worker 编排``## 总管思维链` 仍可作为 **人工参考**,但新包与 world-simulator **不应**以此为主流程。
Runtime 目标态以 agent tool loop + manifest 注册表为准。
---
## 11. 相关文档
| 文档 | 关系 |
|------|------|
| `skill-design-guide.md` | 设计方法 |
| `worker-skill-format.md` | SKILL.md 字段 |
| `creation-playbook.md` | 概念 |