doukui 0.6.0 → 0.9.0
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/README.en.md +85 -18
- package/README.md +32 -72
- package/bin/commands/help.js +2 -25
- package/bin/commands/plan-lint.js +105 -0
- package/bin/commands/verify.js +263 -0
- package/bin/doukui.js +3 -3
- package/package.json +2 -3
- package/plugins/core/hook-session-start/index.js +1 -1
- package/plugins/core/hook-skill-gate/index.js +64 -15
- package/plugins/core/hook-skill-gate/plugin.json +1 -1
- package/plugins/core/skill-agent-dispatcher/cleanup-reference.md +7 -28
- package/plugins/core/skill-agent-dispatcher/monitoring-reference.md +89 -0
- package/plugins/core/skill-agent-dispatcher/plugin.json +1 -1
- package/plugins/core/skill-agent-dispatcher/recovery-reference.md +132 -0
- package/plugins/core/skill-agent-dispatcher/roles-reference.md +9 -22
- package/plugins/core/skill-agent-dispatcher/skill.md +124 -796
- package/plugins/core/skill-agentic-loop/mirror-rules.md +95 -24
- package/plugins/core/skill-agentic-loop/plugin.json +2 -7
- package/plugins/core/skill-agentic-loop/skill.md +125 -354
- package/plugins/core/skill-batch-task-creator/plugin.json +1 -1
- package/plugins/core/skill-checklist/skill.md +15 -141
- package/plugins/core/skill-completion-report/plugin.json +1 -1
- package/plugins/core/skill-completion-report/skill.md +7 -1
- package/plugins/core/skill-doukui-plan/plugin.json +1 -1
- package/plugins/core/skill-doukui-plan/skill.md +24 -21
- package/plugins/core/skill-experience-logger/plugin.json +1 -1
- package/plugins/core/skill-human-checkpoint/skill.md +1 -0
- package/plugins/core/skill-split-work-package/plugin.json +1 -1
- package/plugins/core/skill-task-creator/plugin.json +1 -1
- package/plugins/core/skill-task-creator/skill.md +1 -139
- package/plugins/core/skill-workflow-orchestrator/plugin.json +1 -1
- package/plugins/plugin-registry.json +0 -48
- package/plugins/runtime/harness-build.js +5 -5
- package/plugins/runtime/plan-reader.js +54 -21
- package/plugins/runtime/resolve-plugin-path.js +2 -2
- package/templates/harness-config.yaml +0 -100
- package/bin/commands/loop-server.js +0 -357
- package/bin/commands/loop.js +0 -1508
- package/plugins/contracts/capabilities.js +0 -268
- package/plugins/contracts/checkresult-schema.json +0 -75
- package/plugins/core/provider-loop-engine/index.js +0 -1411
- package/plugins/core/provider-loop-engine/plugin.json +0 -15
- package/plugins/core/provider-memory-store/index.js +0 -510
- package/plugins/core/provider-memory-store/plugin.json +0 -9
- package/plugins/core/provider-state-store/index.js +0 -244
- package/plugins/core/provider-state-store/plugin.json +0 -9
- package/plugins/core/provider-watchdog/assets/daemon-config.template.json +0 -32
- package/plugins/core/provider-watchdog/assets/lib/watchdog-multi-window.js +0 -676
- package/plugins/core/provider-watchdog/assets/watchdog.js +0 -754
- package/plugins/core/provider-watchdog/index.js +0 -151
- package/plugins/core/provider-watchdog/plugin.json +0 -13
- package/plugins/core/skill-agent-dispatcher/daemon-helpers-reference.md +0 -249
- package/plugins/core/skill-watchdog-manager/plugin.json +0 -10
- package/plugins/core/skill-watchdog-manager/skill.md +0 -143
- package/plugins/core/validator-doc-sync/index.js +0 -248
- package/plugins/core/validator-doc-sync/plugin.json +0 -12
- package/plugins/core/validator-work-package/index.js +0 -300
- package/plugins/core/validator-work-package/plugin.json +0 -12
- package/plugins/runtime/audit-logger.js +0 -311
- package/plugins/runtime/build-cli.js +0 -89
- package/plugins/runtime/checkresult-validator.js +0 -131
- package/plugins/runtime/context-window.js +0 -81
- package/plugins/runtime/event-bus.js +0 -207
- package/plugins/runtime/executor-claude.js +0 -604
- package/plugins/runtime/executor-default.js +0 -448
- package/plugins/runtime/executor-local.js +0 -178
- package/plugins/runtime/executor-sdk.js +0 -415
- package/plugins/runtime/hook-dispatcher.js +0 -315
- package/plugins/runtime/loop-actuator.js +0 -292
- package/plugins/runtime/loop-coordinator.js +0 -347
- package/plugins/runtime/loop-defaults.js +0 -29
- package/plugins/runtime/loop-dispatch-batch.js +0 -351
- package/plugins/runtime/loop-executor.js +0 -120
- package/plugins/runtime/loop-report.js +0 -395
- package/plugins/runtime/loop-server-core.js +0 -750
- package/plugins/runtime/loop-snapshot.js +0 -581
- package/plugins/runtime/loop-trace.js +0 -242
- package/plugins/runtime/loop-worktree.js +0 -404
- package/plugins/runtime/multi-window-coordinator.js +0 -560
- package/plugins/runtime/objective-verifier.js +0 -136
- package/plugins/runtime/plan-lint.js +0 -106
- package/plugins/runtime/plugin-loader.js +0 -798
- package/plugins/runtime/plugin-trust.js +0 -182
- package/plugins/runtime/provider-failover.js +0 -114
- package/plugins/runtime/provider-resolver.js +0 -342
- package/plugins/runtime/reflection-evaluator.js +0 -545
- package/plugins/runtime/sandbox-context.js +0 -235
- package/plugins/runtime/sandbox-manager.js +0 -609
- package/plugins/runtime/sandbox-worker.js +0 -215
- package/plugins/runtime/self-rescue-ladder.js +0 -51
- package/plugins/runtime/text-tokenize.js +0 -25
- package/plugins/runtime/validator-pipeline.js +0 -475
package/README.en.md
CHANGED
|
@@ -1,42 +1,109 @@
|
|
|
1
1
|
# Doukui
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> An in-session orchestration discipline pack for Claude Code — a full set of skills (workflow / task splitting / loop / checkpoints), the plan-reader contract, dispatcher multi-agent parallelism, and the PROGRESS convention
|
|
4
4
|
|
|
5
5
|
[](https://opensource.org/licenses/MIT)
|
|
6
|
-
[](https://github.com/chen-xiaochen/doukui)
|
|
7
7
|
|
|
8
8
|
**[中文文档](./README.md)**
|
|
9
9
|
|
|
10
|
-
> "Doukui" (斗魁) names the four stars forming the bowl of the Big Dipper — the pivot around which the handle turns.
|
|
10
|
+
> "Doukui" (斗魁) names the four stars forming the bowl of the Big Dipper — the pivot around which the handle turns. Every work package orbits it.
|
|
11
11
|
> Doukui is a ground-up rebuild of [tackle-harness](https://github.com/ph419/tackle-harness) v0.4.9 (Nov 2026, refactor phases A–E). Thanks to its predecessor.
|
|
12
12
|
|
|
13
13
|
## Why Doukui
|
|
14
14
|
|
|
15
|
-
You run Claude Code, but
|
|
15
|
+
You run complex tasks in Claude Code, but the model itself does not orchestrate: how to split requirements, how to parallelize agents, how to self-heal on failure, how to keep progress — all improvised again in every session. **Doukui fixes that orchestration discipline into skills + contracts + config**:
|
|
16
16
|
|
|
17
|
-
- **Plan first, human gate** — the AI outputs an implementation plan and work-package split; you approve before any code is written.
|
|
18
|
-
- **
|
|
19
|
-
- **
|
|
20
|
-
- **
|
|
21
|
-
- **Experience accrues** — lessons are distilled after each task and
|
|
17
|
+
- **Plan first, human gate** — the AI outputs an implementation plan and a work-package split; you approve before any code is written. No "the AI went ahead and changed a pile of things".
|
|
18
|
+
- **Complex requirements, parallel delivery** — large requirements are split into independent work packages (WPs), dispatched in parallel by the dispatcher along the dependency graph.
|
|
19
|
+
- **Goal-driven closed loop (Agentic Loop)** — a failing checklist does not return to a human; the loop retries / resplits in-session for several rounds until it converges or exhausts self-rescue. Rules and thresholds have a single source of truth (`mirror-rules.md`), no improvisation.
|
|
20
|
+
- **Verify-first acceptance** — plan checklist items can carry a `[verify: npm test]` tag; anything a command can verify needs zero LLM free-form judgment (more reliable, fewer tokens).
|
|
21
|
+
- **Experience accrues** — lessons are distilled after each task and archived per role for later sessions.
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
> Since v0.7.0 the unattended driver (`doukui loop` subprocess) is retired — the in-session path is the only execution path, and provider/model switching is back to Claude Code session-level config (see the BREAKING note in the [CHANGELOG](CHANGELOG.md)).
|
|
24
|
+
|
|
25
|
+
## Core concept: Agentic Loop (in-session)
|
|
26
|
+
|
|
27
|
+
- **Single source of truth for decisions**: `plugins/core/skill-agentic-loop/mirror-rules.md` owns all Observe→Think→Act→Reflect→Decide rules and threshold defaults; the in-session Lead reproduces them from that file. There is no JS decision-engine mirror and no CI mirror lock.
|
|
28
|
+
- **Triple caps + self-rescue before terminal state**: `max_iterations` (default 6), `max_round_time_ms` (10 min), `max_wall_time_ms` (1 h); the P1 confirmation may override them. Before a terminal state (diverged/timeout) the Lead exhausts the retry/resplit order from mirror-rules; only then escalates to a human.
|
|
29
|
+
- **Act is delegated to the dispatcher**: the loop is the decision layer and never writes code; Act serializes the decision into dispatcher instructions executed by agent-dispatcher with multiple agents.
|
|
30
|
+
- **Verify-first acceptance**: plan checklist items can carry a `[verify: npm test]` tag — command-verifiable items need zero LLM judgment.
|
|
31
|
+
- **Progress is observability**: every round's verdict/proximity is written to PROGRESS.md / task.md (`skill-progress-tracker`), the same source the Observe snapshot reads.
|
|
32
|
+
- **Risk-tiered human review**: a plan declares `风险分级: low` at the top level (pure doc/test work) — P1 becomes a lightweight one-line confirmation and the mandatory-pause gate is waived automatically; undeclared plans get the full human review as usual.
|
|
33
|
+
|
|
34
|
+
## Install
|
|
35
|
+
|
|
36
|
+
Requires Node.js >= 18.0.0
|
|
24
37
|
|
|
25
38
|
```bash
|
|
26
39
|
npm install -g doukui
|
|
27
40
|
cd your-project
|
|
28
|
-
doukui init
|
|
41
|
+
doukui init # create config dir + register hooks
|
|
42
|
+
```
|
|
29
43
|
|
|
30
|
-
|
|
31
|
-
|
|
44
|
+
## Commands
|
|
45
|
+
|
|
46
|
+
| Command | Description |
|
|
47
|
+
|------|------|
|
|
48
|
+
| `doukui build` | Build all plugins (default command) |
|
|
49
|
+
| `doukui validate` / `validate-config` | Validate plugin format / harness-config |
|
|
50
|
+
| `doukui plan-lint <plan.md>` | Lint a plan file (read-only): work units / dependency topology / success criteria / verify coverage. Exit 0 usable, 1 unusable |
|
|
51
|
+
| `doukui verify <plan.md> --wp WP-NNN\|all` | Batch-run a unit's `[verify:]` checklist commands and emit a CheckResult. Exit 0 all passed / 1 any failure / 2 no verify item |
|
|
52
|
+
| `doukui init` | First-time setup: build + config |
|
|
53
|
+
| `doukui install` | Install an external plugin (with security review) |
|
|
54
|
+
| `doukui migrate` | Migrate legacy project config |
|
|
55
|
+
| `doukui status` / `list` / `config` | Status / plugin list / config query |
|
|
56
|
+
| `doukui interactive` | Interactive plugin management (alias `i`) |
|
|
57
|
+
| `doukui setup-global` | Install global skills to ~/.claude/skills/ |
|
|
58
|
+
| `doukui team-cleanup <name>` | Deterministic cleanup of leftover Agent Teams directories |
|
|
59
|
+
| `doukui version` / `help` | Version / help |
|
|
60
|
+
|
|
61
|
+
## Workflow overview
|
|
32
62
|
|
|
33
|
-
# Real run: SDK carrier over a GLM plan (provider auto-detected from --settings)
|
|
34
|
-
doukui loop docs/plan/my-plan.md --executor=sdk \
|
|
35
|
-
--settings=~/.claude/settings-glm-5.2[1m]max.json
|
|
36
63
|
```
|
|
64
|
+
requirement → plan(P0) → review(P1) → execute(P2) → check(P3) → report(P4) → deliver
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
| Stage | What happens | Key skills |
|
|
68
|
+
|------|--------|----------|
|
|
69
|
+
| **P0 plan** | Parse the requirement, split into work packages, write docs | task-creator, split-work-package |
|
|
70
|
+
| **P1 review** | Pause for your approval of the plan (mandatory human gate) | human-checkpoint |
|
|
71
|
+
| **P2 execute** | Multi-agent parallel development, dispatched along the dependency graph | agent-dispatcher / agentic-loop |
|
|
72
|
+
| **P3 check** | Code/test/doc quality verification, distill lessons | checklist, experience-logger |
|
|
73
|
+
| **P4 report** | Generate the completion report, ask for next steps | completion-report |
|
|
74
|
+
|
|
75
|
+
## Plugin architecture
|
|
76
|
+
|
|
77
|
+
Three plugin types, 19 in total:
|
|
78
|
+
|
|
79
|
+
| Type | Count | Role |
|
|
80
|
+
|------|------|------|
|
|
81
|
+
| Skill | 16 | Executable skills, called directly by Claude Code |
|
|
82
|
+
| Provider | 1 | Role registry (consumed by agent-def-generator) |
|
|
83
|
+
| Hook | 2 | Skill gating + session-start injection of plan-mode rules |
|
|
84
|
+
|
|
85
|
+
## Docs (Chinese)
|
|
86
|
+
|
|
87
|
+
- [Workflow in depth](docs/design/ai_workflow.md) — full data flow
|
|
88
|
+
- [Agentic Loop design](docs/design/agentic-loop-design.md) — historical design doc (driver path retired, banner at the top; current rules live in `plugins/core/skill-agentic-loop/mirror-rules.md`)
|
|
89
|
+
- [Config reference](docs/design/config-reference.md) — full harness-config.yaml reference
|
|
90
|
+
- [Plugin development](docs/design/plugin-development.md) / [API reference](docs/design/api-reference.md)
|
|
91
|
+
- [Security policy](SECURITY.md) — vulnerability reporting; the sandbox isolation layer was retired in v0.9.0 ([historical threat model](docs/design/sandbox-threat-model.md)). Third-party plugins are loaded after `doukui install` capability confirmation + manual review
|
|
92
|
+
|
|
93
|
+
## Relation to the predecessor
|
|
94
|
+
|
|
95
|
+
| | tackle-harness (predecessor) | doukui |
|
|
96
|
+
|---|---|---|
|
|
97
|
+
| Execution carrier | spawn `claude -p`, single path | in-session skills + dispatcher multi-agent (driver subprocess retired in v0.7.0) |
|
|
98
|
+
| Structured output | bare fenced-block parsing | fenced + machine-readable block + objective verify commands |
|
|
99
|
+
| Thresholds/decisions | three hard-coded copies | mirror-rules.md single source of truth (self-owned thresholds) |
|
|
100
|
+
| Brand/commands | tackle-harness / tackle | doukui |
|
|
101
|
+
|
|
102
|
+
## Acknowledgements
|
|
37
103
|
|
|
38
|
-
|
|
104
|
+
- [tackle-harness](https://github.com/ph419/tackle-harness) — the predecessor; the entire skeleton of Doukui comes from it
|
|
105
|
+
- DeerFlow — reference for memory extraction and plugin architecture
|
|
39
106
|
|
|
40
107
|
## License
|
|
41
108
|
|
|
42
|
-
MIT
|
|
109
|
+
MIT License - see [LICENSE](LICENSE)
|
package/README.md
CHANGED
|
@@ -1,67 +1,34 @@
|
|
|
1
1
|
# Doukui(斗魁)
|
|
2
2
|
|
|
3
|
-
> Claude Code
|
|
3
|
+
> Claude Code 的会话内编排纪律包 —— skills 全家(工作流/任务拆分/循环/检查点)、plan-reader 契约、dispatcher 多 agent 并行、PROGRESS 进度约定
|
|
4
4
|
|
|
5
5
|
[](https://opensource.org/licenses/MIT)
|
|
6
|
-
[](https://github.com/chen-xiaochen/doukui)
|
|
7
7
|
|
|
8
8
|
**[English](./README.en.md)**
|
|
9
9
|
|
|
10
|
-
> 斗魁,北斗前四星之总称,勺子枢转的中心——众 WP
|
|
10
|
+
> 斗魁,北斗前四星之总称,勺子枢转的中心——众 WP 绕其调度。
|
|
11
11
|
> Doukui 重构自 [tackle-harness](https://github.com/ph419/tackle-harness) v0.4.9(2026-11,Phase A-E 激进重构),致谢前身。
|
|
12
12
|
|
|
13
13
|
## 为什么是 Doukui
|
|
14
14
|
|
|
15
|
-
你在用 Claude Code
|
|
15
|
+
你在用 Claude Code 跑复杂任务,但模型本身不负责编排:需求怎么拆、多 agent 怎么并行、失败怎么自愈、进度怎么不丢,每次都靠会话里重新发挥。**Doukui 把这层编排纪律固化成 skills + 契约 + 配置**:
|
|
16
16
|
|
|
17
17
|
- **方案先行,人工把关** — AI 先输出实施方案和工作包拆分,等你确认后才动手写代码。不会出现「AI 自作主张改了一堆东西」的情况。
|
|
18
|
-
- **复杂需求,并行交付** —
|
|
19
|
-
-
|
|
20
|
-
-
|
|
18
|
+
- **复杂需求,并行交付** — 大需求拆成多个独立工作包(WP),按依赖图由 dispatcher 调度多个 Agent 子代理并行执行。
|
|
19
|
+
- **目标驱动自闭环(Agentic Loop)** — checklist 不通过不返回人工,会话内自主 retry/resplit 多轮直到收敛或穷尽自救;判定规则与阈值有唯一真相源(mirror-rules.md),不靠临场发挥。
|
|
20
|
+
- **verify 优先的验收** — plan 验收项可加 `[verify: npm test]` 尾标——命令可验证的项零 LLM 自由判断(更可靠且省 token)。
|
|
21
21
|
- **经验沉淀,越用越好** — 每次任务完成后自动提炼经验教训,按角色存档供后续会话参考。
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
> v0.7.0 起无值守 driver(`doukui loop` 子进程)已退役——会话内路径为唯一执行方式,provider/模型切换回归 Claude Code 会话级配置(详见 [CHANGELOG](CHANGELOG.md) BREAKING 说明)。
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
## 核心概念:Agentic Loop(会话内)
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
doukui loop docs/plan/my-plan.md --executor=sdk \
|
|
33
|
-
--settings=~/.claude/settings-glm-5.2[1m]max.json
|
|
34
|
-
|
|
35
|
-
# spawn CLI 载体(不装 SDK 时的回退,行为一致)
|
|
36
|
-
doukui loop docs/plan/my-plan.md --executor=sdk
|
|
37
|
-
|
|
38
|
-
# 并发批:默认 N=2,批内 WP 并行 spawn + per-WP worktree 隔离
|
|
39
|
-
doukui loop my-plan.md --executor=sdk --concurrency=2
|
|
40
|
-
|
|
41
|
-
# 多 loop 并行(state 物理隔离)
|
|
42
|
-
doukui loop planA.md --loop-id=A --executor=sdk &
|
|
43
|
-
doukui loop planB.md --loop-id=B --executor=sdk &
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
- **决策单一真相源**:判定逻辑全部在 JS 引擎(`provider-loop-engine`)+ 单一阈值源(`loop-defaults.js`);skill 侧仅是行为镜像,由 CI 测试锁定一致性
|
|
47
|
-
- **三重上限保护 + 终态前自救链**:`max_iterations`(默认 6)、`max_round_time_ms`(10min)、`max_wall_time_ms`(1h)均可配置;触顶/发散后**不直接停人**——先自动穷尽自救(换 provider → 换模型,`loop.self_rescue` 可配),穷尽才停且报告标注已试级别
|
|
48
|
-
- **checklist 双重校验**:LLM 自报输出先过 JSON Schema(数值谎报硬改判),再对声明了 `verify.command` 的检查项实跑命令交叉验证(自报 pass 但 `npm test` 失败 → 判 fail)
|
|
49
|
-
- **verify 优先的验收**:plan 验收项可加 `[verify: npm test]` 尾标——命令可验证的项零 LLM 自由判断(更可靠且省 token)
|
|
50
|
-
- **断点恢复 + 精读 retry**:每 phase 落盘 state-store,防上下文压缩丢失;`--loop-id` 跨 run 恢复;SDK 载体额外支持 session 级续轮;retry 只注入与失败项相关的文档段落(非全量重灌)
|
|
51
|
-
- **plan.md 热更新**:运行中修改 plan.md,下一轮自动重解析依赖图
|
|
52
|
-
- **风险分级人审**:plan 顶层声明 `风险分级: low` + 环境设一次 `DOUKUI_LOW_RISK_GATE=1`,纯文档/测试类任务全程无人值守;未声明的 plan 照常完整人审
|
|
53
|
-
- **prompt cache 友好**:prompt 按「稳定前缀 → WP 文档 → 动态尾巴」排列,吃满 GLM/DeepSeek 的 context cache(同一 WP retry 前缀命中率 78%+)
|
|
54
|
-
|
|
55
|
-
## Provider 能力矩阵
|
|
56
|
-
|
|
57
|
-
SDK 载体在各 Anthropic 兼容端点的实测结果(探针脚本 `test/integration/test-provider-capability.js`,`DOUKUI_CAPABILITY_PROBE=1` 显式开启):
|
|
58
|
-
|
|
59
|
-
| 通道 | P1 stream | P2 fenced | P3 resume(断点续轮) | 备注 |
|
|
60
|
-
|---|---|---|---|---|
|
|
61
|
-
| 智谱 GLM(默认通道实测) | ✅ | ✅ | ✅ | resume 首轮偶发 >60s |
|
|
62
|
-
| DeepSeek / MiMo / Claude 官方 | 待跑探针补全 | — | — | 每通道 4 次最小调用 |
|
|
63
|
-
|
|
64
|
-
详见 [docs/design/provider-capability-matrix.md](docs/design/provider-capability-matrix.md)。
|
|
27
|
+
- **判定规则单一真相源**:`plugins/core/skill-agentic-loop/mirror-rules.md` 自持 Observe→Think→Act→Reflect→Decide 全部规则与阈值默认;会话内 Lead 按该文件复现,不存在 JS 判定代码镜像,也没有 CI 镜像锁
|
|
28
|
+
- **三重上限保护 + 终态前自救**:`max_iterations`(默认 6)、`max_round_time_ms`(10min)、`max_wall_time_ms`(1h)触发或 P1 确认时可覆盖;终态(diverged/timeout)前先按 mirror-rules 的 retry/resplit 顺序穷尽自救,穷尽才升级人介入
|
|
29
|
+
- **Act 委托 dispatcher**:loop 是决策层不写代码,Act 阶段把 decision 序列化为 dispatcher 指令,由 agent-dispatcher 多 agent 执行
|
|
30
|
+
- **进度即观测**:每轮 verdict/proximity 记录到 PROGRESS.md / task.md(`skill-progress-tracker`),Observe 快照同源
|
|
31
|
+
- **风险分级人审**:plan 顶层声明 `风险分级: low`(纯文档/测试补充类)→ P1 轻量化一句话确认、门控自动豁免强制暂停;未声明风险的 plan 照常完整人审
|
|
65
32
|
|
|
66
33
|
## 安装
|
|
67
34
|
|
|
@@ -73,25 +40,22 @@ cd your-project
|
|
|
73
40
|
doukui init # 创建配置目录 + 注册钩子
|
|
74
41
|
```
|
|
75
42
|
|
|
76
|
-
SDK 载体按需启用(可选依赖,不装不影响 default 载体):
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
npm i -g @anthropic-ai/claude-agent-sdk
|
|
80
|
-
```
|
|
81
|
-
|
|
82
43
|
## 命令一览
|
|
83
44
|
|
|
84
45
|
| 命令 | 说明 |
|
|
85
46
|
|------|------|
|
|
86
|
-
| `doukui
|
|
87
|
-
| `doukui build` | 更新 .claude/settings.json,注册全局技能和钩子 |
|
|
88
|
-
| `doukui loop <plan>` | Node 进程驱动 Agentic Loop(`--executor=sdk\|default\|local` / `--concurrency=N` / `--loop-id=X` / `--settings=<path>`) |
|
|
89
|
-
| `doukui loop-server <start\|status\|abort>` | 多 loop 协调守护进程:全局视图、per-provider 额度池观测、全局熔断 |
|
|
90
|
-
| `doukui migrate` | 迁移旧项目配置 |
|
|
91
|
-
| `doukui team-cleanup <name>` | 确定性清理残留的 Agent Teams 团队目录 |
|
|
47
|
+
| `doukui build` | 构建所有插件(默认命令) |
|
|
92
48
|
| `doukui validate` / `validate-config` | 插件格式 / harness-config 校验 |
|
|
49
|
+
| `doukui plan-lint <plan.md>` | 计划体检(只读):工作单元 / 依赖拓扑 / 成功标准 / verify 覆盖率,退出码 0 可用 1 不可用 |
|
|
50
|
+
| `doukui verify <plan.md> --wp WP-NNN\|all` | 批跑单元 checklist 的 `[verify:]` 命令并输出 CheckResult,退出码 0 全过 / 1 有失败 / 2 无 verify 项 |
|
|
51
|
+
| `doukui init` | 首次安装:build + config |
|
|
52
|
+
| `doukui install` | 安装外部插件(含安全审查) |
|
|
53
|
+
| `doukui migrate` | 迁移旧项目配置 |
|
|
54
|
+
| `doukui status` / `list` / `config` | 状态 / 插件列表 / 配置查询 |
|
|
93
55
|
| `doukui interactive` | 交互式插件管理(别名 `i`) |
|
|
94
|
-
| `doukui
|
|
56
|
+
| `doukui setup-global` | 安装全局 skills 到 ~/.claude/skills/ |
|
|
57
|
+
| `doukui team-cleanup <name>` | 确定性清理残留的 Agent Teams 团队目录 |
|
|
58
|
+
| `doukui version` / `help` | 版本 / 帮助 |
|
|
95
59
|
|
|
96
60
|
## 工作流概览
|
|
97
61
|
|
|
@@ -109,38 +73,34 @@ npm i -g @anthropic-ai/claude-agent-sdk
|
|
|
109
73
|
|
|
110
74
|
## 插件架构
|
|
111
75
|
|
|
112
|
-
|
|
76
|
+
三类插件,共 19 个:
|
|
113
77
|
|
|
114
78
|
| 类型 | 数量 | 作用 |
|
|
115
79
|
|------|------|------|
|
|
116
|
-
| Skill |
|
|
117
|
-
| Provider |
|
|
80
|
+
| Skill | 16 | 可执行技能,Claude Code 直接调用 |
|
|
81
|
+
| Provider | 1 | 角色注册(agent-def-generator 消费) |
|
|
118
82
|
| Hook | 2 | 技能门控 + 会话启动注入 plan-mode 规则 |
|
|
119
|
-
| Validator | 2 | 文档同步验证、工作包验证 |
|
|
120
83
|
|
|
121
84
|
## 文档
|
|
122
85
|
|
|
123
|
-
- [Agentic Loop 设计](docs/design/agentic-loop-design.md) — 五阶段状态机、终止判定、持久化
|
|
124
86
|
- [工作流详解](docs/design/ai_workflow.md) — 完整数据流
|
|
87
|
+
- [Agentic Loop 设计](docs/design/agentic-loop-design.md) — 历史设计文档(driver 路径已退役,顶部有横幅;现行判定规则见 `plugins/core/skill-agentic-loop/mirror-rules.md`)
|
|
125
88
|
- [配置参考](docs/design/config-reference.md) — harness-config.yaml 全量说明
|
|
126
|
-
- [Provider 能力矩阵](docs/design/provider-capability-matrix.md) — 各端点 SDK 能力实测
|
|
127
89
|
- [插件开发](docs/design/plugin-development.md) / [API 参考](docs/design/api-reference.md)
|
|
128
|
-
- [
|
|
90
|
+
- [安全政策](SECURITY.md) — 漏洞报告渠道;沙箱隔离层已随 v0.9.0 退役([历史威胁模型](docs/design/sandbox-threat-model.md)),第三方插件经 `doukui install` 能力确认 + 人工审查后加载
|
|
129
91
|
|
|
130
92
|
## 与前身的关系
|
|
131
93
|
|
|
132
94
|
| | tackle-harness(前身) | doukui |
|
|
133
95
|
|---|---|---|
|
|
134
|
-
| 执行载体 | spawn `claude -p` 单一路径 |
|
|
135
|
-
| 结构化输出 | fenced block 裸解析 | fenced +
|
|
136
|
-
| 阈值/决策 |
|
|
137
|
-
| 上下文窗口 | 固定 200K 默认 | 按 provider 分档(DeepSeek V4 → 1M) |
|
|
96
|
+
| 执行载体 | spawn `claude -p` 单一路径 | 会话内 skills + dispatcher 多 agent(driver 子进程已于 v0.7.0 退役) |
|
|
97
|
+
| 结构化输出 | fenced block 裸解析 | fenced + 机器可读 block + verify 命令客观验证 |
|
|
98
|
+
| 阈值/决策 | 三处硬编码重复 | mirror-rules.md 单一真相源(自持阈值) |
|
|
138
99
|
| 品牌/命令 | tackle-harness / tackle | doukui |
|
|
139
100
|
|
|
140
101
|
## 致谢
|
|
141
102
|
|
|
142
103
|
- [tackle-harness](https://github.com/ph419/tackle-harness) — 前身,Doukui 的全部骨架来源
|
|
143
|
-
- [Claude Agent SDK](https://github.com/anthropics/claude-agent-sdk-typescript) — SDK 载体
|
|
144
104
|
- DeerFlow — 记忆提取与插件架构参考
|
|
145
105
|
|
|
146
106
|
## 许可证
|
package/bin/commands/help.js
CHANGED
|
@@ -23,6 +23,8 @@ module.exports = {
|
|
|
23
23
|
['build', 'Build all plugins (default)'],
|
|
24
24
|
['validate', 'Validate plugin.json files'],
|
|
25
25
|
['validate-config', 'Validate harness-config.yaml'],
|
|
26
|
+
['plan-lint', 'Lint a plan file: work units, dependency order, verify coverage'],
|
|
27
|
+
['verify', 'Run a plan work unit\'s [verify:] commands and emit CheckResult'],
|
|
26
28
|
['init', 'First-time setup (build + config)'],
|
|
27
29
|
['install', 'Install an external plugin with security review'],
|
|
28
30
|
['migrate', 'Migrate legacy project structure to global setup'],
|
|
@@ -31,8 +33,6 @@ module.exports = {
|
|
|
31
33
|
['list', 'List all registered plugins'],
|
|
32
34
|
['interactive', 'Interactive plugin management (alias: i)'],
|
|
33
35
|
['setup-global', 'Install global skills to ~/.claude/skills/'],
|
|
34
|
-
['loop', 'Run the agentic loop driver (Node process-level steady loop)'],
|
|
35
|
-
['loop-server', 'Global loop coordinator daemon (multi-loop view, quota, circuit break)'],
|
|
36
36
|
['team-cleanup', 'Deterministic agent-team directory cleanup'],
|
|
37
37
|
['version', 'Show version information'],
|
|
38
38
|
['help', 'Show this help message'],
|
|
@@ -54,29 +54,6 @@ module.exports = {
|
|
|
54
54
|
console.log(' --help, -h Show this help message');
|
|
55
55
|
console.log(' --version, -v Show version information');
|
|
56
56
|
console.log('');
|
|
57
|
-
console.log(ctx.colorize('loop', 'green') + ' 子命令用法(Agentic Loop Node Driver):');
|
|
58
|
-
console.log(' doukui loop <plan.md> [options]');
|
|
59
|
-
console.log(' --executor=local|default executor 路由(默认 local;claude 为 default 别名)');
|
|
60
|
-
console.log(' --settings=<path> 指定 claude settings JSON(透传 claude --settings,');
|
|
61
|
-
console.log(' 按文件内 model 自动探测 provider 并门控额度,如 mimo / glm-5.2)');
|
|
62
|
-
console.log(' --loop-id=<name> per-loop 隔离 + 支持 --loop-id 恢复');
|
|
63
|
-
console.log(' --max-iters=<N> 最大迭代数(必须 >0)');
|
|
64
|
-
console.log(' --state-dir=<dir> 隔离 state 目录(默认 .doukui-state)');
|
|
65
|
-
console.log(' --dry-run 不执行 executor(调试)');
|
|
66
|
-
console.log(' --force 允许恢复已终态的 loop(覆盖终态保护)');
|
|
67
|
-
console.log('');
|
|
68
|
-
console.log(ctx.colorize('loop-server', 'green') + ' 子命令用法(全局 loop 协调守护进程):');
|
|
69
|
-
console.log(' doukui loop-server start [--state-dir=X] [--interval=N] [--no-circuit]');
|
|
70
|
-
console.log(' 轮询守护进程(额度池/全局熔断)');
|
|
71
|
-
console.log(' doukui loop-server stop [--state-dir=X]');
|
|
72
|
-
console.log(' 停止守护进程(跨平台 kill)');
|
|
73
|
-
console.log(' doukui loop-server status [--state-dir=X]');
|
|
74
|
-
console.log(' 单次全局快照');
|
|
75
|
-
console.log(' doukui loop-server list [--state-dir=X]');
|
|
76
|
-
console.log(' status 别名');
|
|
77
|
-
console.log(' doukui loop-server abort <loop-id> [--state-dir=X] [--reason=...]');
|
|
78
|
-
console.log(' 向指定 loop 下发熔断指令');
|
|
79
|
-
console.log('');
|
|
80
57
|
console.log('After running ' + ctx.colorize('doukui build', 'green') + ', skills are available in .claude/skills/');
|
|
81
58
|
console.log('and hooks are registered in .claude/settings.json');
|
|
82
59
|
},
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* plan-lint command - Lint a plan file via plan-reader and print a work-unit summary (read-only)
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
var planReader = require('../../plugins/runtime/plan-reader');
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Aggregate verify coverage over all work packages (works for cyclic results too,
|
|
12
|
+
* where goal.checklistSpec is null).
|
|
13
|
+
* @param {Array} workPackages
|
|
14
|
+
* @returns {{withVerify:number, total:number}}
|
|
15
|
+
*/
|
|
16
|
+
function verifyCoverage(workPackages) {
|
|
17
|
+
var total = 0;
|
|
18
|
+
var withVerify = 0;
|
|
19
|
+
for (var i = 0; i < workPackages.length; i++) {
|
|
20
|
+
var cl = workPackages[i].checklist || [];
|
|
21
|
+
total += cl.length;
|
|
22
|
+
for (var j = 0; j < cl.length; j++) {
|
|
23
|
+
if (cl[j].verify) withVerify += 1;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return { withVerify: withVerify, total: total };
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
module.exports = {
|
|
30
|
+
name: 'plan-lint',
|
|
31
|
+
description: 'Lint a plan file: work units, dependency order, verify coverage (read-only)',
|
|
32
|
+
/**
|
|
33
|
+
* Execute the plan-lint command.
|
|
34
|
+
* usage: doukui plan-lint [path] [--json]
|
|
35
|
+
* path defaults to resolvePlanPath() (argument path > .claude/plan.md)
|
|
36
|
+
* exit 0 = usable; exit 1 = unusable
|
|
37
|
+
* (parse error / wpIds empty / successCriteria empty / cyclic dependency)
|
|
38
|
+
* @public
|
|
39
|
+
* @param {object} ctx - CLI context object
|
|
40
|
+
*/
|
|
41
|
+
execute: function (ctx) {
|
|
42
|
+
var argv = ctx.argv || [];
|
|
43
|
+
var json = false;
|
|
44
|
+
var positional = null;
|
|
45
|
+
for (var i = 0; i < argv.length; i++) {
|
|
46
|
+
if (argv[i] === '--json') json = true;
|
|
47
|
+
else if (positional === null) positional = argv[i];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
var projectRoot = ctx.targetRoot;
|
|
51
|
+
var planPath = planReader.resolvePlanPath({ planFilePath: positional, projectRoot: projectRoot });
|
|
52
|
+
var result = planReader.parsePlanToGoal({
|
|
53
|
+
planFilePath: planPath,
|
|
54
|
+
projectRoot: projectRoot,
|
|
55
|
+
throwOnCycle: false,
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
var reasons = [];
|
|
59
|
+
if (result.error) reasons.push(result.error);
|
|
60
|
+
if (result.goal.wpIds.length === 0) reasons.push('wpIds-empty');
|
|
61
|
+
if (result.dependencyGraph.hasCycle) reasons.push('cyclic-dependency');
|
|
62
|
+
// cyclic path returns before goal assembly, successCriteria is not extracted there
|
|
63
|
+
else if (result.goal.successCriteria.length === 0) reasons.push('successCriteria-empty');
|
|
64
|
+
var usable = reasons.length === 0;
|
|
65
|
+
|
|
66
|
+
if (json) {
|
|
67
|
+
console.log(JSON.stringify(result, null, 2));
|
|
68
|
+
ctx.exit(usable ? 0 : 1);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
var wps = result.workPackages;
|
|
73
|
+
var cov = verifyCoverage(wps);
|
|
74
|
+
var pct = cov.total === 0 ? 0 : Math.round((cov.withVerify / cov.total) * 100);
|
|
75
|
+
|
|
76
|
+
console.log(ctx.colorize('plan: ', 'dim') + result.planFilePath);
|
|
77
|
+
console.log(ctx.colorize('工作单元', 'cyan') + '(' + wps.length + ' 个)');
|
|
78
|
+
for (var w = 0; w < wps.length; w++) {
|
|
79
|
+
var wp = wps[w];
|
|
80
|
+
var deps = wp.dependencies.length ? wp.dependencies.join(', ') : '无';
|
|
81
|
+
var verifyCount = wp.checklist.filter(function (it) { return it.verify; }).length;
|
|
82
|
+
console.log(' ' + ctx.colorize(wp.wpId, 'green') + ' ' + wp.title);
|
|
83
|
+
console.log(
|
|
84
|
+
ctx.colorize(' 依赖: ', 'dim') + deps +
|
|
85
|
+
ctx.colorize(' checklist: ', 'dim') + wp.checklist.length +
|
|
86
|
+
ctx.colorize(' verify: ', 'dim') + verifyCount
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
console.log(ctx.colorize('拓扑序', 'cyan') + ':' + (result.dependencyGraph.order.join(' → ') || '(空)'));
|
|
90
|
+
console.log(ctx.colorize('成功标准', 'cyan') + ':' + result.goal.successCriteria.length + ' 条');
|
|
91
|
+
console.log(ctx.colorize('风险分级', 'cyan') + ':riskLow=' +
|
|
92
|
+
(result.riskLow === true ? 'true(人审豁免)' : 'false(人审照常)'));
|
|
93
|
+
console.log(ctx.colorize('verify 覆盖率', 'cyan') + ':' + cov.withVerify + '/' + cov.total + '(' + pct + '%)');
|
|
94
|
+
|
|
95
|
+
if (usable) {
|
|
96
|
+
console.log(ctx.colorize('结论:可用', 'green'));
|
|
97
|
+
} else {
|
|
98
|
+
console.log(ctx.colorize('结论:不可用', 'red'));
|
|
99
|
+
for (var r = 0; r < reasons.length; r++) {
|
|
100
|
+
console.log(ctx.colorize(' - ' + reasons[r], 'red'));
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
ctx.exit(usable ? 0 : 1);
|
|
104
|
+
},
|
|
105
|
+
};
|