@buildr-ai/buildr 0.1.0-rc.3 → 0.1.0-rc.5
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 +1 -1
- package/docs/cli-reference.md +1 -1
- package/docs/known-limitations.md +1 -1
- package/package/bootstrap/contract.yml +1 -0
- package/package/bootstrap/guide.md +4 -4
- package/package/manifest.yml +9 -1
- package/package/targets/runtime/skills/buildr/SKILL.md +7 -6
- package/package/targets/workspace/skills/buildr/task-cockpit/SKILL.md +124 -0
- package/package/targets/workspace/skills/buildr/task-cockpit/agents/openai.yaml +4 -0
- package/package/targets/workspace/skills/buildr/task-cockpit/assets/task-cockpit-template.html +385 -0
- package/package/targets/workspace/skills/buildr/task-triage/SKILL.md +24 -0
- package/package/targets/workspace/skills/manifest.yml +9 -0
- package/package.json +1 -2
- package/tools/cli/application/package-maintenance/static-validation.mjs +41 -2
- package/tools/cli/application/release/bridge-main-to-dev.mjs +144 -0
- package/tools/runtime/skills/render-plan.mjs +4 -4
- package/examples/minimal-workspace/README.md +0 -24
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ buildr runtime list --json
|
|
|
10
10
|
buildr init --agent <agent> --target . --name <name> --profile <personal|team|company>
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
当前公开试用版本是 [`0.1.0-rc.
|
|
13
|
+
当前公开试用版本是 [`0.1.0-rc.5`](https://github.com/elevenching/Buildr/releases/tag/v0.1.0-rc.5)。使用反馈请提交 [GitHub Issue](https://github.com/elevenching/Buildr/issues/new/choose),安全漏洞请按 [SECURITY.md](https://github.com/elevenching/Buildr/blob/main/SECURITY.md) 私下报告。
|
|
14
14
|
|
|
15
15
|
完整产品定位、核心模型、快速开始、当前能力和文档导航见仓库根目录的[中文 README](https://github.com/elevenching/Buildr#readme) 或 [English README](https://github.com/elevenching/Buildr/blob/main/README.en.md)。
|
|
16
16
|
|
package/docs/cli-reference.md
CHANGED
|
@@ -13,7 +13,7 @@ buildr init --agent <claude-code|codex|cursor|qoder|trae|trae-work|workbuddy> --
|
|
|
13
13
|
|
|
14
14
|
`init --agent` 是默认首次 onboarding 入口:它先初始化源资产,再复用完整 `sync` 执行 source update、产品 Buildr Skill 安装、workspace/project Skills 投射和最终 doctor。已有 workspace 的产品能力与 runtime 更新继续使用 `sync`。
|
|
15
15
|
|
|
16
|
-
`buildr update` 只更新 CLI 自身:开发 checkout 使用 Git 安全更新,registry package 使用 npm 更新。它不接收 `--target`,也不读取 workspace
|
|
16
|
+
`buildr update` 只更新 CLI 自身:开发 checkout 使用 Git 安全更新,registry package 使用 npm 更新。它不接收 `--target`,也不读取 workspace。用户要求“更新 Buildr”或“同步 Buildr”时,Agent 在 update 成功后重新解析入口,再执行 `buildr skill install <agent> --target <workspace>`,更新 CLI 与产品入口 Buildr Skill,而不扩大为 workspace sync。用户要求“更新 workspace”或“同步 workspace”时,Agent 直接执行 `buildr sync <agent> --target <workspace>`,不先更新 CLI。
|
|
17
17
|
|
|
18
18
|
## Workspace 与资产
|
|
19
19
|
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
- Commands 只声明和诊断外部 CLI,不执行本机安装、升级或登录。
|
|
10
10
|
- 远端 Skill 当前只支持 raw `SKILL.md` 的 `resolved.kind: skill-url`;未声明 integrity 时允许 render,但 doctor 会警告。
|
|
11
11
|
- Service branch intent 不负责 pull、merge、rebase 或长期分支同步;它只控制首次 clone、metadata 和 drift 诊断。
|
|
12
|
-
- `@buildr-ai/buildr@0.1.0-rc.
|
|
12
|
+
- `@buildr-ai/buildr@0.1.0-rc.5` 通过 GitHub trusted publisher 发布,`next` 指向该 RC;`latest` 仍可能指向历史 prerelease,它不代表稳定版。稳定版 `0.1.0` 尚未发布,公开试用应显式安装 `@next`。`0.1.0-rc.4` 因发布范围错误已弃用。
|
|
13
13
|
- `package check/build` 与 `openspec baseline/check` 是维护/workflow 表面,不建议普通 workspace 直接依赖。
|
|
14
14
|
|
|
15
15
|
遇到 unsupported runtime 或不能确定的资产边界时,Agent 应停止自动变更、保留源资产,并报告可执行下一步。
|
|
@@ -16,21 +16,21 @@ workspace 尚未初始化时,用一个高层命令完成源资产、Buildr Ski
|
|
|
16
16
|
```bash
|
|
17
17
|
buildr init --agent <agent> --target <dir> --name <name> --profile <personal|team|company>
|
|
18
18
|
```
|
|
19
|
-
已有 workspace 中,用户要求“更新 Buildr”时先更新 CLI
|
|
19
|
+
已有 workspace 中,用户要求“更新 Buildr”或“同步 Buildr”时先更新 CLI,再用新入口安装最新产品入口 Buildr Skill,不同步整个 workspace:
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
22
|
buildr update
|
|
23
23
|
command -v buildr
|
|
24
|
-
buildr
|
|
24
|
+
buildr skill install <agent> --target <workspace-root>
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
用户要求“更新 workspace”或“同步 workspace”时直接使用当前 CLI 执行 sync,不先更新 CLI:
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
30
|
buildr sync <agent> --target <dir>
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
`sync` 包含产品能力同步、产品入口 Buildr Skill 安装、从 `.` 递归投射各层 `AGENTS.md` 的当前 Agent runtime render 和 doctor 复查。
|
|
33
|
+
用户明确只更新 CLI 时只运行 `buildr update`,不追加 Skill install 或 workspace sync。`sync` 包含产品能力同步、产品入口 Buildr Skill 安装、从 `.` 递归投射各层 `AGENTS.md` 的当前 Agent runtime render 和 doctor 复查。
|
|
34
34
|
只需要在未初始化目录单独恢复产品入口 Skill 时使用专项入口:
|
|
35
35
|
|
|
36
36
|
```bash
|
package/package/manifest.yml
CHANGED
|
@@ -5,7 +5,6 @@ include:
|
|
|
5
5
|
- docs/cli-reference.md
|
|
6
6
|
- docs/cli-architecture.md
|
|
7
7
|
- docs/known-limitations.md
|
|
8
|
-
- examples/minimal-workspace/README.md
|
|
9
8
|
- package/
|
|
10
9
|
|
|
11
10
|
agentSkills:
|
|
@@ -34,6 +33,12 @@ builtins:
|
|
|
34
33
|
description: 用户要求修 bug、实现或调整功能、改需求、重构、优化、补文档、补测试、调整 API/契约/权限/状态流/数据语义,或询问某项改动是否需要更新 spec、创建 change、只改代码时使用。
|
|
35
34
|
required: false
|
|
36
35
|
runtimes: ["claude-code","codex","cursor","qoder","trae","trae-work","workbuddy"]
|
|
36
|
+
- id: task-cockpit
|
|
37
|
+
path: package/targets/workspace/skills/buildr/task-cockpit
|
|
38
|
+
target: skills/buildr/task-cockpit
|
|
39
|
+
description: 为复杂、长期、跨阶段、跨 change、跨服务或团队,或存在交叉依赖和多次用户判断的任务创建、更新和检查只读 HTML 任务驾驶舱;用户明确要求任务可视化、驾驶舱、整体进度、任务全景或长期跟踪时也使用。简单短时任务不机械创建。
|
|
40
|
+
required: false
|
|
41
|
+
runtimes: ["claude-code","codex","cursor","qoder","trae","trae-work","workbuddy"]
|
|
37
42
|
- id: task-worktree
|
|
38
43
|
path: package/targets/workspace/skills/buildr/task-worktree
|
|
39
44
|
target: skills/buildr/task-worktree
|
|
@@ -127,6 +132,9 @@ workspaceFiles:
|
|
|
127
132
|
- package/targets/workspace/components/manifest.yml => components/manifest.yml copy
|
|
128
133
|
- package/targets/workspace/skills/manifest.yml => skills/manifest.yml copy
|
|
129
134
|
- package/targets/workspace/skills/buildr/task-triage/SKILL.md => skills/buildr/task-triage/SKILL.md copy
|
|
135
|
+
- package/targets/workspace/skills/buildr/task-cockpit/SKILL.md => skills/buildr/task-cockpit/SKILL.md copy
|
|
136
|
+
- package/targets/workspace/skills/buildr/task-cockpit/agents/openai.yaml => skills/buildr/task-cockpit/agents/openai.yaml copy
|
|
137
|
+
- package/targets/workspace/skills/buildr/task-cockpit/assets/task-cockpit-template.html => skills/buildr/task-cockpit/assets/task-cockpit-template.html copy
|
|
130
138
|
- package/targets/workspace/skills/buildr/task-worktree/SKILL.md => skills/buildr/task-worktree/SKILL.md copy
|
|
131
139
|
- package/targets/workspace/skills/buildr/task-finish/SKILL.md => skills/buildr/task-finish/SKILL.md copy
|
|
132
140
|
- package/targets/workspace/skills/buildr/git-ops/SKILL.md => skills/buildr/git-ops/SKILL.md copy
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: buildr
|
|
3
|
-
description: 在 Buildr workspace
|
|
3
|
+
description: 在 Buildr workspace 中安装、更新或同步 Buildr、更新或同步 workspace、诊断和维护组织工作资产时使用,覆盖 Buildr CLI 与产品入口 Skill、组织(Organization/Root)、项目(Project)、服务(Service)、组件(Components)、规则(Rules)、技能(Skills)、命令(Commands)、内置能力(Builtins)和 Agent runtime 渲染。
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Buildr Skill
|
|
@@ -26,7 +26,7 @@ Agent 是 Buildr 功能的默认操作入口。Agent 能在当前工具、权限
|
|
|
26
26
|
3. 如果当前 Agent 无法和支持列表对齐,停止 Buildr 操作,并请联系 Buildr 作者反馈该 Agent。
|
|
27
27
|
4. 判断 workspace 是否已初始化。未初始化时运行 `buildr init --agent <agent> --target <dir> --name <name> --profile <personal|team|company>`,并使用命令内置的最终 doctor 结果;已有 workspace 运行 `buildr doctor --agent <agent> --target <dir> --json` 建立事实基线。不要省略 `--agent`。
|
|
28
28
|
5. 根据用户目标和 doctor 结果选择资产类型:组织(Organization/Root)、项目(Project)、服务(Service)、组件(Components)、规则(Rules)、命令(Commands)、技能(Skills)、内置能力(Builtins)或 Agent runtime 渲染。
|
|
29
|
-
6. 执行对应维护动作。用户要求“更新 Buildr”时,先运行 `buildr update`;成功后重新解析当前 `buildr` 入口,再运行 `buildr
|
|
29
|
+
6. 执行对应维护动作。用户要求“更新 Buildr”或“同步 Buildr”时,先运行 `buildr update`;成功后重新解析当前 `buildr` 入口,再运行 `buildr skill install <agent> --target <dir>`,不因此同步整个 workspace。用户明确要求“只更新 CLI”时只运行 `update`。用户要求“更新 workspace”或“同步 workspace”时运行 `buildr sync <agent> --target <dir>`,不先更新 CLI。update 受阻时不得继续用旧 CLI 安装 Buildr Skill。
|
|
30
30
|
7. 状态变更后确认最新 doctor 结果;`init --agent`、`sync` 和 Component install/uninstall 已包含最终 doctor,其他变更再运行 `buildr doctor --agent <agent> --target <dir> --json`。只有 doctor 指向专项问题,或用户明确要求细查时,才运行 `commands check` 或 `runtime check`。
|
|
31
31
|
8. 优先使用 Buildr CLI;复杂参数以当前 manifest、CLI 帮助和 CLI 错误输出为准。
|
|
32
32
|
|
|
@@ -35,10 +35,11 @@ Agent 是 Buildr 功能的默认操作入口。Agent 能在当前工具、权限
|
|
|
35
35
|
| 用户意图 | 资产类型 |
|
|
36
36
|
|---|---|
|
|
37
37
|
| 初始化、修复或诊断 Buildr workspace | 组织(Organization/Root) |
|
|
38
|
-
|
|
|
39
|
-
|
|
|
38
|
+
| 更新或同步 Buildr | Buildr CLI update + 产品入口 Buildr Skill install |
|
|
39
|
+
| 更新或同步 workspace,或恢复内置能力 | 内置能力(Builtins)/ Agent runtime 渲染 |
|
|
40
40
|
| 接入业务、产品线、系统或长期工作单元 | 项目(Project) |
|
|
41
41
|
| 接入代码仓、服务仓或可执行资产 | 服务(Service) |
|
|
42
|
+
| 复杂、长期、跨阶段或有交叉依赖的任务可视化与持续进度入口 | `task-cockpit` Skill |
|
|
42
43
|
| 代码开发、实现、构建、测试或任务 worktree 生命周期 | `task-worktree` Skill |
|
|
43
44
|
| 完成已验证任务、自动归档集成并清理 task worktree | `task-finish` Skill |
|
|
44
45
|
| 提交、拉取、合并、rebase、checkout/switch、reset、推送、发布或其他单项 Git 操作 | `git-ops` Skill |
|
|
@@ -48,7 +49,6 @@ Agent 是 Buildr 功能的默认操作入口。Agent 能在当前工具、权限
|
|
|
48
49
|
| 声明组织复用的外部命令行工具 | 命令(Commands) |
|
|
49
50
|
| 当前 Agent 找不到已声明规则或技能 | Agent runtime 渲染 |
|
|
50
51
|
| 为 Buildr 增加新的 Agent runtime adapter | runtime trait intake + OpenSpec change |
|
|
51
|
-
|
|
52
52
|
Agent 通过 `git-ops`、`task-worktree` 或 `task-finish` 成功改变已检出工作区内容后,由对应 Skill 在已初始化 Buildr workspace 中执行 post-transition doctor。doctor 指出 workspace sync 是合适修复动作时,询问用户是否由 Agent 立即同步,同时提供手动同步命令作为备选;用户确认后由 Agent 执行 `buildr sync <agent> --target <workspace-root>` 并验证最终 doctor。当前 session 是否重新发现新资产由 Agent runtime 决定。
|
|
53
53
|
|
|
54
54
|
## 资产维护
|
|
@@ -83,6 +83,7 @@ Agent 通过 `git-ops`、`task-worktree` 或 `task-finish` 成功改变已检出
|
|
|
83
83
|
|
|
84
84
|
- Buildr 内置能力包括 required core Rule、optional Skills 和内置 Command 声明。
|
|
85
85
|
- 只更新 Buildr CLI 自身:`buildr update`;查看 CLI 更新状态:`buildr update check --json`。命令自动识别开发 checkout 或 registry package,不读取 workspace。
|
|
86
|
+
- 安装或修复当前 CLI 携带的产品入口 Buildr Skill:`buildr skill install <agent> --target <dir>`;“更新 Buildr”或“同步 Buildr”默认在 update 后使用此入口,不扩大为 workspace sync。
|
|
86
87
|
- 同步 workspace 产品源能力并准备当前 Agent runtime:`buildr sync <agent> --target <dir>`。
|
|
87
88
|
- 查看 workspace 内置能力状态:`buildr builtin list --target <dir> --json` 或最终 doctor。
|
|
88
89
|
- 卸载 optional 内置能力:`buildr builtin uninstall <id> --target <dir>`;required 能力不能卸载。
|
|
@@ -140,7 +141,7 @@ Agent 通过 `git-ops`、`task-worktree` 或 `task-finish` 成功改变已检出
|
|
|
140
141
|
- Adapter 只生成 runtime-specific 声明式计划;Buildr 通用 core 统一负责 Component 完整性后的 source assembly、计划验证、冲突预检、写入、清理和诊断。
|
|
141
142
|
- 用户要求增加新 adapter 时,先从目标 Agent 收集能直接映射到 trait descriptor 的最小 intake:identity/surface、Rules kind、Skills root、activation、安装/版本 checker 和最小黑盒证据;不要调查与 adapter 无关的产品功能。
|
|
142
143
|
- 新 adapter 属于 Buildr 产品 change-flow:每个 runtime 使用独立 descriptor、capability evidence 和 tests;只在现有 primitive 无法表达时增加新的静态 implementation,不能 alias 或 fallback 到其他 adapter。
|
|
143
|
-
- 用户说“更新 Buildr”时,依次运行 `buildr update`
|
|
144
|
+
- 用户说“更新 Buildr”或“同步 Buildr”时,依次运行 `buildr update` 与新入口的 `buildr skill install <agent> --target <dir>`;用户说“只更新 CLI”时不追加 Skill install;用户说“更新 workspace”或“同步 workspace”时运行 `buildr sync <agent> --target <dir>`,不先更新 CLI。sync 默认从 `.` 递归 reconcile workspace Rules,并同步 Root/Project Skills。
|
|
144
145
|
- doctor 指出特定 scope runtime 问题时,按 canonical workspace 相对 scope 运行 `render`、`rules render` 或 `runtime check`;组合 `render` 会把 Skills scope 折叠到所属 Root/Project。
|
|
145
146
|
- `runtime check` 是专项 runtime 细查入口;只有 doctor 指向具体 runtime 问题,或用户明确要求细查时运行。
|
|
146
147
|
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: task-cockpit
|
|
3
|
+
description: 为复杂、长期、跨阶段、跨 change、跨服务或团队,或存在交叉依赖和多次用户判断的任务创建、更新和检查只读 HTML 任务驾驶舱;用户明确要求任务可视化、驾驶舱、整体进度、任务全景或长期跟踪时也使用。简单短时任务不机械创建。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Task Cockpit Skill
|
|
7
|
+
|
|
8
|
+
本 Skill 由 Agent 单向维护整个任务面向用户的可视化驾驶舱。驾驶舱不是 OpenSpec change 的翻译,也不替代 specs、代码、验证或外部系统事实。
|
|
9
|
+
|
|
10
|
+
## 判断创建还是维护
|
|
11
|
+
|
|
12
|
+
满足任一条件时创建或继续维护驾驶舱:
|
|
13
|
+
|
|
14
|
+
- 用户明确要求任务可视化、驾驶舱、整体进度、任务全景或长期跟踪。
|
|
15
|
+
- 任务跨多个阶段、change、服务、代码仓或团队。
|
|
16
|
+
- 任务存在外部依赖、交叉依赖、等待事项或无法一次完成的后续阶段。
|
|
17
|
+
- 任务预计跨会话持续推进,或需要多次用户判断。
|
|
18
|
+
- 单个 `tasks.md`、当前 change 或对话无法表达完整任务生命周期。
|
|
19
|
+
|
|
20
|
+
简单、短时、无持续跟踪价值的任务继续用简洁对话汇报,不为形式完整创建空洞页面。
|
|
21
|
+
|
|
22
|
+
## 解析任务与位置
|
|
23
|
+
|
|
24
|
+
1. 从 Buildr workspace root、Project registry 和任务实际范围解析拥有任务的 Project,不根据当前目录猜测。
|
|
25
|
+
2. 使用稳定、简短的 kebab-case `task-id`。一个驾驶舱可以关联多个 OpenSpec change。
|
|
26
|
+
3. 查找 `projects/<project>/openspec/knowledge/task-cockpits/*-<task-id>.html`;存在时继续更新,不按更新时间创建新文件。
|
|
27
|
+
4. 首次创建时使用 Project 所在环境的本地日期,路径固定为:
|
|
28
|
+
|
|
29
|
+
```text
|
|
30
|
+
projects/<project>/openspec/knowledge/task-cockpits/yyyy-MM-dd-<task-id>.html
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
5. 从本 Skill 的 `assets/task-cockpit-template.html` 复制模板到目标位置,替换内嵌 `#cockpit-data` JSON。保持单文件,不引用 CDN、远端脚本、远端字体或远端图片。
|
|
34
|
+
|
|
35
|
+
## 核实任务事实
|
|
36
|
+
|
|
37
|
+
按任务相关性读取,不做无关全量审计:
|
|
38
|
+
|
|
39
|
+
- 用户已经确认的目标、边界和判断。
|
|
40
|
+
- 当前及历史 OpenSpec proposal、design、specs、tasks 和 CLI status。
|
|
41
|
+
- 相关代码、提交、测试和验证结果。
|
|
42
|
+
- 外部团队、接口、审批、发布或联调依赖。
|
|
43
|
+
- 既有驾驶舱中的历史阶段与稳定任务身份。
|
|
44
|
+
|
|
45
|
+
权威来源冲突时先修正驾驶舱,不用驾驶舱覆盖权威事实。改变 requirement、状态流、API、权限或数据语义的决策先按 `task-triage` 维护 OpenSpec;普通进度、阶段关系、外部等待和验证结果可直接维护驾驶舱。
|
|
46
|
+
|
|
47
|
+
## 组织内容
|
|
48
|
+
|
|
49
|
+
### 首页
|
|
50
|
+
|
|
51
|
+
首页必须让普通用户一眼看懂:
|
|
52
|
+
|
|
53
|
+
- 我们在做什么。
|
|
54
|
+
- 当前结论和阶段。
|
|
55
|
+
- 已完成、正在做、下一步。
|
|
56
|
+
- 当前阻塞或需要用户关注什么。
|
|
57
|
+
- 整体方案的极简链路。
|
|
58
|
+
|
|
59
|
+
首页先写结论再写原因。每张卡片保持短小;不要以 API、类名、数据库字段、大表格或代码作为首页主体。
|
|
60
|
+
|
|
61
|
+
### 推进
|
|
62
|
+
|
|
63
|
+
按整个任务而不是单个 change 展示:
|
|
64
|
+
|
|
65
|
+
- 已完成、进行中、等待、未开始的阶段。
|
|
66
|
+
- 阶段内的关键任务和依赖。
|
|
67
|
+
- active/archive change、code-only 工作和外部协作关系。
|
|
68
|
+
- 可核实的“阶段 N/M”“任务 N/M”,不猜测百分比。
|
|
69
|
+
|
|
70
|
+
已完成阶段保留摘要,默认减少细节;当前阶段和阻塞项高亮。
|
|
71
|
+
|
|
72
|
+
### 方案
|
|
73
|
+
|
|
74
|
+
用普通语言展示整体思路、业务流程、职责边界、关键选择和明确非目标。优先使用简短流程或对照卡,不机械复制 `design.md`。
|
|
75
|
+
|
|
76
|
+
### 技术细节
|
|
77
|
+
|
|
78
|
+
将以下内容后置:API、状态映射、数据结构、关键模块与文件、简略代码、测试结果和证据链接。只保留帮助用户或后续 Agent 理解实现的关键细节,不堆原始命令流水或完整日志。
|
|
79
|
+
|
|
80
|
+
## 更新节点
|
|
81
|
+
|
|
82
|
+
在以下节点核实事实并更新同一文件:
|
|
83
|
+
|
|
84
|
+
- 首次创建。
|
|
85
|
+
- 目标、范围或整体方案变化。
|
|
86
|
+
- 任务阶段变化或完成一个任务组。
|
|
87
|
+
- 出现、变化或解除阻塞。
|
|
88
|
+
- 用户完成关键判断。
|
|
89
|
+
- 用户询问进度。
|
|
90
|
+
- 验证结果改变结论。
|
|
91
|
+
- 任务暂停、恢复或完成。
|
|
92
|
+
|
|
93
|
+
没有改变任务认知的短暂命令或检查不机械刷新。
|
|
94
|
+
|
|
95
|
+
## 页面维护约束
|
|
96
|
+
|
|
97
|
+
- 用户只通过 Agent 对话参与;checkbox、状态 chip、进度条和按钮只读,不回写任务事实。
|
|
98
|
+
- 只修改模板内嵌 `script#cockpit-data` 的 JSON 和确有必要的任务专属文案;保持模板结构、响应式样式和导航行为稳定。
|
|
99
|
+
- JSON 中不放 secret、token、cookie、个人敏感信息、完整思考过程或无关原始日志。
|
|
100
|
+
- `updatedAt` 使用实际更新时间;状态未核实时明确写“待核实”,不伪造进度。
|
|
101
|
+
- 任务完成后保留稳定入口和历史阶段,不因 change archive 移动驾驶舱。
|
|
102
|
+
|
|
103
|
+
## 检查
|
|
104
|
+
|
|
105
|
+
创建或实质更新后:
|
|
106
|
+
|
|
107
|
+
1. 确认文件名匹配 `yyyy-MM-dd-<task-id>.html`,且位于正确 Project 的 `openspec/knowledge/task-cockpits/`。
|
|
108
|
+
2. 检查内嵌 JSON 可解析,页面没有外部网络依赖。
|
|
109
|
+
3. 用本地浏览器检查桌面和窄屏布局;确认默认首页聚焦,导航可用,技术内容后置。
|
|
110
|
+
4. 对照权威来源检查当前状态、任务数量、阻塞、验证结论和链接。
|
|
111
|
+
5. 确认 HTML 只读,没有修改任务状态的事件处理或外部写回。
|
|
112
|
+
|
|
113
|
+
## 面向用户的回复
|
|
114
|
+
|
|
115
|
+
驾驶舱首次创建、实质更新、用户询问进度、任务暂停或完成时,回复提供可点击入口并包含:
|
|
116
|
+
|
|
117
|
+
```text
|
|
118
|
+
任务驾驶舱:[查看 <任务名称>](<absolute-path>)
|
|
119
|
+
位置:<workspace-relative-path>
|
|
120
|
+
当前状态:<一句话状态>
|
|
121
|
+
驾驶舱已更新:<实际时间>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
当前 runtime 不支持本地 Markdown 链接时仍提供准确绝对路径和 workspace 相对路径。未成功更新时不得声称已更新,改为说明原因和下一步。
|
package/package/targets/workspace/skills/buildr/task-cockpit/assets/task-cockpit-template.html
ADDED
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="zh-CN">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<meta name="description" content="Agent 单向维护的任务可视化驾驶舱。">
|
|
7
|
+
<title>任务驾驶舱</title>
|
|
8
|
+
<style>
|
|
9
|
+
:root {
|
|
10
|
+
--ink: #172033;
|
|
11
|
+
--muted: #667085;
|
|
12
|
+
--line: #dfe5ec;
|
|
13
|
+
--paper: #fff;
|
|
14
|
+
--canvas: #f3f6f8;
|
|
15
|
+
--navy: #14213d;
|
|
16
|
+
--teal: #087f76;
|
|
17
|
+
--teal-soft: #ddf4f0;
|
|
18
|
+
--blue: #2563eb;
|
|
19
|
+
--blue-soft: #eaf1ff;
|
|
20
|
+
--amber: #b96300;
|
|
21
|
+
--amber-soft: #fff3d7;
|
|
22
|
+
--red: #b83a34;
|
|
23
|
+
--red-soft: #fff0ee;
|
|
24
|
+
--green: #15803d;
|
|
25
|
+
--green-soft: #eaf8ee;
|
|
26
|
+
--shadow: 0 14px 40px rgba(20, 33, 61, .09);
|
|
27
|
+
--radius: 20px;
|
|
28
|
+
}
|
|
29
|
+
* { box-sizing: border-box; }
|
|
30
|
+
html { scroll-behavior: smooth; }
|
|
31
|
+
body {
|
|
32
|
+
margin: 0;
|
|
33
|
+
color: var(--ink);
|
|
34
|
+
background:
|
|
35
|
+
radial-gradient(circle at 8% 2%, rgba(8, 127, 118, .09), transparent 24rem),
|
|
36
|
+
radial-gradient(circle at 92% 8%, rgba(37, 99, 235, .07), transparent 28rem),
|
|
37
|
+
var(--canvas);
|
|
38
|
+
font-family: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
|
|
39
|
+
line-height: 1.6;
|
|
40
|
+
}
|
|
41
|
+
button, a { font: inherit; }
|
|
42
|
+
.page { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 32px 0 72px; }
|
|
43
|
+
.hero {
|
|
44
|
+
padding: 46px;
|
|
45
|
+
color: #fff;
|
|
46
|
+
border-radius: 28px;
|
|
47
|
+
background: linear-gradient(135deg, var(--navy), #183d52 62%, #0b625e);
|
|
48
|
+
box-shadow: var(--shadow);
|
|
49
|
+
}
|
|
50
|
+
.hero-top, .section-head, .split, .metric-row, .tab-list { display: flex; }
|
|
51
|
+
.hero-top { align-items: center; justify-content: space-between; gap: 18px; }
|
|
52
|
+
.eyebrow, .status, .tag {
|
|
53
|
+
display: inline-flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
width: fit-content;
|
|
56
|
+
padding: 6px 11px;
|
|
57
|
+
border-radius: 999px;
|
|
58
|
+
font-size: 12px;
|
|
59
|
+
font-weight: 800;
|
|
60
|
+
letter-spacing: .04em;
|
|
61
|
+
}
|
|
62
|
+
.eyebrow { color: #caf8ee; border: 1px solid rgba(202, 248, 238, .35); background: rgba(8, 127, 118, .27); }
|
|
63
|
+
.hero h1 { max-width: 850px; margin: 22px 0 0; font-size: clamp(34px, 5vw, 60px); line-height: 1.12; letter-spacing: -.045em; }
|
|
64
|
+
.hero-lead { max-width: 840px; margin: 18px 0 0; color: rgba(255, 255, 255, .8); font-size: 18px; }
|
|
65
|
+
.metric-row { gap: 14px; margin-top: 30px; }
|
|
66
|
+
.metric { flex: 1; min-width: 0; padding: 16px 18px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 16px; background: rgba(255, 255, 255, .075); }
|
|
67
|
+
.metric strong { display: block; font-size: 22px; line-height: 1.25; }
|
|
68
|
+
.metric span { display: block; margin-top: 4px; color: rgba(255, 255, 255, .66); font-size: 12px; }
|
|
69
|
+
.tabs { position: sticky; top: 0; z-index: 10; margin: 18px 0 0; padding: 10px; border: 1px solid rgba(223, 229, 236, .95); border-radius: 18px; background: rgba(255, 255, 255, .92); box-shadow: 0 8px 28px rgba(20, 33, 61, .06); backdrop-filter: blur(14px); }
|
|
70
|
+
.tab-list { gap: 8px; overflow-x: auto; }
|
|
71
|
+
.tab {
|
|
72
|
+
flex: 0 0 auto;
|
|
73
|
+
padding: 10px 16px;
|
|
74
|
+
color: var(--muted);
|
|
75
|
+
border: 0;
|
|
76
|
+
border-radius: 12px;
|
|
77
|
+
background: transparent;
|
|
78
|
+
cursor: pointer;
|
|
79
|
+
font-weight: 800;
|
|
80
|
+
}
|
|
81
|
+
.tab[aria-selected="true"] { color: #fff; background: var(--navy); }
|
|
82
|
+
.panel { display: none; }
|
|
83
|
+
.panel.active { display: block; }
|
|
84
|
+
.section { margin-top: 22px; padding: 30px; border: 1px solid rgba(223, 229, 236, .96); border-radius: var(--radius); background: rgba(255, 255, 255, .95); box-shadow: 0 8px 28px rgba(20, 33, 61, .05); }
|
|
85
|
+
.section-head { align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
|
|
86
|
+
.section h2 { margin: 0; color: var(--navy); font-size: 24px; line-height: 1.25; }
|
|
87
|
+
.section-desc { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
|
|
88
|
+
.focus { padding: 24px; border-radius: 18px; background: linear-gradient(135deg, var(--blue-soft), #f7fbff); border: 1px solid #cbdcff; }
|
|
89
|
+
.focus-label { color: var(--blue); font-size: 12px; font-weight: 900; letter-spacing: .08em; }
|
|
90
|
+
.focus h2 { margin: 8px 0 0; font-size: clamp(24px, 3.4vw, 38px); }
|
|
91
|
+
.focus p { max-width: 840px; margin: 10px 0 0; color: #40516e; }
|
|
92
|
+
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
|
|
93
|
+
.card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
|
|
94
|
+
.card h3 { margin: 8px 0 0; color: var(--navy); font-size: 18px; }
|
|
95
|
+
.card p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
|
|
96
|
+
.tag.done { color: var(--green); background: var(--green-soft); }
|
|
97
|
+
.tag.current { color: var(--blue); background: var(--blue-soft); }
|
|
98
|
+
.tag.next { color: var(--amber); background: var(--amber-soft); }
|
|
99
|
+
.tag.blocked { color: var(--red); background: var(--red-soft); }
|
|
100
|
+
.status { color: #fff; background: rgba(255, 255, 255, .15); }
|
|
101
|
+
.alert { padding: 18px 20px; border-left: 4px solid var(--amber); border-radius: 14px; background: var(--amber-soft); }
|
|
102
|
+
.alert strong { display: block; color: #7c4500; }
|
|
103
|
+
.alert p { margin: 5px 0 0; color: #765523; }
|
|
104
|
+
.flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
|
|
105
|
+
.flow-step { position: relative; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
|
|
106
|
+
.flow-step:not(:last-child)::after { position: absolute; right: -10px; top: 50%; content: "→"; color: #96a1b3; font-weight: 900; transform: translateY(-50%); }
|
|
107
|
+
.flow-step strong { display: block; color: var(--navy); }
|
|
108
|
+
.flow-step span { display: block; margin-top: 5px; color: var(--muted); font-size: 13px; }
|
|
109
|
+
.timeline { display: grid; gap: 12px; }
|
|
110
|
+
.stage { display: grid; grid-template-columns: 150px 1fr; gap: 18px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
|
|
111
|
+
.stage.current { border-color: #a8c5ff; background: #f7faff; }
|
|
112
|
+
.stage.blocked { border-color: #f2c5c2; background: #fffafa; }
|
|
113
|
+
.stage-title strong { display: block; margin-top: 8px; }
|
|
114
|
+
.stage-body p { margin: 0; color: var(--muted); }
|
|
115
|
+
.compact-list { margin: 12px 0 0; padding-left: 20px; }
|
|
116
|
+
.compact-list li + li { margin-top: 6px; }
|
|
117
|
+
.split { gap: 14px; }
|
|
118
|
+
.split > * { flex: 1; }
|
|
119
|
+
.evidence { display: grid; gap: 10px; }
|
|
120
|
+
.evidence-item { padding: 15px 17px; border: 1px solid var(--line); border-radius: 13px; background: #fbfcfe; }
|
|
121
|
+
.evidence-item strong { display: block; }
|
|
122
|
+
.evidence-item span, .evidence-item a { display: block; margin-top: 4px; color: var(--muted); overflow-wrap: anywhere; font-size: 13px; }
|
|
123
|
+
pre { margin: 12px 0 0; padding: 17px; overflow: auto; color: #e8edf7; border-radius: 14px; background: #111a2d; font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
|
|
124
|
+
footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 26px; color: var(--muted); font-size: 12px; }
|
|
125
|
+
.empty { color: var(--muted); font-style: italic; }
|
|
126
|
+
@media (max-width: 820px) {
|
|
127
|
+
.page { width: min(100% - 24px, 1180px); padding-top: 12px; }
|
|
128
|
+
.hero { padding: 28px 22px; border-radius: 22px; }
|
|
129
|
+
.hero-top, .section-head, .split, footer { align-items: stretch; flex-direction: column; }
|
|
130
|
+
.metric-row { display: grid; grid-template-columns: 1fr; }
|
|
131
|
+
.grid, .flow { grid-template-columns: 1fr; }
|
|
132
|
+
.flow-step:not(:last-child)::after { right: auto; left: 50%; top: auto; bottom: -18px; content: "↓"; transform: translateX(-50%); }
|
|
133
|
+
.stage { grid-template-columns: 1fr; gap: 10px; }
|
|
134
|
+
.section { padding: 22px 18px; }
|
|
135
|
+
.tabs { top: 6px; }
|
|
136
|
+
}
|
|
137
|
+
</style>
|
|
138
|
+
</head>
|
|
139
|
+
<body>
|
|
140
|
+
<main class="page">
|
|
141
|
+
<header class="hero">
|
|
142
|
+
<div class="hero-top">
|
|
143
|
+
<span class="eyebrow">TASK COCKPIT · AGENT MAINTAINED</span>
|
|
144
|
+
<span class="status" id="hero-status">待更新</span>
|
|
145
|
+
</div>
|
|
146
|
+
<h1 id="hero-title">任务驾驶舱</h1>
|
|
147
|
+
<p class="hero-lead" id="hero-purpose">用一句普通人能理解的话说明这个任务要解决什么。</p>
|
|
148
|
+
<div class="metric-row" id="hero-metrics"></div>
|
|
149
|
+
</header>
|
|
150
|
+
|
|
151
|
+
<nav class="tabs" aria-label="驾驶舱视图">
|
|
152
|
+
<div class="tab-list" role="tablist">
|
|
153
|
+
<button class="tab" role="tab" aria-selected="true" aria-controls="overview-panel" data-tab="overview">首页</button>
|
|
154
|
+
<button class="tab" role="tab" aria-selected="false" aria-controls="progress-panel" data-tab="progress">推进</button>
|
|
155
|
+
<button class="tab" role="tab" aria-selected="false" aria-controls="solution-panel" data-tab="solution">方案</button>
|
|
156
|
+
<button class="tab" role="tab" aria-selected="false" aria-controls="technical-panel" data-tab="technical">技术细节</button>
|
|
157
|
+
</div>
|
|
158
|
+
</nav>
|
|
159
|
+
|
|
160
|
+
<section class="panel active" id="overview-panel" data-panel="overview"></section>
|
|
161
|
+
<section class="panel" id="progress-panel" data-panel="progress"></section>
|
|
162
|
+
<section class="panel" id="solution-panel" data-panel="solution"></section>
|
|
163
|
+
<section class="panel" id="technical-panel" data-panel="technical"></section>
|
|
164
|
+
|
|
165
|
+
<footer>
|
|
166
|
+
<span id="footer-id"></span>
|
|
167
|
+
<span>由 Agent 单向维护 · 页面只读</span>
|
|
168
|
+
</footer>
|
|
169
|
+
</main>
|
|
170
|
+
|
|
171
|
+
<script id="cockpit-data" type="application/json">
|
|
172
|
+
{
|
|
173
|
+
"meta": {
|
|
174
|
+
"title": "任务名称",
|
|
175
|
+
"taskId": "task-id",
|
|
176
|
+
"status": "进行中",
|
|
177
|
+
"phase": "阶段 1 / 3",
|
|
178
|
+
"taskProgress": "任务 0 / 0",
|
|
179
|
+
"updatedAt": "yyyy-MM-dd HH:mm",
|
|
180
|
+
"relativePath": "projects/<project>/openspec/knowledge/task-cockpits/yyyy-MM-dd-task-id.html"
|
|
181
|
+
},
|
|
182
|
+
"overview": {
|
|
183
|
+
"purpose": "用一句话说明这个任务要解决什么,以及完成后用户会得到什么。",
|
|
184
|
+
"conclusion": "先写当前最重要的结论。",
|
|
185
|
+
"currentFocus": "说明 Agent 现在正在推进什么。",
|
|
186
|
+
"userAttention": "没有需要用户立即处理的事项。",
|
|
187
|
+
"highlights": {
|
|
188
|
+
"done": { "title": "已经完成", "text": "列出最重要的已完成结果。" },
|
|
189
|
+
"current": { "title": "正在进行", "text": "列出当前工作和预期产物。" },
|
|
190
|
+
"next": { "title": "下一步", "text": "列出下一项可执行动作。" }
|
|
191
|
+
},
|
|
192
|
+
"blockers": [],
|
|
193
|
+
"flow": [
|
|
194
|
+
{ "title": "理解目标", "text": "确认任务范围" },
|
|
195
|
+
{ "title": "形成方案", "text": "明确整体路径" },
|
|
196
|
+
{ "title": "推进实现", "text": "完成关键任务" },
|
|
197
|
+
{ "title": "验证交付", "text": "形成可信结果" }
|
|
198
|
+
]
|
|
199
|
+
},
|
|
200
|
+
"progress": {
|
|
201
|
+
"stages": []
|
|
202
|
+
},
|
|
203
|
+
"solution": {
|
|
204
|
+
"summary": "用普通语言说明整体解决方式。",
|
|
205
|
+
"boundaries": { "inScope": [], "outOfScope": [] },
|
|
206
|
+
"decisions": []
|
|
207
|
+
},
|
|
208
|
+
"technical": {
|
|
209
|
+
"facts": [],
|
|
210
|
+
"files": [],
|
|
211
|
+
"validations": [],
|
|
212
|
+
"snippets": []
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
</script>
|
|
216
|
+
<script>
|
|
217
|
+
(() => {
|
|
218
|
+
const dataNode = document.getElementById('cockpit-data');
|
|
219
|
+
let data;
|
|
220
|
+
try { data = JSON.parse(dataNode.textContent); }
|
|
221
|
+
catch (error) {
|
|
222
|
+
document.body.innerHTML = '<main class="page"><section class="section"><h1>驾驶舱数据无法解析</h1><p>请让 Agent 检查 #cockpit-data JSON。</p></section></main>';
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
const el = (tag, className, text) => {
|
|
227
|
+
const node = document.createElement(tag);
|
|
228
|
+
if (className) node.className = className;
|
|
229
|
+
if (text !== undefined && text !== null) node.textContent = text;
|
|
230
|
+
return node;
|
|
231
|
+
};
|
|
232
|
+
const appendList = (items) => {
|
|
233
|
+
if (!items || !items.length) return el('p', 'empty', '暂无');
|
|
234
|
+
const list = el('ul', 'compact-list');
|
|
235
|
+
items.forEach(item => list.append(el('li', '', item)));
|
|
236
|
+
return list;
|
|
237
|
+
};
|
|
238
|
+
const section = (title, desc) => {
|
|
239
|
+
const wrap = el('section', 'section');
|
|
240
|
+
const head = el('div', 'section-head');
|
|
241
|
+
const titleWrap = el('div');
|
|
242
|
+
titleWrap.append(el('h2', '', title));
|
|
243
|
+
if (desc) titleWrap.append(el('p', 'section-desc', desc));
|
|
244
|
+
head.append(titleWrap);
|
|
245
|
+
wrap.append(head);
|
|
246
|
+
return wrap;
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
document.title = `${data.meta.title}|任务驾驶舱`;
|
|
250
|
+
document.getElementById('hero-title').textContent = data.meta.title;
|
|
251
|
+
document.getElementById('hero-purpose').textContent = data.overview.purpose;
|
|
252
|
+
document.getElementById('hero-status').textContent = data.meta.status;
|
|
253
|
+
document.getElementById('footer-id').textContent = `${data.meta.taskId} · ${data.meta.relativePath}`;
|
|
254
|
+
const metrics = [
|
|
255
|
+
[data.meta.phase, '当前阶段'],
|
|
256
|
+
[data.meta.taskProgress, '可核实进度'],
|
|
257
|
+
[data.meta.updatedAt, '最近更新']
|
|
258
|
+
];
|
|
259
|
+
const metricRow = document.getElementById('hero-metrics');
|
|
260
|
+
metrics.forEach(([value, label]) => {
|
|
261
|
+
const card = el('div', 'metric');
|
|
262
|
+
card.append(el('strong', '', value), el('span', '', label));
|
|
263
|
+
metricRow.append(card);
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
const overviewPanel = document.getElementById('overview-panel');
|
|
267
|
+
const focus = section('当前最重要的事');
|
|
268
|
+
const focusBox = el('div', 'focus');
|
|
269
|
+
focusBox.append(el('span', 'focus-label', 'CURRENT FOCUS'), el('h2', '', data.overview.conclusion), el('p', '', data.overview.currentFocus));
|
|
270
|
+
focus.append(focusBox);
|
|
271
|
+
overviewPanel.append(focus);
|
|
272
|
+
|
|
273
|
+
const highlights = section('一眼看懂推进情况', '只保留已经完成、正在做和下一步三个重点。');
|
|
274
|
+
const highlightGrid = el('div', 'grid');
|
|
275
|
+
[['done', 'done'], ['current', 'current'], ['next', 'next']].forEach(([key, status]) => {
|
|
276
|
+
const item = data.overview.highlights[key];
|
|
277
|
+
const card = el('article', 'card');
|
|
278
|
+
card.append(el('span', `tag ${status}`, item.title), el('h3', '', item.text));
|
|
279
|
+
highlightGrid.append(card);
|
|
280
|
+
});
|
|
281
|
+
highlights.append(highlightGrid);
|
|
282
|
+
overviewPanel.append(highlights);
|
|
283
|
+
|
|
284
|
+
const attention = section('需要关注', '阻塞和需要用户判断的事项必须集中展示。');
|
|
285
|
+
if (data.overview.blockers && data.overview.blockers.length) {
|
|
286
|
+
data.overview.blockers.forEach(item => {
|
|
287
|
+
const alert = el('div', 'alert');
|
|
288
|
+
alert.append(el('strong', '', item.title), el('p', '', item.text));
|
|
289
|
+
attention.append(alert);
|
|
290
|
+
});
|
|
291
|
+
} else {
|
|
292
|
+
const alert = el('div', 'alert');
|
|
293
|
+
alert.append(el('strong', '', '当前无阻塞'), el('p', '', data.overview.userAttention));
|
|
294
|
+
attention.append(alert);
|
|
295
|
+
}
|
|
296
|
+
overviewPanel.append(attention);
|
|
297
|
+
|
|
298
|
+
const flowSection = section('整体怎么推进', '首页只展示最短路径,详细方案放在后续视图。');
|
|
299
|
+
const flow = el('div', 'flow');
|
|
300
|
+
(data.overview.flow || []).forEach(item => {
|
|
301
|
+
const step = el('div', 'flow-step');
|
|
302
|
+
step.append(el('strong', '', item.title), el('span', '', item.text));
|
|
303
|
+
flow.append(step);
|
|
304
|
+
});
|
|
305
|
+
flowSection.append(flow);
|
|
306
|
+
overviewPanel.append(flowSection);
|
|
307
|
+
|
|
308
|
+
const progressPanel = document.getElementById('progress-panel');
|
|
309
|
+
const progressSection = section('整个任务的阶段', '保留历史阶段,并将当前阶段、依赖和阻塞放在一起。');
|
|
310
|
+
const timeline = el('div', 'timeline');
|
|
311
|
+
(data.progress.stages || []).forEach(stageData => {
|
|
312
|
+
const stage = el('article', `stage ${stageData.status || ''}`);
|
|
313
|
+
const title = el('div', 'stage-title');
|
|
314
|
+
title.append(el('span', `tag ${stageData.status || 'next'}`, stageData.label || stageData.status), el('strong', '', stageData.title));
|
|
315
|
+
const body = el('div', 'stage-body');
|
|
316
|
+
body.append(el('p', '', stageData.summary), appendList(stageData.items));
|
|
317
|
+
stage.append(title, body);
|
|
318
|
+
timeline.append(stage);
|
|
319
|
+
});
|
|
320
|
+
if (!timeline.children.length) timeline.append(el('p', 'empty', 'Agent 尚未填写阶段。'));
|
|
321
|
+
progressSection.append(timeline);
|
|
322
|
+
progressPanel.append(progressSection);
|
|
323
|
+
|
|
324
|
+
const solutionPanel = document.getElementById('solution-panel');
|
|
325
|
+
const summary = section('整体方案', '先讲清楚怎么解决,再下钻到技术实现。');
|
|
326
|
+
summary.append(el('div', 'focus', data.solution.summary));
|
|
327
|
+
solutionPanel.append(summary);
|
|
328
|
+
const boundaries = section('范围与边界');
|
|
329
|
+
const split = el('div', 'split');
|
|
330
|
+
[['本次处理', data.solution.boundaries.inScope], ['明确不处理', data.solution.boundaries.outOfScope]].forEach(([titleText, items]) => {
|
|
331
|
+
const card = el('article', 'card');
|
|
332
|
+
card.append(el('h3', '', titleText), appendList(items));
|
|
333
|
+
split.append(card);
|
|
334
|
+
});
|
|
335
|
+
boundaries.append(split);
|
|
336
|
+
solutionPanel.append(boundaries);
|
|
337
|
+
const decisions = section('关键选择', '只记录影响整体方案的决定及理由。');
|
|
338
|
+
const decisionGrid = el('div', 'grid');
|
|
339
|
+
(data.solution.decisions || []).forEach(item => {
|
|
340
|
+
const card = el('article', 'card');
|
|
341
|
+
card.append(el('span', 'tag current', item.label || '决定'), el('h3', '', item.title), el('p', '', item.reason));
|
|
342
|
+
decisionGrid.append(card);
|
|
343
|
+
});
|
|
344
|
+
if (!decisionGrid.children.length) decisionGrid.append(el('p', 'empty', '暂无关键选择。'));
|
|
345
|
+
decisions.append(decisionGrid);
|
|
346
|
+
solutionPanel.append(decisions);
|
|
347
|
+
|
|
348
|
+
const technicalPanel = document.getElementById('technical-panel');
|
|
349
|
+
const technicalGroups = [
|
|
350
|
+
['关键技术事实', data.technical.facts],
|
|
351
|
+
['关键文件与产物', data.technical.files],
|
|
352
|
+
['验证证据', data.technical.validations]
|
|
353
|
+
];
|
|
354
|
+
technicalGroups.forEach(([titleText, items]) => {
|
|
355
|
+
const group = section(titleText);
|
|
356
|
+
const evidence = el('div', 'evidence');
|
|
357
|
+
(items || []).forEach(item => {
|
|
358
|
+
const card = el('div', 'evidence-item');
|
|
359
|
+
card.append(el('strong', '', item.title));
|
|
360
|
+
if (item.text) card.append(el('span', '', item.text));
|
|
361
|
+
if (item.path) card.append(el('span', '', item.path));
|
|
362
|
+
evidence.append(card);
|
|
363
|
+
});
|
|
364
|
+
if (!evidence.children.length) evidence.append(el('p', 'empty', '暂无。'));
|
|
365
|
+
group.append(evidence);
|
|
366
|
+
technicalPanel.append(group);
|
|
367
|
+
});
|
|
368
|
+
(data.technical.snippets || []).forEach(snippet => {
|
|
369
|
+
const group = section(snippet.title || '简略代码');
|
|
370
|
+
group.append(el('pre', '', snippet.code));
|
|
371
|
+
technicalPanel.append(group);
|
|
372
|
+
});
|
|
373
|
+
|
|
374
|
+
document.querySelectorAll('.tab').forEach(tab => {
|
|
375
|
+
tab.addEventListener('click', () => {
|
|
376
|
+
const target = tab.dataset.tab;
|
|
377
|
+
document.querySelectorAll('.tab').forEach(item => item.setAttribute('aria-selected', item === tab ? 'true' : 'false'));
|
|
378
|
+
document.querySelectorAll('.panel').forEach(panel => panel.classList.toggle('active', panel.dataset.panel === target));
|
|
379
|
+
window.scrollTo({ top: document.querySelector('.tabs').offsetTop - 6, behavior: 'smooth' });
|
|
380
|
+
});
|
|
381
|
+
});
|
|
382
|
+
})();
|
|
383
|
+
</script>
|
|
384
|
+
</body>
|
|
385
|
+
</html>
|
|
@@ -13,6 +13,7 @@ description: 用户要求修 bug、实现或调整功能、改需求、重构、
|
|
|
13
13
|
- 影响的是产品/业务语义、已有事实文档,还是实现细节。
|
|
14
14
|
- 是否需要业务确认。
|
|
15
15
|
- 后续处理方式是 `code-only`、`spec-maintenance`、`change-flow`,还是暂停确认。
|
|
16
|
+
- 当前任务是否需要创建或继续维护任务驾驶舱。
|
|
16
17
|
|
|
17
18
|
## 判断步骤
|
|
18
19
|
|
|
@@ -29,6 +30,10 @@ description: 用户要求修 bug、实现或调整功能、改需求、重构、
|
|
|
29
30
|
- 是否只是让代码符合已有 spec。
|
|
30
31
|
- 是否只是把已接受的现有事实补写到文档。
|
|
31
32
|
4. 输出后续处理方式。
|
|
33
|
+
5. 判断任务驾驶舱:
|
|
34
|
+
- 简单、短时、无持续跟踪价值时选择“不需要”。
|
|
35
|
+
- 跨阶段、跨 change、跨服务或团队,存在交叉依赖、长期跟踪或多次用户判断时选择“创建”或“继续维护”。
|
|
36
|
+
- 用户明确要求任务可视化、驾驶舱、整体进度或任务全景时,使用 `task-cockpit` Skill。
|
|
32
37
|
|
|
33
38
|
## 输出格式
|
|
34
39
|
|
|
@@ -40,6 +45,17 @@ description: 用户要求修 bug、实现或调整功能、改需求、重构、
|
|
|
40
45
|
- 是否需要业务确认:
|
|
41
46
|
```
|
|
42
47
|
|
|
48
|
+
任务驾驶舱判断:
|
|
49
|
+
|
|
50
|
+
```text
|
|
51
|
+
- 选择:不需要 / 创建 / 继续维护
|
|
52
|
+
- Task ID:<可确认时填写;尚未确定时明确说明>
|
|
53
|
+
- 路径:<已解析路径;尚未创建或解析时明确说明>
|
|
54
|
+
- 当前状态:<未创建 / 已创建 / 已更新 / 待更新 / 阻塞>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
选择“创建”或“继续维护”时,使用独立 `task-cockpit` Skill 创建或更新驾驶舱,不在本 Skill 中复制 HTML 信息架构和维护手册。
|
|
58
|
+
|
|
43
59
|
如果选择或继续使用 OpenSpec,在同一回复中追加:
|
|
44
60
|
|
|
45
61
|
```text
|
|
@@ -79,6 +95,13 @@ OpenSpec change 状态:
|
|
|
79
95
|
- 一个独立业务目标使用一个 change;多个独立业务目标分别维护。
|
|
80
96
|
- 选择或继续 OpenSpec change-flow 时,在用户可见回复中说明当前 change 状态、进度以及下一步或阻塞原因。
|
|
81
97
|
|
|
98
|
+
## 任务驾驶舱判断
|
|
99
|
+
|
|
100
|
+
- 驾驶舱覆盖整个任务,可以关联多个 OpenSpec change、code-only 工作、外部依赖和已完成阶段,不把当前 `tasks.md` 当作整个任务的唯一边界。
|
|
101
|
+
- 驾驶舱默认位于拥有任务的 Project `openspec/knowledge/task-cockpits/`,由 `task-cockpit` Skill 解析实际 Project、日期前缀文件名和稳定路径,不得在 triage 阶段猜测。
|
|
102
|
+
- 驾驶舱由 Agent 单向维护,用户通过 Agent 对话参与;HTML 中的 checkbox 和状态只读。
|
|
103
|
+
- 驾驶舱首次创建、实质更新、用户询问进度、任务暂停或完成时,Agent 回复应提供可点击入口;没有改变任务认知的短暂中间动作不机械重复链接。
|
|
104
|
+
|
|
82
105
|
## 实现型任务的验证编排
|
|
83
106
|
|
|
84
107
|
为实现型 change 编写或调整 tasks 时,按共享实现区域、验证入口或失败影响面组织有语义的任务组,不按固定任务数量机械分组:
|
|
@@ -98,6 +121,7 @@ OpenSpec change 状态:
|
|
|
98
121
|
- 不能用 `spec-maintenance` 绕过新需求评审。
|
|
99
122
|
- 不能用 `code-only` 掩盖 spec 缺失或业务事实不明。
|
|
100
123
|
- 不能为过去未记录的事实补造虚假 change 历史。
|
|
124
|
+
- 不为简单任务机械创建空洞驾驶舱,也不把驾驶舱当作 OpenSpec change 的翻译。
|
|
101
125
|
- OpenSpec 只记录业务语义,不记录代码风格、工具类、SQL 默认值等工程约定。
|
|
102
126
|
- 不使用未经 OpenSpec CLI 确认的路径、进度或完成状态填充 change 状态摘要。
|
|
103
127
|
- 不把“按任务组集中验证”解释为跳过最终候选完整验证。
|
|
@@ -9,6 +9,15 @@ skills:
|
|
|
9
9
|
state: installed
|
|
10
10
|
runtimes: ["claude-code","codex","cursor","qoder","trae","trae-work","workbuddy"]
|
|
11
11
|
runtimePath: task-triage
|
|
12
|
+
- id: task-cockpit
|
|
13
|
+
source: buildr
|
|
14
|
+
path: buildr/task-cockpit
|
|
15
|
+
description: 为复杂、长期、跨阶段、跨 change、跨服务或团队,或存在交叉依赖和多次用户判断的任务创建、更新和检查只读 HTML 任务驾驶舱;用户明确要求任务可视化、驾驶舱、整体进度、任务全景或长期跟踪时也使用。简单短时任务不机械创建。
|
|
16
|
+
enabled: true
|
|
17
|
+
required: false
|
|
18
|
+
state: installed
|
|
19
|
+
runtimes: ["claude-code","codex","cursor","qoder","trae","trae-work","workbuddy"]
|
|
20
|
+
runtimePath: task-cockpit
|
|
12
21
|
- id: task-worktree
|
|
13
22
|
source: buildr
|
|
14
23
|
path: buildr/task-worktree
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buildr-ai/buildr",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Buildr CLI for managing Agent workspace assets.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -51,7 +51,6 @@
|
|
|
51
51
|
"docs/cli-reference.md",
|
|
52
52
|
"docs/cli-architecture.md",
|
|
53
53
|
"docs/known-limitations.md",
|
|
54
|
-
"examples/minimal-workspace/README.md",
|
|
55
54
|
"package/"
|
|
56
55
|
],
|
|
57
56
|
"scripts": {
|
|
@@ -145,7 +145,7 @@ export function createPackageStaticValidator(deps) {
|
|
|
145
145
|
if (!packageMetadata.keywords?.includes(keyword)) problems.push(`package.json keywords must include ${keyword}.`);
|
|
146
146
|
}
|
|
147
147
|
const packagedFiles = new Set(packageMetadata.files || []);
|
|
148
|
-
for (const required of ['LICENSE', 'tools/buildr', 'tools/cli/', 'tools/shared/fetch-remote-text.mjs', 'docs/cli-reference.md', 'docs/cli-architecture.md', 'docs/known-limitations.md', '
|
|
148
|
+
for (const required of ['LICENSE', 'tools/buildr', 'tools/cli/', 'tools/shared/fetch-remote-text.mjs', 'docs/cli-reference.md', 'docs/cli-architecture.md', 'docs/known-limitations.md', 'package/']) {
|
|
149
149
|
if (!packagedFiles.has(required)) problems.push(`package.json files must include ${required}.`);
|
|
150
150
|
}
|
|
151
151
|
for (const obsolete of ['tools/check-runtime-skills.mjs', 'tools/render-codex.mjs']) {
|
|
@@ -153,7 +153,7 @@ export function createPackageStaticValidator(deps) {
|
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
|
-
for (const required of ['LICENSE', 'docs/cli-reference.md', 'docs/cli-architecture.md', 'docs/known-limitations.md'
|
|
156
|
+
for (const required of ['LICENSE', 'docs/cli-reference.md', 'docs/cli-architecture.md', 'docs/known-limitations.md']) {
|
|
157
157
|
if (!fs.existsSync(path.join(root, required))) problems.push(`Open-source product baseline is missing: ${required}`);
|
|
158
158
|
}
|
|
159
159
|
if (existsFile(path.join(root, 'tools', 'install-buildr-cli'))) {
|
|
@@ -355,6 +355,10 @@ export function createPackageStaticValidator(deps) {
|
|
|
355
355
|
'buildr sync <agent> --target <workspace-root>',
|
|
356
356
|
'手动同步命令作为备选',
|
|
357
357
|
'当前 session 是否重新发现新资产由 Agent runtime 决定',
|
|
358
|
+
'用户要求“更新 Buildr”或“同步 Buildr”时',
|
|
359
|
+
'buildr skill install <agent> --target <dir>',
|
|
360
|
+
'用户要求“更新 workspace”或“同步 workspace”时',
|
|
361
|
+
'用户明确要求“只更新 CLI”时',
|
|
358
362
|
]) {
|
|
359
363
|
if (!skillContent.includes(requiredText)) problems.push(`Buildr Agent Skill must include ${JSON.stringify(requiredText)}.`);
|
|
360
364
|
}
|
|
@@ -618,6 +622,34 @@ export function createPackageStaticValidator(deps) {
|
|
|
618
622
|
}
|
|
619
623
|
if (skillContent.includes('buildr openspec')) problems.push('task-triage source must not hard-code OpenSpec contract guard commands; installed Components contribute them at render time.');
|
|
620
624
|
}
|
|
625
|
+
if (skill.id === 'task-cockpit') {
|
|
626
|
+
for (const requiredText of [
|
|
627
|
+
'openspec/knowledge/task-cockpits/yyyy-MM-dd-<task-id>.html',
|
|
628
|
+
'Agent 单向维护',
|
|
629
|
+
'不是 OpenSpec change 的翻译',
|
|
630
|
+
'首页',
|
|
631
|
+
'推进',
|
|
632
|
+
'方案',
|
|
633
|
+
'技术细节',
|
|
634
|
+
'不猜测百分比',
|
|
635
|
+
'可点击入口',
|
|
636
|
+
'assets/task-cockpit-template.html',
|
|
637
|
+
]) {
|
|
638
|
+
if (!skillContent.includes(requiredText)) problems.push(`task-cockpit Skill must include ${JSON.stringify(requiredText)}.`);
|
|
639
|
+
}
|
|
640
|
+
const templatePath = path.join(skillDir, 'assets', 'task-cockpit-template.html');
|
|
641
|
+
const metadataPath = path.join(skillDir, 'agents', 'openai.yaml');
|
|
642
|
+
if (!existsFile(templatePath)) {
|
|
643
|
+
problems.push('task-cockpit Skill must include assets/task-cockpit-template.html.');
|
|
644
|
+
} else {
|
|
645
|
+
const templateContent = fs.readFileSync(templatePath, 'utf8');
|
|
646
|
+
for (const requiredText of ['id="cockpit-data"', 'data-tab="overview"', 'data-tab="progress"', 'data-tab="solution"', 'data-tab="technical"', '由 Agent 单向维护 · 页面只读']) {
|
|
647
|
+
if (!templateContent.includes(requiredText)) problems.push(`task-cockpit template must include ${JSON.stringify(requiredText)}.`);
|
|
648
|
+
}
|
|
649
|
+
if (/https?:\/\//.test(templateContent)) problems.push('task-cockpit template must not depend on external HTTP resources.');
|
|
650
|
+
}
|
|
651
|
+
if (!existsFile(metadataPath)) problems.push('task-cockpit Skill must include agents/openai.yaml.');
|
|
652
|
+
}
|
|
621
653
|
if (skill.id === 'openspec-contract-guard') {
|
|
622
654
|
for (const requiredText of ['buildr openspec baseline create', '--stage pre-sync', '--stage post-sync', '不修改外部 `openspec-*` Skills']) {
|
|
623
655
|
if (!skillContent.includes(requiredText)) problems.push(`openspec-contract-guard Skill must include ${JSON.stringify(requiredText)}.`);
|
|
@@ -632,6 +664,9 @@ export function createPackageStaticValidator(deps) {
|
|
|
632
664
|
if (!manifest.builtins.skills.some((skill) => skill.id === 'task-finish' && skill.required === false)) {
|
|
633
665
|
problems.push('builtins.skills must declare optional task-finish.');
|
|
634
666
|
}
|
|
667
|
+
if (!manifest.builtins.skills.some((skill) => skill.id === 'task-cockpit' && skill.required === false)) {
|
|
668
|
+
problems.push('builtins.skills must declare optional task-cockpit.');
|
|
669
|
+
}
|
|
635
670
|
|
|
636
671
|
for (const command of manifest.builtins.commands) {
|
|
637
672
|
validateLegacyIntegrities(command, `builtins.commands.${command.id || '<missing>'}`);
|
|
@@ -674,6 +709,10 @@ export function createPackageStaticValidator(deps) {
|
|
|
674
709
|
if (!taskFinish || taskFinish.source !== 'buildr' || taskFinish.state !== 'installed' || taskFinish.enabled !== true) {
|
|
675
710
|
problems.push('Workspace skills baseline must declare enabled installed Buildr task-finish.');
|
|
676
711
|
}
|
|
712
|
+
const taskCockpit = baselineSkills.find((entry) => entry.id === 'task-cockpit');
|
|
713
|
+
if (!taskCockpit || taskCockpit.source !== 'buildr' || taskCockpit.state !== 'installed' || taskCockpit.enabled !== true) {
|
|
714
|
+
problems.push('Workspace skills baseline must declare enabled installed Buildr task-cockpit.');
|
|
715
|
+
}
|
|
677
716
|
const gitOps = baselineSkills.find((entry) => entry.id === 'git-ops');
|
|
678
717
|
for (const routedIntent of ['pull', 'checkout', 'switch', 'reset', 'cherry-pick', 'revert', 'stash']) {
|
|
679
718
|
if (!gitOps?.description?.includes(routedIntent)) problems.push(`Workspace git-ops description must route ${routedIntent}.`);
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { spawnSync } from 'node:child_process';
|
|
4
|
+
import process from 'node:process';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
|
|
7
|
+
function fail(message, details = {}) {
|
|
8
|
+
const error = new Error(message);
|
|
9
|
+
error.details = details;
|
|
10
|
+
throw error;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function git(repo, args, { allowFailure = false } = {}) {
|
|
14
|
+
const result = spawnSync('git', args, { cwd: repo, encoding: 'utf8' });
|
|
15
|
+
if (!allowFailure && result.status !== 0) {
|
|
16
|
+
fail(`git ${args.join(' ')} failed`, {
|
|
17
|
+
exitCode: result.status,
|
|
18
|
+
stdout: result.stdout.trim(),
|
|
19
|
+
stderr: result.stderr.trim(),
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function parseArgs(argv) {
|
|
26
|
+
const options = { remote: 'origin', main: 'main', dev: 'dev' };
|
|
27
|
+
for (let index = 0; index < argv.length; index += 2) {
|
|
28
|
+
const key = argv[index];
|
|
29
|
+
const value = argv[index + 1];
|
|
30
|
+
if (!key?.startsWith('--') || value === undefined) fail(`Invalid argument: ${key || '<missing>'}`);
|
|
31
|
+
options[key.slice(2)] = value;
|
|
32
|
+
}
|
|
33
|
+
if (!options.repo) fail('Missing required --repo');
|
|
34
|
+
if (!options['candidate-tree']) fail('Missing required --candidate-tree');
|
|
35
|
+
return { ...options, candidateTree: options['candidate-tree'] };
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function rev(repo, ref) {
|
|
39
|
+
return git(repo, ['rev-parse', ref]).stdout.trim();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function remoteRefs(repo, remote, main, dev) {
|
|
43
|
+
const result = git(repo, ['ls-remote', remote, `refs/heads/${main}`, `refs/heads/${dev}`]);
|
|
44
|
+
const refs = new Map(result.stdout.trim().split('\n').filter(Boolean).map((line) => {
|
|
45
|
+
const [sha, ref] = line.split(/\s+/);
|
|
46
|
+
return [ref, sha];
|
|
47
|
+
}));
|
|
48
|
+
return {
|
|
49
|
+
main: refs.get(`refs/heads/${main}`),
|
|
50
|
+
dev: refs.get(`refs/heads/${dev}`),
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function assertExpected(label, actual, expected) {
|
|
55
|
+
if (actual !== expected) fail(`${label} does not match the verified candidate tree`, {
|
|
56
|
+
label, actual, expected,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function bridgeMainToDev(options) {
|
|
61
|
+
const {
|
|
62
|
+
repo, remote = 'origin', main = 'main', dev = 'dev', candidateTree, beforeRemoteRecheck,
|
|
63
|
+
} = options;
|
|
64
|
+
const root = rev(repo, '--show-toplevel');
|
|
65
|
+
const status = git(root, ['status', '--porcelain']).stdout.trim();
|
|
66
|
+
if (status) fail('Release history bridge requires a clean worktree', { status });
|
|
67
|
+
|
|
68
|
+
git(root, ['fetch', remote, main, dev]);
|
|
69
|
+
const mainRef = `${remote}/${main}`;
|
|
70
|
+
const devRef = `${remote}/${dev}`;
|
|
71
|
+
const fetched = {
|
|
72
|
+
main: rev(root, mainRef),
|
|
73
|
+
dev: rev(root, devRef),
|
|
74
|
+
};
|
|
75
|
+
const trees = {
|
|
76
|
+
main: rev(root, `${mainRef}^{tree}`),
|
|
77
|
+
dev: rev(root, `${devRef}^{tree}`),
|
|
78
|
+
};
|
|
79
|
+
assertExpected(mainRef, trees.main, candidateTree);
|
|
80
|
+
assertExpected(devRef, trees.dev, candidateTree);
|
|
81
|
+
|
|
82
|
+
const ancestor = git(root, ['merge-base', '--is-ancestor', mainRef, devRef], { allowFailure: true });
|
|
83
|
+
if (ancestor.status === 0) {
|
|
84
|
+
return {
|
|
85
|
+
schemaVersion: 'buildr.release-history-bridge/v1',
|
|
86
|
+
ok: true,
|
|
87
|
+
action: 'already-bridged',
|
|
88
|
+
candidateTree,
|
|
89
|
+
refs: fetched,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
if (ancestor.status !== 1) fail('Unable to determine main/dev ancestry', { stderr: ancestor.stderr.trim() });
|
|
93
|
+
|
|
94
|
+
const branch = git(root, ['branch', '--show-current']).stdout.trim();
|
|
95
|
+
if (branch !== dev) fail(`Release history bridge must run with local ${dev} checked out`, { branch });
|
|
96
|
+
const localDev = rev(root, `refs/heads/${dev}`);
|
|
97
|
+
if (localDev !== fetched.dev) fail(`Local ${dev} does not match ${devRef}`, { localDev, remoteDev: fetched.dev });
|
|
98
|
+
|
|
99
|
+
beforeRemoteRecheck?.({ root, fetched });
|
|
100
|
+
const liveBeforeMerge = remoteRefs(root, remote, main, dev);
|
|
101
|
+
if (liveBeforeMerge.main !== fetched.main || liveBeforeMerge.dev !== fetched.dev) {
|
|
102
|
+
fail('Remote refs changed after the tree-identity gate', { fetched, actual: liveBeforeMerge });
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
git(root, ['merge', '-s', 'ours', '--no-ff', mainRef, '-m', `chore(git): 衔接 ${main} squash 历史`]);
|
|
106
|
+
const bridgedTree = rev(root, 'HEAD^{tree}');
|
|
107
|
+
assertExpected('bridged HEAD', bridgedTree, candidateTree);
|
|
108
|
+
|
|
109
|
+
const push = git(root, ['push', remote, `refs/heads/${dev}:refs/heads/${dev}`], { allowFailure: true });
|
|
110
|
+
if (push.status !== 0) fail(`Push of ${dev} history bridge was rejected`, {
|
|
111
|
+
exitCode: push.status,
|
|
112
|
+
stdout: push.stdout.trim(),
|
|
113
|
+
stderr: push.stderr.trim(),
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
const remoteAfterPush = remoteRefs(root, remote, main, dev);
|
|
117
|
+
const head = rev(root, 'HEAD');
|
|
118
|
+
if (remoteAfterPush.dev !== head) fail(`Remote ${dev} does not contain the history bridge`, {
|
|
119
|
+
expected: head,
|
|
120
|
+
actual: remoteAfterPush.dev,
|
|
121
|
+
});
|
|
122
|
+
return {
|
|
123
|
+
schemaVersion: 'buildr.release-history-bridge/v1',
|
|
124
|
+
ok: true,
|
|
125
|
+
action: 'bridged',
|
|
126
|
+
candidateTree,
|
|
127
|
+
commit: head,
|
|
128
|
+
refs: remoteAfterPush,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
133
|
+
try {
|
|
134
|
+
console.log(JSON.stringify(bridgeMainToDev(parseArgs(process.argv.slice(2))), null, 2));
|
|
135
|
+
} catch (error) {
|
|
136
|
+
console.error(JSON.stringify({
|
|
137
|
+
schemaVersion: 'buildr.release-history-bridge/v1',
|
|
138
|
+
ok: false,
|
|
139
|
+
error: error.message,
|
|
140
|
+
details: error.details || {},
|
|
141
|
+
}, null, 2));
|
|
142
|
+
process.exitCode = 1;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
@@ -75,8 +75,8 @@ function buildAdapterRuntimeContext(skill) {
|
|
|
75
75
|
? `${adapter.displayName} 原生读取 scope \`AGENTS.md\``
|
|
76
76
|
: `${adapter.displayName} 使用 ${adapter.renderCapabilities['rules-entry'].projection.targetPattern} Rule bridge`;
|
|
77
77
|
const maintenanceCommands = adapter.renderCapabilities['rules-entry'].writesFiles
|
|
78
|
-
? [commands.installProductSkill, commands.runtimeCheckScope.replace('<workspace-relative-path>', '<scope>'), commands.renderRulesScope, commands.renderSkillsScope, commands.syncWorkspaceEntry]
|
|
79
|
-
: [commands.syncWorkspaceEntry];
|
|
78
|
+
? ['buildr update', commands.installProductSkill, commands.runtimeCheckScope.replace('<workspace-relative-path>', '<scope>'), commands.renderRulesScope, commands.renderSkillsScope, commands.syncWorkspaceEntry]
|
|
79
|
+
: ['buildr update', commands.installProductSkill, commands.syncWorkspaceEntry];
|
|
80
80
|
return [
|
|
81
81
|
'## 当前 Agent Adapter',
|
|
82
82
|
'',
|
|
@@ -90,8 +90,8 @@ function buildAdapterRuntimeContext(skill) {
|
|
|
90
90
|
'```',
|
|
91
91
|
'',
|
|
92
92
|
adapter.renderCapabilities['rules-entry'].writesFiles
|
|
93
|
-
? 'doctor 指向具体 runtime
|
|
94
|
-
: '
|
|
93
|
+
? '用户要求更新或同步 Buildr 时依次运行 update 与 Skill install;更新或同步 workspace 时只运行 sync。doctor 指向具体 runtime 问题后,再使用其余专项维护命令:'
|
|
94
|
+
: '用户要求更新或同步 Buildr 时依次运行 update 与 Skill install;更新或同步 workspace 时只运行 sync:',
|
|
95
95
|
'',
|
|
96
96
|
'```bash',
|
|
97
97
|
...maintenanceCommands,
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# Minimal Buildr Workspace
|
|
2
|
-
|
|
3
|
-
这个示例展示从 CLI 可用到 Agent runtime 可用的最小路径,不保存生成后的 runtime 文件。
|
|
4
|
-
|
|
5
|
-
先用 `buildr runtime list --json` 选择当前 Agent 对应的 adapter id(`claude-code`、`codex`、`cursor`、`qoder`、`trae`、`trae-work` 或 `workbuddy`):
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
mkdir buildr-demo
|
|
9
|
-
cd buildr-demo
|
|
10
|
-
buildr runtime list --json
|
|
11
|
-
buildr init --agent <agent> --target . --name buildr-demo --profile personal
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
该命令已包含完整 sync 和最终 doctor;已有 workspace 后续更新时再使用 `buildr sync <agent> --target .`。
|
|
15
|
-
|
|
16
|
-
随后可以创建 Project 并接入 Service:
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
buildr project create shop --target . --title "Shop" --description "示例业务项目"
|
|
20
|
-
buildr service create shop/api <git-url> --branch main --target . --type backend
|
|
21
|
-
buildr doctor --agent <agent> --target . --json
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
长期事实写入 `AGENTS.md`、`rules/`、`skills/`、`commands/`、`components/` 和 `projects/`;各 Agent 的接入路径见 [Agent Runtime Adapters](../../docs/agent-runtime-adapters.md),生成目标都是可重建 runtime。
|