@xulthekl/team-flow 0.46.0 → 0.48.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/.claude/always/phase-guard.md +1 -1
- package/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +2 -2
- package/.codex-plugin/plugin.json +1 -1
- package/.cursor-plugin/marketplace.json +2 -2
- package/.cursor-plugin/plugin.json +2 -2
- package/.github/plugin/marketplace.json +2 -2
- package/AGENTS.md +5 -4
- package/CHANGELOG.md +29 -0
- package/GEMINI.md +1 -1
- package/INSTALL.md +1 -1
- package/README.md +3 -3
- package/agents/prd-completeness-reviewer.md +22 -5
- package/agents/prd-writer.md +68 -0
- package/docs/README_en.md +1 -1
- package/docs/solutions/INDEX.md +1 -0
- package/docs/solutions/cross-phase/2026-08-21-no-summary.md +17 -0
- package/docs/usage-guide.md +1 -1
- package/gemini-extension.json +1 -1
- package/hooks/session-start +2 -2
- package/llms.txt +1 -1
- package/package.json +2 -2
- package/plugin.json +2 -2
- package/scripts/ensure-branch.mjs +94 -4
- package/scripts/lib/cmd-repo-layout.mjs +51 -0
- package/scripts/lib/config-loader.mjs +17 -1
- package/scripts/lib/conventions-generator.mjs +61 -2
- package/scripts/lib/execution-plan.mjs +10 -7
- package/scripts/lib/glaf4-delegation.mjs +64 -26
- package/scripts/team-flow.mjs +3 -0
- package/skills/ce-brainstorm/SKILL.md +11 -19
- package/skills/ce-brainstorm/references/brainstorm-sections.md +3 -11
- package/skills/ce-brainstorm/references/evidence-chain-validation.md +1 -1
- package/skills/ce-brainstorm/references/prototype-loop.md +10 -8
- package/skills/contract-builder/references/glaf4-delegation.md +6 -4
- package/skills/workflow-orchestrator/SKILL.md +8 -1
- package/skills/workflow-orchestrator/references/s2-prd-prototype-loop.md +10 -1
- package/skills/workflow-start/SKILL.md +10 -0
- package/templates/prd-brainstorm-profile.md +4 -1
- package/templates/prd.md +32 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "team-flow",
|
|
3
|
-
"description": "Unified workflow plugin: team-flow + compound-engineering core subset + architecture-design + prototype + workflow-orchestrator + workflow-bootstrap + e2e + session-handoff + workflow-feedback + business-analysis. 26 skills +
|
|
3
|
+
"description": "Unified workflow plugin: team-flow + compound-engineering core subset + architecture-design + prototype + workflow-orchestrator + workflow-bootstrap + e2e + session-handoff + workflow-feedback + business-analysis. 26 skills + 17 agents, one install.",
|
|
4
4
|
"owner": {
|
|
5
5
|
"name": "LT",
|
|
6
6
|
"url": "https://github.com/LT"
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"plugins": [
|
|
9
9
|
{
|
|
10
10
|
"name": "team-flow",
|
|
11
|
-
"description": "8-state spec workflow + compound global compounding + architecture-design (4A/DDD) + local HTML prototype + product-level orchestration + bootstrap + e2e + session handoff + workflow feedback + independent business analysis. 26 skills +
|
|
12
|
-
"version": "0.
|
|
11
|
+
"description": "8-state spec workflow + compound global compounding + architecture-design (4A/DDD) + local HTML prototype + product-level orchestration + bootstrap + e2e + session handoff + workflow feedback + independent business analysis. 26 skills + 17 agents with embedded TDD, SDD, code review, debugging, delta spec sync, and design-system-driven prototyping.",
|
|
12
|
+
"version": "0.48.0",
|
|
13
13
|
"source": "./",
|
|
14
14
|
"author": {
|
|
15
15
|
"name": "LT",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "team-flow",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Unified workflow plugin: team-flow (spec-driven dev: TDD/SDD/code-review/debugging) + compound-engineering core subset (brainstorm/plan/compound/strategy/ideate/proof, global compounding) + architecture-design (4A+DDD incremental design & global compounding) + prototype (local HTML prototype, zero external deps) + e2e (Playwright E2E, AC-driven) + workflow-orchestrator (product-level workflow orchestration) + workflow-bootstrap (existing project onboarding) + session-handoff (context transfer) + workflow-feedback (issue tracking) + business-analysis (independent requirement/scenario artifact). 26 skills +
|
|
3
|
+
"version": "0.48.0",
|
|
4
|
+
"description": "Unified workflow plugin: team-flow (spec-driven dev: TDD/SDD/code-review/debugging) + compound-engineering core subset (brainstorm/plan/compound/strategy/ideate/proof, global compounding) + architecture-design (4A+DDD incremental design & global compounding) + prototype (local HTML prototype, zero external deps) + e2e (Playwright E2E, AC-driven) + workflow-orchestrator (product-level workflow orchestration) + workflow-bootstrap (existing project onboarding) + session-handoff (context transfer) + workflow-feedback (issue tracking) + business-analysis (independent requirement/scenario artifact). 26 skills + 17 agents, one install.",
|
|
5
5
|
"source": "./",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "LT",
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
},
|
|
6
6
|
"metadata": {
|
|
7
7
|
"description": "Unified workflow plugin marketplace for Cursor (team-flow: team-flow + compound + architecture-design + prototype).",
|
|
8
|
-
"version": "0.
|
|
8
|
+
"version": "0.48.0"
|
|
9
9
|
},
|
|
10
10
|
"plugins": [
|
|
11
11
|
{
|
|
12
12
|
"name": "team-flow",
|
|
13
13
|
"source": ".",
|
|
14
|
-
"description": "Unified workflow plugin: team-flow + compound-engineering core subset + architecture-design + prototype + business-analysis.
|
|
14
|
+
"description": "Unified workflow plugin: team-flow + compound-engineering core subset + architecture-design + prototype + business-analysis. 26 skills + 17 agents."
|
|
15
15
|
}
|
|
16
16
|
]
|
|
17
17
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "team-flow",
|
|
3
3
|
"displayName": "team-flow",
|
|
4
|
-
"description": "Unified workflow plugin: team-flow (spec-driven dev: TDD/SDD/code-review/debugging) + compound-engineering core subset (brainstorm/plan/compound/strategy/ideate/proof, global compounding) + architecture-design (4A+DDD incremental design & global compounding) + prototype (local HTML prototype, zero external deps) + e2e (Playwright E2E, AC-driven) + workflow-orchestrator (product-level workflow orchestration) + workflow-bootstrap (existing project onboarding) + session-handoff (context transfer) + workflow-feedback (issue tracking) + business-analysis (independent requirement/scenario artifact). 26 skills +
|
|
5
|
-
"version": "0.
|
|
4
|
+
"description": "Unified workflow plugin: team-flow (spec-driven dev: TDD/SDD/code-review/debugging) + compound-engineering core subset (brainstorm/plan/compound/strategy/ideate/proof, global compounding) + architecture-design (4A+DDD incremental design & global compounding) + prototype (local HTML prototype, zero external deps) + e2e (Playwright E2E, AC-driven) + workflow-orchestrator (product-level workflow orchestration) + workflow-bootstrap (existing project onboarding) + session-handoff (context transfer) + workflow-feedback (issue tracking) + business-analysis (independent requirement/scenario artifact). 26 skills + 17 agents, one install.",
|
|
5
|
+
"version": "0.48.0",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "LT",
|
|
8
8
|
"url": "https://github.com/LT"
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
},
|
|
7
7
|
"metadata": {
|
|
8
8
|
"description": "Unified workflow plugins and skills for AI coding agents (team-flow: team-flow + compound + architecture-design + prototype).",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.48.0"
|
|
10
10
|
},
|
|
11
11
|
"plugins": [
|
|
12
12
|
{
|
|
13
13
|
"name": "team-flow",
|
|
14
14
|
"description": "Unified workflow with planning artifacts, execution contracts, TDD, review gates, systematic debugging, delta spec sync, architecture-design, independent business analysis, and local HTML prototyping.",
|
|
15
|
-
"version": "0.
|
|
15
|
+
"version": "0.48.0",
|
|
16
16
|
"source": ".",
|
|
17
17
|
"author": {
|
|
18
18
|
"name": "LT",
|
package/AGENTS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# AGENTS.md · team-flow
|
|
2
2
|
|
|
3
|
-
> team-flow 统一插件 = **team-flow**(spec 驱动开发)+ **compound-engineering 核心子集**(全局复利)+ **architecture-design**(4A+DDD 增量设计)+ **prototype**(本地 HTML 原型)+ **e2e**(AC 驱动 Playwright E2E)+ **workflow-orchestrator**(产品级编排)+ **workflow-bootstrap**(既有项目接入)。一次安装,七套能力协同(26 skills +
|
|
3
|
+
> team-flow 统一插件 = **team-flow**(spec 驱动开发)+ **compound-engineering 核心子集**(全局复利)+ **architecture-design**(4A+DDD 增量设计)+ **prototype**(本地 HTML 原型)+ **e2e**(AC 驱动 Playwright E2E)+ **workflow-orchestrator**(产品级编排)+ **workflow-bootstrap**(既有项目接入)。一次安装,七套能力协同(26 skills + 17 agents),支持 9 安装面(Claude Code, Cursor, OpenAI Codex CLI/App, GitHub Copilot CLI, Gemini CLI, OpenCode, WorkBuddy, Trae, ima-copilot)。
|
|
4
4
|
|
|
5
5
|
## What This Is
|
|
6
6
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
### 身份与依赖关系
|
|
14
14
|
|
|
15
|
-
- **team-flow**(本插件):Claude Code / Cursor 等宿主的插件实体(`plugin.json` name = `team-flow`),包含 26 个 skills +
|
|
15
|
+
- **team-flow**(本插件):Claude Code / Cursor 等宿主的插件实体(`plugin.json` name = `team-flow`),包含 26 个 skills + 17 个 agents + hooks + templates
|
|
16
16
|
- **@xulthekl/team-flow**(npm 底座包):team-flow 的 CLI 工具层(`package.json` name = `@xulthekl/team-flow`,bin = `tf` / `team-flow`),提供状态机、校验、复利 CLI 等运行时能力
|
|
17
17
|
- 关系:team-flow 插件 **包含** @xulthekl/team-flow npm 包作为底座(同一仓库、同一版本)。skills 中的 `tf ...` 调用的是已全局安装的 @xulthekl/team-flow CLI,版本由 session-start hook 自动同步
|
|
18
18
|
- 历史身份(已废弃):`spec-superflow`(npm 包名,0.11.0 后停止发布)/ `ssf`(CLI 前缀)/ `.spec-superflow.yaml`(状态文件)—— 详见设计增强方案 v0.9 §27
|
|
@@ -220,7 +220,7 @@ STRATEGY.md CONCEPTS.md 产品策略(BA) / 领域词汇
|
|
|
220
220
|
|
|
221
221
|
> **规则**:新增 skill 时必须在此表登记所属层级。产品级新需求触发词归 workflow-orchestrator 独占。
|
|
222
222
|
|
|
223
|
-
### Agents 索引(v0.7 新增,v0.
|
|
223
|
+
### Agents 索引(v0.7 新增,v0.47.0 增至 17 个)
|
|
224
224
|
|
|
225
225
|
> **agent 文件设计规范见 CONTRIBUTING.md §6 + `templates/agent-template.md`**(v0.33.0):frontmatter 必须合法 YAML(非法时 Claude Code 静默降级,skills: 预加载与 tools: 限制全部失效);description 单句、禁 `<example>` 块;新增/修改 agent 必过 frontmatter-lint + 实证探针。
|
|
226
226
|
|
|
@@ -232,7 +232,8 @@ STRATEGY.md CONCEPTS.md 产品策略(BA) / 领域词汇
|
|
|
232
232
|
| change-split-auditor | plan.md 拆分质量审计 | Read/Bash/Grep/Glob | orchestrator S4 脚手架前(必选门禁,PASS 方可继续) |
|
|
233
233
|
| code-reviewer | spec 合规审查(批次完成/合并门禁) | Read/Bash/Grep/Glob | build-executor 批次完成、release-archivist 合并前 |
|
|
234
234
|
| cross-change-consistency-checker | 跨 change 冲突检测 | Read/Bash/Grep/Glob | orchestrator S5 多 change 并行/closing 时 |
|
|
235
|
-
| prd-completeness-reviewer | PRD 完整性评审(能否支撑 plan/spec,
|
|
235
|
+
| prd-completeness-reviewer | PRD 完整性评审(能否支撑 plan/spec,6 维度含 §8.4 契约级细节 D6) | Read/Bash/Grep/Glob | orchestrator S2 / ce-brainstorm 冻结前门禁(v0.15.0,v0.47.0 并入 D6) |
|
|
236
|
+
| prd-writer | PRD 撰写 agent——契约级 §8.4 逐功能详述(ce-brainstorm Phase 3 委托;可写型,PRD 唯一所有者,先读模板检查清单) | Read/Bash/Grep/Glob/Write/Edit | ce-brainstorm Phase 3 委托(v0.47.0) |
|
|
236
237
|
| prototype-builder | 原型绘制执行者(种子优先:template.html+layouts.md 组合;**v0.20.0 产物落盘硬闸门**:index.html 未落盘非空禁返 done + 大产出分片;**v0.21.0 决策点 SendMessage stop-and-resume**) | Read/Write/Edit/Bash/Grep/Glob | prototype skill 内部编排步骤③/⑤修正轮(v0.15.0,v0.18.0 种子优先) |
|
|
237
238
|
| prototype-env-scout | 原型环境探查 + 2-3 差异化方向(direction-picker;**v0.20.0 简报完整性闸门**:简报未完整禁返 done) | Read/Bash/Grep/Glob | prototype skill 内部编排步骤①(v0.15.0,v0.18.0 direction-picker) |
|
|
238
239
|
| prototype-reviewer | PRD 6 维度 + P0 grep + craft 4 席 rubric 评审 | Read/Bash/Grep/Glob | orchestrator S2 原型循环每轮产出后 |
|
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,35 @@ All notable changes to `team-flow` will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format loosely follows Keep a Changelog.
|
|
6
6
|
|
|
7
|
+
## [0.48.0] - 2026-08-21
|
|
8
|
+
|
|
9
|
+
### Added(多仓库场景支持,v0.48.0)
|
|
10
|
+
|
|
11
|
+
设计来源:`docs/plan/multi-repo-support-design.md` v1.0(2026-08-21,fytx-message 4 feedback:cli-command-1/2 + sop-flow-1/2)
|
|
12
|
+
|
|
13
|
+
- **repo_layout 机制**(P0):`detectRepoLayout` 判定 single/monorepo/multi-repo + 代码仓库清单;`tf repo-layout detect <root>` CLI 写 `repo_layout` 段到 `team-flow.config.json`;config-loader DEFAULTS 固化
|
|
14
|
+
- **detect 修复**(P1,cli-command-1):change 目录→项目根解析(detectWorkspaceRoot/getGitRoot);repos 清单聚合判定 `is_glaf4_java`(任一仓库 Java → 项目级 true);`--target-repo` 精确探测;config 主副本写项目根(不再写 change 目录)
|
|
15
|
+
- **review 修复**(P2,cli-command-2):overlay 目录自动创建(修 ENOENT);`--repo <代码仓库>` 提供 base/head git 校验上下文;multi-repo 下 change 目录无 git 不再报错(--repo 场景)
|
|
16
|
+
- **isolate 修复**(P2,sop-flow-2):`checkSharedBranch` 检测 origin tracking + ahead/behind(有 upstream 即共享);共享分支建 worktree 而非就地实施;`checkUncommitted` 报告未提交变更归属
|
|
17
|
+
- **流程接入**(P3):workflow-start DP-0 + orchestrator S1 项目模式确认(识别存量结构,写 repo_layout config)
|
|
18
|
+
- **三评审闭环**:P3 code-reviewer(2 Important + 8 Minor)+ P4 plugin-validator(7 minor)+ skill-reviewer(5 minor)全修
|
|
19
|
+
- 723/723 测试通过
|
|
20
|
+
|
|
21
|
+
## [0.47.0] - 2026-08-21
|
|
22
|
+
|
|
23
|
+
### Added(PRD §8.4 契约级详述规范,v0.47.0)
|
|
24
|
+
|
|
25
|
+
设计来源:`docs/architecture-api-db-design-enhancement-v0.20.md` §81(2026-08-21,来源 workflow-feedback 20260821-131256 P1 artifact-quality)
|
|
26
|
+
|
|
27
|
+
- **重构 `templates/prd.md` §8.4 契约级检查清单**:UI 功能 11 维(页面布局/权限规则/区块说明/搜索模块/表格列定义/交互规则/弹层结构/动态字段/导入导出规则/状态操作差异/异常边界)+ 非 UI 功能 7 维(触发条件/输入输出/处理步骤/异常处理/权限角色/幂等并发/性能约束)双形态;NA 机制(不适用须标注 NA+理由,未标注且未覆盖=缺失);模板为单一权威
|
|
28
|
+
- **`prd-brainstorm-profile.md` 新增「功能细节(契约级)」核心维度**(替代按需扩展):Standard/Deep 强制契约级澄清,产出 detail_ledger(`requirement/vN/detail-ledger.md`)
|
|
29
|
+
- **新增 `prd-writer` agent**:ce-brainstorm Phase 3 委托撰写(写法 2 预加载 ce-brainstorm,Iron Law=先读模板 §8.4 检查清单,不提问、不虚构、missing_info 回传,PRD 唯一所有者)
|
|
30
|
+
- **`prd-completeness-reviewer` 并入 D6 维度**(5 维→6 维):§8.4 契约级细节——核心维度缺失/悬空功能=Critical,辅助维度缺失=Important;detail_ledger 交叉核对(澄清已确认但 PRD 缺失/标 NA=Critical);`template_path` 入参(自定义模板支持)
|
|
31
|
+
- **ce-brainstorm 流程更新**:Phase 1.3b 功能细节澄清 + Phase 3 委托 prd-writer + QA-4 派发归并(standalone→Phase 3.5 §3.5.5、orchestrated→orchestrator S2 step 3.5,QA-4 不重复派发)+ 完整性评审全路径门禁(有原型/非 UI/跳过原型三路径均强制派发)
|
|
32
|
+
- **orchestrated 路径补齐**:s2-prd-prototype-loop.md step 3.5(冻结前完整性评审门禁,补此前纯后端/跳过原型路径静默漏评审缺口)
|
|
33
|
+
- agent 计数 16→17 全平台同步(plugin.json / .claude-plugin / .cursor-plugin / package.json / AGENTS.md / README / usage-guide)
|
|
34
|
+
- 710/710 测试通过
|
|
35
|
+
|
|
7
36
|
## [0.46.0] - 2026-08-19
|
|
8
37
|
|
|
9
38
|
### Added(PROJECT_INITIALIZE 场景 + project-initialize skill + ARCH 上移,v0.46.0)
|
package/GEMINI.md
CHANGED
|
@@ -8,7 +8,7 @@ The workflow is self-contained and does not require OpenSpec or Superpowers at r
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
<!-- team-flow-phase-guard-start -->
|
|
11
|
-
# team-flow v0.
|
|
11
|
+
# team-flow v0.48.0 | 阶段: {{state}} | 工作流: {{workflow}}
|
|
12
12
|
当前阶段允许的操作由 workflow-start 路由规则定义。
|
|
13
13
|
禁止跨越 DP gate 进入下一阶段。变更范围以 execution-contract.md 的 Intent Lock 为准。
|
|
14
14
|
<!-- team-flow-phase-guard-end -->
|
package/INSTALL.md
CHANGED
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# team-flow
|
|
2
2
|
|
|
3
|
-
> 当前版本:`v0.
|
|
3
|
+
> 当前版本:`v0.48.0`
|
|
4
4
|
|
|
5
5
|
> 统一插件:**team-flow**(spec 驱动开发)+ **compound-engineering 核心子集**(全局复利)+ **architecture-design**(4A+DDD 增量设计)+ **prototype**(本地 HTML 原型)+ **e2e**(AC 驱动 E2E)+ **workflow-orchestrator**(产品级编排)+ **workflow-bootstrap**(既有项目接入)。一次安装,七套能力协同。
|
|
6
6
|
|
|
@@ -84,9 +84,9 @@ STRATEGY.md CONCEPTS.md 策略 / 领域词汇
|
|
|
84
84
|
- **设计系统**(1):design-system(独立创建/迭代项目级设计系统,用户主导交互,v0.19.0)
|
|
85
85
|
- **业务分析**(1):business-analysis(将任意输入整理为 requirement/vN/business-analysis.md,多轮单问澄清,独立外挂,v0.44.0)
|
|
86
86
|
|
|
87
|
-
### 配套 agents(
|
|
87
|
+
### 配套 agents(17 个,v0.47.0 增至 17)
|
|
88
88
|
|
|
89
|
-
全部由编排层 dispatch(主代理只编排,need-explorer 为主进程交互式澄清):architecture-design(架构设计门控)/ architecture-reviewer(架构自动审查)/ bug-investigator(bug 根因调查)/ change-split-auditor(拆分质量审计)/ code-reviewer(代码审查)/ cross-change-consistency-checker(跨 change 一致性)/ prd-completeness-reviewer(PRD
|
|
89
|
+
全部由编排层 dispatch(主代理只编排,need-explorer 为主进程交互式澄清):architecture-design(架构设计门控)/ architecture-reviewer(架构自动审查)/ bug-investigator(bug 根因调查)/ change-split-auditor(拆分质量审计)/ code-reviewer(代码审查)/ cross-change-consistency-checker(跨 change 一致性)/ prd-completeness-reviewer(PRD 完整性评审,含 §8.4 契约级细节 D6)/ prd-writer(PRD 契约级撰写)/ prototype-builder(原型绘制)/ prototype-env-scout(原型环境探查)/ prototype-reviewer(原型评审)/ need-explorer(需求探索)/ spec-writer(规格编写)/ contract-builder(执行契约构建)/ build-executor(TDD 构建执行)/ release-archivist(发布归档)/ business-analysis(独立业务分析)。
|
|
90
90
|
|
|
91
91
|
### 命名约定
|
|
92
92
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: prd-completeness-reviewer
|
|
3
|
-
description: PRD 完整性自动评审。在 PRD 写入后、冻结前,独立检查"需求描述是否完整到能支撑后续 plan/spec 实施"(
|
|
3
|
+
description: PRD 完整性自动评审。在 PRD 写入后、冻结前,独立检查"需求描述是否完整到能支撑后续 plan/spec 实施"(6 维度,含 §8.4 契约级细节 D6),输出分级完整性报告。直接写审查报告文件,返回摘要 + 文件路径。与 claim verifier 分工——claim verifier 管"说得对不对"(核查事实声明),本 agent 管"说得全不全、能否落地"。由编排层在 PRD 冻结前显式派发(workflow-orchestrator S2 / ce-brainstorm Phase 3.6 前)。
|
|
4
4
|
|
|
5
5
|
model: inherit
|
|
6
6
|
color: yellow
|
|
7
7
|
tools: ["Read", "Bash", "Grep", "Glob", "Write"]
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
You are an independent PRD Completeness Reviewer. You check whether a PRD is **complete enough to support downstream plan/spec/build work**. You produce a graded completeness report across
|
|
10
|
+
You are an independent PRD Completeness Reviewer. You check whether a PRD is **complete enough to support downstream plan/spec/build work**. You produce a graded completeness report across 6 dimensions and write it to disk.
|
|
11
11
|
|
|
12
12
|
## The Iron Law
|
|
13
13
|
|
|
@@ -26,10 +26,12 @@ Do NOT duplicate claim verification. A statement can be factually correct yet st
|
|
|
26
26
|
|-----------|-------------|
|
|
27
27
|
| `prd_path` | PRD 文件路径(e.g., `requirement/v1/prd.md`) |
|
|
28
28
|
| `concepts_path` | (可选)CONCEPTS.md 路径,用于术语一致性比对 |
|
|
29
|
+
| `template_path` | PRD 模板路径(可选,默认 `templates/prd.md`;§8.4 检查清单单一权威,以解析后的模板为基准) |
|
|
30
|
+
| `detail_ledger_path` | (可选)detail_ledger 路径(功能细节澄清产出;存在时用于 D6 交叉核对 NA 标注一致性) |
|
|
29
31
|
|
|
30
32
|
If `prd_path` is missing or unreadable, report `FAIL` with reason `INPUT_ERROR`.
|
|
31
33
|
|
|
32
|
-
##
|
|
34
|
+
## 6-Dimension Checklist
|
|
33
35
|
|
|
34
36
|
| Dim | Name | Check Content | Severity |
|
|
35
37
|
|-----|------|---------------|----------|
|
|
@@ -38,6 +40,7 @@ If `prd_path` is missing or unreadable, report `FAIL` with reason `INPUT_ERROR`.
|
|
|
38
40
|
| D3 | 边界与非功能 | 空/错/异常状态、性能/兼容约束 | Important |
|
|
39
41
|
| D4 | 术语一致性 | 与 CONCEPTS.md / §6 业务术语一致 | Minor |
|
|
40
42
|
| D5 | 范围闭环 | in/out scope 明确,无悬空功能 | Important |
|
|
43
|
+
| D6 | §8.4 契约级细节 | 逐功能模块按模板检查清单覆盖适用维度(UI 11 维/非 UI 7 维);§7↔§8.4 交叉核对无悬空功能。**基准 = 模板 §8.4 检查清单(单一权威)** | Critical(核心维度缺失/悬空)/ Important(辅助维度缺失) |
|
|
41
44
|
|
|
42
45
|
## Review Process
|
|
43
46
|
|
|
@@ -71,6 +74,14 @@ If `prd_path` is missing or unreadable, report `FAIL` with reason `INPUT_ERROR`.
|
|
|
71
74
|
- Any out-of-scope item that other requirements implicitly depend on?
|
|
72
75
|
Missing scope declaration or dangling feature = Important.
|
|
73
76
|
|
|
77
|
+
8. **D6 §8.4 契约级细节完整度**:Read the template §8.4 checklist FIRST — `template_path`(默认 `templates/prd.md`)is the single authority (UI 11 维 / 非 UI 7 维), never judge against your own expectations. Then for each function module in the PRD §8.4:
|
|
78
|
+
- 判定功能形态(UI/非 UI),按对应维度清单核对覆盖度;**未标注 NA 且未覆盖的适用维度 = 缺失**
|
|
79
|
+
- **核心维度缺失 = Critical**:功能概述缺失;UI 页面布局/表格列定义缺失;非 UI 输入输出/处理步骤/异常处理缺失
|
|
80
|
+
- **辅助维度缺失 = Important**:UI 权限规则/搜索模块/弹层结构/动态字段/导入导出/状态操作差异/异常边界;非 UI 触发条件/权限角色/幂等并发/性能约束
|
|
81
|
+
- **§7 系统功能清单 ↔ §8.4 详述块交叉核对**:§7 列出但 §8.4 无详述 = **悬空功能 = Critical**
|
|
82
|
+
- 维度不适用但已显式标注 `NA + 理由` 的模块 = 不视为缺失(但需抽查 NA 理由合理性)
|
|
83
|
+
- **detail_ledger 交叉核对(可选)**:若 `detail_ledger_path` 提供,对比澄清期确认的维度状态与 PRD §8.4 覆盖/NA 标注——澄清已确认内容但 PRD 缺失或标 NA = Critical;澄清标 NA 但 PRD 有详述 = 记录不阻断
|
|
84
|
+
|
|
74
85
|
### Phase 3: 汇总判定
|
|
75
86
|
|
|
76
87
|
Aggregate findings → final verdict per the Judgment Criteria.
|
|
@@ -81,9 +92,9 @@ Aggregate findings → final verdict per the Judgment Criteria.
|
|
|
81
92
|
|---------|-----------|--------|
|
|
82
93
|
| **PASS** | Critical=0 且 Important=0 | 可进入冻结 / 下游 plan |
|
|
83
94
|
| **PASS_WITH_WARNINGS** | Critical=0 且 Important>0 | 警告项交人工裁定,不阻断 |
|
|
84
|
-
| **FAIL** | Critical>0 | 必须回 Phase 1.3 补充后重新评审 |
|
|
95
|
+
| **FAIL** | Critical>0 | 必须回 Phase 1.3/Phase 3 补充后重新评审 |
|
|
85
96
|
|
|
86
|
-
**FAIL 仅由 Critical 触发**(D1/D2
|
|
97
|
+
**FAIL 仅由 Critical 触发**(D1/D2 缺失;D6 核心维度缺失、D6 悬空功能)。Important(D3/D5/D6 辅助维度)误报不触发 FAIL。Minor(D4/D6 可读性)仅记录。
|
|
87
98
|
|
|
88
99
|
## Output Format
|
|
89
100
|
|
|
@@ -122,6 +133,9 @@ Aggregate findings → final verdict per the Judgment Criteria.
|
|
|
122
133
|
### D5 范围闭环 — {PASS/WARN}
|
|
123
134
|
[in/out scope 声明状态 + 悬空功能列表]
|
|
124
135
|
|
|
136
|
+
### D6 §8.4 契约级细节 — {PASS/FAIL} ({m}/{n} modules contract-grade)
|
|
137
|
+
[逐功能模块检查:功能形态 | 适用维度覆盖 | NA 标注 | 悬空功能 | 状态]
|
|
138
|
+
|
|
125
139
|
## Findings
|
|
126
140
|
| # | Dim | Severity | PRD Source | Requirement | Description | Suggestion |
|
|
127
141
|
|---|-----|----------|-----------|-------------|-------------|------------|
|
|
@@ -146,6 +160,8 @@ Aggregate findings → final verdict per the Judgment Criteria.
|
|
|
146
160
|
- Distinguish "missing" from "present-but-unverifiable" (both Critical for D2, but different fixes)
|
|
147
161
|
- Give a clear, unambiguous verdict
|
|
148
162
|
- Treat vague AC ("表现良好"/"快速响应" without threshold) as a D2 Critical
|
|
163
|
+
- Read the template §8.4 checklist BEFORE assessing D6 — the template is the single authority, not your expectations
|
|
164
|
+
- Distinguish "维度不适用(已标注 NA)" from "维度缺失(未标注 NA 且未覆盖)" in D6
|
|
149
165
|
|
|
150
166
|
**DON'T:**
|
|
151
167
|
- Modify the PRD or any other artifact — only write the review report
|
|
@@ -154,3 +170,4 @@ Aggregate findings → final verdict per the Judgment Criteria.
|
|
|
154
170
|
- Trigger FAIL on Important or Minor findings — FAIL is Critical-only
|
|
155
171
|
- Mark stylistic/wording polish as findings — completeness, not prose quality
|
|
156
172
|
- Omit the PRD source reference for any finding
|
|
173
|
+
- Judge D6 against your own detail expectations — cite the template checklist dimension name for every D6 finding
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: prd-writer
|
|
3
|
+
description: PRD 撰写 agent——在 ce-brainstorm 主会话完成交互澄清(Phase 0-2.6 + 功能细节澄清)之后、QA-4 审查之前,按 PRD 模板 §8.4 契约级检查清单将已确认产出整理为契约级 PRD 草稿(requirement/vN/prd.md)。可写型,负责 PRD 文档。
|
|
4
|
+
|
|
5
|
+
model: inherit
|
|
6
|
+
color: green
|
|
7
|
+
tools: ["Read", "Bash", "Grep", "Glob", "Write", "Edit"]
|
|
8
|
+
skills:
|
|
9
|
+
- ce-brainstorm
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
You are an independent PRD Writer. You turn the confirmed brainstorm outputs (business-analysis.md, dialogue-log.md, detail_ledger, synthesis summary) into a contract-grade PRD document at `requirement/vN/prd.md`. You execute ONLY the PRD writing phase — interactive clarification (Phase 0-2.6) is ALREADY DONE by the main conversation.
|
|
13
|
+
|
|
14
|
+
## Scope Boundary
|
|
15
|
+
|
|
16
|
+
You write PRD documents only. You do NOT run interactive phases, do NOT ask the user questions, do NOT modify business-analysis.md / dialogue-log.md / detail_ledger. Any information gap is reported as `missing_info` in your output contract — never invented.
|
|
17
|
+
|
|
18
|
+
## Artifact Ownership
|
|
19
|
+
|
|
20
|
+
**You are the sole owner of `requirement/vN/prd.md`.** No other agent or the orchestration layer may directly edit it. Modification requests (review feedback) MUST be routed through you via `SendMessage` resume.
|
|
21
|
+
|
|
22
|
+
**Your preloaded Skill (ce-brainstorm) contains the detailed methodology** — PRD template resolution, `references/brainstorm-sections.md` chapter mapping (incl. §8.4 功能模块提取规则), `references/prd-mapping.md` version format. Follow it for HOW. This prompt defines WHO you are and WHAT you must deliver.
|
|
23
|
+
|
|
24
|
+
## Iron Law
|
|
25
|
+
|
|
26
|
+
1. **先读模板 §8.4 检查清单再撰写**:定位 `template_path`(默认 `templates/prd.md`)§8.4(UI 11 维 / 非 UI 7 维),以解析后的模板为逐功能详述的强制基准,不在他处猜测规范。
|
|
27
|
+
2. **逐功能模块契约级详述**:每个功能按「功能形态」(UI/非 UI)覆盖对应必含维度;维度不适用时标注 `NA + 一句理由`;**未标注 NA 且未覆盖 = PRD 不完整**。
|
|
28
|
+
3. **无信息章节保留模板占位,不虚构**:data source 未覆盖的内容保留 `{占位}`,并列入 `missing_info`。
|
|
29
|
+
4. **不写实现契约**:接口路径/表字段/类结构/算法实现属 change 级 spec/design,PRD 只写产品行为与规则。
|
|
30
|
+
|
|
31
|
+
## Inputs
|
|
32
|
+
|
|
33
|
+
| Parameter | Description |
|
|
34
|
+
|-----------|-------------|
|
|
35
|
+
| `prd_path` | 目标 PRD 路径(e.g., `requirement/v1/prd.md`) |
|
|
36
|
+
| `template_path` | PRD 模板路径(默认 `templates/prd.md`) |
|
|
37
|
+
| `business_analysis_path` | business-analysis.md 路径(§2/§3/§7/§8 数据源) |
|
|
38
|
+
| `dialogue_log_path` | dialogue-log.md 路径(§1.2 修订记录引用) |
|
|
39
|
+
| `detail_ledger_path` | detail_ledger 路径(功能细节澄清产出,§8.4 数据源) |
|
|
40
|
+
| `synthesis_summary` | 综合确认产出(scope 判定与核心决策) |
|
|
41
|
+
|
|
42
|
+
If `template_path` is missing or unreadable, report `FAIL` with reason `INPUT_ERROR`.
|
|
43
|
+
|
|
44
|
+
## Structured Output Contract
|
|
45
|
+
|
|
46
|
+
Return the following YAML to the orchestration layer:
|
|
47
|
+
|
|
48
|
+
```yaml
|
|
49
|
+
status: done | blocked # done: PRD 草稿已写入并通过自检
|
|
50
|
+
artifact_path: requirement/vN/prd.md
|
|
51
|
+
missing_info: [...] # 保留占位的未澄清信息清单(供 QA-4 / D6 定位)
|
|
52
|
+
summary: "..." # 2-3 sentence overview + 待主会话确认点
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Red Lines
|
|
56
|
+
|
|
57
|
+
**DO:**
|
|
58
|
+
- 先读模板 §8.4 检查清单,再逐功能模块按维度详述
|
|
59
|
+
- 从 detail_ledger / business-analysis.md 提取已确认信息,保持信息完整(页面布局/搜索字段/表格列/交互规则/级联逻辑等关键细节不得丢失或过度概括)
|
|
60
|
+
- 功能描述含糊到"一句话说不清"时,先拆分功能再详述
|
|
61
|
+
- 结束回复用显式终止标记:`FINAL VERDICT: <DONE | BLOCKED | FAIL>`
|
|
62
|
+
|
|
63
|
+
**DON'T:**
|
|
64
|
+
- 不执行交互阶段,不向用户提问(澄清已由主会话完成)
|
|
65
|
+
- 不虚构未确认信息——data source 缺失就保留占位 + 列入 missing_info
|
|
66
|
+
- 不写接口/表/类/算法等实现契约(属 change 级 spec/design)
|
|
67
|
+
- 不修改 business-analysis.md / dialogue-log.md / detail_ledger / ledger.md
|
|
68
|
+
- 不删除模板占位——无信息章节保留 `{占位}`
|
package/docs/README_en.md
CHANGED
|
@@ -126,7 +126,7 @@ npm install -g team-flow
|
|
|
126
126
|
|
|
127
127
|
### Version
|
|
128
128
|
|
|
129
|
-
- Current: `v0.
|
|
129
|
+
- Current: `v0.48.0`
|
|
130
130
|
- v0.9.1 highlights: DP-4 execution-mode recommendations, a portable runtime across 17 platforms, and a raw-package smoke with no plugin-root variable.
|
|
131
131
|
- Self-contained — no OpenSpec or Superpowers runtime required
|
|
132
132
|
- Upstream: [Fission-AI/OpenSpec](https://github.com/Fission-AI/OpenSpec), [obra/superpowers](https://github.com/obra/superpowers)
|
package/docs/solutions/INDEX.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
<!-- 每条一行,按 severity 降序,≤150 行硬上限 -->
|
|
3
3
|
| date | phase | domain | type | severity | summary | file |
|
|
4
4
|
|------|-------|--------|------|----------|---------|------|
|
|
5
|
+
| 2026-08-21 | cross-phase | general | insight | medium | (no summary) | cross-phase/2026-08-21-no-summary.md |
|
|
5
6
|
| 2026-08-19 | cross-phase | general | insight | medium | (no summary) | cross-phase/2026-08-19-no-summary.md |
|
|
6
7
|
| 2026-08-18 | cross-phase | general | insight | medium | (no summary) | cross-phase/2026-08-18-no-summary.md |
|
|
7
8
|
| 2026-08-17 | cross-phase | general | insight | medium | (no summary) | cross-phase/2026-08-17-no-summary.md |
|
package/docs/usage-guide.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# team-flow 使用说明(研发团队版)
|
|
2
2
|
|
|
3
|
-
> 版本锚点:v0.
|
|
3
|
+
> 版本锚点:v0.47.0(26 skills + 17 agents)· 更新日期:2026-08-21
|
|
4
4
|
> 读者:使用 team-flow 做日常研发的工程师。不需要你懂插件内部实现,只需要照着路径走。
|
|
5
5
|
> 配套文档:安装细节见 [INSTALL.md](../INSTALL.md);状态机细节见 [state-machine.md](state-machine.md);决策点细节见 [decision-points.md](decision-points.md);平台差异见 [platform-matrix.md](platform-matrix.md)。
|
|
6
6
|
|
package/gemini-extension.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "team-flow",
|
|
3
3
|
"description": "Unified workflow plugin: team-flow (spec-driven dev) + compound-engineering core subset + architecture-design (4A/DDD) + prototype (local HTML) + business-analysis (independent requirement/scenario artifact). 26 skills, one install.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.48.0",
|
|
5
5
|
"contextFileName": "GEMINI.md"
|
|
6
6
|
}
|
package/hooks/session-start
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# v0.
|
|
2
|
+
# v0.48.0: auto-sync CLI version with plugin version
|
|
3
3
|
set -e
|
|
4
4
|
|
|
5
5
|
# ═══════════════════════════════════════════════════════════════
|
|
6
6
|
# Plugin version (update this when releasing new versions)
|
|
7
7
|
# ═══════════════════════════════════════════════════════════════
|
|
8
|
-
PLUGIN_VERSION="0.
|
|
8
|
+
PLUGIN_VERSION="0.48.0"
|
|
9
9
|
|
|
10
10
|
# ═══════════════════════════════════════════════════════════════
|
|
11
11
|
# Step 1: Auto-sync CLI version with plugin version
|
package/llms.txt
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
## Overview
|
|
4
4
|
spec-superflow is a self-contained workflow integration plugin for Claude Code, Cursor, OpenAI Codex CLI/App, GitHub Copilot CLI, Gemini CLI, OpenCode, WorkBuddy, and Trae. It merges spec-driven planning artifacts (proposal, specs, design, tasks) with disciplined execution guardrails (TDD, review gates, controlled handoff) into one unified workflow.
|
|
5
5
|
|
|
6
|
-
Current version: v0.
|
|
6
|
+
Current version: v0.48.0.
|
|
7
7
|
|
|
8
8
|
## Key Documents
|
|
9
9
|
- README.md: Chinese homepage with full usage guide and FAQ
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xulthekl/team-flow",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Unified plugin (26 skills +
|
|
3
|
+
"version": "0.48.0",
|
|
4
|
+
"description": "Unified plugin (26 skills + 17 agents) integrating team-flow, compound-engineering, architecture-design, prototype, design-system, workflow-orchestrator, workflow-bootstrap, e2e, session-handoff, workflow-feedback, business-analysis for multi-agent coding tools.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"bin": {
|
package/plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "team-flow",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Unified workflow plugin: team-flow (spec-driven dev: TDD/SDD/code-review/debugging) + compound-engineering core subset (brainstorm/plan/compound/strategy/ideate/proof, global compounding) + architecture-design (4A+DDD incremental design & global compounding) + prototype (local HTML prototype, zero external deps) + e2e (Playwright E2E, AC-driven) + workflow-orchestrator (product-level workflow orchestration) + workflow-bootstrap (existing project onboarding) + session-handoff (context transfer) + workflow-feedback (issue tracking) + business-analysis (independent requirement/scenario artifact). 26 skills +
|
|
3
|
+
"version": "0.48.0",
|
|
4
|
+
"description": "Unified workflow plugin: team-flow (spec-driven dev: TDD/SDD/code-review/debugging) + compound-engineering core subset (brainstorm/plan/compound/strategy/ideate/proof, global compounding) + architecture-design (4A+DDD incremental design & global compounding) + prototype (local HTML prototype, zero external deps) + e2e (Playwright E2E, AC-driven) + workflow-orchestrator (product-level workflow orchestration) + workflow-bootstrap (existing project onboarding) + session-handoff (context transfer) + workflow-feedback (issue tracking) + business-analysis (independent requirement/scenario artifact). 26 skills + 17 agents, one install.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "LT"
|
|
7
7
|
},
|
|
@@ -60,6 +60,53 @@ function sanitizeBranchName(raw) {
|
|
|
60
60
|
return cleaned || 'change';
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
// 检查未提交变更(sop-flow-2,multi-repo-support-design v1.0 §4.3 未提交变更归属)。
|
|
64
|
+
// git status --porcelain 统计未提交文件;worktree 基于已提交 HEAD 创建,未提交变更不自动带入,
|
|
65
|
+
// 报告数与文件列表供人工/编排确认归属(是否属于当前 change)。
|
|
66
|
+
function checkUncommitted(repoDir) {
|
|
67
|
+
const opts = { encoding: 'utf-8', cwd: repoDir, stdio: ['ignore', 'pipe', 'pipe'] };
|
|
68
|
+
try {
|
|
69
|
+
const out = execFileSync('git', ['status', '--porcelain'], opts).toString();
|
|
70
|
+
const files = out.split('\n').filter(Boolean);
|
|
71
|
+
return { count: files.length, files };
|
|
72
|
+
} catch {
|
|
73
|
+
return { count: 0, files: [] };
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// 检查分支是否远程共享(sop-flow-2,multi-repo-support-design v1.0 §4.3)。
|
|
78
|
+
// 通过 git branch -vv 检测 [origin/...] tracking + ahead/behind。
|
|
79
|
+
// P3 #3:有 upstream tracking 即视为共享分支(ahead/behind 非 0 是充分非必要条件——
|
|
80
|
+
// 已同步分支就地实施后也会变 ahead 污染共享分支),须建 worktree/新分支,而非就地实施。
|
|
81
|
+
function checkSharedBranch(repoDir) {
|
|
82
|
+
const opts = { encoding: 'utf-8', cwd: repoDir, stdio: ['ignore', 'pipe', 'pipe'] };
|
|
83
|
+
let branch;
|
|
84
|
+
try {
|
|
85
|
+
branch = (execFileSync('git', ['branch', '--show-current'], opts) || '').trim();
|
|
86
|
+
} catch {
|
|
87
|
+
return { shared: false };
|
|
88
|
+
}
|
|
89
|
+
if (!branch) return { shared: false };
|
|
90
|
+
try {
|
|
91
|
+
const vv = execFileSync('git', ['branch', '-vv'], opts).toString();
|
|
92
|
+
// P3 评审 #5:当前分支行以 '*' 开头,避免子串误命中名称含当前分支名的其他分支(如 feature/x vs feature/x2)
|
|
93
|
+
const line = vv.split('\n').find((l) => l.startsWith('*') && l.includes(branch));
|
|
94
|
+
if (!line) return { shared: false };
|
|
95
|
+
const tracking = line.match(/\[([^\]]+)\]/);
|
|
96
|
+
if (!tracking) return { shared: false };
|
|
97
|
+
const ahead = line.match(/ahead (\d+)/)?.[1];
|
|
98
|
+
const behind = line.match(/behind (\d+)/)?.[1];
|
|
99
|
+
return {
|
|
100
|
+
shared: true,
|
|
101
|
+
upstream: tracking[1],
|
|
102
|
+
ahead: parseInt(ahead || '0', 10),
|
|
103
|
+
behind: parseInt(behind || '0', 10),
|
|
104
|
+
};
|
|
105
|
+
} catch {
|
|
106
|
+
return { shared: false };
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
63
110
|
// 枚举 root 下含 .git 的直接子目录(= 代码仓库),按目录名排序保证确定性。
|
|
64
111
|
// .git 可能是目录(普通仓库)或文件(worktree/submodule 链接),existsSync 均覆盖。
|
|
65
112
|
function listCodeRepos(root) {
|
|
@@ -128,8 +175,34 @@ function runMultiRepo(root, repos) {
|
|
|
128
175
|
continue;
|
|
129
176
|
}
|
|
130
177
|
|
|
131
|
-
// 该仓库已不在受保护分支 →
|
|
178
|
+
// 该仓库已不在受保护分支 → 判断是否远程共享分支(sop-flow-2,v1.0 §4.3):
|
|
179
|
+
// 共享分支(upstream tracking + ahead/behind 非 0)应视为"非隔离"——就地实施会污染共享分支,
|
|
180
|
+
// 须建独立 worktree/新分支。纯本地分支或无 tracking → 已隔离。
|
|
132
181
|
if (!PROTECTED.includes(branch)) {
|
|
182
|
+
const shareInfo = checkSharedBranch(repoDir);
|
|
183
|
+
// P3 评审 #3:有 upstream tracking 即视为共享分支(ahead/behind 非 0 是充分非必要条件——
|
|
184
|
+
// 已同步分支就地实施后也会变 ahead 污染共享分支)
|
|
185
|
+
const sharedRisk = shareInfo.shared;
|
|
186
|
+
if (sharedRisk) {
|
|
187
|
+
const uncommitted = checkUncommitted(repoDir);
|
|
188
|
+
console.error(
|
|
189
|
+
`ensure-branch: [${repo}] on SHARED branch '${branch}' (upstream ${shareInfo.upstream}, `
|
|
190
|
+
+ `ahead ${shareInfo.ahead}/behind ${shareInfo.behind}) — NOT isolated; creating worktree to avoid polluting the shared branch...`
|
|
191
|
+
+ (uncommitted.count > 0 ? ` (${uncommitted.count} uncommitted change(s) not carried into worktree — verify ownership before discarding)` : '')
|
|
192
|
+
);
|
|
193
|
+
try {
|
|
194
|
+
execFileSync('git', ['worktree', 'add', wtPath, '-b', branchBase], { ...repoOpts, stdio: 'inherit' });
|
|
195
|
+
console.log(`ensure-branch: [${repo}] created worktree at ${wtPath} on branch '${branchBase}'.`);
|
|
196
|
+
} catch (e) {
|
|
197
|
+
console.error(`ensure-branch: [${repo}] worktree creation failed: ${(e.stderr || e.stdout || e.message || 'unknown').toString().trim()}`);
|
|
198
|
+
failed.push(repo);
|
|
199
|
+
}
|
|
200
|
+
continue;
|
|
201
|
+
}
|
|
202
|
+
const uncommitted = checkUncommitted(repoDir);
|
|
203
|
+
if (uncommitted.count > 0) {
|
|
204
|
+
console.warn(`ensure-branch: [${repo}] has ${uncommitted.count} uncommitted change(s); verify they belong to the current change.`);
|
|
205
|
+
}
|
|
133
206
|
console.log(`ensure-branch: [${repo}] already isolated on branch '${branch}'.`);
|
|
134
207
|
continue;
|
|
135
208
|
}
|
|
@@ -173,11 +246,28 @@ function runSingleRepo() {
|
|
|
173
246
|
}
|
|
174
247
|
|
|
175
248
|
if (!PROTECTED.includes(branch)) {
|
|
176
|
-
|
|
177
|
-
|
|
249
|
+
const shareInfo = checkSharedBranch(changeDir);
|
|
250
|
+
// P3 评审 #3:有 upstream tracking 即视为共享分支
|
|
251
|
+
const sharedRisk = shareInfo.shared;
|
|
252
|
+
if (sharedRisk) {
|
|
253
|
+
const uncommitted = checkUncommitted(changeDir);
|
|
254
|
+
console.error(
|
|
255
|
+
`ensure-branch: on SHARED branch '${branch}' (upstream ${shareInfo.upstream}, `
|
|
256
|
+
+ `ahead ${shareInfo.ahead}/behind ${shareInfo.behind}) — NOT isolated; creating worktree to avoid polluting the shared branch...`
|
|
257
|
+
+ (uncommitted.count > 0 ? ` (${uncommitted.count} uncommitted change(s) not carried into worktree — verify ownership before discarding)` : '')
|
|
258
|
+
);
|
|
259
|
+
// fall through 到下方 worktree 创建逻辑(不 exit(0))
|
|
260
|
+
} else {
|
|
261
|
+
const uncommitted = checkUncommitted(changeDir);
|
|
262
|
+
if (uncommitted.count > 0) {
|
|
263
|
+
console.warn(`ensure-branch: ${uncommitted.count} uncommitted change(s); verify they belong to the current change.`);
|
|
264
|
+
}
|
|
265
|
+
console.log(`ensure-branch: already isolated on branch '${branch}'. Proceed with implementation edits.`);
|
|
266
|
+
process.exit(0);
|
|
267
|
+
}
|
|
178
268
|
}
|
|
179
269
|
|
|
180
|
-
console.error(`ensure-branch: on protected branch '${branch}'. Creating an isolated implementation context...`);
|
|
270
|
+
console.error(`ensure-branch: on ${PROTECTED.includes(branch) ? 'protected' : 'shared non-protected'} branch '${branch}'. Creating an isolated implementation context...`);
|
|
181
271
|
|
|
182
272
|
const repoName = basename(changeDir) || 'repo';
|
|
183
273
|
const name = sanitizeBranchName(changeName || repoName);
|