@xulthekl/team-flow 0.54.0 → 0.56.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.
Files changed (63) hide show
  1. package/.claude/always/phase-guard.md +1 -1
  2. package/.claude-plugin/marketplace.json +1 -1
  3. package/.claude-plugin/plugin.json +1 -1
  4. package/.codex-plugin/plugin.json +1 -1
  5. package/.cursor-plugin/marketplace.json +1 -1
  6. package/.cursor-plugin/plugin.json +1 -1
  7. package/.github/plugin/marketplace.json +2 -2
  8. package/AGENTS.md +2 -2
  9. package/CHANGELOG.md +92 -1
  10. package/GEMINI.md +1 -1
  11. package/INSTALL.md +1 -1
  12. package/README.md +1 -1
  13. package/agents/prototype-env-scout.md +4 -4
  14. package/dist/parsing/requirement-blocks.d.ts +26 -0
  15. package/dist/parsing/requirement-blocks.js +33 -5
  16. package/dist/validation/validator.js +8 -1
  17. package/docs/README_en.md +1 -1
  18. package/gemini-extension.json +1 -1
  19. package/hooks/session-start +19 -2
  20. package/llms.txt +1 -1
  21. package/package.json +1 -1
  22. package/plugin.json +1 -1
  23. package/scripts/check-project-config.mjs +84 -0
  24. package/scripts/design-system-clone.mjs +150 -0
  25. package/scripts/design-system-import.mjs +102 -14
  26. package/scripts/gen-primer.mjs +65 -13
  27. package/scripts/guard/checks/tasks-complete.mjs +9 -4
  28. package/scripts/guard/design-token-guard.mjs +136 -117
  29. package/scripts/infer-workflow.mjs +10 -1
  30. package/scripts/lib/arch-merge.mjs +20 -6
  31. package/scripts/lib/arch-parse.mjs +5 -11
  32. package/scripts/lib/ds-inputs.mjs +125 -0
  33. package/scripts/lib/ds-parse.mjs +124 -12
  34. package/scripts/lib/execution-recommendation.mjs +10 -1
  35. package/scripts/lib/glaf4-delegation.mjs +14 -3
  36. package/scripts/lib/hash.mjs +18 -2
  37. package/scripts/lib/md-normalize.mjs +108 -0
  38. package/scripts/lib/prototype-sync.mjs +19 -1
  39. package/scripts/lib/sdd-overlay.mjs +17 -6
  40. package/scripts/lib/slug.mjs +68 -0
  41. package/scripts/lib/solutions-capture.mjs +6 -12
  42. package/scripts/lib/solutions-index-gen.mjs +2 -2
  43. package/scripts/lib/solutions-phases.mjs +32 -0
  44. package/scripts/lib/solutions-promote.mjs +16 -5
  45. package/scripts/lib/spec-merge.mjs +46 -11
  46. package/scripts/lib/state-loader.mjs +4 -1
  47. package/scripts/lib/test-merge.mjs +4 -1
  48. package/scripts/token-extract.mjs +101 -9
  49. package/skills/ce-compound/references/three-tier-index.md +6 -2
  50. package/skills/design-system/SKILL.md +46 -23
  51. package/skills/design-system/references/agents/design-system-architect.md +25 -12
  52. package/skills/design-system/references/creation-flow.md +17 -0
  53. package/skills/design-system/references/creation-modes.md +171 -0
  54. package/skills/design-system/references/showcase-board-b-end.md +50 -36
  55. package/skills/design-system/references/showcase-board-c-end.md +59 -36
  56. package/skills/design-system/references/variant-schema.md +21 -1
  57. package/skills/prototype/SKILL.md +4 -0
  58. package/skills/prototype/references/builder-methodology.md +11 -4
  59. package/skills/prototype/references/layouts.md +10 -0
  60. package/skills/prototype/references/orchestration-flow.md +8 -0
  61. package/skills/workflow-bootstrap/SKILL.md +15 -5
  62. package/src/parsing/requirement-blocks.ts +34 -5
  63. package/src/validation/validator.ts +8 -1
@@ -1,3 +1,3 @@
1
- # team-flow v0.54.0 | 阶段: {{state}} | 工作流: {{workflow}}
1
+ # team-flow v0.56.0 | 阶段: {{state}} | 工作流: {{workflow}}
2
2
  当前阶段允许的操作由 workflow-start 路由规则定义。
3
3
  禁止跨越 DP gate 进入下一阶段。变更范围以 execution-contract.md 的 Intent Lock 为准。
