@jspg-ai/coding-bb 0.0.1 → 0.0.2-beta.23

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.
Files changed (145) hide show
  1. package/cbb/bin/cbb.js +6 -0
  2. package/cbb/bin/cbbm.js +6 -0
  3. package/cbb/dev-standards/rules/cbb-ai-behavior.md +103 -103
  4. package/cbb/dev-standards/rules/cbb-priority.md +55 -55
  5. package/cbb/lib/install/claude-code.js +2 -0
  6. package/cbb/lib/install/init.js +496 -290
  7. package/cbb/lib/install/opencode.js +31 -0
  8. package/cbb/lib/install/qoder.js +2 -0
  9. package/cbb/lib/install/workspaces.js +53 -13
  10. package/cbb/lib/openspec/index.js +3 -3
  11. package/cbb/lib/superpowers/index.js +1 -1
  12. package/cbb/lib/utils/check-update.js +16 -14
  13. package/cbb/lib/utils/gitignore.js +2 -1
  14. package/cbb/lib/utils/output.js +92 -4
  15. package/cbb/lib/utils/version.js +2 -31
  16. package/cbb/lib/wiki/cli.js +25 -25
  17. package/cbb/lib/wiki/index.js +16 -16
  18. package/cbb/tools/cbb-design-to-wiki/SKILL.md +14 -14
  19. package/cbb/tools/cbb-wiki-ops/SKILL.md +22 -22
  20. package/cbb/worktrees/_shared/scripts/find-target-worktree.js +2 -2
  21. package/cbb/worktrees/_shared/scripts/find-workspace-root.js +7 -7
  22. package/cbb/worktrees/_shared/scripts/push-core.js +18 -0
  23. package/cbb/worktrees/commands/{close.md → worktree-close.md} +8 -8
  24. package/cbb/worktrees/commands/{init.md → worktree-init.md} +9 -9
  25. package/cbb/worktrees/commands/{push.md → worktree-push.md} +3 -3
  26. package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-close}/SKILL.md +20 -20
  27. package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-close}/scripts/check-env.js +4 -4
  28. package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-close}/scripts/check-unarchived.js +1 -1
  29. package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-close}/scripts/delete-branches.js +3 -3
  30. package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-close}/scripts/discover-apps.js +6 -6
  31. package/cbb/worktrees/skills/{openspec-extend-worktree → cbb-worktree-close}/scripts/find-target-worktree.js +2 -2
  32. package/cbb/worktrees/skills/{openspec-push-worktrees → cbb-worktree-close}/scripts/find-workspace-root.js +7 -7
  33. package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-close}/scripts/remove-worktrees.js +4 -4
  34. package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-close}/scripts/safety-check.js +4 -4
  35. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/SKILL.md +81 -107
  36. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/auto-open.js +1 -1
  37. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/check-env-deep.js +4 -4
  38. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/check-env.js +6 -6
  39. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/check-repos.js +4 -4
  40. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/create-branches.js +4 -4
  41. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/create-worktrees.js +8 -7
  42. package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-init}/scripts/find-workspace-root.js +7 -7
  43. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/install-ai.js +33 -33
  44. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/parse-config.js +7 -7
  45. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/push-branches.js +9 -7
  46. package/cbb/worktrees/skills/{openspec-extend-worktree → cbb-worktree-init}/scripts/push-core.js +18 -0
  47. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/sync-repos.js +10 -12
  48. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/update-gitignore.js +19 -6
  49. package/cbb/worktrees/skills/{openspec-push-worktrees → cbb-worktree-push}/SKILL.md +16 -16
  50. package/cbb/worktrees/skills/{openspec-push-worktrees → cbb-worktree-push}/scripts/commit-worktrees.js +2 -2
  51. package/cbb/worktrees/skills/{openspec-push-worktrees → cbb-worktree-push}/scripts/find-target-worktree.js +2 -2
  52. package/cbb/worktrees/skills/{openspec-extend-worktree → cbb-worktree-push}/scripts/find-workspace-root.js +7 -7
  53. package/cbb/worktrees/skills/{openspec-push-worktrees → cbb-worktree-push}/scripts/push-core.js +18 -0
  54. package/cbb/worktrees/skills/{openspec-push-worktrees → cbb-worktree-push}/scripts/push-worktrees.js +7 -5
  55. package/config/workspace-config.sample.json +18 -0
  56. package/config/workspaces.json +11 -6
  57. package/openspec/.version +6 -6
  58. package/openspec/commands/apply.md +7 -7
  59. package/openspec/commands/archive.md +7 -7
  60. package/openspec/commands/bulk-archive.md +7 -7
  61. package/openspec/commands/continue.md +7 -7
  62. package/openspec/commands/explore.md +7 -7
  63. package/openspec/commands/ff.md +7 -7
  64. package/openspec/commands/new.md +7 -7
  65. package/openspec/commands/onboard.md +7 -7
  66. package/openspec/commands/propose.md +7 -7
  67. package/openspec/commands/sync.md +7 -7
  68. package/openspec/commands/update.md +7 -7
  69. package/openspec/commands/verify.md +7 -7
  70. package/openspec/skills/openspec-apply-change/SKILL.md +187 -187
  71. package/openspec/skills/openspec-archive-change/SKILL.md +181 -181
  72. package/openspec/skills/openspec-bulk-archive-change/SKILL.md +338 -338
  73. package/openspec/skills/openspec-continue-change/SKILL.md +117 -117
  74. package/openspec/skills/openspec-explore/SKILL.md +342 -342
  75. package/openspec/skills/openspec-ff-change/SKILL.md +116 -116
  76. package/openspec/skills/openspec-new-change/SKILL.md +76 -76
  77. package/openspec/skills/openspec-onboard/SKILL.md +560 -560
  78. package/openspec/skills/openspec-propose/SKILL.md +162 -162
  79. package/openspec/skills/openspec-sync-specs/SKILL.md +261 -261
  80. package/openspec/skills/openspec-update-change/SKILL.md +90 -90
  81. package/openspec/skills/openspec-verify-change/SKILL.md +174 -174
  82. package/package.json +4 -3
  83. package/superpowers/.version +6 -6
  84. package/superpowers/skills/brainstorming/SKILL.md +250 -250
  85. package/superpowers/skills/brainstorming/scripts/helper.js +167 -167
  86. package/superpowers/skills/brainstorming/scripts/start-server.sh +209 -209
  87. package/superpowers/skills/brainstorming/scripts/stop-server.sh +120 -120
  88. package/superpowers/skills/brainstorming/spec-document-reviewer-prompt.md +49 -49
  89. package/superpowers/skills/brainstorming/visual-companion.md +299 -299
  90. package/superpowers/skills/dispatching-parallel-agents/SKILL.md +167 -167
  91. package/superpowers/skills/executing-plans/SKILL.md +64 -64
  92. package/superpowers/skills/finishing-a-development-branch/SKILL.md +225 -225
  93. package/superpowers/skills/receiving-code-review/SKILL.md +205 -205
  94. package/superpowers/skills/requesting-code-review/SKILL.md +95 -95
  95. package/superpowers/skills/requesting-code-review/code-reviewer.md +181 -181
  96. package/superpowers/skills/subagent-driven-development/SKILL.md +568 -568
  97. package/superpowers/skills/subagent-driven-development/implementer-prompt.md +154 -154
  98. package/superpowers/skills/subagent-driven-development/re-review-prompt.md +115 -115
  99. package/superpowers/skills/subagent-driven-development/task-reviewer-prompt.md +207 -207
  100. package/superpowers/skills/systematic-debugging/CREATION-LOG.md +119 -119
  101. package/superpowers/skills/systematic-debugging/SKILL.md +283 -283
  102. package/superpowers/skills/systematic-debugging/condition-based-waiting-example.ts +158 -158
  103. package/superpowers/skills/systematic-debugging/condition-based-waiting.md +115 -115
  104. package/superpowers/skills/systematic-debugging/defense-in-depth.md +122 -122
  105. package/superpowers/skills/systematic-debugging/find-polluter.sh +72 -72
  106. package/superpowers/skills/systematic-debugging/root-cause-tracing.md +169 -169
  107. package/superpowers/skills/systematic-debugging/test-academic.md +14 -14
  108. package/superpowers/skills/systematic-debugging/test-pressure-1.md +58 -58
  109. package/superpowers/skills/systematic-debugging/test-pressure-2.md +68 -68
  110. package/superpowers/skills/systematic-debugging/test-pressure-3.md +69 -69
  111. package/superpowers/skills/test-driven-development/SKILL.md +320 -320
  112. package/superpowers/skills/test-driven-development/writing-good-tests.md +198 -198
  113. package/superpowers/skills/using-git-worktrees/SKILL.md +167 -167
  114. package/superpowers/skills/using-superpowers/SKILL.md +63 -63
  115. package/superpowers/skills/using-superpowers/references/antigravity-tools.md +23 -23
  116. package/superpowers/skills/using-superpowers/references/codex-tools.md +108 -108
  117. package/superpowers/skills/using-superpowers/references/gemini-tools.md +63 -63
  118. package/superpowers/skills/using-superpowers/references/hermes-tools.md +56 -56
  119. package/superpowers/skills/using-superpowers/references/pi-tools.md +16 -16
  120. package/superpowers/skills/verification-before-completion/SKILL.md +120 -120
  121. package/superpowers/skills/writing-plans/SKILL.md +171 -171
  122. package/superpowers/skills/writing-plans/plan-document-reviewer-prompt.md +49 -49
  123. package/superpowers/skills/writing-skills/SKILL.md +679 -679
  124. package/superpowers/skills/writing-skills/anthropic-best-practices.md +1150 -1150
  125. package/superpowers/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -189
  126. package/superpowers/skills/writing-skills/persuasion-principles.md +187 -187
  127. package/superpowers/skills/writing-skills/render-graphs.js +169 -169
  128. package/superpowers/skills/writing-skills/testing-skills-with-subagents.md +384 -384
  129. package/cbb/worktrees/commands/extend.md +0 -65
  130. package/cbb/worktrees/skills/openspec-close-worktree/scripts/find-target-worktree.js +0 -96
  131. package/cbb/worktrees/skills/openspec-extend-worktree/SKILL.md +0 -390
  132. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/check-env.js +0 -95
  133. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/check-repos.js +0 -98
  134. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/create-branches-and-worktrees.js +0 -135
  135. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/install-ai.js +0 -150
  136. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/list-available-apps.js +0 -88
  137. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/sync-repos.js +0 -93
  138. package/cbb/worktrees/skills/openspec-init-worktree/scripts/find-workspace-root.js +0 -67
  139. package/cbb/worktrees/skills/openspec-init-worktree/scripts/generate-app-options.js +0 -93
  140. package/cbb/worktrees/skills/openspec-init-worktree/scripts/push-core.js +0 -136
  141. package/cbb/worktrees/skills/openspec-push-worktrees/scripts/silence-popup.js +0 -23
  142. package/config/config.sample.json +0 -16
  143. /package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-close}/scripts/silence-popup.js +0 -0
  144. /package/cbb/worktrees/skills/{openspec-extend-worktree → cbb-worktree-init}/scripts/silence-popup.js +0 -0
  145. /package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-push}/scripts/silence-popup.js +0 -0
