agentic-flow-kit 0.3.1 → 0.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 +2 -0
- package/modules/hosts/omp/agents/implementer.md +45 -6
- package/modules/hosts/omp/agents/independent-reviewer.md +42 -5
- package/modules/hosts/omp/agents/ui-verifier.md +41 -6
- package/modules/hosts/opencode/agents/implementer.md +45 -1
- package/modules/hosts/opencode/agents/independent-reviewer.md +42 -1
- package/modules/hosts/opencode/agents/ui-verifier.md +41 -1
- package/modules/hosts/opencode/commands/build.md +55 -7
- package/modules/hosts/opencode/commands/deploy.md +51 -6
- package/modules/hosts/opencode/commands/design.md +34 -6
- package/modules/hosts/opencode/commands/maintain.md +71 -6
- package/modules/hosts/opencode/commands/new-task.md +59 -6
- package/modules/hosts/opencode/commands/plan.md +32 -6
- package/modules/hosts/opencode/commands/review.md +40 -6
- package/modules/hosts/opencode/commands/test.md +56 -8
- package/modules/hosts/trae/agents/implementer.md +44 -2
- package/modules/hosts/trae/agents/independent-reviewer.md +42 -1
- package/modules/hosts/trae/agents/ui-verifier.md +39 -3
- package/modules/hosts/trae/commands/wf-build.md +55 -7
- package/modules/hosts/trae/commands/wf-deploy.md +51 -6
- package/modules/hosts/trae/commands/wf-design.md +34 -6
- package/modules/hosts/trae/commands/wf-maintain.md +71 -6
- package/modules/hosts/trae/commands/wf-new-task.md +59 -6
- package/modules/hosts/trae/commands/wf-plan.md +32 -6
- package/modules/hosts/trae/commands/wf-review.md +40 -6
- package/modules/hosts/trae/commands/wf-test.md +56 -7
- package/modules/hosts/zcode/agents/implementer.md +45 -6
- package/modules/hosts/zcode/agents/independent-reviewer.md +42 -5
- package/modules/hosts/zcode/agents/ui-verifier.md +41 -5
- package/package.json +6 -3
- package/src/cli.mjs +15 -2
- package/src/doctor.mjs +140 -13
- package/src/init.test.mjs +25 -2
- package/src/pack.test.mjs +24 -0
- package/src/run-tests.mjs +4 -11
- package/src/sync-hosts.mjs +193 -0
- package/src/sync-hosts.test.mjs +170 -0
- package/src/sync.mjs +1 -0
- package/src/sync.test.mjs +10 -0
- package/templates/AGENTS.md +2 -2
- package/templates/_agents/commands/build.md +20 -0
- package/templates/_agents/commands/design.md +1 -0
- package/templates/_agents/commands/gate-checklist.md +91 -0
- package/templates/_agents/commands/maintain.md +1 -1
- package/templates/_agents/commands/plan.md +2 -1
- package/templates/_agents/commands/review.md +1 -0
- package/templates/_agents/commands/source-sync-check.md +103 -0
- package/templates/_agents/commands/sync-hosts.md +79 -0
- package/templates/_agents/commands/test.md +2 -1
- package/templates/_agents/notes/runtime-env.md +1 -1
- package/templates/_agents/rule-budgets.txt +1 -1
- package/templates/_agents/scripts/check-loop.mjs +517 -0
- package/templates/_agents/scripts/check-loop.sh +5 -808
- package/templates/_agents/scripts/check-loop.test.mjs +481 -0
- package/templates/_agents/scripts/doctor.test.mjs +298 -0
- package/templates/_agents/scripts/ensure-board.mjs +158 -0
- package/templates/_agents/scripts/fill-intent.mjs +59 -0
- package/templates/_agents/scripts/fill-intent.test.mjs +73 -0
- package/templates/_agents/scripts/fill-plan.mjs +60 -0
- package/templates/_agents/scripts/fill-plan.test.mjs +67 -0
- package/templates/_agents/scripts/fill-spec.mjs +52 -0
- package/templates/_agents/scripts/fill-spec.test.mjs +61 -0
- package/templates/_agents/scripts/gate-checklist.mjs +192 -0
- package/templates/_agents/scripts/gate-checklist.test.mjs +204 -0
- package/templates/_agents/scripts/gen-workflow-index.mjs +4 -2
- package/templates/_agents/scripts/kb-search.mjs +3 -1
- package/templates/_agents/scripts/source-sync-check.mjs +131 -0
- package/templates/_agents/scripts/source-sync-check.test.mjs +156 -0
- package/templates/_agents/scripts/verify.mjs +8 -10
- package/templates/_agents/scripts/verify.test.mjs +13 -1
- package/templates/_agents/scripts/wf-journal.mjs +158 -0
- package/templates/_agents/scripts/wf-journal.test.mjs +150 -0
- package/templates/_agents/scripts/workflow-board-server.mjs +18 -10
- package/templates/_agents/scripts/workflow-enums.mjs +68 -0
- package/templates/_agents/scripts/workflow-enums.test.mjs +110 -0
- package/templates/_agents/scripts/workflows-check.mjs +260 -0
- package/templates/_agents/scripts/workflows-check.test.mjs +267 -0
- package/templates/_agents/workflow-enums.txt +19 -0
- package/templates/_agents/workflows/_TEMPLATE.md +74 -0
- package/templates/_agents/workflows/pipeline-closing.md +29 -0
- package/templates/_agents/workflows/source-sync-repair.md +30 -0
- package/templates/_agents/workflows/steps//347/244/272/344/276/213-/351/203/250/347/275/262/351/252/214/350/257/201.md +10 -0
- package/templates/_agents/workflows//347/244/272/344/276/213-/345/271/266/350/241/214/345/256/236/347/216/260/350/257/204/345/256/241.md +16 -0
- package/templates/workflow/README.md +2 -2
- package/templates/_agents/cache/kb-index.json +0 -1
- package/templates/_agents/scripts/check-loop.test.sh +0 -1042
- package/templates/_agents/scripts/ensure-board.ps1 +0 -48
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: source-sync-repair
|
|
3
|
+
description: 装户面双源漂移修复专项——跑 source-sync-check 看 4 类差异(缺失 / 孤儿 / 漂移 / frontmatter-only-diff)→ 按 B-b 决策方向修齐(包源 → 装副本同步)→ 重跑确认 0 差异 → 走 pipeline-closing 标准关单。基于 F 环节真实过程沉淀
|
|
4
|
+
concurrency: 2
|
|
5
|
+
---
|
|
6
|
+
# workflow — source-sync-repair(装户面双源漂移修复)
|
|
7
|
+
|
|
8
|
+
> 双源结构(`templates/_agents/` 包源 + `.agents/` 装副本)的差异修复。F 环节(2026-09-25-fix-double-source-drift)首次实测发现 5 个真实差异并闭环,本文件(custom)把修复路径固化为可复用编排。所有 stage 用 role 派单 + gate 终端两种形态——不引新 step。
|
|
9
|
+
|
|
10
|
+
| id | after | role | step | task / params | files(授权) | accept(验收判据) | gate | retries |
|
|
11
|
+
|----|-------|------|------|---------------|---------------|-------------------|------|---------|
|
|
12
|
+
| scan-diff | — | implementer | — | 跑 source-sync-check --diff(首次摸底) | .agents/scripts/source-sync-check.mjs | 输出 4 类差异报告(缺失 / 孤儿 / 漂移 / frontmatter-only-diff),无 error | | 0 |
|
|
13
|
+
| classify | scan-diff | implementer | — | 按差异类型分类:缺失/漂移走 repair;孤儿走白名单扩展或装副本删除;frontmatter-only-diff 走角色契约确认 | workflow/intents/<date>-fix-double-source-drift.md | intent 立 draft + 4 段改动面(漂移修复 / 白名单 / 测试 / docs)+ 9 条验收标准 | | 0 |
|
|
14
|
+
| repair | classify | implementer | — | 按 intent 改动面修漂移:包源 → 装副本同步;白名单 RENDER_OUTPUT_FILES 扩展(含 hooks/commit-check.config.json 等 init 渲染产物);test.mjs 新增 S8/S9 场景;双源纪律(包源改了装副本手动同步) | 见 intent | source-sync-check --diff 报告漂移数减少;双源文件 sha 一致 | | 1 |
|
|
15
|
+
| gate-rescan | repair | — | — | — | — | — | node .agents/scripts/source-sync-check.mjs --diff(必须 0 差异) | |
|
|
16
|
+
| sync-refresh | gate-rescan | implementer | — | 跑 flow-kit sync 刷台账(owned 哈希按盘面自愈) | .agents/kit.json | sync exit 0;doctor 报 owned 漂移已自愈 | | 0 |
|
|
17
|
+
| feat-commit | sync-refresh | implementer | — | 提交 feat commit(fix(模块名)) | 工作区所有变更文件 | pre-commit 钩子全过;commit message 含 4 段改动面 + 白名单扩展 | | 0 |
|
|
18
|
+
| closeout | feat-commit | implementer | — | 走 pipeline-closing 标准关单(intent 8 条验收勾验 + plan → done + docs commit);如有需要新建 wiki/双源漂移修复/README.md 沉淀 | workflow/intents/, workflow/plans/, workflow/INDEX.md, wiki/双源漂移修复/README.md | intent + plan 状态均 done;9 条验收勾验含 commit SHA 证据;wiki 主题更新(如适用) | | 0 |
|
|
19
|
+
|
|
20
|
+
**编排语义**:第 0 层 scan-diff → 第 1 层 classify(差异分诊)→ 第 2 层 repair(按分诊结果修漂移)→ 第 3 层 2 关静态门(gate-rescan + sync-refresh,并行 fan-out)→ 第 4 层 feat-commit → 第 5 层 closeout(复用 pipeline-closing 6 阶段闭环尾段)。失败且 retries > 0 → 重派(全新上下文);gate-rescan 非零 → 中止后续、回到 repair 重派。
|
|
21
|
+
|
|
22
|
+
**与 pipeline-closing 的关系**:source-sync-repair 是 pipeline-closing 的子集(第 3-6 层复用),不重复定义 6 阶段全流程;closeout stage 引用 pipeline-closing 的关单动作。如需完整 6 阶段闭环(含 author / gate-doc / confirm / plan-commit),直接用 pipeline-closing 即可。
|
|
23
|
+
|
|
24
|
+
**白名单扩展协议**(沿用 source-sync-check.mjs 的 RENDER_OUTPUT_FILES):init 渲染产物(`kit.json` / `settings.json` / `hooks/commit-check.config.json`)不属双源结构;新增白名单项必须同时加进 source-sync-check.mjs + test.mjs 新场景,且 gate-rescan 跑通 0 命中才认闭环。
|
|
25
|
+
|
|
26
|
+
**纪律**(先读):
|
|
27
|
+
- 声明随 plan 确认后方可执行;本 workflow 修复必须先立 intent + plan(用 pipeline-closing 的 author stage 起草)。
|
|
28
|
+
- 子智能体不跨确认门、不 commit / push(派单红线行:只改授权文件;缺输入或需偏离 → `BLOCKER:` 停下)。
|
|
29
|
+
- 留痕:每个派单 stage 完成后向 `workflow/delegations.md` 委派结果表追加一行。
|
|
30
|
+
- 解析校验先行:role ∈ `.agents/roles/`、`after` 引用存在且无环——任一不过即拒,不执行。
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
params: env(目标环境,必填);timeout-min(超时分钟,可选,默认 10)
|
|
3
|
+
---
|
|
4
|
+
# 步骤 — 部署验证(示例)
|
|
5
|
+
|
|
6
|
+
> kit steps 扩展点示例:把项目领域动作注册为可被编排脚本引用的步骤。文件名即步骤名;按项目实际改写。
|
|
7
|
+
|
|
8
|
+
1. 跑终端命令:`npm run deploy -- --env <env>`(工作目录 = 项目根);非零即步骤失败,回报 stderr 尾段
|
|
9
|
+
2. 跑冒烟检查:`curl -fsS https://<env>.example.com/healthz`(URL 按项目改写);非零即步骤失败
|
|
10
|
+
3. 回报:部署版本号(取 deploy 输出中的 version 行)+ 冒烟检查结果
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 示例-并行实现评审
|
|
3
|
+
description: 两域并行实现 → 汇聚过测试门 → 部署验证(step)→ 独立评审(示例,按 plan 改写后使用)
|
|
4
|
+
concurrency: 2
|
|
5
|
+
---
|
|
6
|
+
# workflow — 示例:并行实现评审
|
|
7
|
+
|
|
8
|
+
> 格式示例:三形态各一处(role 派单 / gate / step);id / after / task 按 plan 改写;随 plan 确认后方可执行。机制口径见 `_TEMPLATE.md`。
|
|
9
|
+
|
|
10
|
+
| id | after | role | step | task / params | files(授权) | accept(验收判据) | gate | retries |
|
|
11
|
+
|----|-------|------|------|---------------|--------------|-------------------|------|---------|
|
|
12
|
+
| backend | — | implementer | — | 实现后端改动(示例占位,按 plan 改写) | src/api/** | 项目测试命令通过 | | 0 |
|
|
13
|
+
| frontend | — | implementer | — | 实现前端改动(示例占位,按 plan 改写) | web/** | 项目构建命令通过 | | 0 |
|
|
14
|
+
| gate-all | backend,frontend | — | — | — | — | — | npm test | |
|
|
15
|
+
| deploy-check | gate-all | — | 示例-部署验证 | env=staging | | 部署命令与冒烟 exit 0 | | 0 |
|
|
16
|
+
| review | deploy-check | independent-reviewer | — | 独立评审两域改动是否符合 plan 与验收判据 | | 符合 plan 与判据 | | 0 |
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
**命名一律英文 kebab-case**(如 `2026-09-07-<主题>.md`),**禁中文文件名**——check-loop 对非 ASCII 文件名给 warning。文档内容(标题/正文)不受此限。
|
|
17
17
|
|
|
18
|
-
**文档协议(frontmatter 受限子集)**:四类文档头部一律为 YAML frontmatter(每行 `键: 值`,机器字段唯一来源)——`状态`(intent/spec/plan:draft/approved/done/superseded/cancelled;incident:open/fixed/closed
|
|
18
|
+
**文档协议(frontmatter 受限子集)**:四类文档头部一律为 YAML frontmatter(每行 `键: 值`,机器字段唯一来源)——`状态`(intent/spec/plan:draft/approved/done/superseded/cancelled;incident:open/fixed/closed,**严格枚举,单源 `.agents/workflow-enums.txt`**——check-loop / 看板 / 检索 / fill-* 一律读它,改枚举改那边;附注写 `备注:` 键)、`级别`(L0-L3,同单源)、`日期`/`发现`(YYYY-MM-DD)、`模块`(**新建文档必填**,取值见 `.agents/workflow-modules.txt` 词表,单值取主导模块;存量不回填,AI 触碰时顺手补)、L3 spec 的 `确认结果`/`确认时间`、回填件 `流程: legacy`。**`状态` 迁移须经 `approved`**(确认环节的机器可见态,`done` 只在关单出现):新建的 spec/plan 若已 done 而 git 历史中从未出现行首 `状态: approved`,check-loop 报「确认态缺失」warning。check-loop 只扫 frontmatter 取机器字段(`fm_get` 字段断言),正文不再写「状态:/级别:」行;叙述性字段(独立复核/复盘三件套/验收勾验)仍留正文按节锚定。
|
|
19
19
|
|
|
20
20
|
各子目录内 `_TEMPLATE.md` 为起步模板,复制后填写,不直接改动模板本身。
|
|
21
21
|
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
## 使用方式
|
|
25
25
|
|
|
26
26
|
- **发起新任务**:执行 `.agents/commands/new-task.md` 定义的流程(6 阶段总入口)
|
|
27
|
-
- **看板(可选,默认不拉起)**:需要时手动跑 .agents/scripts/ensure-board.
|
|
27
|
+
- **看板(可选,默认不拉起)**:需要时手动跑 node .agents/scripts/ensure-board.mjs(跨平台单入口;幂等:探活 / 旧代码自动重启 / 全新启动弹浏览器),端口从基端口 {{BOARD_PORT}} 起自动上探首个可用,链接以脚本输出为准;**预警层,非门禁;告警口径对齐 check-loop 硬断档**。端口被占时探活 `/api/board` 并比对 `root`——本项目看板才复用 / 旧代码重启;他人进程(含其他项目看板)不动手不 kill,自动跳过试下一端口
|
|
28
28
|
- **检索**:活跃流程读 `INDEX.md`(生成物,`node .agents/scripts/gen-workflow-index.mjs` 重生成、`--check` 校验漂移);跨语料检索 `node .agents/scripts/kb-search.mjs "<词>"`(workflow 按节级定位 + wiki 全文,`--type/--module/--status/-n` 过滤;`--status all` 显式全量)
|
|
29
29
|
- **验证**:`.agents/commands/test.md`(静态门 + 实测;项目自有验证脚本/门禁如有,见 `.agents/hooks/local-pre-commit` 与根 `AGENTS.md`「项目适配区」)
|
|
30
30
|
- **评审**:`.agents/commands/review.md`(按 P0 / P1 / P2 分级:机器兜底 + AI 自查出清单,用户决策定性与合入)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"fp":"b779761db958797b","files":{"/tmp/kb-search-test-T8zWVC::workflow/intents/2026-09-21-bbb.md":{"st":[1790250003552.587,270],"kind":"wf","meta":{"状态":"approved","级别":"L1","日期":"2026-09-21","模块":"pipeline"},"title":"乙需求","lines":[[1,"(frontmatter)","---"],[2,"(frontmatter)","状态: approved"],[3,"(frontmatter)","级别: L1"],[4,"(frontmatter)","日期: 2026-09-21"],[5,"(frontmatter)","模块: pipeline"],[6,"(frontmatter)","---"],[7,"(标题)","# INTENT — 乙需求"],[9,"目标","## 目标"],[10,"目标","- 统一口径:编码模板与分类层级,冲突处理见 A/B乙"],[11,"目标",""]]},"/tmp/kb-search-test-T8zWVC::workflow/plans/2026-09-20-ccc.md":{"st":[1790250003552.587,200],"kind":"wf","meta":{"状态":"approved","级别":"L1","模块":"purchase"},"title":"丙计划","lines":[[1,"(frontmatter)","---"],[2,"(frontmatter)","状态: approved"],[3,"(frontmatter)","级别: L1"],[4,"(frontmatter)","模块: purchase"],[5,"(frontmatter)","---"],[6,"(标题)","# PLAN — 丙计划"],[8,"目标","## 目标"],[9,"目标","- 只讲编码模板,不提另一个词"],[10,"目标",""]]},"/tmp/kb-search-test-T8zWVC::workflow/incidents/2026-09-01-aaa.md":{"st":[1790250003552.587,270],"kind":"wf","meta":{"状态":"closed","级别":"L2","发现":"2026-09-01","模块":"material"},"title":"甲事故","lines":[[1,"(frontmatter)","---"],[2,"(frontmatter)","状态: closed"],[3,"(frontmatter)","级别: L2"],[4,"(frontmatter)","发现: 2026-09-01"],[5,"(frontmatter)","模块: material"],[6,"(frontmatter)","---"],[7,"(标题)","# INCIDENT — 甲事故"],[9,"目标","## 目标"],[10,"目标","- 统一口径:编码模板与分类层级,冲突处理见 A/B甲"],[11,"目标",""]]},"/tmp/kb-search-test-T8zWVC::wiki/测试主题/说明.md":{"st":[1790250003552.587,47],"kind":"wiki","lines":[[1,"# 说明"],[2,""],[3,"编码模板的领域知识条目。"],[4,""]]}}}
|