cowork-flow 1.8.0 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -1
- package/CONTRIBUTING.md +8 -36
- package/README.en.md +180 -0
- package/README.md +12 -16
- package/docs/architecture.md +4 -2
- package/docs/direction.md +35 -149
- package/docs/hosts.md +6 -5
- package/docs/index.md +7 -12
- package/docs/release.md +4 -2
- package/package.json +4 -3
- package/presets/claude-code/.claude-plugin/plugin.json +1 -1
- package/presets/codex/.codex-plugin/plugin.json +1 -1
- package/presets/kimi-code/.kimi-plugin/plugin.json +1 -1
- package/presets/opencode/cowork-flow/plugin-core.js +136 -869
- package/presets/opencode/plugins/cowork-flow.js +10 -3
- package/presets/qoder/.qoder-plugin/plugin.json +1 -1
- package/presets/qoder/agents/cowork-check.md +1 -1
- package/presets/qoder/agents/cowork-implement.md +1 -1
- package/presets/zcode/.zcode-plugin/plugin.json +1 -1
- package/presets/zcode/agents/cowork-check.md +1 -1
- package/presets/zcode/agents/cowork-implement.md +1 -1
- package/src/commands/host.js +1 -1
- package/src/commands/install-claude-code-plugin.js +45 -84
- package/src/commands/install-dsh-hook.js +22 -28
- package/src/commands/install-dsh-preset.js +5 -6
- package/src/commands/install-kimi-code-plugin.js +100 -90
- package/src/commands/install-kimi-hook.js +42 -34
- package/src/commands/install-opencode-plugin.js +49 -117
- package/src/commands/install-qoder-plugin.js +3 -10
- package/src/commands/install-zcode-plugin.js +2 -6
- package/src/commands/source-refresh.js +3 -0
- package/src/commands/sync.js +3 -0
- package/src/lib/copy-template.js +136 -7
- package/src/lib/host-assets.js +4 -0
- package/src/lib/install-support.js +14 -1
- package/src/lib/kimi-installed-registry.js +100 -0
- package/src/lib/payload-install.js +185 -0
- package/template/.claude/agents/cowork-check.md +1 -1
- package/template/.claude/agents/cowork-implement.md +1 -1
- package/template/.codex/agents/cowork-check.toml +1 -1
- package/template/.codex/agents/cowork-implement.toml +1 -1
- package/template/.cowork-flow/.version +1 -1
- package/template/.cowork-flow/scripts/adapters/cli/spec_check.py +17 -1
- package/template/.cowork-flow/scripts/adapters/cli/subagent.py +71 -0
- package/template/.cowork-flow/scripts/adapters/cli/task.py +2 -0
- package/template/.cowork-flow/scripts/adapters/cli/task_archive_commands.py +24 -0
- package/template/.cowork-flow/scripts/adapters/cli/task_create_command.py +3 -0
- package/template/.cowork-flow/scripts/adapters/cli/task_lifecycle_commands.py +107 -0
- package/template/.cowork-flow/scripts/adapters/cli/task_navigation.py +2 -0
- package/template/.cowork-flow/scripts/adapters/cli/task_next_runner.py +95 -8
- package/template/.cowork-flow/scripts/adapters/cli/task_parser.py +55 -1
- package/template/.cowork-flow/scripts/adapters/cli/task_tree_commands.py +25 -15
- package/template/.cowork-flow/scripts/adapters/host/inject.py +3 -3
- package/template/.cowork-flow/scripts/adapters/host/opencode_policy.py +32 -0
- package/template/.cowork-flow/scripts/adapters/host/workflow_state_hook.py +1 -0
- package/template/.cowork-flow/scripts/adapters/mcp/state_server.py +4 -1
- package/template/.cowork-flow/scripts/adapters/review/test_intent.py +11 -1
- package/template/.cowork-flow/scripts/runtime/host_identity.py +4 -4
- package/template/.cowork-flow/scripts/services/context_paths.py +3 -3
- package/template/.cowork-flow/scripts/services/fact_view.py +37 -9
- package/template/.cowork-flow/scripts/services/lifecycle_checks.py +431 -53
- package/template/.cowork-flow/scripts/services/lifecycle_policy.py +13 -0
- package/template/.cowork-flow/scripts/services/review_receipt.py +254 -0
- package/template/.cowork-flow/scripts/services/spec_check.py +58 -0
- package/template/.cowork-flow/scripts/services/task_board.py +83 -0
- package/template/.cowork-flow/scripts/services/task_context.py +14 -8
- package/template/.cowork-flow/scripts/services/task_creation.py +130 -5
- package/template/.cowork-flow/scripts/services/task_gate_profiles.py +141 -0
- package/template/.cowork-flow/scripts/services/task_graph.py +134 -0
- package/template/.cowork-flow/scripts/services/task_lifecycle.py +193 -15
- package/template/.cowork-flow/scripts/services/task_tree.py +3 -0
- package/template/.cowork-flow/spec/contracts/context-injection.md +35 -37
- package/template/.cowork-flow/spec/contracts/decision-anchor.md +119 -55
- package/template/.cowork-flow/spec/contracts/error-codes.md +48 -0
- package/template/.cowork-flow/spec/contracts/error-output-as-data.md +54 -37
- package/template/.cowork-flow/spec/contracts/evidence-completion.md +65 -28
- package/template/.cowork-flow/spec/contracts/fact-layer-access.md +1 -1
- package/template/.cowork-flow/spec/contracts/index.md +19 -15
- package/template/.cowork-flow/spec/contracts/plan-binding.md +56 -40
- package/template/.cowork-flow/spec/contracts/spec-checks.md +243 -57
- package/template/.cowork-flow/spec/contracts/subagent-dispatch.md +25 -0
- package/template/.cowork-flow/spec/contracts/task-adopt.md +92 -0
- package/template/.cowork-flow/spec/contracts/task-board.md +74 -0
- package/template/.cowork-flow/spec/contracts/workflow-state-templates.md +10 -0
- package/template/.cowork-flow/spec/references/orchestration-patterns.md +3 -1
- package/template/.kimi-code/agents/cowork-check.md +1 -1
- package/template/.kimi-code/agents/cowork-implement.md +1 -1
- package/template/.opencode/agents/cowork-check.md +1 -1
- package/template/.opencode/agents/cowork-implement.md +1 -1
- package/template/.opencode/cowork-flow/plugin-core.js +136 -869
- package/template/.opencode/plugins/cowork-flow.js +10 -3
- package/template/AGENTS.md +1 -0
- package/template/CLAUDE.md +1 -1
- package/template/skills/agent-dispatch/SKILL.md +3 -2
- package/template/skills/batch-execution/SKILL.md +1 -1
- package/template/skills/cowork-flow/SKILL.md +13 -0
- package/template/skills/cowork-flow-maintenance/SKILL.md +2 -0
- package/template/skills/cowork-flow-maintenance/manifest.json +2 -2
- package/template/skills/runtime-health/scripts/doctor.py +26 -11
- package/template/skills/task-planning/SKILL.md +6 -2
- package/template/skills/task-review/SKILL.md +26 -3
- package/template/.cowork-flow/spec/game/asset-pipeline.md +0 -53
- package/template/.cowork-flow/spec/game/engine-guidelines.md +0 -43
- package/template/.cowork-flow/spec/game/index.md +0 -23
- package/template/.cowork-flow/spec/game/multiplayer-guidelines.md +0 -44
- package/template/.cowork-flow/spec/game/performance-guidelines.md +0 -58
- package/template/skills/decision-audit/SKILL.md +0 -23
- package/template/skills/decision-audit/manifest.json +0 -11
- package/template/skills/game-design/SKILL.md +0 -39
- package/template/skills/game-design/manifest.json +0 -11
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,47 @@
|
|
|
4
4
|
|
|
5
5
|
### Added
|
|
6
6
|
|
|
7
|
+
## [1.9.1] - 2026-10-14
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- **CI 与发布校验在 Node 20 全红(1.9.0 发布阻断)**:`compliance-e2e` 用例嵌套的 `node --test` 断言写死了 Node 22+ 默认 reporter 的 `✔`/`﹣` 标记,CI 的 Node 20 默认输出 TAP(`ok N -`),断言恒失败——v1.9.0 的 test / windows-core / verify 各环节全红、publish 跳过、npm 未上架。嵌套 spawn 现在显式钉 `--test-reporter=spec`,Node 20 / 24 双绿。
|
|
12
|
+
- **Windows 上 Kimi Code hook 重复安装会双注册**:TOML basic string 把安装路径的反斜杠转义成 `\\`,归属比较此前只做单斜杠替换,`\\` 折叠成 `//` 后与单斜杠形式不相等,自身的 `[[hooks]]` 行恒不被识别——第二次安装追加第二行钩子(双次注入)。分隔符归一化改为折叠连续 `[\\/]+`,并新增"无标记旧行被接管而非复制"的回归测试。
|
|
13
|
+
|
|
14
|
+
## [1.9.0] - 2026-10-14
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- **多执行者协作事实(1.9.0 主线)**:把 executor / evidence / adopt 语义补成团队协调原语,让 `.cowork-flow/tasks/` 在多 agent 场景下当共享看板。① **看板归属可见**:`task next --list --json` 与 MCP `task_list`(同一实现)每条记录新增 `executor` / `ownerSessionActive`(提示位:是否有会话绑定该任务,不裁决孤儿)/ `evidenceCoverage` / `blocked` / `blockedBy`——第二个执行者不跑 `run state` 就能看出谁在占用、有没有卡住、证据到哪了。② **依赖边**:`task next --run --title ... --depends-on <task>`(可重复,完整目录名)在创建时写入 `task.json` 的 `dependsOn`,声明期 fail-closed(目标不存在 / 自依赖 / 环分别报 `TASK-CREATE-DEPENDENCY-001/002/003`,失败不落盘;归档任务按已完成依赖解析);start 门禁 `LIFECYCLE-DEPENDENCY-001`——依赖未全部 completed 时阻断进入 in_progress,导航 payload 与 `--run` 报同一 blocker 文本,已启动任务不受回溯影响,adopt/review/complete 不受约束。③ **交接凭证**:adopt 成功后打印 Handover 段(原执行者 → 新执行者、原基线 → 新基线、剩余未勾选 AC、证据覆盖 n/m)。契约见 `.cowork-flow/spec/contracts/task-board.md`。
|
|
19
|
+
- **严格任务门禁与验收闭环(10 月门禁轮)**:新建任务默认 `strict`——创建期必须声明 dev_type(`backend|frontend|fullstack|test|spec`,报 `TASK-CREATE-DEVTYPE-001`);完成期重新校验 decision-anchor 与证据:仍有未勾选 AC 报 `LIFECYCLE-AC-001`、已声明 AC 缺 `evidence.jsonl` 记录报 `002`(唯一可被 `--allow-missing-evidence` 豁免的码)、strict 任务读不到 AC 行报 `003`、证据模块不可导入报 `004`。轻量路径 `meta.taskType=tiny`:strict+tiny 免复核凭证与 AC 证据,但只能创建期声明、`task next --list` 与 doctor 可见、不得用于触碰 runtime/门禁/spec 的任务。
|
|
20
|
+
- **独立复核凭证与变更指纹**:`subagent check-review` 把 cowork-check 的结论写入 `review.jsonl`,完成门禁消费——无凭证报 `LIFECYCLE-REVIEW-001`、最新一条非 pass 报 `002`、指纹过期报 `003`、来源回查失败报 `004`;接收侧守卫 `REVIEW-RECEIPT-001..007`(上下文形态 / agent 类型 / 任务绑定 / 真实 runtime 绑定回查),`by` 字段不算独立性证据。16 hex 变更指纹的分量 = 变更内容摘要 + anchor 目标与 AC 正文 + plan 摘要 + dev_type + 被引用规范正文 + implement.jsonl 摘要——改代码 / 规范 / AC 即凭证失效,需重跑复核。
|
|
21
|
+
- **spec-check 可遵循闭环(spec-check 后续)**:每次运行携带 `summary.classification` 分类事实(`parse-error` / `executor-failure` / `zero-declaration` / `violation` / `unchecked` / `pass` / `empty`,`--json` 可查);整只执行器损坏单独阻断(executor-failure,`--allow-unchecked` 不豁免);豁免明细(flag / by)在完成与归档同源打印;零声明处给出下游 AI 的指路,契约 quick-start 示例可从交付文件整段抽用。
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- **技能面收敛(16→14)**:删除 `decision-audit`(与 `adversarial-review` 是同一段 CLAIM/DOUBT 复核循环的两份文本)与 `game-design`(连同 `spec/game/` 5 个文件);`cowork-flow-maintenance` 路由收紧为 `template/**` + `presets/**`;固定代理提示统一指向 `adversarial-review`。
|
|
26
|
+
- **复核报告三元组**:`subagent check-review --finding` 的每条 finding 必须携带 clause / command / negativeProof(无命令可判的显式给 null),把取证方式写进复核契约。
|
|
27
|
+
- **发布门禁覆盖自实例与实例路径**:`release:check` 增加 self-instance-drift(自实例镜像须与 `template/` 一致,`source:refresh` 消除漂移)与 doctor error 级阻断;PR CI 与发布共用同一门禁。
|
|
28
|
+
- **文档事实源收敛与契约英文化**:README / AGENTS / docs / spec 四层去重消死、统一称谓、控制面唯一化;契约正文英文化并补英文版 README;新增 `spec/contracts/error-codes.md` 汇总全部 `LIFECYCLE-*` 码(code 是稳定契约、消息文本不承诺稳定)。
|
|
29
|
+
- **子代理派发默认化(技能层)**:`cowork-flow` 技能新增 Delegation 段——计划并行切片逐片派发 `cowork-implement`(切片简报走运行时上下文 assignment,协议引用 `subagent-dispatch.md`)、完成前的 `cowork-check` 派发显式写入流程(不再靠撞门禁)、调研型任务可 `cowork-research` 扇出(2–3 个),协议传输细节仍由 `subagent init` 输出与 `subagent-dispatch.md` 承载、路由技能不复刻;`task-planning` 的 Parallel Work 补两条:并行项注明 dispatch(`main` | `cowork-implement`)、同一工作树内不可并行两个任务(范围门禁读取工作树全量变更,跨任务并行走独立 worktree/clone + 看板依赖边);`agent-dispatch` 绑定步骤改为从运行时上下文读取 assignment(`goal` / `expected_output`);`orchestration-patterns` 模式 1 使用场景改为可操作触发、模式 2 验证清单补收束与单树约束。零 runtime 代码变更。
|
|
30
|
+
- **安装器共享助手收敛(内部)**:9 份 `install-*.js` 的机械重复收进 `src/lib/`,可观测行为(stdout 文案、守卫顺序、退出码)逐字冻结,既有测试零修改通过。① `writeJsonAtomic` 单源化到 `install-support.js`(写前 mkdir 父目录 + 临时文件换名),zcode/qoder/dsh-preset 的本地副本删除。② 新增 `payload-install.js`(含 `pruneEmptyDir`):claude-code/kimi-code/opencode 三份同构安装器走共享"头部 → 归属守卫 → dry-run → 物化 → 报告"骨架,三家逐字重复的句子只保留一份(守卫拒绝、强制覆盖提示、未安装提示、完成行),各自收敛为 90 行薄壳(原 129/142/169 行;kimi-code 安装器随后因插件直装扩展至 152 行);marketplace/registry/bundle 等宿主语义留在原模块。③ kimi-hook 与 dsh-hook 的托管块手术(定位/替换/移除)共享 `upsertManagedBlock` / `removeManagedBlock`,各自的块渲染与行尾锚定保留,重复安装幂等与卸载字节复原语义不变。④ 复核收尾删除死配置点与孤儿 import(`13f3b7c`)。
|
|
31
|
+
- **OpenCode 插件收敛为 zcode 同形态传输 shim**:插件内 1125 行 JS 手写渲染/绑定(registry 加载、指纹计算、stage-contract、decision-anchor、运行时绑定 JSON-pair 写入)全部删除,`experimental.chat.system.transform` 改为 spawn 项目内 `inject.py --host opencode` 并原样注入其 stdout;`plugin-core.js` 只剩宿主能力胶水(传输、`shell.env` 上下文键导出、edit 期 spec-check 代理、载荷技能目录注册)。配套变化:① `inject.py --host opencode` 成为合法选项,新增 `opencode_policy`(digest 措辞保留 "every plugin transform";无 SessionStart 事件,digest 形状由会话状态文件探测推导;stdout 即注入故 `emit_text`)。② 行为变化:主会话现在同样收到 `<workflow-state>` 注入(此前仅 delegated 子代理会话有),digest 全量/指纹判定由「进程内 per-session 集合」改为跨进程可靠的「会话激活文件探测」,workflow-state 头按统一规则携带 `session` 属性。③ `DEFAULT_CONTRACT_REGISTRY` 兜底单源化:JS 副本随渲染删除,只剩 Python 一份,`tests/test_contract_registry.py` 把它与 `contract-registry.json` 逐条锁定防漂移。④ 机器级安装载荷新增 `cowork-flow/runtime/scripts` 缓存副本(安装时从 template 刷新,zcode 同形态),项目外渲染 not-initialized 上下文;项目内始终以项目自身运行时副本为准。契约同步见 `.cowork-flow/spec/contracts/context-injection.md`。升级动作:`cwf host add opencode --force` 刷新机器级载荷后重启 OpenCode。
|
|
32
|
+
- **Kimi Code 插件直装**:`cwf host add kimi-code` 一步完成插件安装,不再需要 TUI 手工执行 `/plugins install`。命令物化两份载荷(`plugins/sources/` 稳定重装源 + `plugins/managed/` 宿主加载副本)并直接写入宿主注册表 `$KIMI_CODE_HOME/plugins/installed.json`——落盘格式与 Kimi Code 自身安装逻辑逐字段一致(读自宿主源码 `agent-core-v2` 的 plugin store/manifest/manager):记录含 `id/root/source:"local-path"/enabled/installedAt/updatedAt/originalSource`,按 id 合并、保留其他插件记录与未知顶层字段、首装时间与启用状态在重装时保留、注册表不可解析时 fail-closed 且原文件不动;`--uninstall` 反向移除记录并删除两份目录(外来目录仍受守卫保护,`--force` 才覆盖)。doctor 的半装/陈旧指引与 `docs/hosts.md` 同步为 `cwf host add kimi-code [--force]`。升级动作:`cwf host add kimi-code --force` 后重启 Kimi Code。后续文档收口:`host` 组件自述与 `docs/hosts.md` 不再把 hook 描述成「插件缺位时的 fallback」——hook 即注入唯一路径(`2fa9606`、`3ba305a`)。
|
|
33
|
+
|
|
34
|
+
### Fixed
|
|
35
|
+
|
|
36
|
+
- **测试自身两处不可信缺陷(P0)**:hook 用例被 shell 会话变量干扰造成的环境假红(改为整体清空宿主环境键的隔离夹具);删除一条在 gitignore 目录写文件的空转断言(无论规则是否生效都不可能失败),替换为可被定点破坏变红的用例。
|
|
37
|
+
- **`review-check` 非单调位置崩溃**:多行非 ASCII 字符串的字面量剥离保留了错误的字节偏移,导致工具整条崩溃(`73627d7`)。
|
|
38
|
+
|
|
39
|
+
## [1.8.1] - 2026-10-08
|
|
40
|
+
|
|
41
|
+
### Added
|
|
42
|
+
|
|
43
|
+
- **任务收养 `task next --run --adopt`(1.9.0 多执行者协作前置)**:为孤儿/滞留任务提供受支持的接管路径,替代手改 task.json meta。收养是独立动作(不与 review/complete/archive 链式同发):把 `in_progress`/`review` 状态、由另一执行者占有的任务重绑到收养者(`executor`),把评审基线**重置**到收养时 HEAD(原值记入 `meta.previousBaseline`),保留状态并写审计字段 `meta.previousExecutor` / `meta.previousBaseline` / `meta.adoptedAt`,结果 code `LIFECYCLE-EXECUTOR-ADOPTED`。误用 fail-closed(`LIFECYCLE-ADOPT-001`):planning/completed、无 executor、自我收养、process-fallback 身份、delegated 上下文、携带 create/plan 或批启动旗标全部拒绝且不改状态。start 路径"基线永不覆盖"不变量原样保留(既有测试零改动),收养是唯一经审计的显式重置路径;成功后 CLI 把会话绑定到该任务。契约见 `.cowork-flow/spec/contracts/task-adopt.md`。
|
|
44
|
+
|
|
45
|
+
### Fixed
|
|
46
|
+
|
|
47
|
+
- **`--allow-missing-evidence` 恢复独立解析**(1.8.0 遗留缺陷):该旗标此前被误注册为 `--allow-unchecked` 的解析别名(同一 `add_argument`、dest 相同),造成两个后果——AC 证据豁免(`LIFECYCLE-AC-002` 的可豁免路径)从 CLI 不可达(`cmd_complete` 读取的属性 argparse 从不创建,恒为 False);且传入 `--allow-missing-evidence` 会静默获得 spec-check 未检查豁免(语义错误、方向危险:本意只豁免 AC 证据,却放开了缺失/超时的 spec-check 命令)。现在两个旗标各自独立解析,parser 级与命令贯通级回归测试锁定(既有测试手工构造 Namespace 绕过 parser,正是此缺陷漏网原因)。
|
|
7
48
|
|
|
8
49
|
## [1.8.0] - 2026-10-08
|
|
9
50
|
|
|
@@ -296,7 +337,10 @@
|
|
|
296
337
|
|
|
297
338
|
此版本未保留本地条目正文,详情见 [GitHub Release](https://github.com/fishlikewater/cowork-flow/releases/tag/v0.0.47)。
|
|
298
339
|
|
|
299
|
-
[Unreleased]: https://github.com/fishlikewater/cowork-flow/compare/v1.
|
|
340
|
+
[Unreleased]: https://github.com/fishlikewater/cowork-flow/compare/v1.9.1...HEAD
|
|
341
|
+
[1.9.1]: https://github.com/fishlikewater/cowork-flow/compare/v1.9.0...v1.9.1
|
|
342
|
+
[1.9.0]: https://github.com/fishlikewater/cowork-flow/compare/v1.8.1...v1.9.0
|
|
343
|
+
[1.8.1]: https://github.com/fishlikewater/cowork-flow/compare/v1.8.0...v1.8.1
|
|
300
344
|
[1.8.0]: https://github.com/fishlikewater/cowork-flow/compare/v1.7.3...v1.8.0
|
|
301
345
|
[1.7.3]: https://github.com/fishlikewater/cowork-flow/compare/v1.7.2...v1.7.3
|
|
302
346
|
[1.7.2]: https://github.com/fishlikewater/cowork-flow/compare/v1.7.1...v1.7.2
|
package/CONTRIBUTING.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 参与开发
|
|
2
2
|
|
|
3
|
-
感谢你参与 cowork-flow。本文只保留开始工作、判断改动范围和提交 PR 需要知道的内容。仓库结构见 [架构与扩展](docs/architecture.md),发布流程见 [
|
|
3
|
+
感谢你参与 cowork-flow。本文只保留开始工作、判断改动范围和提交 PR 需要知道的内容。仓库结构见 [架构与扩展](docs/architecture.md),发布流程见 [发布与维护](docs/release.md)。
|
|
4
4
|
|
|
5
5
|
## 环境要求
|
|
6
6
|
|
|
@@ -62,30 +62,7 @@ npm run source:refresh
|
|
|
62
62
|
| `test/host-assets.test.js`、`test/host-command.test.js`、`test/<host>-plugin.test.js`、`tests/test_host_*.py` | 行为与回归门禁 |
|
|
63
63
|
| `docs/hosts.md` | 安装前提、升级、卸载和排障 |
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
- `template/.cowork-flow/scripts/{services,runtime,infra}` 和 `src/lib/` 的通用模块不写宿主分支。
|
|
68
|
-
- 宿主差异放在 Host Asset Manifest、`scripts/adapters/`、`template/.<host>/` 或明确的宿主命令模块中。
|
|
69
|
-
- 插件只提供宿主确实支持的字段,不复制未知或无效键。
|
|
70
|
-
- 项目技能只由 `template/skills/` 分发;机器级载荷不复制同名项目技能。
|
|
71
|
-
- 修改命令名时,同步更新注册表、README、doctor 提示、Skill 正文和测试。
|
|
72
|
-
|
|
73
|
-
## 测试
|
|
74
|
-
|
|
75
|
-
| 命令 | 覆盖范围 |
|
|
76
|
-
|---|---|
|
|
77
|
-
| `npm run test:fast` | 核心 Node 套件,等价于 `npm test` |
|
|
78
|
-
| `npm run test:integration` | `project init` / `sync` 关键集成路径 |
|
|
79
|
-
| `npm run test:node:full` | 全部 Node 测试 |
|
|
80
|
-
| `npm run test:template` | 核心模板集成测试 |
|
|
81
|
-
| `npm run test:template:full` | 完整模板 Python 测试 |
|
|
82
|
-
| `npm run test:windows:core` | Windows 路径、换行、宿主和打包检查 |
|
|
83
|
-
| `python -m pytest -q` | 仓库级 Python 测试 |
|
|
84
|
-
| `npm run release:check` | 完整 Node、模板和打包门禁 |
|
|
85
|
-
|
|
86
|
-
`test:fast` 只运行 `package.json` 中列出的核心套件。新增测试文件时,根据影响面决定是否加入该列表。
|
|
87
|
-
|
|
88
|
-
平台前提不满足时,测试可能明确跳过。PR 描述必须列出跳过项和未验证项,不能把跳过写成通过。
|
|
65
|
+
上表说明改哪里。宿主特化不能进入通用层——具体边界见 [架构与扩展](docs/architecture.md) 的“扩展规则”。
|
|
89
66
|
|
|
90
67
|
## 提交信息
|
|
91
68
|
|
|
@@ -105,23 +82,20 @@ refactor(zcode): 将插件载荷迁到 presets/zcode
|
|
|
105
82
|
|
|
106
83
|
常用 `type`:`feat`、`fix`、`refactor`、`docs`、`test`、`chore`、`perf`。描述写清楚做了什么,不写“优化体验”一类无法核对的信息。
|
|
107
84
|
|
|
108
|
-
## PR 前置检查
|
|
85
|
+
## 测试与 PR 前置检查
|
|
109
86
|
|
|
110
|
-
|
|
87
|
+
最低检查:
|
|
111
88
|
|
|
112
89
|
```bash
|
|
113
90
|
npm run test:fast
|
|
114
91
|
git diff --check
|
|
115
92
|
```
|
|
116
93
|
|
|
117
|
-
|
|
94
|
+
按改动范围该补哪些命令、各自覆盖什么,见 [发布与维护](docs/release.md) 的“发布前检查”——那是命令与适用场景的唯一清单,本文不重复。
|
|
118
95
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
npm run test:integration # init / sync
|
|
123
|
-
./.cowork-flow/run spec-check # 规范声明覆盖的改动
|
|
124
|
-
```
|
|
96
|
+
`test:fast` 只运行 `package.json` 中列出的核心套件。新增测试文件时,根据影响面决定是否加入该列表。
|
|
97
|
+
|
|
98
|
+
平台前提不满足时,测试可能明确跳过。CI 在 Ubuntu 和 Windows 上运行各自的门禁,本地缺少平台前提可以跳过,但必须如实记录,不能把跳过写成通过。
|
|
125
99
|
|
|
126
100
|
PR 描述需要写明:
|
|
127
101
|
|
|
@@ -130,8 +104,6 @@ PR 描述需要写明:
|
|
|
130
104
|
- 哪些平台用例跳过或仍未验证。
|
|
131
105
|
- 是否改变安装位置、命令、配置格式或升级步骤。
|
|
132
106
|
|
|
133
|
-
CI 在 Ubuntu 和 Windows 上运行各自的门禁。本地缺少平台前提可以跳过,但必须如实记录。
|
|
134
|
-
|
|
135
107
|
## 许可
|
|
136
108
|
|
|
137
109
|
提交代码即表示同意以 [MIT](LICENSE) 授权。
|
package/README.en.md
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# cowork-flow
|
|
2
|
+
|
|
3
|
+
[中文](README.md) | English
|
|
4
|
+
|
|
5
|
+
An in-repository collaboration workflow for AI coding assistants.
|
|
6
|
+
|
|
7
|
+
Agree on the goal, the plan, and the scope of changes before work starts, and check
|
|
8
|
+
against the project's own rules before calling it done. Task state lives in the
|
|
9
|
+
repository, so you can pick the work back up in a new session instead of reconstructing
|
|
10
|
+
progress from chat history.
|
|
11
|
+
|
|
12
|
+
Supports Codex, Claude Code, OpenCode, ZCode, Qoder, Kimi Code, and DeepSeek Harness.
|
|
13
|
+
|
|
14
|
+
## What it solves
|
|
15
|
+
|
|
16
|
+
- Keeps requirements, decisions, plans, and the allowed change scope inside the project.
|
|
17
|
+
- Makes the assistant read the current task before working, instead of continuing from memory.
|
|
18
|
+
- Separates implementation from checking, so a problem sends the work back to implementation.
|
|
19
|
+
- Protects custom configuration, specs, tasks, and plans in an existing project.
|
|
20
|
+
|
|
21
|
+
cowork-flow is not tied to a tech stack and does not rewrite an existing project with a
|
|
22
|
+
scaffold. It only adds a collaboration convention and the files that go with it.
|
|
23
|
+
|
|
24
|
+
## Where it fits
|
|
25
|
+
|
|
26
|
+
- You often have an AI handle features or fixes that need several rounds of confirmation.
|
|
27
|
+
- You want every task to have an explicit scope, completion conditions, and a check record.
|
|
28
|
+
- Work continues across multiple sessions or multiple developers.
|
|
29
|
+
- You already use an AI coding host, but task state mostly lives in chat history.
|
|
30
|
+
|
|
31
|
+
If you only ask questions or change a line or two, or you already have a solid task
|
|
32
|
+
system, read up first and decide whether to adopt it.
|
|
33
|
+
|
|
34
|
+
## Getting started
|
|
35
|
+
|
|
36
|
+
Node.js 20 or later is required.
|
|
37
|
+
|
|
38
|
+
### 1. Install the CLI
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npm install -g cowork-flow
|
|
42
|
+
cwf --version
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
`cwf` and `cowork-flow` are the same command. To skip the global install, replace `cwf`
|
|
46
|
+
below with `npx cowork-flow` — except for `cwf self update`.
|
|
47
|
+
|
|
48
|
+
### 2. Initialize a project
|
|
49
|
+
|
|
50
|
+
Preview the files that will be written:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
cwf project init . --platform codex --developer alice --dry-run
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Drop `--dry-run` once the list looks right:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
cwf project init . --platform codex --developer alice
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Replace `codex` with the host you use:
|
|
63
|
+
|
|
64
|
+
`codex`, `claude-code`, `opencode`, `zcode`, `qoder`, `kimi-code`, `dsh`.
|
|
65
|
+
|
|
66
|
+
For a new project, replace `.` with `./my-project` and enter that directory. Use
|
|
67
|
+
`--platform all` only when the project really will be worked on from several hosts.
|
|
68
|
+
|
|
69
|
+
Initialization adds `AGENTS.md`, `.cowork-flow/`, and the matching host files. It does
|
|
70
|
+
not touch application code. `--developer` is optional; on an existing project, always
|
|
71
|
+
run `--dry-run` first.
|
|
72
|
+
|
|
73
|
+
### 3. Finish host setup
|
|
74
|
+
|
|
75
|
+
Codex, Claude Code, and OpenCode work in an initialized project as-is. ZCode, Qoder,
|
|
76
|
+
DeepSeek Harness, and Kimi Code also need a machine-level component:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
cwf host add <host>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
See [host integration](docs/hosts.md) for each host's exact command, restart
|
|
83
|
+
requirements, and special cases.
|
|
84
|
+
|
|
85
|
+
### 4. Start inside the host
|
|
86
|
+
|
|
87
|
+
Go back to your AI coding host, open the project root, and start a new session. Describe
|
|
88
|
+
what you want, for example:
|
|
89
|
+
|
|
90
|
+
```text
|
|
91
|
+
Use cowork-flow to implement "filter the order list by status". Spell out the
|
|
92
|
+
requirements, the plan, and the change scope first, and wait for confirmation before
|
|
93
|
+
editing code.
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
To inspect progress by hand, run this in the project root:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
./.cowork-flow/run task next
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Day to day
|
|
103
|
+
|
|
104
|
+
- **Start a new request**: just describe what you want. The assistant confirms the goal, the plan, and the files it may change.
|
|
105
|
+
- **Resume a task**: start a new session and say "continue the current task". State and context come from the project, not from the previous chat.
|
|
106
|
+
- **Pause a task**: end the session. Task state stays in the project for next time.
|
|
107
|
+
- **Update the project**: after upgrading the CLI, preview the sync and then apply it.
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
cwf self update
|
|
111
|
+
cwf project sync . --dry-run
|
|
112
|
+
cwf project sync .
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
`project sync` only updates files cowork-flow manages. Existing configuration, `spec/`,
|
|
116
|
+
tasks, and plans are kept by default; **retired-asset cleanup** deletes obsolete
|
|
117
|
+
cowork-flow files listed in the release manifest and touches nothing else. For upgrading
|
|
118
|
+
machine-level host components, see [host integration](docs/hosts.md).
|
|
119
|
+
|
|
120
|
+
## Troubleshooting
|
|
121
|
+
|
|
122
|
+
| Symptom | First move |
|
|
123
|
+
|---|---|
|
|
124
|
+
| You do not know what to do next | Run `./.cowork-flow/run task next` |
|
|
125
|
+
| You worry init or sync will change the wrong files | Add `--dry-run` to the command |
|
|
126
|
+
| You want to confirm which hosts the project selected | Run `cwf host list .` |
|
|
127
|
+
| Skills, plugins, hooks, or project files look wrong | Run `./.cowork-flow/run doctor --all` |
|
|
128
|
+
| You are unsure how to write a command or flag | Run `cwf --help` or `cwf <group> <command> --help` |
|
|
129
|
+
|
|
130
|
+
For host-specific problems, start with [host integration](docs/hosts.md). To understand
|
|
131
|
+
how the project is organized, see [architecture and extension](docs/architecture.md).
|
|
132
|
+
|
|
133
|
+
<details>
|
|
134
|
+
<summary>Command reference</summary>
|
|
135
|
+
|
|
136
|
+
| Command | Purpose |
|
|
137
|
+
|---|---|
|
|
138
|
+
| `cwf project init [target] --platform <host> [--developer <name>] [--dry-run] [--force]` | Initialize a project |
|
|
139
|
+
| `cwf project sync [target] [--dry-run] [--force]` | Update the cowork-flow-managed files in a project |
|
|
140
|
+
| `cwf host add <host> [--component <name>] [--dry-run] [--force] [--prune-old] [--uninstall]` | Install a machine-level host component |
|
|
141
|
+
| `cwf host remove <host> [--component <name>] [--dry-run] [--force]` | Remove a machine-level host component |
|
|
142
|
+
| `cwf host list [target] [--json]` | List supported hosts and what the project selected |
|
|
143
|
+
| `cwf self update [--dry-run]` | Update the globally installed CLI |
|
|
144
|
+
| `cwf dev refresh [target] [--dry-run]` | Refresh the self-instance while maintaining the cowork-flow repo |
|
|
145
|
+
| `cwf mcp serve [args...]` | Serve task facts to an MCP client |
|
|
146
|
+
|
|
147
|
+
Old command names still work; use the new names in new scripts.
|
|
148
|
+
|
|
149
|
+
| Old name | New name |
|
|
150
|
+
|---|---|
|
|
151
|
+
| `init` | `cwf project init` |
|
|
152
|
+
| `sync` | `cwf project sync` |
|
|
153
|
+
| `mcp-state` | `cwf mcp serve` |
|
|
154
|
+
| `update` | `cwf self update` |
|
|
155
|
+
| `source-refresh` | `cwf dev refresh` |
|
|
156
|
+
| `install-zcode-plugin` | `cwf host add zcode` |
|
|
157
|
+
| `install-qoder-plugin` | `cwf host add qoder` |
|
|
158
|
+
| `install-codex-plugin` | `cwf host add codex` |
|
|
159
|
+
| `install-dsh-preset` | `cwf host add dsh --component preset` |
|
|
160
|
+
| `install-dsh-hook` | `cwf host add dsh --component hook` |
|
|
161
|
+
| `install-kimi-hook` | `cwf host add kimi-code --component hook` |
|
|
162
|
+
|
|
163
|
+
</details>
|
|
164
|
+
|
|
165
|
+
## Documentation
|
|
166
|
+
|
|
167
|
+
The detailed documentation is written in Chinese.
|
|
168
|
+
|
|
169
|
+
| Document | Contents |
|
|
170
|
+
|---|---|
|
|
171
|
+
| [Documentation index](docs/index.md) | Entry point for every document |
|
|
172
|
+
| [Architecture and extension](docs/architecture.md) | How the project files are organized, how spec checks work |
|
|
173
|
+
| [Host integration](docs/hosts.md) | Install, restart, troubleshoot, and uninstall for each host |
|
|
174
|
+
| [Release and maintenance](docs/release.md) | Tests, CI, and maintainer commands |
|
|
175
|
+
| [Contributing](CONTRIBUTING.md) | Local setup, commit conventions, and PR checks |
|
|
176
|
+
| [Changelog](CHANGELOG.md) | What changed in each version |
|
|
177
|
+
|
|
178
|
+
## License
|
|
179
|
+
|
|
180
|
+
[MIT](LICENSE)
|
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# cowork-flow
|
|
2
2
|
|
|
3
|
+
[English](README.en.md) | 中文
|
|
4
|
+
|
|
3
5
|
给 AI 编码助手加一套项目内的协作流程。
|
|
4
6
|
|
|
5
7
|
开工前先确认目标、计划和改动范围,完成前按项目自己的规则检查。任务状态保存在仓库里,换个会话也能接着做,不用靠聊天记录回忆进度。
|
|
@@ -61,19 +63,13 @@ cwf project init . --platform codex --developer alice
|
|
|
61
63
|
|
|
62
64
|
### 3. 完成宿主设置
|
|
63
65
|
|
|
64
|
-
Codex、Claude Code 和 OpenCode
|
|
66
|
+
Codex、Claude Code 和 OpenCode 在初始化的项目里就能用;ZCode、Qoder、DeepSeek Harness 和 Kimi Code 还需要安装机器级组件:
|
|
65
67
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
| Claude Code | `cwf host add claude-code` | 可选,用于全局引导入口 |
|
|
70
|
-
| OpenCode | `cwf host add opencode` | 可选,用于全局引导入口 |
|
|
71
|
-
| ZCode | `cwf host add zcode` | 初始化后执行,并新开会话 |
|
|
72
|
-
| Qoder | `cwf host add qoder` | 初始化后执行;信任工作区并重启 Qoder |
|
|
73
|
-
| DeepSeek Harness | `cwf host add dsh` | 初始化后执行;新会话中选择 Cowork Flow 预设 |
|
|
74
|
-
| Kimi Code | `cwf host add kimi-code --component hook` | 初始化后执行;完成后重载配置或新开会话 |
|
|
68
|
+
```bash
|
|
69
|
+
cwf host add <host>
|
|
70
|
+
```
|
|
75
71
|
|
|
76
|
-
|
|
72
|
+
每个宿主的准确命令、重启要求和特殊情况见 [宿主接入](docs/hosts.md)。
|
|
77
73
|
|
|
78
74
|
### 4. 在宿主里开始
|
|
79
75
|
|
|
@@ -114,7 +110,7 @@ cwf project sync .
|
|
|
114
110
|
| 技能、插件、hook 或项目文件状态异常 | 运行 `./.cowork-flow/run doctor --all` |
|
|
115
111
|
| 不确定命令或参数怎么写 | 运行 `cwf --help` 或 `cwf <group> <command> --help` |
|
|
116
112
|
|
|
117
|
-
宿主相关问题优先查 [宿主接入](docs/hosts.md)。需要了解工作原理时再看 [
|
|
113
|
+
宿主相关问题优先查 [宿主接入](docs/hosts.md)。需要了解工作原理时再看 [架构与扩展](docs/architecture.md)。
|
|
118
114
|
|
|
119
115
|
<details>
|
|
120
116
|
<summary>命令速查</summary>
|
|
@@ -123,7 +119,7 @@ cwf project sync .
|
|
|
123
119
|
|---|---|
|
|
124
120
|
| `cwf project init [target] --platform <host> [--developer <name>] [--dry-run] [--force]` | 初始化项目 |
|
|
125
121
|
| `cwf project sync [target] [--dry-run] [--force]` | 更新项目内由 cowork-flow 管理的文件 |
|
|
126
|
-
| `cwf host add <host> [--component <name>] [--dry-run] [--force]` | 安装机器级宿主组件 |
|
|
122
|
+
| `cwf host add <host> [--component <name>] [--dry-run] [--force] [--prune-old] [--uninstall]` | 安装机器级宿主组件 |
|
|
127
123
|
| `cwf host remove <host> [--component <name>] [--dry-run] [--force]` | 卸载机器级宿主组件 |
|
|
128
124
|
| `cwf host list [target] [--json]` | 查看支持的宿主和项目选择情况 |
|
|
129
125
|
| `cwf self update [--dry-run]` | 更新全局安装的 CLI |
|
|
@@ -153,10 +149,10 @@ cwf project sync .
|
|
|
153
149
|
| 文档 | 内容 |
|
|
154
150
|
|---|---|
|
|
155
151
|
| [文档索引](docs/index.md) | 全部文档入口 |
|
|
156
|
-
| [
|
|
152
|
+
| [架构与扩展](docs/architecture.md) | 项目文件如何组织、规范检查如何工作 |
|
|
157
153
|
| [宿主接入](docs/hosts.md) | 各宿主的安装、重启、排障和卸载方式 |
|
|
158
|
-
| [
|
|
159
|
-
| [
|
|
154
|
+
| [发布与维护](docs/release.md) | 测试、CI 和维护者命令 |
|
|
155
|
+
| [参与开发](CONTRIBUTING.md) | 本地开发、提交和 PR 检查 |
|
|
160
156
|
| [更新日志](CHANGELOG.md) | 版本变化 |
|
|
161
157
|
|
|
162
158
|
## 许可
|
package/docs/architecture.md
CHANGED
|
@@ -109,6 +109,8 @@ checks:
|
|
|
109
109
|
## 扩展规则
|
|
110
110
|
|
|
111
111
|
- 宿主特化只能放在 `spec/runtime/host-assets.json`、`scripts/adapters/`、`template/.<host>/` 或明确的宿主命令模块中。
|
|
112
|
+
- 插件只提供宿主确实支持的字段,不复制未知或无效键。
|
|
113
|
+
- 项目技能只由 `template/skills/` 分发;机器级载荷不复制同名项目技能。
|
|
112
114
|
- `scripts/services|runtime|infra` 和 `src/lib/` 的通用计划、拷贝模块不能出现宿主分支。
|
|
113
115
|
- 新宿主先更新 Host Asset Manifest 与 schema,再补安装器、doctor 和测试;不要在多个文件各写一份宿主清单。
|
|
114
116
|
- 项目差异写入 `AGENTS.md`、`config.yaml`、`spec/` 或项目自有 Skill,不恢复第二套流程文档。
|
|
@@ -117,6 +119,6 @@ checks:
|
|
|
117
119
|
|
|
118
120
|
## 测试与字节码
|
|
119
121
|
|
|
120
|
-
Node 测试位于 `test/`,Python 仓库测试位于 `tests/`。`node --test` 会加载 `test/` 下全部 `.js`,辅助模块也必须无副作用;Python 侧按 pytest 或 unittest 的默认发现规则收集。
|
|
121
|
-
|
|
122
122
|
测试与技能脚本不得在 `template/`、`presets/` 下留下 `__pycache__` 或 `*.pyc`。Node 测试通过 `test/helpers/bytecode-isolation.js` 重定向缓存;技能脚本通过 `runtime_pythonpath_env(cache_bytecode=False)` 关闭字节码写入。`tests/test_no_legacy_template_paths.py` 负责守住这一边界。
|
|
123
|
+
|
|
124
|
+
`node --test` 会加载 `test/` 下全部 `.js`,辅助模块也必须无副作用;Python 侧按 pytest 或 unittest 的默认发现规则收集。
|