agentic-flow-kit 1.3.0 → 1.5.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.md +10 -4
- package/modules/hosts/claude/agents/implementer.md +5 -6
- package/modules/hosts/claude/agents/independent-reviewer.md +6 -6
- package/modules/hosts/claude/agents/ui-verifier.md +5 -5
- package/modules/hosts/claude/commands/wf-build.md +21 -21
- package/modules/hosts/claude/commands/wf-deploy.md +2 -2
- package/modules/hosts/claude/commands/wf-design.md +8 -8
- package/modules/hosts/claude/commands/wf-gate-checklist.md +8 -8
- package/modules/hosts/claude/commands/wf-maintain.md +12 -12
- package/modules/hosts/claude/commands/wf-new-task.md +9 -9
- package/modules/hosts/claude/commands/wf-pipeline-run.md +3 -3
- package/modules/hosts/claude/commands/wf-plan.md +10 -11
- package/modules/hosts/claude/commands/wf-review.md +4 -4
- package/modules/hosts/claude/commands/wf-source-sync-check.md +10 -10
- package/modules/hosts/claude/commands/wf-sync-hosts.md +9 -9
- package/modules/hosts/claude/commands/wf-test.md +6 -7
- package/modules/hosts/codex/agents/implementer.md +5 -6
- package/modules/hosts/codex/agents/independent-reviewer.md +6 -6
- package/modules/hosts/codex/agents/ui-verifier.md +5 -5
- package/modules/hosts/codex/commands/wf-build.md +21 -21
- package/modules/hosts/codex/commands/wf-deploy.md +2 -2
- package/modules/hosts/codex/commands/wf-design.md +8 -8
- package/modules/hosts/codex/commands/wf-gate-checklist.md +8 -8
- package/modules/hosts/codex/commands/wf-maintain.md +12 -12
- package/modules/hosts/codex/commands/wf-new-task.md +9 -9
- package/modules/hosts/codex/commands/wf-pipeline-run.md +3 -3
- package/modules/hosts/codex/commands/wf-plan.md +10 -11
- package/modules/hosts/codex/commands/wf-review.md +4 -4
- package/modules/hosts/codex/commands/wf-source-sync-check.md +10 -10
- package/modules/hosts/codex/commands/wf-sync-hosts.md +9 -9
- package/modules/hosts/codex/commands/wf-test.md +6 -7
- package/modules/hosts/cursor/agents/implementer.md +5 -6
- package/modules/hosts/cursor/agents/independent-reviewer.md +6 -6
- package/modules/hosts/cursor/agents/ui-verifier.md +5 -5
- package/modules/hosts/cursor/commands/wf-build.md +21 -21
- package/modules/hosts/cursor/commands/wf-deploy.md +2 -2
- package/modules/hosts/cursor/commands/wf-design.md +8 -8
- package/modules/hosts/cursor/commands/wf-gate-checklist.md +8 -8
- package/modules/hosts/cursor/commands/wf-maintain.md +12 -12
- package/modules/hosts/cursor/commands/wf-new-task.md +9 -9
- package/modules/hosts/cursor/commands/wf-pipeline-run.md +3 -3
- package/modules/hosts/cursor/commands/wf-plan.md +10 -11
- package/modules/hosts/cursor/commands/wf-review.md +4 -4
- package/modules/hosts/cursor/commands/wf-source-sync-check.md +10 -10
- package/modules/hosts/cursor/commands/wf-sync-hosts.md +9 -9
- package/modules/hosts/cursor/commands/wf-test.md +6 -7
- package/modules/hosts/omp/agents/implementer.md +5 -6
- package/modules/hosts/omp/agents/independent-reviewer.md +6 -6
- package/modules/hosts/omp/agents/ui-verifier.md +5 -5
- package/modules/hosts/opencode/agents/implementer.md +5 -6
- package/modules/hosts/opencode/agents/independent-reviewer.md +6 -6
- package/modules/hosts/opencode/agents/ui-verifier.md +5 -5
- package/modules/hosts/opencode/commands/wf-build.md +21 -21
- package/modules/hosts/opencode/commands/wf-deploy.md +2 -2
- package/modules/hosts/opencode/commands/wf-design.md +8 -8
- package/modules/hosts/opencode/commands/wf-gate-checklist.md +8 -8
- package/modules/hosts/opencode/commands/wf-maintain.md +12 -12
- package/modules/hosts/opencode/commands/wf-new-task.md +9 -9
- package/modules/hosts/opencode/commands/wf-pipeline-run.md +3 -3
- package/modules/hosts/opencode/commands/wf-plan.md +10 -11
- package/modules/hosts/opencode/commands/wf-review.md +4 -4
- package/modules/hosts/opencode/commands/wf-source-sync-check.md +10 -10
- package/modules/hosts/opencode/commands/wf-sync-hosts.md +9 -9
- package/modules/hosts/opencode/commands/wf-test.md +6 -7
- package/modules/hosts/trae/agents/implementer.md +5 -6
- package/modules/hosts/trae/agents/independent-reviewer.md +6 -6
- package/modules/hosts/trae/agents/ui-verifier.md +5 -5
- package/modules/hosts/trae/commands/wf-build.md +21 -21
- package/modules/hosts/trae/commands/wf-deploy.md +2 -2
- package/modules/hosts/trae/commands/wf-design.md +8 -8
- package/modules/hosts/trae/commands/wf-gate-checklist.md +8 -8
- package/modules/hosts/trae/commands/wf-maintain.md +12 -12
- package/modules/hosts/trae/commands/wf-new-task.md +9 -9
- package/modules/hosts/trae/commands/wf-pipeline-run.md +3 -3
- package/modules/hosts/trae/commands/wf-plan.md +10 -11
- package/modules/hosts/trae/commands/wf-review.md +4 -4
- package/modules/hosts/trae/commands/wf-source-sync-check.md +10 -10
- package/modules/hosts/trae/commands/wf-sync-hosts.md +9 -9
- package/modules/hosts/trae/commands/wf-test.md +6 -7
- package/modules/hosts/zcode/agents/implementer.md +5 -6
- package/modules/hosts/zcode/agents/independent-reviewer.md +6 -6
- package/modules/hosts/zcode/agents/ui-verifier.md +5 -5
- package/package.json +7 -2
- package/src/doctor.mjs +1 -1
- package/src/init.test.mjs +1 -1
- package/src/run-tests.mjs +15 -1
- package/src/sync-hosts.test.mjs +4 -4
- package/src/sync.test.mjs +1 -1
- package/templates/_agents/commands/build.md +21 -21
- package/templates/_agents/commands/deploy.md +2 -2
- package/templates/_agents/commands/design.md +8 -8
- package/templates/_agents/commands/gate-checklist.md +8 -8
- package/templates/_agents/commands/maintain.md +12 -12
- package/templates/_agents/commands/new-task.md +9 -9
- package/templates/_agents/commands/pipeline-run.md +3 -3
- package/templates/_agents/commands/plan.md +10 -11
- package/templates/_agents/commands/review.md +4 -4
- package/templates/_agents/commands/source-sync-check.md +10 -10
- package/templates/_agents/commands/sync-hosts.md +9 -9
- package/templates/_agents/commands/test.md +6 -7
- package/templates/_agents/roles/implementer.md +5 -6
- package/templates/_agents/roles/independent-reviewer.md +6 -6
- package/templates/_agents/roles/ui-verifier.md +5 -5
- package/templates/_agents/scripts/agg-delegations.cjs +41 -13
- package/templates/_agents/scripts/agg-delegations.test.mjs +78 -3
- package/templates/_agents/scripts/agg-gate-stats.mjs +113 -0
- package/templates/_agents/scripts/agg-gate-stats.test.mjs +95 -0
- package/templates/_agents/scripts/check-hygiene.mjs +167 -0
- package/templates/_agents/scripts/check-hygiene.test.mjs +182 -0
- package/templates/_agents/scripts/check-ledger-invariant.mjs +0 -1
- package/templates/_agents/scripts/check-loop.mjs +112 -117
- package/templates/_agents/scripts/check-loop.test.mjs +115 -1
- package/templates/_agents/scripts/commit-check-trigger.test.mjs +0 -1
- package/templates/_agents/scripts/confirm-doc.mjs +27 -7
- package/templates/_agents/scripts/confirm-doc.test.mjs +35 -0
- package/templates/_agents/scripts/ensure-board.mjs +2 -2
- package/templates/_agents/scripts/fill-intent.mjs +2 -2
- package/templates/_agents/scripts/fill-plan.mjs +1 -2
- package/templates/_agents/scripts/gate-seg.mjs +54 -0
- package/templates/_agents/scripts/gate-seg.test.mjs +112 -0
- package/templates/_agents/scripts/gen-wiki-board.mjs +1 -1
- package/templates/_agents/scripts/gen-workflow-dashboard.mjs +76 -9
- package/templates/_agents/scripts/gen-workflow-dashboard.test.mjs +64 -3
- package/templates/_agents/scripts/gen-workflow-index.test.mjs +1 -1
- package/templates/_agents/scripts/gen-workflow-metrics.mjs +1 -1
- package/templates/_agents/scripts/kb-search.mjs +1 -2
- package/templates/_agents/scripts/kb-search.test.mjs +1 -1
- package/templates/_agents/scripts/pipeline-run-docs.mjs +76 -0
- package/templates/_agents/scripts/pipeline-run-run.mjs +63 -0
- package/templates/_agents/scripts/pipeline-run.mjs +8 -128
- package/templates/_agents/scripts/policy.mjs +37 -3
- package/templates/_agents/scripts/source-sync-check.mjs +2 -2
- package/templates/_agents/scripts/source-sync-check.test.mjs +1 -1
- package/templates/_agents/scripts/verify-wiki-consistency.mjs +0 -1
- package/templates/_agents/scripts/verify.mjs +27 -2
- package/templates/_agents/scripts/verify.test.mjs +53 -0
- package/templates/_agents/scripts/workflow-board-server.test.mjs +0 -1
- package/templates/_agents/scripts/workflow-enums.test.mjs +0 -1
- package/templates/_agents/scripts-test-exempt.txt +4 -1
|
@@ -9,7 +9,7 @@ description: 代码评审标准(按风险分级:机器兜底 + AI 自查出
|
|
|
9
9
|
> 参考 Anthropic REVIEW.md 做法。宗旨是**用户决策 + AI 协作**:AI 跑机器门禁、自查、出分级清单与建议;用户确认问题定性与合入。把"该机器兜底"与"靠 AI 自查"分开列明,避免注意力耗在机械逐行上。
|
|
10
10
|
> 本文件为通用骨架;项目专属红线 / 命名 / 组件约定的具体口径在项目适配区(目录级 `AGENTS.md` 与 `.agents/hooks/`)补充。
|
|
11
11
|
|
|
12
|
-
## P0 必拦(优先机器兜底,hook 覆盖不到的靠 AI 自查)
|
|
12
|
+
## 1. P0 必拦(优先机器兜底,hook 覆盖不到的靠 AI 自查)
|
|
13
13
|
|
|
14
14
|
- **架构红线**:分层依赖方向约束(如领域 / 应用层禁直接引用基础设施实现;豁免清单见目录级 `AGENTS.md` / 项目适配区)
|
|
15
15
|
- 机器兜底:项目自有架构门禁(如有,`.agents/hooks/`)
|
|
@@ -21,7 +21,7 @@ description: 代码评审标准(按风险分级:机器兜底 + AI 自查出
|
|
|
21
21
|
- 机器兜底:项目验证测试覆盖(如有) + AI 自查
|
|
22
22
|
- **L2 / L3 改动无 spec**:拒收,先回 `workflow/specs/` 立 spec 确认通过
|
|
23
23
|
|
|
24
|
-
## P1 应拦(自查重点)
|
|
24
|
+
## 2. P1 应拦(自查重点)
|
|
25
25
|
|
|
26
26
|
- **DB 命名与迁移**:遵循项目表 / 字段 / 外键命名规范与 schema 变更流程(见目录级 `AGENTS.md`);不得擅自引入项目未采用的迁移机制
|
|
27
27
|
- **前端形态**:新增 / 编辑与大数据量选择等交互遵循项目组件约定(弹层 vs 跳页、选择器形态、表格与样式统一等)
|
|
@@ -34,14 +34,14 @@ description: 代码评审标准(按风险分级:机器兜底 + AI 自查出
|
|
|
34
34
|
- **spec 承诺的断言落地**:spec §测试列出的用例 / 断言须真落到测试或验证脚本;「写进 spec」不等于「跑得起来」,且常驻断言禁写成随时间增长的行数常量
|
|
35
35
|
- **跨宿主薄适配正文漂移**:改 `templates/_agents/{commands,roles}/*.md` 后必须跑 `flow-kit sync-hosts --apply` 单向同步注册表内全部宿主薄适配(`modules/hosts/<h>/{agents,commands}/*.md`);装户视角由 `flow-kit doctor` §6.7 检查(包源环境 §6.7 skipped)
|
|
36
36
|
|
|
37
|
-
## P2 建议(提醒,不拦合入)
|
|
37
|
+
## 3. P2 建议(提醒,不拦合入)
|
|
38
38
|
|
|
39
39
|
- 样式统一性(深色 / 浅色主题、卡片样式)
|
|
40
40
|
- 注释完整性(复杂逻辑处补注释,AGENTS.md 已说的不重复)
|
|
41
41
|
- Conventional Commits 中文(feat / fix / docs / style / refactor / perf)
|
|
42
42
|
- 历史同类 incident 的复盘三件套是否补齐
|
|
43
43
|
|
|
44
|
-
## 审查分工(用户决策 + AI 协作)
|
|
44
|
+
## 4. 审查分工(用户决策 + AI 协作)
|
|
45
45
|
|
|
46
46
|
- **机器兜底**(pre-commit / pre-push / test 自动拦,无需人守):门禁清单与判据以 `.githooks/`、`.agents/hooks/`、`check-loop.sh` 头部注释为准;`项目测试命令` 跑自动化用例。
|
|
47
47
|
- **AI 复核**:机器门禁完成后优先委派 `independent-reviewer`,聚焦 P0 hook 未覆盖项 + 全部 P1(P2 视精力)——产出分级问题清单 + 修复建议。复核方法参考 `code-review` 技能(Standards×Spec 双轴);每条 finding 报告前过 `review-verification-protocol` 防误报门(锚定 file:line、给出证据、校准严重级,不确定就降级为提问)。
|
|
@@ -9,16 +9,16 @@ description: 装户面同步一致性检查(包源 templates/_agents/ vs 装
|
|
|
9
9
|
> `templates/_agents/` 包源 vs `.agents/` 装副本——三类差异报告:缺失 / 孤儿 / 漂移。
|
|
10
10
|
> managed 文件由 `flow-kit sync` 跟踪;owned 文件由 `flow-kit doctor` §6.6 校验——本工具补"两者都没扫"的真空地带(结构级差异)。
|
|
11
11
|
|
|
12
|
-
## 何时跑
|
|
12
|
+
## 1. 何时跑
|
|
13
13
|
|
|
14
14
|
- 改 `templates/_agents/*` 包源后
|
|
15
15
|
- 怀疑装副本未跟包源更新
|
|
16
16
|
- 体检装副本完整性(清理前 / 发版前)
|
|
17
17
|
- 不跑:仅改装副本 `.agents/*`(B-b 决策「只报告」+ 不反向同步)
|
|
18
18
|
|
|
19
|
-
## 怎么跑
|
|
19
|
+
## 2. 怎么跑
|
|
20
20
|
|
|
21
|
-
### 默认 `--diff`(仅报告)
|
|
21
|
+
### 2.1 默认 `--diff`(仅报告)
|
|
22
22
|
|
|
23
23
|
```
|
|
24
24
|
node .agents/scripts/source-sync-check.mjs --diff
|
|
@@ -35,7 +35,7 @@ node .agents/scripts/source-sync-check.mjs --pkg-root <path> --target <path> #
|
|
|
35
35
|
- `templates/_agents/cache/`(运行时缓存,与 `flow-kit sync` 既有约定一致)
|
|
36
36
|
- `.agents/kit.json` / `.agents/settings.json`(init 渲染产物,不属双源)
|
|
37
37
|
|
|
38
|
-
### 输出示例
|
|
38
|
+
### 2.2 输出示例
|
|
39
39
|
|
|
40
40
|
```
|
|
41
41
|
▶ flow-kit source-sync-check --diff
|
|
@@ -50,7 +50,7 @@ node .agents/scripts/source-sync-check.mjs --pkg-root <path> --target <path> #
|
|
|
50
50
|
- scripts/ensure-board.mjs pkg=e66653b0… tgt=b6f3cc9b…
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
### 自验
|
|
53
|
+
### 2.3 自验
|
|
54
54
|
|
|
55
55
|
```
|
|
56
56
|
node .agents/scripts/source-sync-check.test.mjs # 11 场景全过
|
|
@@ -58,7 +58,7 @@ npm test # 含 source-sync-check 套
|
|
|
58
58
|
flow-kit doctor # 10/0/0
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
## 边界(不要做)
|
|
61
|
+
## 3. 边界(不要做)
|
|
62
62
|
|
|
63
63
|
- 不要自动化同步(B-b 决策「只报告不修复」——与 `gate-checklist` 同源)
|
|
64
64
|
- 不改 managed 台账跟踪逻辑(`sync.mjs` 不动)
|
|
@@ -66,7 +66,7 @@ flow-kit doctor # 10/0/0
|
|
|
66
66
|
- 不反向同步——装副本独自有文件(如 hooks/commit-check.config.json)可能是装户配置,不应被删
|
|
67
67
|
- 不检查注册表内宿主 `modules/hosts/` 薄适配漂移(那是 `flow-kit sync-hosts` 范围)
|
|
68
68
|
|
|
69
|
-
## 当前已识别的真实漂点(首次实测,2026-09-25)
|
|
69
|
+
## 4. 当前已识别的真实漂点(首次实测,2026-09-25)
|
|
70
70
|
|
|
71
71
|
- **缺失**:本工具写完后未同步装副本(预期内——随本次 commit 解决)
|
|
72
72
|
- **孤儿**:`.agents/hooks/commit-check.config.json`(装副本独有,疑似装户配置)
|
|
@@ -74,7 +74,7 @@ flow-kit doctor # 10/0/0
|
|
|
74
74
|
|
|
75
75
|
修复留后续 incident / intent 跟踪(不在本次范围)。
|
|
76
76
|
|
|
77
|
-
## 与既有工具的关系
|
|
77
|
+
## 5. 与既有工具的关系
|
|
78
78
|
|
|
79
79
|
| 工具 | 作用域 | 算法 |
|
|
80
80
|
|---|---|---|
|
|
@@ -84,8 +84,8 @@ flow-kit doctor # 10/0/0
|
|
|
84
84
|
|
|
85
85
|
三者互补,不重叠。
|
|
86
86
|
|
|
87
|
-
## 相关留痕
|
|
87
|
+
## 6. 相关留痕
|
|
88
88
|
|
|
89
89
|
- intent:`workflow/intents/2026-09-25-source-sync-check.md`
|
|
90
90
|
- plan:`workflow/plans/2026-09-25-source-sync-check.md`
|
|
91
|
-
- 父 incident:`workflow/incidents/2026-09-25-wf-runtime.md`(包源改了装副本未同步——本工具预防性体检)
|
|
91
|
+
- 父 incident:`workflow/incidents/2026-09-25-wf-runtime.md`(包源改了装副本未同步——本工具预防性体检)
|
|
@@ -12,16 +12,16 @@ description: 跨宿主适配层同步(正文段 sha 比对 + 用户拍板 +
|
|
|
12
12
|
> 比 `templates/_agents` ↔ `modules/hosts/<宿主键>/`;含 `.agents` → 装户:比 `.agents` ↔ 项目根下 `<宿主点目录>/`),
|
|
13
13
|
> 目标根取 `--dir <目录>` > 当前目录。
|
|
14
14
|
|
|
15
|
-
## 何时跑
|
|
15
|
+
## 1. 何时跑
|
|
16
16
|
|
|
17
17
|
- 改 `templates/_agents/commands/*.md` 正文后(11 个 commands 文件)
|
|
18
18
|
- 改 `templates/_agents/roles/*.md` 正文后(3 个 roles 文件)
|
|
19
19
|
- 装户跑 `flow-kit doctor` 报"跨宿主薄适配正文漂移 N 对" WARN 时
|
|
20
20
|
- 不跑:仅改 frontmatter;改 trae 钩子/规则;改包源其他文件
|
|
21
21
|
|
|
22
|
-
## 怎么跑
|
|
22
|
+
## 2. 怎么跑
|
|
23
23
|
|
|
24
|
-
### 默认 `--diff`(仅报告)
|
|
24
|
+
### 2.1 默认 `--diff`(仅报告)
|
|
25
25
|
|
|
26
26
|
```
|
|
27
27
|
node bin/flow-kit.mjs sync-hosts --diff # 包源仓(在包源根跑)
|
|
@@ -35,7 +35,7 @@ flow-kit sync-hosts --diff # 装户仓(在装户根跑;或
|
|
|
35
35
|
- **⚠️ 权威源声明但薄适配缺失** — `add-host <h>` 接管后跑 `--apply` 才会装(apply 不自动创建)
|
|
36
36
|
- **⚠️ 孤儿薄适配(权威源无对应文件)** — 历史残留或宿主特化,apply 不删
|
|
37
37
|
|
|
38
|
-
### `--apply` 单向同步
|
|
38
|
+
### 2.2 `--apply` 单向同步
|
|
39
39
|
|
|
40
40
|
```
|
|
41
41
|
node bin/flow-kit.mjs sync-hosts --apply
|
|
@@ -43,7 +43,7 @@ node bin/flow-kit.mjs sync-hosts --apply
|
|
|
43
43
|
|
|
44
44
|
按权威源正文覆盖薄适配正文段;薄适配原 frontmatter 保留(trae name: wf-X、opencode 描述、zcode/omp 中文风格各自不动)。apply 不反向同步——薄适配手改了正文也会被覆盖(这是设计选择,避免漂移方向歧义)。
|
|
45
45
|
|
|
46
|
-
### 自验
|
|
46
|
+
### 2.3 自验
|
|
47
47
|
|
|
48
48
|
```
|
|
49
49
|
npm test # 含 sync-hosts.test.mjs 8 场景
|
|
@@ -51,7 +51,7 @@ node bin/flow-kit.mjs doctor # 装户跑 §7.x PASS;包源
|
|
|
51
51
|
sh .agents/scripts/check-loop.sh # Windows 无 sh 时 doctor 已探测分流
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
## 边界(不要做)
|
|
54
|
+
## 3. 边界(不要做)
|
|
55
55
|
|
|
56
56
|
- 不要 `--apply` 反向同步(写权威源):权威源是真相,薄适配手改会被覆盖——这是设计,apply 前先看 `--diff`
|
|
57
57
|
- 不要删除孤儿薄适配:可能是宿主特化或历史残留,apply 不动
|
|
@@ -59,14 +59,14 @@ sh .agents/scripts/check-loop.sh # Windows 无 sh 时 doctor 已
|
|
|
59
59
|
- 不要把「避免与权威版本漂移」明文加回去——这是旧契约的指针风格,已被 B-b 正文副本取代
|
|
60
60
|
- 装了新宿主后跑 `--apply`:新宿主目录空白,apply 不会自动创建薄适配(薄适配须经 `add-host <h>` 接管)
|
|
61
61
|
|
|
62
|
-
## 不在本次同步范围
|
|
62
|
+
## 4. 不在本次同步范围
|
|
63
63
|
|
|
64
64
|
- trae 钩子(`modules/hosts/trae/hooks/*.cjs`)— 独立演进的工程件
|
|
65
65
|
- trae 规则(`modules/hosts/trae/rules/*.md`)— 同上
|
|
66
66
|
- 包源 .agents/scripts/*.cjs(pre-commit 等钩子)— 同步由 `flow-kit sync` 走 managed 台账负责
|
|
67
67
|
|
|
68
|
-
## 相关留痕
|
|
68
|
+
## 5. 相关留痕
|
|
69
69
|
|
|
70
70
|
- intent:`workflow/intents/2026-09-25-cross-host-sync.md`
|
|
71
71
|
- plan:`workflow/plans/2026-09-25-cross-host-sync.md`(含 B-b 方案拍板)
|
|
72
|
-
- incident:`workflow/incidents/2026-09-25-wf-runtime.md`(双源纪律教训,规范 §7.x 包源环境跳过)
|
|
72
|
+
- incident:`workflow/incidents/2026-09-25-wf-runtime.md`(双源纪律教训,规范 §7.x 包源环境跳过)
|
|
@@ -46,20 +46,19 @@ node bin/flow-kit.mjs doctor # §6.5 delegations + §6.6 o
|
|
|
46
46
|
- 复核者读入口文档(intent / incident) + spec + plan + diff,判断变更意图与风险
|
|
47
47
|
- 复核意见交用户定性(采纳 / 驳回);采纳项回 `build.md` 修改
|
|
48
48
|
|
|
49
|
-
## 子代理调用约定
|
|
49
|
+
## 5. 子代理调用约定
|
|
50
50
|
|
|
51
51
|
- 静态门不委派;UI 实测委派 `ui-verifier`(静态门通过后)、独立复核委派 `independent-reviewer`,均要求读取对应 `.agents/roles/*.md`;宿主不支持时按 frontmatter `fallback`(reviewer 必须另开新会话,不得主智能体自查冒充)。
|
|
52
52
|
- 子智能体只返回证据与结论——失败项修复仍回 `build.md`,不得在 Test 阶段顺手改代码;修复后重跑本阶段,全过后用户确认再关单。
|
|
53
53
|
|
|
54
|
-
##
|
|
54
|
+
## 6. 确认后(关单)
|
|
55
55
|
|
|
56
|
-
- 输出测试报告(通过项 / 失败项)
|
|
57
|
-
- 失败项已修复并复测通过
|
|
56
|
+
- 输出测试报告(通过项 / 失败项);失败项已修复并复测通过。
|
|
58
57
|
- **关单**(日常闭环点,不依赖是否上 prod):
|
|
59
|
-
- 关单前一键过门:`node .agents/scripts/verify.mjs`(npm test + check-loop
|
|
60
|
-
- 新需求:逐条勾验入口 intent「验收标准」,每条补「证据:」(例如:粘贴 CI 运行结果、UI 截图路径、或具体的 commit SHA),intent
|
|
58
|
+
- 关单前一键过门:`node .agents/scripts/verify.mjs --doc workflow/intents/<本单>.md`(npm test + check-loop 固定编排,任一失败非零退出,非绿不关单);**`--doc` 把测试绿凭证绑到本单**——不带它落下的绿行不给任何单背书,confirm-doc 前置与检查 8 对账只认带本单 `--doc` 的绿行(仅 v6+ 生效);**装户仓**(根目录无 `package.json`,工程在子目录)默认 `npm test` 不可跑 → 脚本**显式跳过步骤 1 且不落测试绿凭证**(防假绿)并提示;此时按项目口径手工跑测试,或带 `--test-cmd "<项目测试命令>"` 指定(2026-10-07 papercut)
|
|
59
|
+
- 新需求:逐条勾验入口 intent「验收标准」,每条补「证据:」(例如:粘贴 CI 运行结果、UI 截图路径、或具体的 commit SHA),intent → done;同名 spec/Quick-Plan(若有)仍 approved → done。**注意:勾选但缺证据会被 check-loop 拦截(hard-block)**
|
|
61
60
|
- **approved 留痕提交**(2026-09-30 起):done 确认前确认**本次关单文档**的 approved 态已进 git 历史(越早越好——approved 后即应提交;若尚未,先补提交再 done;门为逐份校验,三件套均关单时逐份各自满足)——confirm-doc 的 done 前置门硬校验(历史未出现「状态: approved」→ 拒绝落账);done 后再提交 done 态与其余改动
|
|
62
|
-
|
|
61
|
+
- **确认落态**:唯一入口 `node .agents/scripts/confirm-doc.mjs <path>`(两形态 / 逐件+逐件原话 / done 内容绑定(关单编辑先于 done 确认、confirm-doc 是最后一次写入)/ 台账对质全口径见根 `AGENTS.md` §1.3 确认门)。
|
|
63
62
|
- 修复:防复发验证已落地,incident → closed(经确认门 confirm-doc:open→fixed / fixed→closed 两跳、无单跳;2026-09-28 起 check-loop 15 对账——关单编辑先于 closed 确认,口径同 done 内容绑定)
|
|
64
63
|
- **同族收尾**:入口置终态时,同名 plan 一并置 `done`(spec 见上条),不留 `approved` 孤儿(口径同看板「入口已 done,本 plan 未终态」告警)
|
|
65
64
|
- 主智能体自做的 L1+ 新需求在 `workflow/delegations.md`「自做任务结果表」记一行(修复类不重复记)
|
|
@@ -6,7 +6,7 @@ description: 公共契约见 .agents/roles/implementer.md
|
|
|
6
6
|
|
|
7
7
|
> 公共角色契约(本文件):`.agents/roles/implementer.md`。宿主薄适配(各宿主目录下 `agents/implementer.md`)正文段同源本文件,frontmatter 各自保留宿主特化字段(check-loop 检查项 6 按本引用校验适配层不断线)。
|
|
8
8
|
|
|
9
|
-
## 职责
|
|
9
|
+
## 1. 职责
|
|
10
10
|
|
|
11
11
|
执行已经由主智能体和用户确认、范围明确的实现任务。适用范围仅限:
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@ description: 公共契约见 .agents/roles/implementer.md
|
|
|
15
15
|
- 编写或调整任务直接要求的测试
|
|
16
16
|
- 修复与任务直接相关的编译错误
|
|
17
17
|
|
|
18
|
-
## 必需输入
|
|
18
|
+
## 2. 必需输入
|
|
19
19
|
|
|
20
20
|
开始前必须获得:
|
|
21
21
|
|
|
@@ -26,7 +26,7 @@ description: 公共契约见 .agents/roles/implementer.md
|
|
|
26
26
|
|
|
27
27
|
任一输入缺失或相互冲突时,停止并向主智能体报告,不自行扩大范围。
|
|
28
28
|
|
|
29
|
-
## 行为边界
|
|
29
|
+
## 3. 行为边界
|
|
30
30
|
|
|
31
31
|
- 只修改明确授权的文件;若必须触及其他文件,先停止并说明原因。
|
|
32
32
|
- 仓库可能有其他智能体或用户同时工作;保留现有改动,不回退、不覆盖无关修改。
|
|
@@ -35,13 +35,13 @@ description: 公共契约见 .agents/roles/implementer.md
|
|
|
35
35
|
- 不执行提交、推送、发布、数据迁移或破坏性操作。
|
|
36
36
|
- 不顺手重构、格式化或清理与任务无关的代码。
|
|
37
37
|
|
|
38
|
-
## 验证
|
|
38
|
+
## 4. 验证
|
|
39
39
|
|
|
40
40
|
- 运行任务指定的最小相关检查。
|
|
41
41
|
- 检查失败时只修复由本次改动引起且仍在授权范围内的问题。
|
|
42
42
|
- 同一验证连续失败三次,或继续需要猜测需求时,停止并报告阻塞。
|
|
43
43
|
|
|
44
|
-
## 输出
|
|
44
|
+
## 5. 输出
|
|
45
45
|
|
|
46
46
|
返回给主智能体:
|
|
47
47
|
|
|
@@ -49,4 +49,3 @@ description: 公共契约见 .agents/roles/implementer.md
|
|
|
49
49
|
2. 每个文件的改动摘要
|
|
50
50
|
3. 已运行的验证及结果
|
|
51
51
|
4. 未解决的阻塞或剩余风险
|
|
52
|
-
|
|
@@ -6,11 +6,11 @@ description: 公共契约见 .agents/roles/independent-reviewer.md
|
|
|
6
6
|
|
|
7
7
|
> 公共角色契约(本文件):`.agents/roles/independent-reviewer.md`。宿主薄适配(各宿主目录下 `agents/independent-reviewer.md`)正文段同源本文件,frontmatter 各自保留宿主特化字段(check-loop 检查项 6 按本引用校验适配层不断线)。
|
|
8
8
|
|
|
9
|
-
## 职责
|
|
9
|
+
## 1. 职责
|
|
10
10
|
|
|
11
11
|
在独立上下文中对 spec、plan 或代码 diff 做只读复核,发现原作者可能遗漏的正确性、契约、架构、数据安全和回归风险。
|
|
12
12
|
|
|
13
|
-
## 必需输入
|
|
13
|
+
## 2. 必需输入
|
|
14
14
|
|
|
15
15
|
开始前必须获得:
|
|
16
16
|
|
|
@@ -21,7 +21,7 @@ description: 公共契约见 .agents/roles/independent-reviewer.md
|
|
|
21
21
|
|
|
22
22
|
输入不足以确定范围时,停止并向主智能体报告。
|
|
23
23
|
|
|
24
|
-
## 行为边界
|
|
24
|
+
## 3. 行为边界
|
|
25
25
|
|
|
26
26
|
- 只读,不修改任何仓库文件。
|
|
27
27
|
- 不替用户决定问题定性、方案取舍、合入或上线。
|
|
@@ -30,7 +30,7 @@ description: 公共契约见 .agents/roles/independent-reviewer.md
|
|
|
30
30
|
- 不把样式偏好、假设性风险或既有无关问题包装成缺陷。
|
|
31
31
|
- 无法验证的事项明确标为未验证,不声称已经通过。
|
|
32
32
|
|
|
33
|
-
## 复核重点
|
|
33
|
+
## 4. 复核重点
|
|
34
34
|
|
|
35
35
|
1. 实现是否满足入口文档和验收标准
|
|
36
36
|
2. 是否违反根 `AGENTS.md` 与改动域目录级 `AGENTS.md` 的架构、数据和所在域红线
|
|
@@ -38,7 +38,7 @@ description: 公共契约见 .agents/roles/independent-reviewer.md
|
|
|
38
38
|
4. 是否缺少能防止回归的验证
|
|
39
39
|
5. 是否存在数据丢失、安全、权限或发布风险
|
|
40
40
|
|
|
41
|
-
## 输出
|
|
41
|
+
## 5. 输出
|
|
42
42
|
|
|
43
43
|
按严重度输出问题清单:
|
|
44
44
|
|
|
@@ -46,4 +46,4 @@ description: 公共契约见 .agents/roles/independent-reviewer.md
|
|
|
46
46
|
- `P1`:功能错误、明确回归或违反项目硬约束
|
|
47
47
|
- `P2`:非阻断但有证据的维护性问题
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
每项必须包含:位置、问题、证据、建议。没有发现时明确输出"未发现阻断问题",并列出未验证范围。
|
|
@@ -6,11 +6,11 @@ description: 公共契约见 .agents/roles/ui-verifier.md
|
|
|
6
6
|
|
|
7
7
|
> 公共角色契约(本文件):`.agents/roles/ui-verifier.md`。宿主薄适配(各宿主目录下 `agents/ui-verifier.md`)正文段同源本文件,frontmatter 各自保留宿主特化字段(check-loop 检查项 6 按本引用校验适配层不断线)。
|
|
8
8
|
|
|
9
|
-
## 职责
|
|
9
|
+
## 1. 职责
|
|
10
10
|
|
|
11
11
|
对已经实现的 UI 改动执行浏览器实测并收集可复核证据。只验证,不修复。
|
|
12
12
|
|
|
13
|
-
## 必需输入
|
|
13
|
+
## 2. 必需输入
|
|
14
14
|
|
|
15
15
|
开始前必须获得:
|
|
16
16
|
|
|
@@ -21,7 +21,7 @@ description: 公共契约见 .agents/roles/ui-verifier.md
|
|
|
21
21
|
|
|
22
22
|
缺少可观察的预期结果时,停止并向主智能体报告。
|
|
23
23
|
|
|
24
|
-
## 执行
|
|
24
|
+
## 3. 执行
|
|
25
25
|
|
|
26
26
|
1. 读取项目根目录 `AGENTS.md`,以及改动域目录级 `AGENTS.md`(如有,前端改动域)。
|
|
27
27
|
2. 读取并遵循项目 UI 实测技能 `.agents/skills/verify-ui/SKILL.md`(如有)。
|
|
@@ -30,14 +30,14 @@ description: 公共契约见 .agents/roles/ui-verifier.md
|
|
|
30
30
|
5. 收集控制台、网络请求、DOM 数据或截图等证据。
|
|
31
31
|
6. 结束时关闭本次启动的后台进程。
|
|
32
32
|
|
|
33
|
-
## 行为边界
|
|
33
|
+
## 4. 行为边界
|
|
34
34
|
|
|
35
35
|
- 不修改代码、配置、测试数据或工作流文档。
|
|
36
36
|
- 不自行修复发现的问题;将失败证据交还主智能体。
|
|
37
37
|
- 不使用生产环境或真实业务数据。
|
|
38
38
|
- 无法启动环境或完成关键路径时,报告阻塞,不把部分验证标记为通过。
|
|
39
39
|
|
|
40
|
-
## 输出
|
|
40
|
+
## 5. 输出
|
|
41
41
|
|
|
42
42
|
返回:
|
|
43
43
|
|
|
@@ -8,20 +8,20 @@ description: Build 阶段:起 plan + 实现代码 + 自验(确认后才动代码
|
|
|
8
8
|
|
|
9
9
|
> AI 起草 plan,用户确认;进计划模式列改动,用户确认;最后才动代码。两道确认门。
|
|
10
10
|
|
|
11
|
-
## 执行
|
|
11
|
+
## 1. 执行
|
|
12
12
|
|
|
13
|
-
### 起草 plan
|
|
13
|
+
### 1.1 起草 plan
|
|
14
14
|
|
|
15
|
-
1. 确认同名入口文档(approved intent 或已确认的 incident)+ spec(若 L2/L3)均已确认;否则回上一阶段(fill/confirm
|
|
15
|
+
1. 确认同名入口文档(approved intent 或已确认的 incident)+ spec(若 L2/L3)均已确认;否则回上一阶段(fill/confirm 未过即拒)。
|
|
16
16
|
2. 起草 plan:
|
|
17
17
|
- 复制 `workflow/plans/_TEMPLATE.md` → `workflow/plans/YYYY-MM-DD-<主题>.md`(与入口文档同名)
|
|
18
18
|
- L2/L3 按 4 节填写:改动方案 / 任务拆解(每个任务有判据) / 执行顺序 / 验证计划(与 fill-plan.mjs 单源一致)
|
|
19
19
|
- L1 使用 Quick-Plan 极简三节:改动方案 / 约束与风险(原 Spec 核心) / 验证计划;多文件多步骤时可补任务拆解/执行顺序
|
|
20
|
-
3. 停下,输出 plan 草稿全文给用户过目,一句"可以"即确认。**逐件确认**:入口文档 / spec / plan 各自的确认点不得并作一次,plan 草稿须全文过目(不接受摘要代替)。**逐件配逐件原话**:`--delegated` 每次传当次实际放行的措辞,不复用同句——复用同句使台账 quote 失去分辨力(事后对质看不出放行的是哪一件);原因与根治见 workflow/papercuts.md 2026-09-28
|
|
21
|
-
|
|
22
|
-
4. 确认后 → plan 状态 draft → approved,并在 plan 内补「确认与复核」节(确认结果 + 日期)。确认环节须在文档留痕:`approved` 是确认的机器可见态,`done` 只在关单出现,禁从 `draft` 直跳 `done`;确认后立即 `docs(workflow)` 单独提交留痕(根 `AGENTS.md` 提交约定;check-loop 检查 14 口径)
|
|
20
|
+
3. 停下,输出 plan 草稿全文给用户过目,一句"可以"即确认。**逐件确认**:入口文档 / spec / plan 各自的确认点不得并作一次,plan 草稿须全文过目(不接受摘要代替)。**逐件配逐件原话**:`--delegated` 每次传当次实际放行的措辞,不复用同句——复用同句使台账 quote 失去分辨力(事后对质看不出放行的是哪一件);原因与根治见 workflow/papercuts.md 2026-09-28。
|
|
21
|
+
**确认落态**:唯一入口 `node .agents/scripts/confirm-doc.mjs <path>`(draft→approved / approved→done;TTY 两形态 / 一次一份多份并录被拒 / 台账对质全口径见根 `AGENTS.md` §1.3 确认门)。
|
|
22
|
+
4. 确认后 → plan 状态 draft → approved,并在 plan 内补「确认与复核」节(确认结果 + 日期)。确认环节须在文档留痕:`approved` 是确认的机器可见态,`done` 只在关单出现,禁从 `draft` 直跳 `done`;确认后立即 `docs(workflow)` 单独提交留痕(根 `AGENTS.md` 提交约定;check-loop 检查 14 口径)。
|
|
23
23
|
|
|
24
|
-
### 进计划模式列改动
|
|
24
|
+
### 1.2 进计划模式列改动
|
|
25
25
|
|
|
26
26
|
5. **不要直接动代码**。先进「计划模式」:
|
|
27
27
|
- **先拉同模块历史坑**:按入口文档 `模块:` 跑 `node .agents/scripts/kb-search.mjs --scope workflow --module <token> "<关键词>"`——命中 incident 的根因 / 防复发条目列入改动自查
|
|
@@ -29,38 +29,38 @@ description: Build 阶段:起 plan + 实现代码 + 自验(确认后才动代码
|
|
|
29
29
|
- 列步骤(改 X 文件做 Y → 改 Z 文件做 W)
|
|
30
30
|
- **owned 文件同步**:kit.owned 列表文件(AGENTS.md / workflow 模板等)sync 不动,须列「手动同步装副本」步骤(见 incidents/2026-09-25-wf-runtime 复盘)
|
|
31
31
|
- 标注触达红线(对照根 `AGENTS.md` 红线/约束相关节(如「项目适配区」「门禁与提交」)+ 改动域目录级 `AGENTS.md`(如有))
|
|
32
|
-
6.
|
|
32
|
+
6. 停下,等用户确认改动清单。
|
|
33
33
|
|
|
34
|
-
### 实现
|
|
34
|
+
### 1.3 实现
|
|
35
35
|
|
|
36
|
-
7. 确认后按 plan 顺序推进;每个任务对照判据自验。若任务满足 `.agents/roles/implementer.md` 的边界,主智能体可将单个工作包连同必读材料、授权文件和验收条件委派给 `implementer
|
|
37
|
-
8. 自验:按改动域跑 `项目构建命令` / `项目类型检查命令` / `项目测试命令`(对应编译 / 前端类型检查 / 自动化测试;静态门全集见 `test.md` §1)
|
|
38
|
-
9. **项目架构红线**:数据访问模式、公共字段写入等以根与目录级 `AGENTS.md`(如有)
|
|
39
|
-
10. **L3 且含 schema 变更时**:schema 变更走项目约定的维护方式(人工 SQL / 迁移工具,以目录级 `AGENTS.md` 或 spec 约束为准),不得擅自引入项目未采用的迁移机制(仅运行时 / 管线类 L3
|
|
40
|
-
11. 实现中若需偏离已确认的 plan(改公共接口 / 动 plan 未列文件 / 引新依赖 / 影响任务判据)→
|
|
36
|
+
7. 确认后按 plan 顺序推进;每个任务对照判据自验。若任务满足 `.agents/roles/implementer.md` 的边界,主智能体可将单个工作包连同必读材料、授权文件和验收条件委派给 `implementer`;否则由主智能体执行。
|
|
37
|
+
8. 自验:按改动域跑 `项目构建命令` / `项目类型检查命令` / `项目测试命令`(对应编译 / 前端类型检查 / 自动化测试;静态门全集见 `test.md` §1)。
|
|
38
|
+
9. **项目架构红线**:数据访问模式、公共字段写入等以根与目录级 `AGENTS.md`(如有)红线为准,不自创旁路。
|
|
39
|
+
10. **L3 且含 schema 变更时**:schema 变更走项目约定的维护方式(人工 SQL / 迁移工具,以目录级 `AGENTS.md` 或 spec 约束为准),不得擅自引入项目未采用的迁移机制(仅运行时 / 管线类 L3 无此约束)。
|
|
40
|
+
11. 实现中若需偏离已确认的 plan(改公共接口 / 动 plan 未列文件 / 引新依赖 / 影响任务判据)→ 停下,向用户说明原因与影响,确认后再继续。
|
|
41
41
|
|
|
42
|
-
## 技能辅助(可选,宿主级 skills)
|
|
42
|
+
## 2. 技能辅助(可选,宿主级 skills)
|
|
43
43
|
|
|
44
44
|
- plan 任务多、依赖复杂时:用 `to-tickets` 拆 tracer-bullet 任务单(每张带阻塞边);结果回填 plan「任务拆解」节,不发布外部 tracker
|
|
45
45
|
- 后端逻辑改动:有测试基建的用 `tdd` 测试先行(红→绿→重构);整体实现纪律可用 `implement` 驱动
|
|
46
46
|
- 遇合并冲突:用 `resolving-merge-conflicts` 按意图逐 hunk 处理
|
|
47
47
|
- 技能不改变两道确认门、红线检查与委派边界
|
|
48
48
|
|
|
49
|
-
## 红线提示(本阶段高频踩)
|
|
49
|
+
## 3. 红线提示(本阶段高频踩)
|
|
50
50
|
|
|
51
51
|
- 红线(架构 / 数据 / 安全等)正文与豁免见根与目录级 `AGENTS.md`(如有)——已由 pre-commit 机器门强制的部分以钩子为准,写代码前先过一遍目录级 AGENTS
|
|
52
52
|
|
|
53
|
-
## 改权威源后必跑(薄适配同步防漏)
|
|
53
|
+
## 4. 改权威源后必跑(薄适配同步防漏)
|
|
54
54
|
|
|
55
55
|
- 改 `templates/_agents/{commands,roles}/*.md` 正文后跑 `node bin/flow-kit.mjs sync-hosts --diff` → 拍板 → `--apply` 单向同步(只动正文段,frontmatter 不动);口径与边界详见 `.agents/commands/sync-hosts.md`
|
|
56
56
|
|
|
57
|
-
## 改 doctor / check-loop 后必跑(三处口径对账)
|
|
57
|
+
## 5. 改 doctor / check-loop 后必跑(三处口径对账)
|
|
58
58
|
|
|
59
59
|
- 改 `src/doctor.mjs` 加新 § 检查项 → 跑 `node .agents/scripts/gate-checklist.mjs --diff` 看 doctor ↔ check-loop 对照表
|
|
60
60
|
- 改 `.agents/scripts/check-loop.sh` 加新 § 检查项 → 同上
|
|
61
61
|
- 任一处有而另一边无 → 工具报"缺点",由用户拍板是否补齐(不自动同步,B-b 决策);详见 `.agents/commands/gate-checklist.md`
|
|
62
62
|
|
|
63
|
-
## 改包源后必跑(装户面同步一致性)
|
|
63
|
+
## 6. 改包源后必跑(装户面同步一致性)
|
|
64
64
|
|
|
65
65
|
- 改 `templates/_agents/*` 包源后 → 跑 `node .agents/scripts/source-sync-check.mjs --diff` 看装副本 `.agents/` 是否同步(缺失 / 孤儿 / 漂移三类差异)
|
|
66
66
|
- 漂移说明包源改了装副本未跟;缺失说明新增文件 init 未执行;孤儿说明装副本独有(可能是装户配置,不删)
|
|
@@ -68,13 +68,13 @@ description: Build 阶段:起 plan + 实现代码 + 自验(确认后才动代码
|
|
|
68
68
|
- 门禁边界(pre-commit 双源一致性):比较工作树非暂存区——两侧改好、分两笔提交不拦(最终一致即可);包源删除文件退化为「孤儿」只报告不拦,删包源须手动清理装副本残件(复核 P2-2 声明,2026-09-27 gate-hardening-p2-batch)
|
|
69
69
|
- B-b 决策「只报告不修复」;详见 `.agents/commands/source-sync-check.md`
|
|
70
70
|
|
|
71
|
-
## 子代理调用约定
|
|
71
|
+
## 7. 子代理调用约定
|
|
72
72
|
|
|
73
73
|
- plan 起草、风险判断、改动清单与两道确认门由主智能体负责;仅两道确认后范围明确的工作包可委派 `implementer`,公共接口 / Schema / 依赖 / 安全 / 权限 / 破坏性操作不得委派。
|
|
74
74
|
- 多工作包并行 / 链式推进:编排机制(声明随 plan 草稿一并确认;确认后读 `.agents/workflows/` 按机制文档执行,`steps/` 为项目自定义步骤扩展点);详见 `.agents/workflows/_TEMPLATE.md`。
|
|
75
75
|
- 子智能体返回后,主智能体须检查 diff 与授权文件范围、确认未覆盖既有修改并重跑相关验证;不支持子智能体时 `fallback: main`,验收标准不变。
|
|
76
76
|
|
|
77
|
-
## 确认后
|
|
77
|
+
## 8. 确认后
|
|
78
78
|
|
|
79
79
|
- plan 状态 → done(实现完成;intent / spec 关单在 test)
|
|
80
80
|
- commit:L1+ 入口文档 / spec / plan 随代码同一提交(Conventional Commits 中文 feat/fix/refactor/perf);docs 豁免与 bootstrap 可单独 `docs(*)`
|
|
@@ -45,11 +45,11 @@ description: Deploy 阶段:prod 上线清单(静态门 + 配对检查 + 回归 +
|
|
|
45
45
|
- 异常回落:超阈值 → 生成 `workflow/incidents/YYYY-MM-DD-<主题>.md`,进 `maintain.md`(止血方案用户拍板,见 maintain.md §0)
|
|
46
46
|
- 事故响应:单用途账号 + 最小权限;不得跨智能体协作推送修复(参考 Anthropic 教训)
|
|
47
47
|
|
|
48
|
-
## 子代理调用约定
|
|
48
|
+
## 7. 子代理调用约定
|
|
49
49
|
|
|
50
50
|
- 上线清单、回滚方案、授权、tag 与事故决策均由主智能体处理,本阶段不委派子智能体;回滚方案(尤其含数据回滚 SQL)涉及数据安全,不得以通用实现子智能体代替主智能体判断与用户确认。
|
|
51
51
|
|
|
52
|
-
## 确认后
|
|
52
|
+
## 8. 确认后
|
|
53
53
|
|
|
54
54
|
- 打 `release/<日期>` tag(commit SHA 可追溯)
|
|
55
55
|
- 上线 + 用户观察 24h
|
|
@@ -6,9 +6,9 @@ description: Design 阶段:起 spec(L2/L3 强制,L1 可省略)
|
|
|
6
6
|
|
|
7
7
|
> L2/L3 强制;L1 走快车道(直接跳 `next: build.md` 起草 Quick-Plan)。
|
|
8
8
|
|
|
9
|
-
## 执行
|
|
9
|
+
## 1. 执行
|
|
10
10
|
|
|
11
|
-
1. 确认同名入口文档已批准:新需求为 approved intent,修复为已确认的 incident 草稿;否则拒绝,分别回 `plan.md` / `maintain.md`(2026-09-30 起机器强制:fill-spec / confirm-doc 对前置未过直接拒绝 exit 2
|
|
11
|
+
1. 确认同名入口文档已批准:新需求为 approved intent,修复为已确认的 incident 草稿;否则拒绝,分别回 `plan.md` / `maintain.md`(2026-09-30 起机器强制:fill-spec / confirm-doc 对前置未过直接拒绝 exit 2、不落盘不记账)。
|
|
12
12
|
2. 级别判断(对照 AGENTS.md 第 3 条):
|
|
13
13
|
- **L1**(实现级改动,未命中 L2/L3)→ 走快车道,省略 spec,直接跳 `next: build.md` 起草 Quick-Plan
|
|
14
14
|
- **L2**(改规则 / 契约:编码权威 / 共享契约 / 既有接口语义 / 全局横切口径,闭集见 `new-task.md` §级别判断)→ 必须有 spec
|
|
@@ -20,23 +20,23 @@ description: Design 阶段:起 spec(L2/L3 强制,L1 可省略)
|
|
|
20
20
|
- 约束映射必须对照根 `AGENTS.md` 红线/约束相关节(如「项目适配区」「门禁与提交」)与改动域目录级 `AGENTS.md`(如有)逐条说明如何满足
|
|
21
21
|
- 存在多个可行方案时,在 spec 中列出各方案取舍与 AI 建议项,由用户选定后方可确认
|
|
22
22
|
- **页面/交互入口形态必须用户确认**:spec 须写明入口是「表单(字段清单)」还是「选择器/弹窗」,禁止自行推定交互形态
|
|
23
|
-
4.
|
|
24
|
-
5. L3 必须独立复核:宿主支持子智能体时调用 `independent-reviewer`,并要求其读取 `.agents/roles/independent-reviewer.md`;不支持时另开新会话。复核者读 spec + 根 AGENTS.md 与改动域目录级 AGENTS.md 的红线挑漏洞,结论写入 spec
|
|
23
|
+
4. 起草后停下,输出草稿全文给用户过目。
|
|
24
|
+
5. L3 必须独立复核:宿主支持子智能体时调用 `independent-reviewer`,并要求其读取 `.agents/roles/independent-reviewer.md`;不支持时另开新会话。复核者读 spec + 根 AGENTS.md 与改动域目录级 AGENTS.md 的红线挑漏洞,结论写入 spec「确认与复核」节;复核未过不得确认。
|
|
25
25
|
|
|
26
|
-
## 技能辅助(可选,宿主级 skills)
|
|
26
|
+
## 2. 技能辅助(可选,宿主级 skills)
|
|
27
27
|
|
|
28
28
|
- 对话已充分、无需再访谈时:用 `to-spec` 直接综合成 spec 草稿;其"发布到 issue tracker"默认行为一律改为写入 `workflow/specs/` 同名文件,按 `_TEMPLATE.md` 格式
|
|
29
29
|
- L2/L3 模块设计:用 `codebase-design`(深模块/接缝/接口收窄);术语混乱或需记 ADR:用 `domain-modeling`
|
|
30
30
|
- 方案取舍需压力测试:用 `grilling`;技能产出不越过用户确认门,L3 独立复核流程不变
|
|
31
31
|
|
|
32
|
-
## 委派约定
|
|
32
|
+
## 3. 委派约定
|
|
33
33
|
|
|
34
34
|
- spec 起草、方案取舍与用户确认由主智能体负责,不委派;只有 L3 确认前的独立复核委派 `independent-reviewer`(必需输入:入口文档、spec、根 `AGENTS.md` + 改动域目录级 `AGENTS.md`、固定复核目标)。
|
|
35
35
|
- 宿主不支持子智能体时必须 `fallback: new-session`,不得由原主智能体自查冒充独立复核。
|
|
36
36
|
|
|
37
|
-
## 确认后
|
|
37
|
+
## 4. 确认后
|
|
38
38
|
|
|
39
39
|
- spec 状态 draft → approved
|
|
40
|
-
|
|
40
|
+
- **确认落态**:唯一入口 `node .agents/scripts/confirm-doc.mjs <path>`(draft→approved / approved→done;TTY 两形态 / 逐件调用+逐件原话 / 台账对质全口径见根 `AGENTS.md` §1.3 确认门)。
|
|
41
41
|
- 立即 `docs(workflow)` 单独提交留痕(根 `AGENTS.md` 提交约定;check-loop 检查 14 口径)
|
|
42
42
|
- 进 `next: .agents/commands/build.md`
|
|
@@ -10,14 +10,14 @@ description: 三处口径一致性检查(doctor §检查项 ↔ check-loop §
|
|
|
10
10
|
> 任何一处加新检查项,另一处不会自动同步——本工具报「未登记」;检查项被删/改号而登记未跟报「断档」。
|
|
11
11
|
> 只报告不修复(B-b 决策):缺点暴露给用户拍板,本工具不自动同步;exit 恒 0。
|
|
12
12
|
|
|
13
|
-
## 何时跑
|
|
13
|
+
## 1. 何时跑
|
|
14
14
|
|
|
15
15
|
- 改 `src/doctor.mjs` 加新 § 检查项后(同时须登记 PAIRS)
|
|
16
16
|
- 改 `.agents/scripts/check-loop.sh` 加新 § 检查项后(同时须登记 PAIRS)
|
|
17
17
|
- 怀疑两处口径不一致时
|
|
18
18
|
- 不跑:仅改既有检查项的提示文案(不动 § 项与登记表)
|
|
19
19
|
|
|
20
|
-
## 登记表纪律(契约)
|
|
20
|
+
## 2. 登记表纪律(契约)
|
|
21
21
|
|
|
22
22
|
`templates/_agents/scripts/gate-checklist.mjs` 内 **PAIRS** 是配对单源,三选一登记:
|
|
23
23
|
|
|
@@ -31,7 +31,7 @@ description: 三处口径一致性检查(doctor §检查项 ↔ check-loop §
|
|
|
31
31
|
- 删/改检查项不动登记表 → 工具报「断档」
|
|
32
32
|
- 关键词匹配已退役(2026-09-25 registry 重写:实测 18×14 项只匹配 2、28 条噪声缺点,真漏点不可见)
|
|
33
33
|
|
|
34
|
-
## 怎么跑
|
|
34
|
+
## 3. 怎么跑
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
37
|
node .agents/scripts/gate-checklist.mjs --diff # 人类可读(默认)
|
|
@@ -40,7 +40,7 @@ node .agents/scripts/gate-checklist.mjs --json # 机器可读
|
|
|
40
40
|
|
|
41
41
|
输出四段:总览计数 → 对照表(登记表展开)→ 断档(如有)→ 未登记(如有);全绿时输出「登记完整」。
|
|
42
42
|
|
|
43
|
-
### 输出示例
|
|
43
|
+
### 3.1 输出示例
|
|
44
44
|
|
|
45
45
|
```
|
|
46
46
|
▶ flow-kit gate-checklist --diff(显式配对登记表)
|
|
@@ -52,27 +52,27 @@ node .agents/scripts/gate-checklist.mjs --json # 机器可读
|
|
|
52
52
|
✅ 登记完整(0 断档 / 0 未登记)
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
### 自验
|
|
55
|
+
### 3.2 自验
|
|
56
56
|
|
|
57
57
|
```bash
|
|
58
58
|
node .agents/scripts/gate-checklist.test.mjs # 13 场景全过
|
|
59
59
|
npm test # 含 gate-checklist 套件
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
## 边界(不要做)
|
|
62
|
+
## 4. 边界(不要做)
|
|
63
63
|
|
|
64
64
|
- 不要把「登记完整」当作强制门 —— B-b 决策「只报告不修复」:断档/未登记暴露给 follow-up,exit 恒 0
|
|
65
65
|
- 不要改 doctor / check-loop 检查项来消音 —— 登记表才是该改的地方(配对 / 独有 / 经 §7 三选一)
|
|
66
66
|
- 不要扩展到看板告警 —— 看板当前无告警规则(gen-wiki-board.mjs 不做判定),扩展超出范围
|
|
67
67
|
- 不要绕过登记直接改解析正则 —— 解析面只认 doctor `// N.` 节注释与 check-loop `// N.` 项注释(.mjs 头部清单,fallback 旧装户 .sh `# N.`)
|
|
68
68
|
|
|
69
|
-
## 不在本次同步范围
|
|
69
|
+
## 5. 不在本次同步范围
|
|
70
70
|
|
|
71
71
|
- `.agents/board/` 看板告警(无告警规则)
|
|
72
72
|
- `wiki/知识沉淀总览.html` 渲染(数据来源是 workflow/INDEX.md 与 wiki 目录,非本工具对照)
|
|
73
73
|
- `flow-kit sync` managed 台账追踪(gate-checklist 不在 managed 范围)
|
|
74
74
|
|
|
75
|
-
## 相关留痕
|
|
75
|
+
## 6. 相关留痕
|
|
76
76
|
|
|
77
77
|
- intent(登记表重写):`workflow/intents/2026-09-25-gate-checklist-registry.md`
|
|
78
78
|
- intent(工具首建):`workflow/intents/2026-09-25-gate-checklist.md`
|