@@ -9,7 +9,7 @@
9
9
  {
10
10
  "name": "team-flow",
11
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.54.0",
12
+ "version": "0.56.0",
13
13
  "source": "./",
14
14
  "author": {
15
15
  "name": "LT",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "team-flow",
3
- "version": "0.54.0",
3
+ "version": "0.56.0",
4
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) + design-system (design tokens + component contract + AI primer + showcase) + test-strategy (test strategy design) + project-initialize (new service onboarding). 26 skills + 17 agents, one install.",
5
5
  "source": "./",
6
6
  "author": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "team-flow",
3
- "version": "0.54.0",
3
+ "version": "0.56.0",
4
4
  "description": "Spec-first workflow that bridges OpenSpec-style planning and Superpowers-style execution discipline.",
5
5
  "author": {
6
6
  "name": "MageByte",
@@ -5,7 +5,7 @@
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.54.0"
8
+ "version": "0.56.0"
9
9
  },
10
10
  "plugins": [
11
11
  {
@@ -2,7 +2,7 @@
2
2
  "name": "team-flow",
3
3
  "displayName": "team-flow",
4
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.54.0",
5
+ "version": "0.56.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.54.0"
9
+ "version": "0.56.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.54.0",
15
+ "version": "0.56.0",
16
16
  "source": ".",
17
17
  "author": {
18
18
  "name": "LT",
package/AGENTS.md CHANGED
@@ -110,7 +110,7 @@ docs/
110
110
  ├── architecture/ 全局架构三层(v0.36.0):L1 当前态(ARCHITECTURE.md marker 区 / PHYSICAL-MODEL.md / DATABASE.md / API-INDEX.md / INDEX.md / domains/<bc>.md / diagrams/ / schema-baseline.sql / baseline.md)+ L2 changelog/ + L3 iterations/vN/architecture.md(产品级快照,archived 退役)
111
111
  └── solutions/ 复利经验库(v0.5 新增,三层索引)
112
112
  ├── INDEX.md # L1 轻量索引(≤150行,每条一行摘要+标签)
113
- ├── requirement/ plan/ architecture/ prototype/ spec/ build/ review/ cross-phase/ # L2 分阶段目录(v0.36.0 加 architecture)
113
+ ├── prd/ plan/ architecture/ prototype/ spec/ build/ review/ cross-phase/ # L2 分阶段目录(枚举权威:scripts/lib/solutions-phases.mjs)
114
114
  └── <file>.md # L3 经验文件(YAML frontmatter: phase/domain/type/severity)
115
115
  changes/<name>/ 变更脚手架(S4 创建):.team-flow.yaml(变更级状态文件)/ change-brief.md(产品级交接物,含 upstream_arch_ref)/ proposal.md / design.md / tasks.md / execution-contract.md / learnings.md(变更级经验台账)/ architecture/(变更级三件套 + sql/)
116
116
  specs/<cap>/ 每变更规格:spec.md(v0.49.0 §83.3.5:learnings.md 归 change 根,不在此目录)
@@ -253,7 +253,7 @@ STRATEGY.md CONCEPTS.md 产品策略(BA) / 领域词汇
253
253
  ```
254
254
  docs/solutions/
255
255
  ├── INDEX.md # L1:轻量索引(≤150行,每条一行摘要+标签,按 severity 降序)
256
- ├── requirement/ plan/ prototype/ spec/ build/ review/ cross-phase/ # L2:分阶段目录
256
+ ├── prd/ plan/ architecture/ prototype/ spec/ build/ review/ cross-phase/ # L2:分阶段目录(枚举权威:scripts/lib/solutions-phases.mjs)
257
257
  └── <date>-<summary>.md # L3:经验文件(YAML frontmatter: phase/domain/type/severity/date/source)
258
258
  ```
259
259
 
package/CHANGELOG.md CHANGED
@@ -4,6 +4,97 @@ 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.56.0] - 2026-09-12
8
+
9
+ ### Fixed(复利产物文件名退化 + 索引丢条目;来源:emp-auth 复利膨胀调查)
10
+
11
+ 设计来源:`docs/plan/compound-lifecycle-governance-design.md` v1.0。输入 = **emp-auth v1 迭代(5 change)的复利产物实测**——发现"复利条目随迭代膨胀/重复"的表象下,实为**存储层无上限 + 身份层去重键选错 + 索引层无门禁**三层缺口(完整证据链见该方案附录 A;P1/P2 待实施)。
12
+
13
+ 本版处置其中两个**确定性缺陷**(P0):
14
+
15
+ - **PHASES 枚举三处定义互相矛盾**(`solutions-capture` 8 项含 `architecture` / `solutions-index-gen` 7 项缺 / 文档树写 `requirement`):`tf solutions capture --phase architecture` 写入的条目在 `tf solutions index-gen` 重建后**从 INDEX.md 消失**——文件仍在磁盘,但对所有注入与检索通道不可见。新增 `scripts/lib/solutions-phases.mjs` 作唯一真相源,两处消费点收敛。
16
+ - **slug 规则三套并存,两处不保留 CJK 且逐字符替换**:`test-merge.mjs` 的 `replace(/[^a-z0-9-]/g,'-')` 与 `sdd-overlay.mjs` 的 `replace(/[^A-Za-z0-9._-]/g,'_')` 把中文标题**逐字符**替换为分隔符,产生 `--------------------.md`(原名「执行结果(三仓实测,命令 + 实际输出)」)这类无信息量文件名(emp-auth 实测 17 个文件受影响);叠加 baselines 的 `moduleName` 取自 test-matrix 三级标题原文(每轮自由命名)⇒ 文件名不稳定 ⇒ `existsSync` 不命中 ⇒ **新建而非增量合并**(`demohome` 三次 merge 全为 `A(Added)`,攒出 3 个文件)。新增 `scripts/lib/slug.mjs` 作唯一真相源(`slugify` / `safeName` / `CJK_CLASS`),4 处消费点收敛。
17
+
18
+ **关键陷阱(已写入模块注释守护)**:字面「一-鿿」拼进字符类时,**前一个字符若为 `-` 会构成范围**——`[^..._-一-鿿]` 里的 `_-一` 是 U+005F–U+4E00 范围,U+4E00 以上的汉字(如「任务」U+4EFB)仍被替换。故 `CJK_CLASS` 以转义写法导出,`safeName` 的 `-` 置于字符类末尾。
19
+
20
+ ### Added
21
+
22
+ - `scripts/lib/slug.mjs`(文件名/路径段安全化唯一真相源)、`scripts/lib/solutions-phases.mjs`(复利 phase 枚举唯一真相源)
23
+ - `tests/lib/slug.test.mjs`(13 用例,含 U+4E00 以上汉字的范围陷阱守护)、`tests/lib/solutions-phases.test.mjs`(6 用例,含"capture 能写但 index-gen 扫不到"的行为级守护)、`tests/lib/test-merge.test.mjs` +1 用例(中文模块名不退化为短横线)
24
+
25
+ ### Changed
26
+
27
+ - `AGENTS.md` ×2、`skills/ce-compound/references/three-tier-index.md` ×2:phase 目录列表同口径同步,顺带修正 `requirement/` → `prd/`(与脚本实际写入目录对齐),并补注"CLI 通道 phase 目录"与"ce-compound category 目录"两套词表互不兼容
28
+
29
+ ### 验证
30
+
31
+ - 全量测试 **1108/1108 通过**
32
+ - **4 项变异验证**确认新增测试具备判别力(去掉 `architecture` / index-gen 写死列表 / `safeName` 的 `-` 置中 / test-merge 还原旧正则——每项均使对应测试失败并报出原缺陷形态)
33
+ - **行为等价实证**:以 emp-auth 真实 learnings 标题跑新 `slugify`,与既有条目文件名 **4/4 一致**(无回归)
34
+ - 提交可见性:4 个新增文件未被 `.gitignore` 吞掉,2 个脚本进入 `npm pack` 白名单
35
+
36
+ ## [0.55.0] - 2026-09-11
37
+
38
+ ### Added(首次真实使用反馈处置:棕地机制 + 解析层加固)
39
+
40
+ 设计来源:`docs/plan/design-system-prototype-enhancement-design.md` v1.8-r3(第八章;三轮对抗验证闭合表见附录 A.5/A.6/A.7)。输入 = **v0.54.0 设计系统能力的首次真实使用**(`fytx-agreement` 项目,4 条 workflow-feedback)+ 4 路并行核查(插件仓库 3 路事实核查 + 使用现场 1 路证据勘查);P1.5 **完整档(3 轮)** 收敛:问题数 29 → 21 → 0 Critical。
41
+
42
+ **根因(3 个,非 4 条反馈的简单加总)**:**A** 插件内置资产与项目既有资产之间无「探测 → 替代」机制(首次使用正落在被推迟到 v2 的那一侧);**B** 静态副本冒充真相源(showcase brief 的写死清单 vs 动态契约表);**C** 手写 Markdown 解析层无统一容错约定与测试守护(**复发型**——同型 bug 已修过两次且均未横展)。
43
+
44
+ - **解析层共享层**(根因 C 的收口):新增 `scripts/lib/md-normalize.mjs`——**全仓库唯一的 Markdown 容错约定**(`stripEmphasis` / `stripInlineEmphasis` / `normalizeInline` / `matchKeyValue` / `parseTaskLine`),含 CRLF 容错;`scripts/lib/ds-inputs.mjs`——输入解析下沉(`resolveInputs` / `REQUIRED_SECTIONS` / `readFileOrNull` 等),使 `gen-primer` 能复用 guard 的变体发现而**不必 import 顶层副作用模块**。
45
+ - **`create-from-docs` 模式**(根因 A):`token-extract.mjs --docs` 扫描 Markdown 规范树,出**证据报告 + 冲突呈现**(不做取值裁决——真实规范树列序不固定,按频次排序会选出错的主色);`SKILL.md` Step 0 增该入口。
46
+ - **`clone --from` 移植**(根因 A,LT 需求"同类后台复用"):`scripts/design-system-clone.mjs` 把 `cp -r` 会留的 **4 个坑**自动化——来源记录改写(保留原裁决历史)/ primer 强制重生成 / 业务组件清单输出 / 授权提示。
47
+ - **`--profile antd` 通用起点**(D-21):`design-system-import.mjs` 新增 profile 分支(AntD v5 seed token,MIT)——零 LLM、零外部资产、零授权链风险。
48
+ - **`layout` 段扩展承载页面范式**(根因 A):新增 `### 页面范式` 子块(`页面范式来源:引用内置 | 项目自有 | 同 <端>` 三值 + 页面类型表)与 `### 容器骨架` 块(类名 + 关键 CSS)——**后者的动机**:内置 `template.html` 的骨架是营销向的 `hero/cta/log`,**无 B 端容器类**,不给物料则 builder 每页要手写整套骨架 CSS。
49
+ - **`来源与裁决记录` 段**(导入类创建条件必填,审计层 advisory):记录原始来源 / 导入方式 / "为何不直接采纳" / 主色裁决 / 待清理项——把现场手工映射时趟出的高质量做法**固化为流程**。
50
+ - **消费端改造**(根因 A 的真正闭环):`builder-methodology.md` 改为**以 primer 的「页面范式」段为准**(内置 `layouts.md` 降为回退默认)、验收口径改"结构性区块齐全 + token 合规 + 零白名单外自造";`layouts.md` 类清单契约加注;`prototype/SKILL.md` 同步。
51
+ - **showcase brief 引用化**(根因 B):两个 board 的「区块与组件」与「覆盖清单」两段由**写死组件名**改为**角色化描述 + 从契约表选**(静态副本 vs 动态事实必然漂移,实测已漂移:19/16 类 vs 现 31 类)。
52
+ - **配置漂移检查**:`scripts/check-project-config.mjs`——检查配置指向是否存在、`version` 是否与插件一致(现场实测三类漂移**全部静默**);检查面按"实际被消费"分级,零消费者键只提示。
53
+ - **三种新模式的文档**:`skills/design-system/references/creation-modes.md`(渐进式披露,避免 SKILL.md 过载)。
54
+
55
+ ### Changed(行为变更,存量项目升级须知)
56
+
57
+ > **本节是升级必读**:以下变更会改变既有产物的判定或触发一次性失效。
58
+
59
+ - **guard L3/L4 语义重写**:L3 由"关键词匹配(**实为空检测**——判据对 `markdown + primer.md` 匹配,而 primer 里 gen-primer 硬编码的 `## 页面范式` 段必然命中,恒通过)"改为**基于 `layout` 段结构化声明的解析**;L4 拆 a/b(布局基础 / 页面范式内容)并**收紧判据**(原裸子串 `/sm|md|lg/` 被 `.md` 路径文本保证命中)。**检测面改为"设计系统源文本,按端分别求值"**(不再读 primer——消除自证;不用合并文本——`sectionBodyRaw` 用 `findIndex` 只取首个 `## layout`,`both` 端下 c-end 声明永不解析)。
60
+ - **三态标签贯穿全渲染链**:`layerResults` 值域 `true | false | 'warn'`;`'warn'` 用于"新增可选内容缺失"**绕过 `labelOf` 恒输出 ⚠️**(现场 `contract: v1` 系统缺声明若走原机制会打 ❌,与 D-15 冲突);汇总行与 `--json` 同步(原只改明细行会**同一次运行出现相反标签**)。
61
+ - **单文件模式变体发现告警**:原实现 `ignored` 计算在 `!subjectComplete` 分支内 → 单文件模式(转换器产物)整块跳过,同目录变体**静默不参与判据**。现无论合并与否都告警。
62
+ - **`gen-primer` digest 覆盖 base + 参与合并的变体**:原先只对 base.md 做 sha256 → **变体变更不判 STALE** → prototype Step 0 gate 放行 → 原型静默用旧页面范式。**升级影响**:存量 primer 会判一次 STALE(exit 2),需重跑生成。
63
+ - **导入类产物的 `contract` 由 `v1` 改 `legacy`**(D-18):导入的既有资产天然未经校准,按最严档判会一落盘即 blocked(死循环)。**门禁面影响**:模板库/转换器路径从"blocked 强制"降为"WARN 放行"——这是有意的。
64
+ - **复选框 5 处统一到共享原语**:`hash`(**替换式**,语义保持)/ `guard.tasks-complete` / `glaf4-delegation` / `execution-recommendation` / `infer-workflow`。**档位影响**(约束③ 对照表,已固化为可执行断言):`[X]` 大写 / 缩进子项 / `*` bullet / `-\t` 分隔 在旧实现下**全部漏计** → 新实现计入。两个具体后果:单条 `* [x] A` **full → hotfix**(旧实现零计数落到"无规划制品 → full"安全默认);4 条大写 `[X]` 为主 **hotfix → tweak**。
65
+ - **`hash.normalizeCheckboxes` 的归一化面扩大**:`* [x] A` / `-\t[x] A` 现在也被归一化 → **存量 change 的 `artifacts_hash` 会过期一次**。
66
+ - **`hooks/session-start` 版本比较改"只升不降"**:原 `if [ "$installed_version" != "$PLUGIN_VERSION" ]` 只判"不等"不判"谁新谁旧" → **任何一个旧版插件缓存副本跑起来都会把新版 CLI 降级**(实测 `tf` 被从 0.54.0 降到 0.51.0)。
67
+ - **多源路径改显式报错**(`token-extract.mjs`):原实现取 `positional[0]`、**静默丢弃**其余源路径——多仓场景下用户以为处理了全部。现收到 ≥2 个即 exit 1 并列出全部路径。**源路径是位置参数(不存在 `--source` flag)**,文档中的旧写法已同步修正。
68
+ - **`design-system-clone` 的 primer 自检改参与退出码**:`gen-primer --check` 紧随"刚重生成"之后运行,两者不一致 = **生成器自相矛盾**(而非用户输入问题)。原实现只打印不决定退出码 → 脚本报成功,而产物对 `contract: v1` 系统实为 blocked(prototype Step 0 会拒绝),问题被推迟到使用现场才暴露。现失败即 exit 1 并提示上报。
69
+
70
+ ### Fixed(解析层,根因 C)
71
+
72
+ - **`parseContract` / `parseA1Tokens` 对 Markdown 强调语法脆弱且失败静默**(FB-4):`- **contract**: v1` 与 `` `contract`: v1 `` 都解析不出值,被判 `unset` → guard 降级、primer 头部错报,**全程无提示**。现容忍加粗 / 反引号 / 全角冒号 / 冒号前空格 / 表格五种形态,并在"段存在 + 提到 contract + 解析不出"时**显式 WARN**。
73
+ - **`parseComponentsTable` 整行静默漏计**:`| **交互** |`(类型列被加粗)无法匹配类型表 → 该组件行被 `continue` 丢弃。现表格单元格统一归一化。
74
+ - **`parseContract` 值域过窄**:原只认 `v1|legacy`,未来 `v2` 会静默降级。现接受 `v\d+`,**未知值按最严档(等同 v1)+ WARN**。
75
+ - **`custom-prop` 把 `rgba(0, 0, 0, 0.05)` 拆成碎片**:多值拆分逻辑(为 `padding: 8px 16px` 设计)对含括号/逗号的值产生 `rgba(0` / `0.05)` 假证据。现含 `(),` 的值视为单值。
76
+ - **`token-extract` 产物自吞**:`--docs` 模式下产物原落 `join(root, …)`,而 root 恰是被扫描树 → 二次运行自吞(实测 ×1 → ×3)。现落调用方工作目录 + `.team-flow` 入 `SKIP_DIRS`。
77
+ - **转换器 id 取目录名**:内置模板库(`templates/.../references/linear-app.md`)会得到无意义的 `references`,写进来源段后无法辨认。现文件名优先(非约定名 `DESIGN.md` 时)。
78
+ - **横展 13 处**:`spec-merge` / `arch-parse`(**删除本地重复实现**,双实现归零)/ `arch-merge` / `prototype-sync` / `solutions-promote` / `sdd-overlay` / `state-loader` / `hash.extractYamlField`。其中 `prototype-sync` 的加粗标题原会**静默丢段**。
79
+ - **TS 侧解析层漏修**(P4 code-review 发现后补修,**本插件两条解析实现分属两种语言、两个测试通道**):`src/parsing/requirement-blocks.ts` 是 JS 侧之外的**另一条实现**,编译到 `dist/`,而 `tf sync` 走的正是它(`spec-merge.mjs` → `import('../../dist/index.js')` → `parseDeltaSpec`)——**JS 侧修复覆盖不到**。实测 `### **Requirement**: X` / `` ### `Requirement`: X `` / 全角冒号 / 冒号前空格**四种全部解析出 0 条**,且不报错不告警(delta spec 静默不合并,`spec_merged` 保持 false 但不说明原因)。现同源归一化(键名两侧符号**任意交错**:`` **`Requirement`** `` 亦可);同时删除 `src/validation/validator.ts` 中**同契约的第二处 `REQUIREMENT_HEADER_REGEX` 定义**(定义后从未被使用,属"同一契约多处定义"的结构性维护陷阱);新增 `tests/lib/ts-parsing-tolerance.test.mjs`(19)——含**端到端闭环**(宽松形态 delta 经真实 `tf sync` 合并进主基,再由 `extractRequirementsSection` 读回)与**单一真相源护栏**(src 下不得出现第二处需求头正则定义)。
80
+
81
+ ### Tests
82
+
83
+ `1088 tests / 1088 pass / 0 fail`(基线 942)。新增 **8 个测试文件**:`md-normalize`(29)、`ds-parse`(59)、`checkbox-consistency`(12,**约束③ 的可执行形态**——走真实生产 API + 差异白名单)、`design-system-import`(5,该模块此前**全仓零测试**)、`design-system-clone`(6)、`prototype-sync`(6,此前零命中)、`spec-merge-tolerance`(6)、`ts-parsing-tolerance`(19,**TS 侧独立通道**——`tf sync` 走 `dist/` 编译产物,JS 侧测试覆盖不到;见 Fixed 末条)。既有 `design-token-guard`(+7,L3/L4 新语义)与 `hook-session-start`(+4,"只升不降"回归)同步更新。
84
+
85
+ ### Known Deviations(记录在案)
86
+
87
+ | # | 设计原文 | 实施结果 | 理由 |
88
+ |---|---------|---------|------|
89
+ | 1 | §8.4.3 约束② 要求"缺字段一律 WARN + 关键字段清单 + 走 stderr + `tf state get` 冒烟断言" | **仅实现"缺字段不报错",WARN 未落地** | 实测部分写法 37 处(20 文件),落地后刷 stderr 有触碰既有 CLI 断言的实测风险;建议单独立项 |
90
+ | 2 | §8.2.1 "修多值或显式报错" | 选**显式报错** | 不改变既有单值语义;多仓可用多次调用 |
91
+ | 3 | §8.4.3 `parseContract` 值域 `[a-z0-9_]+` | 实施为 `/^(v\d+\|legacy)$/i` | 更收敛:`contract: bogus` 返回 null 并由 guard 按最严档 + WARN,与意图一致 |
92
+ | 4 | §8.2.5 L4a "键形态 或 断点值形态" | 增**第三种:表格形态** | 现场用 `\| \`sm\` \| \`≥ 768px\` \|` 声明断点,只认前两种会把它判成"缺断点"(P1.5 三轮预警的假阴性,实施期实测确认) |
93
+ | 5 | §8.2.1 输出"三类候选" | 增 `doc-table-ctx` 与 `VALUE_LIKE_RE` 值形态过滤 | 不加则把说明文字("不变"/"悬停态")当成 token 值——实测 185 条噪音冲突,过滤后 16 条且质量高(现场 6 组跨期主色矛盾完整呈现) |
94
+ | 6 | —(设计未提) | 新增 `references/creation-modes.md` | SKILL.md 渐进式披露:**六条起点**的完整流程 + §5「B 端容器骨架为何必须给」外置,主体回收至 145 行(≤150 规则) |
95
+ | 7 | §8.2.2 `parsePageArchetype` 表行数 | 表头抵扣**只作用于子块内首个表** | 约定形态是单表;多表会虚高(已在测试中以特征化断言登记,非背书) |
96
+ | 8 | §8.2.6 "prototype 内部 dispatch 增加 mode 传达" | 改为**传达事实而非 mode**:prototype 侧说"缺设计系统" + scout 简报中的**资产事实**(如"已有符合规范的原型代码"),起点由 design-system 的 Step 0 **无条件展示 7 条**(这才是可达性的保证);并补"目录已存在但不完整 → 走 iterate 不走 Step 0"分支。**P4 同步校正**:`design-system/SKILL.md` 的"入口同步"声明原写"三处,缺一则新模式不可达"——实为**两处声明 + 一处事实传达**,且 `orchestration-flow.md §①b` 此前完全未提(声明为假),现已落地 | 采用哪条起点取决于**用户的资产状况**(是否有可移植的同类设计系统 / 既有规范文档),**prototype 无从判断**——预选反而让能力不可达(与 D-23"能力存在但用户不知道 = 能力不存在"相悖) |
97
+
7
98
  ## [0.54.0] - 2026-09-10
8
99
 
9
100
  ### Added(设计系统 → 原型贯通:组件契约 + Primer + Showcase + 逆向建库)
@@ -44,7 +135,7 @@ The format loosely follows Keep a Changelog.
44
135
 
45
136
  ### Fixed(P5 提交期发现)
46
137
 
47
- - **内置参考库第 8 个文件被 `.gitignore` 静默吞掉**:`templates/design-systems/references/claude.md` 与 `.gitignore:9` 的 `CLAUDE.md` 规则同名,macOS 大小写不敏感文件系统上被判为忽略 → **registry.json 声明 8 个参考、git 只跟踪 7 个**(npm 包因读磁盘仍含 8 个,两边不一致;且 `git add -A` 永远不会收录它)。修法:`.gitignore` 加显式**例外规则**并注明原因;验证 `git ls-files templates/design-systems/references/` = 8。**该缺陷形态值得留意**:整个 P3/P4 的门禁(含我新加的两条 lint)都在查"文件引用是否存在",而没有一条检查"文件是否真的会被提交"——已作为教训记入本轮复盘。
138
+ - **内置参考库第 8 个文件被 `.gitignore` 静默吞掉**:`templates/design-systems/references/claude.md` 与 `.gitignore:9` 的 `CLAUDE.md` 规则同名,macOS 大小写不敏感文件系统上被判为忽略 → **registry.json 声明 8 个参考、git 只跟踪 7 个**(npm 包因读磁盘仍含 8 个,两边不一致;且 `git add -A` 永远不会收录它)。修法:`.gitignore` 加显式**例外规则**并注明原因;验证 `git ls-files templates/design-systems/references/` = 8。**该缺陷形态值得留意(本轮复盘的通用教训)**:整个 P3/P4 的门禁(含本轮新加的两条 lint)都在查「文件引用是否存在」,**没有一条检查「文件是否真的会被提交」**——而 `.gitignore` / 打包白名单这类「可见性」问题恰好在所有既有门禁的盲区里(它们只看磁盘,不看索引)。本轮的发现路径也很典型:**不是任何检查报出来的,是 `npm version` 自带的 `git add -A` 让暂存清单与预期不符才暴露的**。
48
139
 
49
140
  ### Tests
50
141
 
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.54.0 | 阶段: {{state}} | 工作流: {{workflow}}
11
+ # team-flow v0.56.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
@@ -7,7 +7,7 @@
7
7
  - [Fission-AI/OpenSpec](https://github.com/Fission-AI/OpenSpec) — 规划引擎(Schema 验证、Delta Spec、工件解析)
8
8
  - [obra/superpowers](https://github.com/obra/superpowers) — 执行纪律(TDD 铁律、SDD、系统化调试、代码审查)
9
9
 
10
- 当前发布版本:**v0.54.0**。
10
+ 当前发布版本:**v0.56.0**。
11
11
 
12
12
  ---
13
13
 
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # team-flow
2
2
 
3
- > 当前版本:`v0.54.0`
3
+ > 当前版本:`v0.56.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
 
@@ -11,7 +11,7 @@ You are a Prototype Environment Scout. You are dispatched by the `prototype` ski
11
11
 
12
12
  ## The Iron Law
13
13
 
14
- You NEVER write, edit, create, or delete any file. Your only output is the brief in your final response. Writing `prototype/` is `prototype-builder`'s job; writing `.team-flow/design-system/` is `design-system-architect`'s job.
14
+ You NEVER write, edit, create, or delete any file. Your only output is the brief in your final response. Writing `prototype/` is `prototype-builder`'s job; `.team-flow/design-system/` is the `/team-flow:design-system` skill's job(其内部执行引擎 `design-system-architect` 是唯一写者,但入口是 skill——v0.19.0 起不由原型侧直接派发)。
15
15
 
16
16
  ## Invocation Contract
17
17
 
@@ -43,13 +43,13 @@ Turn the probe into a decision-ready brief: what exists, what is missing, and a
43
43
  Produce:
44
44
  1. **Environment brief**: design-system status (9-段 completeness + palette), branch status, PRD version, existing prototype inventory.
45
45
  2. **Recommended prototype design plan(v0.18.0 升级:direction-picker)**: 产出 **2-3 个差异化方向**(反模式:>3 个、互为变体),每个方向含:
46
- - 布局策略(section 组合,参照 `references/layouts.md` 页面类型节奏表)
46
+ - 布局策略(section 组合,参照 `references/layouts.md` 页面类型节奏表;**若设计系统声明 `页面范式来源:项目自有`,改以 primer 的「页面范式」段页面类型表为准**——内置节奏表是回退默认)
47
47
  - 视觉侧重(信息密度 / 留白 / 数据可视化程度)
48
48
  - 风险权衡(复杂度 / 用户认知负荷 / 实施成本)
49
49
  - 方向间必须有**实质差异**(如"数据密集仪表盘" vs "任务流导向" vs "渐进披露")
50
50
  - 附推荐方向 + 理由(1 个)
51
51
  通用部分不变:page list (from PRD §4), component list (reuse vs new→sediment), navigation flow (from PRD §8.2), target branch + version.
52
- 3. **Readiness verdict**: `ready`(设计系统完整 + 方案可定)/ `needs_design_system`(缺/不全,需先派 design-system-architect)/ `needs_prd`(PRD 缺页面/功能定义).
52
+ 3. **Readiness verdict**: `ready`(设计系统完整 + 方案可定)/ `needs_design_system`(缺/不全,需主代理先调用 `/team-flow:design-system` skill)/ `needs_prd`(PRD 缺页面/功能定义).
53
53
 
54
54
  ## Output Format
55
55
 
@@ -128,4 +128,4 @@ Produce:
128
128
  阻断疑问(如 PRD 完全缺失无法定方案、无法定位任何原型/PRD 输入)→ 立即停止,返回 status=blocked + blockers[],绝不强行猜测。你不能调用 AskUserQuestion。
129
129
 
130
130
  **决策点交互(v0.21.0,§22.1.1 stop-and-resume)**:你无 AskUserQuestion。探查中遇到必须用户/主代理拍板、且 default_assumption 不安全的点(罕见——方向选定由主代理人工评审),可 `SendMessage(to: "main")` 发结构化提问 `{ question, why, options[] }` 后**停止**,主代理代问用户后回传并自动 resume 你续跑;**收到回传须校验对应性**(无主答案/串线 → 拒绝将错就错)。常规非阻断疑问照旧记 `outstanding_questions`,硬阻断照旧 `blocked`。
131
- 注意:设计系统缺失/不全通常**不是**你的 blocker(你只读探查),而是把 Readiness Verdict 标为 needs_design_system 交主代理决定是否先派 design-system-architect。
131
+ 注意:设计系统缺失/不全通常**不是**你的 blocker(你只读探查),而是把 Readiness Verdict 标为 needs_design_system,交主代理决定是否先调用 `/team-flow:design-system` skill。若探查中发现与**起点选择**相关的资产事实(如"已有符合规范的原型代码""需求方提到有既有 UI 规范文档""公司另一个后台项目已建过设计系统"),**在简报中如实记录**——主代理会把这些事实传达给 design-system skill 作为起点提示(不预选起点)。
@@ -10,7 +10,33 @@ export interface RequirementsSectionParts {
10
10
  bodyBlocks: RequirementBlock[];
11
11
  after: string;
12
12
  }
13
+ /**
14
+ * 行内强调剥离 + 去反引号(v0.55.0 §8.4.3 横展;与 `scripts/lib/md-normalize.mjs` 同约定)。
15
+ *
16
+ * **根因**:解析层对最常见的 Markdown 强调语法脆弱且**失败静默**——手写
17
+ * `### **Requirement**: X` 或 `` ### `Requirement`: X `` 会让需求块整块漏解析,
18
+ * 而这条路径在 `tf sync`(→ `spec-merge` → 本模块)上是**活路径**,且
19
+ * `guard/checks/specs-merged` 会在 delta spec 存在时硬阻断 `executing → closing`。
20
+ * JS 侧已修(`md-normalize.mjs`),本函数是 TS 侧的对应实现(D-16「全修」)。
21
+ *
22
+ * **只剥双符号对**(`**` / `__`):单 `*` 可能是列表符、单 `_` 可能是 snake_case
23
+ * 标识符——剥它们是"改语义"而非"容格式"。
24
+ */
25
+ export declare function stripInlineEmphasis(text: string): string;
26
+ /** 归一化需求名:剥行内强调/反引号(名称本身被包裹时)+ trim。 */
13
27
  export declare function normalizeRequirementName(name: string): string;
28
+ /**
29
+ * 需求块标题:`### Requirement: <name>`。
30
+ *
31
+ * v0.55.0 容忍:`Requirement` 键被加粗/反引号包裹(`**Requirement**` /
32
+ * `` `Requirement` `` / `` **`Requirement`** ``——**两种符号可任意交错、任意顺序**,
33
+ * 故用字符类而非固定序列)、全角冒号、冒号前后空格。
34
+ * 名称内的标记由 {@link normalizeRequirementName} 归一。
35
+ *
36
+ * 注:单 `*` 包裹(`*Requirement*`)也在容错内——键名两侧的星号无论一个两个
37
+ * 都是强调写法,剥它不改变语义。**需求名内部**的单符号才是语义边界,
38
+ * 由 `stripInlineEmphasis` 只剥成对双符号来保证。
39
+ */
14
40
  export declare const REQUIREMENT_HEADER_REGEX: RegExp;
15
41
  export declare function extractRequirementsSection(content: string): RequirementsSectionParts;
16
42
  export interface DeltaPlan {
@@ -1,7 +1,35 @@
1
+ /**
2
+ * 行内强调剥离 + 去反引号(v0.55.0 §8.4.3 横展;与 `scripts/lib/md-normalize.mjs` 同约定)。
3
+ *
4
+ * **根因**:解析层对最常见的 Markdown 强调语法脆弱且**失败静默**——手写
5
+ * `### **Requirement**: X` 或 `` ### `Requirement`: X `` 会让需求块整块漏解析,
6
+ * 而这条路径在 `tf sync`(→ `spec-merge` → 本模块)上是**活路径**,且
7
+ * `guard/checks/specs-merged` 会在 delta spec 存在时硬阻断 `executing → closing`。
8
+ * JS 侧已修(`md-normalize.mjs`),本函数是 TS 侧的对应实现(D-16「全修」)。
9
+ *
10
+ * **只剥双符号对**(`**` / `__`):单 `*` 可能是列表符、单 `_` 可能是 snake_case
11
+ * 标识符——剥它们是"改语义"而非"容格式"。
12
+ */
13
+ export function stripInlineEmphasis(text) {
14
+ return text.replace(/`/g, '').replace(/\*\*(.+?)\*\*/g, '$1').replace(/__(.+?)__/g, '$1');
15
+ }
16
+ /** 归一化需求名:剥行内强调/反引号(名称本身被包裹时)+ trim。 */
1
17
  export function normalizeRequirementName(name) {
2
- return name.trim();
18
+ return stripInlineEmphasis(name).trim();
3
19
  }
4
- export const REQUIREMENT_HEADER_REGEX = /^###\s*Requirement:\s*(.+)\s*$/i;
20
+ /**
21
+ * 需求块标题:`### Requirement: <name>`。
22
+ *
23
+ * v0.55.0 容忍:`Requirement` 键被加粗/反引号包裹(`**Requirement**` /
24
+ * `` `Requirement` `` / `` **`Requirement`** ``——**两种符号可任意交错、任意顺序**,
25
+ * 故用字符类而非固定序列)、全角冒号、冒号前后空格。
26
+ * 名称内的标记由 {@link normalizeRequirementName} 归一。
27
+ *
28
+ * 注:单 `*` 包裹(`*Requirement*`)也在容错内——键名两侧的星号无论一个两个
29
+ * 都是强调写法,剥它不改变语义。**需求名内部**的单符号才是语义边界,
30
+ * 由 `stripInlineEmphasis` 只剥成对双符号来保证。
31
+ */
32
+ export const REQUIREMENT_HEADER_REGEX = /^###\s*[`*]{0,4}\s*Requirement\s*[`*]{0,4}\s*[::]\s*(.+?)\s*$/i;
5
33
  function normalizeLineEndings(content) {
6
34
  return content.replace(/\r\n?/g, '\n');
7
35
  }
@@ -137,7 +165,7 @@ function parseRemovedNames(sectionBody) {
137
165
  names.push(normalizeRequirementName(m[1]));
138
166
  continue;
139
167
  }
140
- const bullet = line.match(/^\s*-\s*`?###\s*Requirement:\s*(.+?)`?\s*$/);
168
+ const bullet = line.match(/^\s*-\s*`?###\s*[`*]{0,4}\s*Requirement\s*[`*]{0,4}\s*[::]\s*(.+?)\s*$/i);
141
169
  if (bullet) {
142
170
  names.push(normalizeRequirementName(bullet[1]));
143
171
  }
@@ -151,8 +179,8 @@ function parseRenamedPairs(sectionBody) {
151
179
  const lines = normalizeLineEndings(sectionBody).split('\n');
152
180
  let current = {};
153
181
  for (const line of lines) {
154
- const fromMatch = line.match(/^\s*-?\s*FROM:\s*`?###\s*Requirement:\s*(.+?)`?\s*$/);
155
- const toMatch = line.match(/^\s*-?\s*TO:\s*`?###\s*Requirement:\s*(.+?)`?\s*$/);
182
+ const fromMatch = line.match(/^\s*-?\s*FROM\s*[::]\s*`?###\s*[`*]{0,4}\s*Requirement\s*[`*]{0,4}\s*[::]\s*(.+?)\s*$/i);
183
+ const toMatch = line.match(/^\s*-?\s*TO\s*[::]\s*`?###\s*[`*]{0,4}\s*Requirement\s*[`*]{0,4}\s*[::]\s*(.+?)\s*$/i);
156
184
  if (fromMatch) {
157
185
  current.from = normalizeRequirementName(fromMatch[1]);
158
186
  }
@@ -1,7 +1,14 @@
1
1
  import { MIN_PURPOSE_LENGTH, MIN_WHY_SECTION_LENGTH, MAX_WHY_SECTION_LENGTH, MAX_REQUIREMENT_TEXT_LENGTH, MAX_DELTAS_PER_CHANGE, VALIDATION_MESSAGES, VERIFICATION_MESSAGES, } from './constants.js';
2
2
  import { tokenize } from './tokenizer.js';
3
3
  import { parseDeltaSpec, normalizeRequirementName, extractRequirementsSection, } from '../parsing/requirement-blocks.js';
4
- const REQUIREMENT_HEADER_REGEX = /^###\s*Requirement:\s*(.+)\s*$/i;
4
+ // v0.55.0 §8.4.3(D-16「全修」横展):本文件原有第二份 `REQUIREMENT_HEADER_REGEX`
5
+ // 定义(`/^###\s*Requirement:\s*(.+)\s*$/i`)——**定义后从未使用**(本文件的需求头
6
+ // 解析全部经 `parseDeltaSpec` / `extractRequirementsSection` 走解析层),属"同一契约
7
+ // 两处定义"的维护陷阱:改解析层正则时无人知道这里还有一份。已删除,需求头正则的
8
+ // 唯一真相源是 `parsing/requirement-blocks.ts`。
9
+ //
10
+ // ⚠️ 不要再在本文件内定义需求头/场景头以外格式约定的正则——场景头(下方)是
11
+ // 本文件唯一自有的格式契约,其余一律从解析层引入。
5
12
  const SCENARIO_HEADER_REGEX = /^####\s+Scenario:/i;
6
13
  function normalizeLineEndings(content) {
7
14
  return content.replace(/\r\n?/g, '\n');
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.54.0`
129
+ - Current: `v0.56.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)
@@ -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.54.0",
4
+ "version": "0.56.0",
5
5
  "contextFileName": "GEMINI.md"
6
6
  }
@@ -1,16 +1,23 @@
1
1
  #!/usr/bin/env bash
2
- # v0.54.0: auto-sync CLI version with plugin version
2
+ # v0.56.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.54.0"
8
+ PLUGIN_VERSION="0.56.0"
9
9
 
10
10
  # ═══════════════════════════════════════════════════════════════
11
11
  # Step 1: Auto-sync CLI version with plugin version
12
12
  # ═══════════════════════════════════════════════════════════════
13
13
 
14
+ # v0.55.0(N1):取两者中较高的版本号。
15
+ # 按**段的数值**排序(`-k1,1n -k2,2n -k3,3n`),不用 GNU 的 `sort -V`——BSD sort 不保证支持。
16
+ # 数值排序不可退化为字符串排序:`0.6.0` 字符串比 `0.54.0` 大,数值上却更小。
17
+ higher_version() {
18
+ printf '%s\n%s\n' "$1" "$2" | sort -t. -k1,1n -k2,2n -k3,3n | tail -1
19
+ }
20
+
14
21
  sync_tf_version() {
15
22
  # Get installed tf version
16
23
  local installed_version=""
@@ -18,6 +25,16 @@ sync_tf_version() {
18
25
  installed_version=$(tf --version 2>/dev/null | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+' | head -1)
19
26
  fi
20
27
 
28
+ # v0.55.0(N1):**只升不降**——同步的语义是"CLI 追上插件",不是"CLI 随谁启动而震荡"。
29
+ # 原实现只判 != ,机器上任一旧版插件缓存副本跑起来都会把新版 CLI 降级
30
+ # (实测 0.54.0 被降到 0.51.0)。故已安装版本 ≥ 插件版本时一律跳过。
31
+ # 回归守卫:tests/lib/hook-session-start.test.mjs
32
+ if [ -n "$installed_version" ] && [ "$installed_version" != "$PLUGIN_VERSION" ] \
33
+ && [ "$(higher_version "$installed_version" "$PLUGIN_VERSION")" = "$installed_version" ]; then
34
+ echo "⏭️ team-flow CLI ($installed_version) 比插件 ($PLUGIN_VERSION) 新,跳过同步"
35
+ return 0
36
+ fi
37
+
21
38
  # Compare versions and sync if needed
22
39
  if [ "$installed_version" != "$PLUGIN_VERSION" ]; then
23
40
  echo "🔄 team-flow CLI version mismatch: ${installed_version:-not installed} → $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.54.0.
6
+ Current version: v0.56.0.
7
7
 
8
8
  ## Key Documents
9
9
  - README.md: Chinese homepage with full usage guide and FAQ
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xulthekl/team-flow",
3
- "version": "0.54.0",
3
+ "version": "0.56.0",
4
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",
package/plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "team-flow",
3
- "version": "0.54.0",
3
+ "version": "0.56.0",
4
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) + design-system (design tokens + component contract + AI primer + showcase) + test-strategy (test strategy design) + project-initialize (new service onboarding). 26 skills + 17 agents, one install.",
5
5
  "author": {
6
6
  "name": "LT"
@@ -0,0 +1,84 @@
1
+ #!/usr/bin/env node
2
+ // check-project-config.mjs — 项目配置漂移检查(v0.55.0,设计 §8.5 N2)
3
+ //
4
+ // ── 动机 ─────────────────────────────────────────────────────────────────────
5
+ // 现场实测(workflow-feedback 2026-09-11)的三类漂移:
6
+ // ① `version` 落后于插件版本(0.48.0 vs 0.54.0)——用户以为在用新版
7
+ // ② `designSystemC` 指向**不存在**的 c-end.md
8
+ // ③ `versionWorktree` 指向**不存在**的 .worktrees/ 目录
9
+ // 三者都不会报错,只会在用到时静默失效。
10
+ //
11
+ // ── 检查面(P1.5 三轮校正:按"实际被消费"分级)──────────────────────────────
12
+ // 真调用点:`prototype.designSystem`(ce-brainstorm/references/prototype-loop.md)
13
+ // 声明级: `prototype.designSystemBase` / `prototype.entry`(多处文档声明、无 --get 调用点)
14
+ // 零消费者:`prototype.designSystemC` / `prototype.versionWorktree`(全仓无引用)
15
+ // → 前两类做**存在性检查**;后两类只报"未被消费"(不是错误,是配置残留)。
16
+ //
17
+ // Usage: node scripts/check-project-config.mjs [项目根,默认 cwd]
18
+ // 退出码:0 = 正常(含仅警告);1 = 配置存在但不可解析
19
+
20
+ import { readFileSync, existsSync } from 'node:fs';
21
+ import { resolve, join, dirname } from 'node:path';
22
+ import { fileURLToPath } from 'node:url';
23
+
24
+ const PLUGIN_DIR = dirname(dirname(fileURLToPath(import.meta.url)));
25
+ const root = resolve(process.argv[2] || process.cwd());
26
+ const cfgPath = join(root, '.team-flow', 'team-flow.config.json');
27
+
28
+ if (!existsSync(cfgPath)) {
29
+ console.log(`ℹ️ 未找到 ${cfgPath}(跳过配置漂移检查)`);
30
+ process.exit(0);
31
+ }
32
+
33
+ let cfg;
34
+ try {
35
+ cfg = JSON.parse(readFileSync(cfgPath, 'utf-8'));
36
+ } catch (e) {
37
+ console.error(`❌ 配置无法解析:${cfgPath}`);
38
+ console.error(` ${e.message}`);
39
+ process.exit(1);
40
+ }
41
+
42
+ const proto = cfg.prototype || {};
43
+ const warnings = [];
44
+
45
+ // ①–② 存在性检查(真调用点 + 声明级)
46
+ const CONSUMED = [
47
+ { key: 'designSystem', level: '真调用点' },
48
+ { key: 'designSystemBase', level: '声明级' },
49
+ { key: 'entry', level: '声明级' },
50
+ ];
51
+ for (const { key, level } of CONSUMED) {
52
+ const v = proto[key];
53
+ if (!v || typeof v !== 'string') continue;
54
+ if (!existsSync(resolve(root, v))) {
55
+ warnings.push(`prototype.${key}(${level})指向的路径不存在:${v}`);
56
+ }
57
+ }
58
+
59
+ // ③ 零消费者键(配置残留,不是错误)
60
+ for (const key of ['designSystemC', 'versionWorktree']) {
61
+ if (proto[key]) {
62
+ warnings.push(`prototype.${key} 在插件内**零消费者**(全仓无引用)——该键不会被读取,可删除或忽略`);
63
+ }
64
+ }
65
+
66
+ // ④ 版本漂移
67
+ if (cfg.version) {
68
+ const pkgPath = join(PLUGIN_DIR, 'package.json');
69
+ const pluginVersion = existsSync(pkgPath)
70
+ ? JSON.parse(readFileSync(pkgPath, 'utf-8')).version
71
+ : null;
72
+ if (pluginVersion && cfg.version !== pluginVersion) {
73
+ warnings.push(`配置 version=${cfg.version} 与插件版本 ${pluginVersion} 不一致(配置由项目侧维护,请确认是否需更新)`);
74
+ }
75
+ }
76
+
77
+ if (warnings.length === 0) {
78
+ console.log(`✅ 配置无漂移(${cfgPath})`);
79
+ process.exit(0);
80
+ }
81
+
82
+ console.log(`⚠️ 配置漂移 ${warnings.length} 项(${cfgPath})——**均为提示,不阻断**:`);
83
+ for (const w of warnings) console.log(` - ${w}`);
84
+ process.exit(0);