@@ -1,65 +0,0 @@
1
- ---
2
- name: "OPSX: Extend"
3
- description: 为已存在的 worktree(init-worktree 创建的工作空间)补加关联应用,添加嵌套 worktree,不影响现有开发
4
- category: Workflow
5
- tags: [worktree, extend, worktree, git-worktree, add-app]
6
- ---
7
-
8
- # OPSX: Extend - 补加应用到现有 Worktree
9
-
10
- ## 重要:第一步必须用 Read 工具直接打开 SKILL.md
11
-
12
- **禁止**用 `ls` / `find` / `cat` / `head` / `grep` 等 bash 命令搜索 SKILL.md。这些命令在 Qoder Windows PowerShell 沙箱中经常失败。
13
-
14
- **直接路径**:
15
- - Qoder 适配器:`.qoder/skills/openspec-extend-worktree/SKILL.md`
16
- - Claude Code 适配器:`.claude/skills/openspec-extend-worktree/SKILL.md`
17
-
18
- **第一步**:
19
- 1. 用 Read 工具直接打开 SKILL.md
20
- 2. 按 SKILL.md 的 Step 0 → 1 → 2 → 3 → 4 → 5 顺序执行
21
- 3. 每次调用 Node.js 脚本时使用**绝对路径**
22
-
23
- ## Input
24
-
25
- 无必需参数。
26
-
27
- - 未指定时自动识别目标 worktree:cwd 在 worktree 内则反推需求名;唯一 worktree 时自动选用;多个时按 SKILL.md Step 0.2 在对话中提问
28
- - 也可在斜杠命令后直接传 `<需求名>`(kebab-case),与已有 worktree 匹配则使用
29
-
30
- **Steps 概述**(完整流程见 SKILL.md)
31
-
32
- 1. Step 0:前置校验(向上查找 CONFIG.json + cwd 反推需求名 + 校验目标 worktree 存在)
33
- 2. Step 1:选择要补加的应用(CONFIG.json 减去已关联 → AskUserQuestion multiSelect)
34
- 3. Step 2:状态检查(仅对新增应用,workspace 跳过)
35
- 4. Step 3:创建分支 + 嵌套 worktree(仅对新增应用,分支已存在则复用)
36
- 5. Step 4:在新增 worktree 中执行 `cbb init -y`(`.cbb/.managed-by-cbb` 判重)
37
- 6. Step 5:报告扩展前后对比(**不切 IDE 窗口**,用户留在原 worktree)
38
-
39
- **Output**
40
-
41
- ```
42
- ✅ worktree 已扩展
43
- 目标 worktree: <需求名>
44
- 工作空间根: <WS_ROOT>
45
- 当前目录: <cwd>
46
- 补加应用:
47
- - ep-user-info-server → .worktrees/<需求名>/ep-user-info-server
48
- - ep-user-web → .worktrees/<需求名>/ep-user-web
49
- AI 配置: ✅ 已安装(新建)/ 跳过(已存在)
50
- 已存在的关联应用(本次未变):
51
- - ep-user-auth-app
52
- ```
53
-
54
- 详细输出格式与失败回滚命令,见 SKILL.md「最终报告」与「常见错误」段。
55
-
56
- **Guardrails**
57
-
58
- - **目标 worktree 必须已存在**(`.worktrees/<需求名>/` 必须存在),否则提示用 init-worktree
59
- - **不重建、修改、删除任何已存在的 worktree**——只增量添加
60
- - 嵌套 worktree 路径与 init-worktree 完全一致:`.worktrees/<需求名>/<应用名>/`
61
- - 分支名与 init-worktree 一致:`<需求名>`(不加前缀)
62
- - 仅对待补加应用执行状态检查、clone/fetch、创建分支、worktree add
63
- - **不切 IDE 窗口**——用户在原 worktree 继续开发,扩展的工作是嵌套子目录
64
- - 自由文本输入(需求名、应用 URL)禁止使用 `AskUserQuestion`,仅在固定选项场景(应用多选)使用
65
- - 必须单次 Bash 调用合并 `cd "..." && ...`,不依赖跨调用的 cwd
@@ -1,96 +0,0 @@
1
- require('./silence-popup');
2
- /**
3
- * openspec-shared 目标需求名识别
4
- *
5
- * 唯一真源:cbb/worktrees/_shared/scripts/find-target-worktree.js
6
- * 由 scripts/sync-shared.js 展开到各 skill 的 scripts/ 下(extend / close / push)。
7
- *
8
- * 用法:node find-target-worktree.js <ws_root>
9
- *
10
- * 优先级:
11
- * 1. cwd 在 .worktrees/worktree-xxx/ 内 → 自动从路径反推
12
- * 2. .worktrees/ 下只有一个 worktree → 自动选用
13
- * 3. 多个 worktree → 按 mtime 倒序,第一个为推荐
14
- *
15
- * 输出:
16
- * 末行输出需求名(用于 AI agent 解析)
17
- * 多个时按 [1] xxx ⭐ / [2] yyy 列出
18
- *
19
- * 退出码:
20
- * 0 - 唯一识别(自动或唯一)
21
- * 1 - 多个 worktree,需用户输入
22
- * 2 - 无 worktree
23
- */
24
-
25
- const { execSync } = require('child_process');
26
- const fs = require('fs');
27
- const path = require('path');
28
-
29
- const wsRoot = process.argv[2];
30
-
31
- if (!wsRoot) {
32
- console.error('❌ 用法:node find-target-worktree.js <ws_root>');
33
- process.exit(1);
34
- }
35
-
36
- // 优先级 1:cwd 反推
37
- const cwd = process.cwd();
38
- const cwdMatch = cwd.match(/\.worktrees[\\\/]worktree-([^\\\/]+)/);
39
- if (cwdMatch) {
40
- const branch = cwdMatch[1];
41
- console.log('✅ 从 cwd 反推需求名:' + branch);
42
- console.log('---');
43
- console.log(branch);
44
- process.exit(0);
45
- }
46
-
47
- const worktreesDir = path.join(wsRoot, '.worktrees');
48
- if (!fs.existsSync(worktreesDir)) {
49
- console.error('❌ .worktrees 目录不存在:' + worktreesDir);
50
- console.error(' 请先执行 openspec-init-worktree 创建 worktree');
51
- console.log('---');
52
- console.log('NO_WORKTREE');
53
- process.exit(2);
54
- }
55
-
56
- // 列出所有 worktree-xxx 目录
57
- const entries = fs.readdirSync(worktreesDir, { withFileTypes: true })
58
- .filter(e => e.isDirectory() && e.name.startsWith('worktree-'))
59
- .map(e => ({
60
- name: e.name.substring('worktree-'.length),
61
- fullName: e.name,
62
- path: path.join(worktreesDir, e.name),
63
- mtime: fs.statSync(path.join(worktreesDir, e.name)).mtime.getTime(),
64
- }));
65
-
66
- if (entries.length === 0) {
67
- console.error('❌ 未找到任何 worktree');
68
- console.error(' 请先执行 openspec-init-worktree 创建 worktree');
69
- console.log('---');
70
- console.log('NO_WORKTREE');
71
- process.exit(2);
72
- }
73
-
74
- // 优先级 2:唯一
75
- if (entries.length === 1) {
76
- console.log('✅ 自动选用唯一 worktree:' + entries[0].name);
77
- console.log('---');
78
- console.log(entries[0].name);
79
- process.exit(0);
80
- }
81
-
82
- // 优先级 3:多个 → 按 mtime 倒序
83
- entries.sort((a, b) => b.mtime - a.mtime);
84
-
85
- console.log('⚠️ 检测到 ' + entries.length + ' 个 worktree(按最近修改排序):');
86
- entries.forEach((e, i) => {
87
- if (i === 0) {
88
- console.log(' [' + (i + 1) + '] ' + e.name + ' ⭐ (推荐:最近修改)');
89
- } else {
90
- console.log(' [' + (i + 1) + '] ' + e.name);
91
- }
92
- });
93
- console.log('请在对话中输入序号(1/2/3)或完整分支名:');
94
- console.log('---');
95
- console.log('MULTIPLE_WORKTREEES');
96
- process.exit(1);
@@ -1,390 +0,0 @@
1
- ---
2
- name: openspec-extend-worktree
3
- description: "为已有 worktree 补加关联应用:创建新分支、嵌套 worktree,不重建已有 worktree。触发:用户明确说补加应用/漏选了/加新应用。禁止在 openspec-init-worktree 执行后自动调用——只有用户主动要求补加时才触发。"
4
- license: MIT
5
- compatibility: Requires git (>=2.30) and Node.js (>=16.7.0). All commands are pure Node.js scripts under `scripts/`, fully cross-platform (Windows / macOS / Linux, bash / PowerShell / Git Bash).
6
- metadata:
7
- author: Contributors
8
- version: "2.0"
9
- generatedBy: coding-bb
10
- ---
11
-
12
- # Extend Worktree(跨平台脚本化版本 v2.0)
13
-
14
- 为已存在的 worktree(由 `openspec-init-worktree` 创建)补加关联应用:在工作空间根目录和各 app 仓库中创建/复用同名需求分支,在 `.worktrees/worktree-<需求名>/` 下添加嵌套 worktree,并安装 AI 配置。当你已经在某个 worktree 内开发中途发现漏选了某个应用、或者想引入一个之前未关联的依赖应用时,本技能**不重建已有 worktree**,只增量添加。
15
-
16
- **启动时声明:** "我正在使用 openspec-extend-worktree 技能来补加应用到已有的多仓库联动 worktree。"
17
-
18
- ## 核心原则
19
-
20
- - 本技能的所有原子操作封装为 `scripts/*.js` Node.js 脚本,**跨平台执行**
21
- - **本技能不会重建、修改、删除任何已存在的 worktree**——只增量添加新 worktree,已开发的工作不受影响
22
- - 使用 `git worktree add` 创建新 worktree,物理位置与 init-worktree 完全一致(`.worktrees/worktree-<需求名>/<应用名>/`)
23
- - 所有仓库使用统一的分支名(不加前缀);worktree 目录名自动加 `worktree-` 前缀
24
- - **目标 worktree 必须已存在**(即 `.worktrees/worktree-<需求名>/` 必须已存在);不存在则终止并提示用 init-worktree
25
- - 输入约定:**自由文本**(需求名、应用仓库 URL 等)直接在对话中提问并等待回复,禁止使用 `AskUserQuestion`;**固定列表多选**(如应用选择)使用 `AskUserQuestion`(`multiSelect: true`),按 side 分组排列选项
26
-
27
- ---
28
-
29
- ## Step 0:前置校验与执行位置确认
30
-
31
- 本技能支持**两层执行位置**(与 `openspec-close-worktree` 对称):
32
-
33
- | 执行位置 | cwd 形态 | 需求名识别方式 |
34
- |---|---|---|
35
- | 工作空间根目录 | `WS_ROOT/` | 列 `.worktrees/` 下所有 worktree,唯一时自动选用,多个时按 mtime 倒序并提示 |
36
- | worktree 内部 | `WS_ROOT/.worktrees/worktree-<需求名>/` 或其子目录 | **自动从 cwd 路径反推** |
37
-
38
- ### 0.1 环境健康探活
39
-
40
- ```bash
41
- node "D:/workspace/<ws_root>/.qoder/skills/openspec-extend-worktree/scripts/check-env.js
42
- "
43
- ```
44
-
45
- **解读输出**:
46
- - 退出码 0 + 末行 `ENV_OK {...}` → 探活通过,继续
47
- - 退出码 1 → git 不可用,**终止流程**
48
- - 退出码 2 → 当前不在 git 仓库,**终止流程**
49
-
50
- ### 0.2 定位工作空间根目录
51
-
52
- ```bash
53
- node "D:/workspace/<ws_root>/.qoder/skills/openspec-extend-worktree/scripts/find-workspace-root.js
54
- "
55
- ```
56
-
57
- **解读输出**:
58
- - 退出码 0 + 末行(纯路径) → WS_ROOT 绝对路径,AI agent 解析后用于后续命令的 `<ws_root>` 占位符
59
- - 退出码 1 → 未找到工作空间根目录,**终止流程**
60
-
61
- > ⓘ **为什么不用 CONFIG.json 存在性判断**:init-worktree 会把 CONFIG.json 提交到主分支,`git worktree add` 会自动 checkout 副本到 worktree 目录中。使用 `git worktree list` 的第一行(git 契约上始终为主仓库绝对路径)则不受该问题影响。
62
-
63
- ### 0.3 目标需求名识别
64
-
65
- ```bash
66
- node "D:/workspace/<ws_root>/.qoder/skills/openspec-extend-worktree/scripts/find-target-worktree.js "<ws_root>"
67
- ```
68
-
69
- **优先级**:
70
- 1. cwd 在 worktree 内 → 自动从路径反推需求名
71
- 2. `.worktrees/` 下只有一个 worktree → 自动选用
72
- 3. 多个 worktree → 按 mtime 倒序输出列表,AI agent 在对话中让用户输入
73
-
74
- **解读输出**:
75
- - 退出码 0 + 末行(纯需求名) → 唯一识别,AI agent 解析后用于 `<branch>` 占位符
76
- - 退出码 1 + 末行 `MULTIPLE_WORKTREEES` → 多个 worktree,AI agent 列出上面的 `[1] xxx ⭐ / [2] yyy` 让用户输入序号或完整分支名
77
- - 退出码 2 + 末行 `NO_WORKTREE` → 无 worktree,提示用户用 init-worktree
78
-
79
- **情况 B:任一仓库已存在该分支 → 复用**
80
- - 脚本自动跳过已存在分支(`status: 'reused'`),不阻塞流程
81
- - 不再提供「复用/修改/中断」选项(脚本自动处理)
82
-
83
- > 续:在对话中纯文本提问用户,等待回复后重新执行 find-target-worktree.js。
84
-
85
- ### 0.4 校验 CONFIG.json 与 Git 仓库
86
-
87
- > 注:find-workspace-root.js 已隐式校验 CONFIG.json 存在;本步骤额外校验 apps 非空。
88
-
89
- ```bash
90
- # 复用 init-worktree 的 parse-config.js
91
- node "D:/workspace/<ws_root>/.qoder/skills/openspec-init-worktree/scripts/parse-config.js"
92
- ```
93
-
94
- **解读输出**:
95
- - 退出码 0 + 末行 `CONFIG_OK [...]` → 继续
96
- - 其他 → 终止流程
97
-
98
- ---
99
-
100
- ## Step 1:选择要补加的应用
101
-
102
- ### 1.1 计算"未关联"应用清单
103
-
104
- ```bash
105
- node "D:/workspace/<ws_root>/.qoder/skills/openspec-extend-worktree/scripts/list-available-apps.js "<ws_root>" "<branch>"
106
- ```
107
-
108
- **解读输出**:
109
- - 退出码 0 + 末行 `LIST_RESULT {available: [...], already: [...]}` → 有可用应用
110
- - 退出码 2 → 所有应用都已关联,**终止流程**(无需扩展)
111
-
112
- ### 1.2 多选补加应用
113
-
114
- 1. **从 Step 1.1 输出中提取待补加应用名列表**(`LIST_RESULT` 中 `available` 数组的 `name` 值)。
115
-
116
- 2. **运行 `generate-app-options.js` 脚本**,用 `--filter` 只生成未关联应用的 options:
117
-
118
- ```bash
119
- node ".qoder/skills/openspec-init-worktree/scripts/generate-app-options.js" --filter=app1,app2,...
120
- ```
121
-
122
- > ⓘ `--filter` 值取 Step 1.1 `available[].name`,逗号分隔。脚本根据 CONFIG.json 中对应的 `side` + `name` 硬编码生成 label,绝不翻译。
123
-
124
- **解读输出**:
125
- - 退出码 0 + 末行 `APP_OPTIONS [{...}]` → 解析 JSON,得到 options 数组
126
- - 退出码 1/2 → 出错,**终止流程**
127
-
128
- 3. **使用 `AskUserQuestion`(`multiSelect: true`)让用户勾选**:将脚本输出的 options 数组**原样传入**,不增、不减、不改任何字段:
129
-
130
- ```
131
- AskUserQuestion({
132
- questions: [{
133
- header: "补加应用",
134
- multiSelect: true,
135
- options: <脚本输出的 options 数组,不做任何修改>
136
- }]
137
- })
138
- ```
139
-
140
- **用户未选任何项** → 终止流程(用户主动取消)。
141
-
142
- **解析选择结果**:从 `AskUserQuestion` 返回的选中项中提取 `name` 字段(脚本输出的 options 中每个元素自带 `name`),得到待补加应用列表。
143
-
144
- ### 1.3 同步待补加应用的 `.code/` 仓库
145
-
146
- ```bash
147
- node "D:/workspace/<ws_root>/.qoder/skills/openspec-extend-worktree/scripts/sync-repos.js "<ws_root>" '<app1,app2,...>'
148
- ```
149
-
150
- **解读输出**:
151
- - 退出码 0 + 末行 `SYNC_RESULT [...]` → 全部成功
152
- - 退出码 2 → 部分 clone 失败,**终止流程**
153
-
154
- > ⓘ **关于 `.code/` 共享**:`.code/<应用名>/` 是该 app 仓库的本地基线(`origin/main` 等远程引用就绪即可),跨所有 worktree / worktree 共享。extend-worktree 不复制代码、不影响其他 worktree 的基线。
155
-
156
- ### 1.4 最终输出
157
-
158
- ```text
159
- 确认补加应用:
160
- [1] ep-user-info-server → .code/ep-user-info-server
161
- [2] ep-user-web → .code/ep-user-web
162
- 目标 worktree: <需求名>(.worktrees/worktree-<需求名>/)
163
- ```
164
-
165
- ---
166
-
167
- ## Step 2:状态检查(仅对新增应用)
168
-
169
- 对每个待补加应用执行**轻量状态检查**(与 init-worktree 对 app 仓库的检查一致):
170
-
171
- ```bash
172
- node "D:/workspace/<ws_root>/.qoder/skills/openspec-extend-worktree/scripts/check-repos.js "<ws_root>" '<app1,app2,...>'
173
- ```
174
-
175
- **解读输出**:
176
- - 退出码 0 + 末行 `CHECK_RESULT ALL_OK` → 全部通过,继续 Step 3
177
- - 退出码 2 + 末行 `CHECK_RESULT HAS_FAILURES` → 部分失败,**终止流程**
178
-
179
- > **注意:workspace 仓库不在本步骤检查**(extend 不修改 workspace 状态,`.gitignore` 在 init-worktree 阶段已处理完毕)。
180
-
181
- ---
182
-
183
- ## Step 3:创建分支 + 嵌套 Worktree
184
-
185
- ```bash
186
- node "D:/workspace/<ws_root>/.qoder/skills/openspec-extend-worktree/scripts/create-branches-and-worktrees.js "<ws_root>" "<branch>" '<app1,app2,...>'
187
- ```
188
-
189
- 脚本内部自动完成:
190
- 1. 对每个 app:检测分支是否已存在,已存在则复用
191
- 2. 不存在则从 `origin/<main>` 创建
192
- 3. 创建嵌套 worktree(物理路径:`.worktrees/worktree-<branch>/<app>`)
193
-
194
- > 注:脚本使用 Node.js + execSync 串行执行(Node.js 单线程无法真正并行 execSync)。
195
- > 沙箱内/沙箱外行为一致,避免并发 DLL 冲突。
196
-
197
- **解读输出**:
198
- - 退出码 0 + 末行 `BRANCH_WT_RESULT [...]` → 全部成功
199
- - 退出码 2 → 部分失败,**报告详情**
200
-
201
- **报告格式:**
202
- ```
203
- ✅ ep-user-info-server: 分支 feature-login 创建成功(从 origin/main)
204
- ✅ ep-user-info-server: 嵌套 worktree 创建成功
205
- ⏭️ ep-user-web: 分支已存在,复用
206
- ✅ ep-user-web: 嵌套 worktree 创建成功
207
- ```
208
-
209
- **复用机制**:
210
- - 分支已存在 → 跳过创建(用户可能已通过其他方式创建)
211
- - 嵌套 worktree 已存在 → 跳过创建(兜底)
212
- - 两种复用都不会影响现有 worktree 内容
213
-
214
- **失败回滚**:某个 app 失败时,已成功的 worktree 仍保留(用户可手动决定是否清理),报告失败详情。
215
-
216
- ---
217
-
218
- ### 3.5 推送新分支建立 upstream(必要步骤)
219
-
220
- extend-worktree 在 init-worktree 基础上补加应用,必须为本次**新建**的分支建立 upstream,否则后续 agent 在新 worktree 中 `git push` 会报 `fatal: The current branch <branch> has no upstream branch`。
221
-
222
- **自动行为**:[`create-branches-and-worktrees.js`](file:///d:/workspace/va-ai/coding-bb/cbb/worktrees/skills/openspec-extend-worktree/scripts/create-branches-and-worktrees.js) 内部对 `status='created'`(即本次新建分支 + 新建 worktree 的应用)自动调 `push-core.pushSingle` 推送,复用分支(init-worktree 已推过)跳过。
223
-
224
- **解读末行 `BRANCH_WT_RESULT`** 每项的 `push_status` 字段:
225
- - `pushed` → 已推送 `origin/<branch>`
226
- - `skipped` → 复用分支,init-worktree 已推送过
227
- - `failed` → 推送失败,AI 阻塞并按错误码处理(ssh/https/network/branch-protected 等)
228
- - `remote-exists` → 远程分支已存在,AI 展示 commit 元信息后由用户决策
229
-
230
- **错误处理**:与 init-worktree Step 3.4 一致——失败时阻塞流程,AI 必须询问用户三选项(修复后重试/跳过失败应用/完全终止),远程分支已存在时必须输出 commit 元信息再询问两选项(关联/终止+重新创建)。
231
-
232
- > ⓘ **为什么只推新建分支**:复用分支(`status='branch-reused-wt-created'` 或 `status='reused'`)在 init-worktree 阶段已建立过 upstream,重复 push 可能触发 `already exists` 错误并要求用户额外决策。
233
-
234
- ---
235
-
236
- ## Step 4:确保 workspace worktree AI 配置完整(必要步骤)
237
-
238
- workspace 主分支的 `.claude/` `.qoder/` `.cbb/` 通常为 gitignore'd,extend-worktree 创建的嵌套 worktree 不会自动带入。
239
- **开发约束只在 workspace worktree 中生效**——各应用 worktree 不需要安装 AI 配置。
240
-
241
- > 本步骤只对 workspace worktree 跑一次 `cbb init --yes`。用 `.cbb/.managed-by-cbb` 判重,
242
- > 若 init-worktree 已经 init 过则直接跳过;失败则 exit 2 阻塞(与 init-worktree 语义一致)。
243
-
244
- ```bash
245
- node "D:/workspace/<ws_root>/.qoder/skills/openspec-extend-worktree/scripts/install-ai.js "<ws_root>" "<branch>"
246
- ```
247
-
248
- **解读输出**:
249
- - 退出码 0 + 末行 `AI_INIT_OK` → 成功 / 跳过(workspace 已 init 过)
250
- - 退出码 1 → 参数错误(脚本 bug 或调用错误)
251
- - 退出码 2 + 末行 `AI_INIT_FAILED` → cbb init 执行失败,**extend-worktree 中断**,
252
- 按错误提示手动执行 `cd "<ws_root>/.worktrees/worktree-<branch>" && cbb init --yes` 后重跑
253
-
254
- > ⓘ **关于 `.cbb/.managed-by-cbb`**:cbb 初始化时会创建该清单文件,作为"已初始化"的标志,避免重复安装。
255
-
256
- > ⓘ **为什么不各应用 worktree 都装?** 开发约束(编码规范、OpenSpec 技能)只在 workspace worktree 里使用,
257
- > 各应用 worktree(Java 后端项目)不直接依赖 cbb,无需安装。
258
-
259
- ---
260
-
261
- ## Step 5:报告
262
-
263
- AI agent 根据以上 Step 的输出汇总报告:
264
-
265
- ```
266
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
267
- ✅ worktree 已扩展
268
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
269
- 目标 worktree: <branch>
270
- 工作空间根: <ws_root>
271
- 补加应用:
272
- - <app1> → .worktrees/worktree-<branch>/<app1>
273
- - <app2> → .worktrees/worktree-<branch>/<app2>
274
- AI 配置: ✅ 已安装(新建)/ 跳过(已存在)
275
-
276
- close-worktree 时会自动识别并清理所有已存在的 worktree
277
- 继续在当前目录开发即可
278
- ```
279
-
280
- > ⓘ **本技能不切换 IDE 窗口**:与 init-worktree 创建后切到新 worktree、close-worktree 切回 WS_ROOT 不同,extend-worktree **不切 IDE 窗口**——用户在原 worktree 窗口继续开发,新增 worktree 是嵌套子目录,通过 IDE 的文件树/终端面板即可访问。
281
-
282
- ---
283
-
284
- ## Step 6:后置扩展(预留)
285
-
286
- 当前为预留步骤,不执行具体逻辑。后续可扩展为执行后置脚本、上报数据等。
287
-
288
- 报告:*"Step 6:后置扩展点(预留,当前无操作)"*
289
-
290
- ---
291
-
292
- ## 快速参考
293
-
294
- | 场景 | 处理方式 |
295
- |---|---|
296
- | `CONFIG.json` 缺失或 apps 为空 | 终止并提示用户先配置 CONFIG.json |
297
- | 目标 worktree 不存在(`.worktrees/worktree-<需求名>/` 不存在) | 终止并提示用 init-worktree |
298
- | 所有应用已关联 | 终止并提示无需扩展 |
299
- | `.code/<应用名>/` 不存在 | 自动 clone(从 CONFIG.json 读 repo) |
300
- | 已在 worktree 中的 worktree 内执行 | cwd 自动反推需求名(Step 0.3 优先级 1) |
301
- | 多个 worktree 共存 | 按 mtime 倒序列出,AI 提示用户输入序号或分支名 |
302
- | 分支已存在 | 复用(脚本自动跳过) |
303
- | 嵌套 worktree 已存在 | 复用(防御性兜底) |
304
- | cbb 未全局安装 | 脚本自动安装;失败则提示手动 |
305
- | 新建 worktree 的 AI 配置 | `cbb init -y`(用 `.cbb/.managed-by-cbb` 判重) |
306
- | 已存在 worktree 的 AI 配置 | 跳过(不重复安装) |
307
- | close-worktree 清理 | 自动识别所有已存在的 worktree |
308
- | 沙箱内 node 不可用 | 脚本 fail-fast 并提示用户到系统终端重试 |
309
-
310
- ---
311
-
312
- ## 常见错误
313
-
314
- ### 跳过 worktree 存在性校验直接创建 worktree
315
-
316
- - **问题:** 目标 worktree 目录不存在时强行 `git worktree add`,会导致嵌套路径不正确
317
- - **修复:** Step 0.3 必须先校验 `.worktrees/worktree-<需求名>/` 存在
318
-
319
- ### 用 checkout -b 创建分支后再创建 worktree
320
-
321
- - **问题:** `git checkout -b <branch>` 将主目录切到新分支,随后 `git worktree add` 报 `fatal: '<branch>' is already checked out`
322
- - **修复:** Step 3 只用 `git branch` 创建分支,不切换;分支检出由 worktree 完成
323
-
324
- ### 把"未关联"应用判定为"全部应用"
325
-
326
- - **问题:** 误把所有 CONFIG.json 中的应用都补加到 worktree,导致重复创建 worktree
327
- - **修复:** Step 1.1 必须基于 `.worktrees/worktree-<需求名>/<应用名>/` 实际存在性过滤,已关联的应用必须跳过
328
-
329
- ### label 被 AI 翻译或丢失(已从根本上解决)
330
-
331
- - **问题:** 历史版本中 Step 1.2 要求 AI 手动拼接 label 字符串,导致 `app.name` 被翻译或完全丢失。
332
- - **修复:** 改为调用 `generate-app-options.js` 脚本(`--filter` 只生成未关联应用),AI 只需将脚本输出的 options 数组原样传入 `AskUserQuestion`,不允许手动修改任何字段。
333
-
334
- ### 用 AskUserQuestion 收集自由文本输入
335
-
336
- - **问题:** 需求名、APP 仓库 URL 需要用户自由输入文本,却用了 AskUserQuestion 工具
337
- - **修复:** 自由文本输入场景一律直接在对话中提问并等待用户文本回复
338
-
339
- ### 把 .code/ 当作"每个 worktree 独占"
340
-
341
- - **问题:** 误以为 `.code/<应用名>/` 是 worktree 私有目录,尝试在 worktree 内 clone
342
- - **修复:** `.code/` 是 app 仓库的本地基线,跨所有 worktree 共享
343
-
344
- ### 完成后续切 IDE 窗口
345
-
346
- - **问题:** 模仿 init-worktree 的 Step 6 / close-worktree 的 Step 5.8,强制切 IDE 窗口
347
- - **修复:** extend-worktree **故意不切 IDE 窗口**——用户在原 worktree 继续开发,扩展的工作是嵌套子目录,不应打断当前工作流
348
-
349
- ---
350
-
351
- ## 红线规则
352
-
353
- 以下为硬性红线,违反任一会导致工作树状态不一致或扩展失败。
354
-
355
- **绝不允许**
356
-
357
- - 跳过 Step 0.3 目标 worktree 存在性校验
358
- - 跳过 Step 1.1 已关联应用过滤(避免重复创建 worktree)
359
- - 用 `git checkout -b` 切分支后再建 worktree(分支检出冲突)
360
- - 用 `AskUserQuestion` 收集自由文本(需求名 / 应用 URL 等)
361
- - 在已存在的嵌套 worktree 中再次执行 `git worktree add`(导致 "already exists" 错误)
362
- - 修改 workspace 的 `.gitignore`(已由 init-worktree 在创建时处理,extend 不应触碰)
363
- - 切换 IDE 窗口(extend 故意不切,保持用户在原 worktree 内继续开发)
364
- - **Step 1.2 手动构造 AskUserQuestion options(禁止)**——必须调用 `generate-app-options.js` 脚本生成 options,将输出原样传入 `AskUserQuestion`,不得手动拼接 label。详见 [Step 1.2](#12-多选补加应用)
365
- - 沙箱内 node 不可用时强行继续 → 改为 fail-fast 提示用户
366
-
367
- **必须执行**
368
-
369
- - 严格按 Step 0 → Step 1 → Step 2 → Step 3 → Step 4 → Step 5 顺序执行
370
- - 所有脚本调用以 `node "D:/workspace/<ws_root>/.qoder/skills/openspec-extend-worktree/scripts/<name>.js "<绝对路径>" '<json>' "<branch>"` 形式发起
371
- - 嵌套 worktree 路径与 init-worktree 一致:`.worktrees/worktree-<需求名>/<应用名>/`
372
- - 分支名与 init-worktree 一致:`<需求名>`(不加前缀)
373
- - 仅对待补加应用执行状态检查、clone/fetch、创建分支、worktree add
374
- - 已存在的 worktree 不重复执行 `cbb init -y`(用 `.cbb/.managed-by-cbb` 判重)
375
- - **Step 1.2 调用 `AskUserQuestion` 前必须由脚本生成 options**:执行 `node ".qoder/skills/openspec-init-worktree/scripts/generate-app-options.js" --filter=<names>`,将 `APP_OPTIONS` 输出的 JSON 数组原样传入 `AskUserQuestion` options,禁止手动修改。
376
-
377
- ---
378
-
379
- ## 附录:脚本清单
380
-
381
- | 脚本 | 功能 | 参数 | 退出码 |
382
- |------|------|------|--------|
383
- | `check-env.js` | 环境探活 | 无 | 0/1/2 |
384
- | `find-workspace-root.js` | 定位工作空间根目录(共享脚本,源仓库真源在 `_shared/scripts/`) | 无 | 0/1 |
385
- | `find-target-worktree.js` | 目标需求名识别(共享脚本,源仓库真源在 `_shared/scripts/`) | ws_root | 0/1/2 |
386
- | `list-available-apps.js` | 计算"未关联"应用清单 | ws_root, branch | 0/1/2 |
387
- | `sync-repos.js` | 同步待补加应用的 .code/ 仓库 | ws_root, apps_json | 0/1/2 |
388
- | `check-repos.js` | app 轻量状态检查 | ws_root, apps_json | 0/1/2 |
389
- | `create-branches-and-worktrees.js` | 创建分支 + 嵌套 worktree | ws_root, branch, apps_json | 0/1/2 |
390
- | `install-ai.js` | 确保 workspace worktree AI 配置完整(**必要步骤**) | ws_root, branch | 0/1/2 |
@@ -1,95 +0,0 @@
1
- #!/usr/bin/env node
2
- require('./silence-popup');
3
- /**
4
- * openspec-extend-worktree 环境健康探活
5
- *
6
- * 与 init-worktree 同构,但额外检测「是否在 worktree 内」(extend 支持双层执行位置)。
7
- *
8
- * 退出码:
9
- * 0 - 探活通过
10
- * 1 - 致命错误(git 不可用)
11
- * 2 - 当前不在 git 仓库
12
- */
13
-
14
- const { execSync } = require('child_process');
15
-
16
- function tryExec(cmd, opts = {}) {
17
- try {
18
- const out = execSync(cmd, {
19
- encoding: 'utf-8',
20
- stdio: ['ignore', 'pipe', 'pipe'],
21
- ...opts,
22
- });
23
- return { ok: true, out: out.trim() };
24
- } catch (e) {
25
- return { ok: false, err: (e.stderr || e.message || String(e)).trim() };
26
- }
27
- }
28
-
29
- const checks = {};
30
-
31
- // ── 必检:git ─────────────────────────────────────────
32
- checks.git = tryExec('git --version');
33
- if (!checks.git.ok) {
34
- console.error('❌ git 启动失败(可能是 Qoder 沙箱 DLL 问题 0xc0000142)');
35
- console.error(' 解决方案:到系统终端(非 Qoder AI 终端)重新执行本技能');
36
- process.exit(1);
37
- }
38
- console.log('✅ git OK:', checks.git.out);
39
-
40
- // ── 必检:当前目录是 git 仓库 ─────────────────────────
41
- const insideRepo = tryExec('git rev-parse --is-inside-work-tree');
42
- if (!insideRepo.ok || insideRepo.out !== 'true') {
43
- console.error('❌ 当前目录不是 Git 仓库');
44
- console.error(' extend-worktree 必须在工作空间根目录或 worktree 内执行');
45
- process.exit(2);
46
- }
47
- console.log('✅ 当前目录是 git 仓库');
48
-
49
- // ── 必检:定位 worktree(git worktree list) ─────────
50
- const worktreeList = tryExec('git worktree list');
51
- if (worktreeList.ok) {
52
- const lines = worktreeList.out.split('\n').filter(Boolean);
53
- console.log(`✅ git worktree list 返回 ${lines.length} 行`);
54
- // 第一行总是主仓库
55
- if (lines.length > 0) {
56
- console.log(' 主仓库:', lines[0].split(/\s+/)[0]);
57
- }
58
- } else {
59
- console.log('⚠️ git worktree list 失败');
60
- }
61
-
62
- // ── 选检:node.js(脚本运行时,所有 .js 脚本依赖) ──
63
- checks.node = tryExec('node --version');
64
- if (!checks.node.ok) {
65
- console.log('⚠️ node 不可用(脚本将无法执行,建议安装 Node.js >= 16.7.0)');
66
- } else {
67
- console.log('✅ node OK:', checks.node.out);
68
- }
69
-
70
- // ── 选检:cbb ────────────────────────────────────
71
- checks.cbbInfo = tryExec('cbb --version');
72
- if (!checks.cbbInfo.ok) {
73
- console.log('ℹ️ cbb 未全局安装(Step 4 会兜底自动安装)');
74
- } else {
75
- console.log('✅ cbb OK:', checks.cbbInfo.out);
76
- }
77
-
78
- // ── 沙箱检测 ─────────────────────────────────────────
79
- const inWorktree = !!(process.env.QODER_AGENT || process.env.QODER_WORKTREE);
80
- if (inWorktree) {
81
- console.log('🛡️ Qoder 沙箱环境:Step 3 将降级为串行执行(避免并发 DLL 冲突)');
82
- } else {
83
- console.log('✅ 非沙箱环境:Step 3 可并发执行');
84
- }
85
-
86
- const summary = {
87
- git: checks.git.ok,
88
- node: checks.node.ok,
89
- cbbInfo: checks.cbbInfo.ok,
90
- inWorktree,
91
- ok: true,
92
- };
93
- console.log('---');
94
- console.log('ENV_OK', JSON.stringify(summary));
95
- process.exit(0);