@xulthekl/team-flow 0.53.0 → 0.54.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 (52) 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 +2 -2
  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/CHANGELOG.md +71 -0
  9. package/GEMINI.md +1 -1
  10. package/INSTALL.md +1 -1
  11. package/README.md +1 -1
  12. package/agents/prototype-builder.md +6 -5
  13. package/agents/prototype-env-scout.md +4 -4
  14. package/agents/release-archivist.md +1 -0
  15. package/docs/README_en.md +1 -1
  16. package/gemini-extension.json +1 -1
  17. package/hooks/session-start +2 -2
  18. package/llms.txt +1 -1
  19. package/package.json +1 -1
  20. package/plugin.json +2 -2
  21. package/scripts/design-system-import.mjs +238 -0
  22. package/scripts/gen-primer.mjs +143 -0
  23. package/scripts/guard/design-token-guard.mjs +284 -63
  24. package/scripts/lib/ds-parse.mjs +124 -0
  25. package/scripts/token-extract.mjs +257 -0
  26. package/skills/design-system/SKILL.md +55 -9
  27. package/skills/design-system/references/agents/design-system-architect.md +44 -7
  28. package/skills/design-system/references/creation-flow.md +39 -5
  29. package/skills/design-system/references/showcase-board-b-end.md +78 -0
  30. package/skills/design-system/references/showcase-board-c-end.md +92 -0
  31. package/skills/design-system/references/token-derivation.md +34 -9
  32. package/skills/design-system/references/variant-schema.md +14 -3
  33. package/skills/prototype/SKILL.md +14 -8
  34. package/skills/prototype/references/builder-methodology.md +62 -5
  35. package/skills/prototype/references/craft/anti-ai-slop.md +1 -1
  36. package/skills/prototype/references/craft/state-coverage.md +8 -2
  37. package/skills/prototype/references/orchestration-flow.md +12 -3
  38. package/skills/prototype/references/prototype-scaffold/assets/design-tokens.css +2 -2
  39. package/skills/prototype/references/template.html +10 -10
  40. package/skills/release-archivist/SKILL.md +10 -3
  41. package/skills/release-archivist/references/closing-procedures.md +10 -0
  42. package/skills/workflow-bootstrap/SKILL.md +14 -2
  43. package/templates/design-systems/references/claude.md +315 -0
  44. package/templates/design-systems/references/linear-app.md +370 -0
  45. package/templates/design-systems/references/notion.md +312 -0
  46. package/templates/design-systems/references/posthog.md +259 -0
  47. package/templates/design-systems/references/sentry.md +265 -0
  48. package/templates/design-systems/references/stripe.md +325 -0
  49. package/templates/design-systems/references/supabase.md +258 -0
  50. package/templates/design-systems/references/vercel.md +313 -0
  51. package/templates/design-systems/registry.json +75 -0
  52. package/templates/design-systems/styles.json +576 -0
@@ -1,3 +1,3 @@
1
- # team-flow v0.53.0 | 阶段: {{state}} | 工作流: {{workflow}}
1
+ # team-flow v0.54.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.53.0",
12
+ "version": "0.54.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.53.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.",
3
+ "version": "0.54.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) + 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": {
7
7
  "name": "LT",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "team-flow",
3
- "version": "0.53.0",
3
+ "version": "0.54.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.53.0"
8
+ "version": "0.54.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.53.0",
5
+ "version": "0.54.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.53.0"
9
+ "version": "0.54.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.53.0",
15
+ "version": "0.54.0",
16
16
  "source": ".",
17
17
  "author": {
18
18
  "name": "LT",
package/CHANGELOG.md CHANGED
@@ -4,6 +4,77 @@ 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.54.0] - 2026-09-10
8
+
9
+ ### Added(设计系统 → 原型贯通:组件契约 + Primer + Showcase + 逆向建库)
10
+
11
+ 设计来源:`docs/plan/design-system-prototype-enhancement-design.md` v1.7(2026-09-10;P4 偏差记录见其附录 A.4)。输入 = open-design 迁移管线研究 + 设计系统核对工具 L0-L5 方法论 + LT 三项补充需求(持续迭代 / 逆向建库 / Design Showcase);本方案按 **P1.5 完整档(3 轮对抗式验证 + 逐轮闭合表)** 收敛:问题数 39→9→6,Critical 4→2→0。
12
+
13
+ **核心承诺**:设计系统从「token 定义文档」升级为「**能约束 AI 生成原型的契约体系**」——正向白名单(primer,prompt 层劝告)+ 反向拦截(guard / P0 grep,代码层)双层防护。
14
+
15
+ - **组件契约表(L2 结构化)**:base.md 的 components 段由散文升级为表格(组件 × 类型 × variants × sizes × states × 用途 × 禁止);**类型列决定 states 下限**(交互 ≥3 / 轻量 ≥2 / 豁免);数量三档阈值(<10 FAIL 标签 / 10-14 WARN 可用 / ≥15 PASS);`contract: v1|legacy` 标记区分存量(legacy 降级 WARN,不阻断)。
16
+ - **AI Primer(L5 补齐)**:新增 `scripts/gen-primer.mjs`——确定性生成 `.team-flow/design-system/primer.md`(零 LLM、纯字符串拼接)+ digest 头部;`--check` 模式供 builder Step 0 gate 校验新鲜度(exit 0 一致 / exit 2 STALE);内容 = 组件白名单 + Token 速查 + 硬规则。配「生成物 == 源表」单测。
17
+ - **六层审计 guard**:新增 `scripts/guard/design-token-guard.mjs`——硬校验(exit 1)+ 六层审计报告(恒 exit 0,不输出总分,`--strict` 存量当 v1 标签 / `--json`);配套 `scripts/lib/ds-parse.mjs` 共享解析器(guard / gen-primer / import 三方复用,消除同契约多实现漂移)。
18
+ - **Design Showcase**:新增展示板机制——**草案阶段**产出 1-3 页 Board(让用户在确认设计系统前先看到实际效果,解决「确认后才见效果」的时序倒置);内置车企场景 brief(`showcase-board-{b,c}-end.md`,虚构品牌「星驰汽车」:B 端线索管理后台 6 区块 / C 端官网 + 车主 APP);`prototype-builder` 新增 `mode: showcase`(gate 豁免 `confirmed_plan`/`prd_path`,flat 单文件最小交付契约)。
19
+ - **持续迭代(不新增第二账本)**:原型阶段的组件 / token 增量经 builder 既有 `outstanding_questions` 通道回传(`ds_increment` 字段),在原型人工评审 ⑥ 由用户确认(全部 / 逐项 / 暂不处理);"暂不处理"入 `.team-flow/design-system/pending.md`——**单写者 = design-system skill**(主代理 / release-archivist 只读);两级确认节点(⑥ 即时 + change closing 兜底),不新造流程。
20
+ - **逆向建库**:新增 `scripts/token-extract.mjs`(8 类正则证据机器 + ΔE<2 颜色聚类 + 频次排序 + directory skiplist + `--report` 只读报告);新增 `scripts/design-system-import.mjs`(open-design DESIGN.md → team-flow base.md:A 类九节解析 + B 类兜底提取);design-system skill 新增 create-from-code 模式(**确定性提取 + 人工策展**,语义角色由人定,不自动推断落盘)。
21
+ - **L0 / L1 补齐**:base.md 新增 `principles` 段(≥3 条,guard 计数)+ `governance` 段(contract / version / 负责人 / 弃用策略);`token-derivation.md` 新增**确定性 dark 派生规则** + `creation-flow.md` 新增维度 6(theme 输入)。
22
+ - **open-design 资源内置(精选)**:新增 `templates/design-systems/`——`registry.json`(8 个 B 端相关参考:linear-app / stripe / vercel / supabase / sentry / posthog / notion / claude)+ `styles.json`(57 风格种子,扩充 mood → palette 映射)+ `references/*.md`(160KB 原文,MIT 归因 "inspired by")。**全量扫描 143 个的真实分布**:A 类 63(44%)/ B 类 80(55%),B 类总体积 ~1.3MB → 精选内置而非全量(体积 + 相关性双重考量),未内置的按 registry 指引用 import 现取。
23
+ - **首次接入提示**:`workflow-bootstrap` 新增 **B4.6**(advisory,不阻断)——检测项目无设计系统时 AskUserQuestion 四选一(模板库 / 逆向建库 / 从零创建 / 跳过)。
24
+ - **流程制度化(父仓库 CLAUDE.md)**:新增 **P1.5 方案对抗验证**(可选,三档强度:轻量 1 轮 / 标准 2 轮 / 完整 3 轮;P1 完成后必须询问用户是否执行,可跳过)——本次方案本身即按完整档执行并借此收敛。
25
+
26
+ ### Changed(行为变更)
27
+
28
+ | # | 变更 | 影响面 |
29
+ |---|------|--------|
30
+ | 1 | `prototype-builder` Step 0 新增 primer gate | `governance.contract: v1` 且 primer 缺失/过期 → **blocked**;legacy / 无标记 → WARN 放行(存量项目不受阻) |
31
+ | 2 | design-system 创建流程新增六层审计 + 组件数量三档标签 | 创建完成时 guard 恒输出审计报告;组件 <10 类标 FAIL 标签(不阻断落盘,供用户判断) |
32
+ | 3 | release-archivist closing 新增 **⑥ 设计系统待办检查** | 只读检查 pending.md → closing summary 新增 `design_system_pending` 字段(报告契约扩展,不执行 iterate) |
33
+ | 4 | `workflow-bootstrap` 新增 B4.6 | advisory 步骤,不阻断;Output Standard 阶段清单同步 B4.6 |
34
+
35
+ ### P4 复验(双门禁独立复验:均 PASS)
36
+
37
+ - **plugin-validator 复验 → PASS**:Major 闭合(指定 grep 空集 + 更宽 grep 交叉印证 + import 提示实测为绝对路径 + 新 lint 非空转)。release-archivist 的**描述性写法成立**(约束真实——`platform-runtime-distribution.test.mjs:38` 对 9 个 runtime skill 断言禁宿主变量;两处无解释器前缀、无调用动词,仓库内既有同写法先例)。**横展发现 3 处存量同类真调用点**:`build-executor/SKILL.md:150` 与 `references/execution-modes.md:46` 的 `` `scripts/task-brief PLAN_FILE N` ``、`code-reviewer/SKILL.md:87` 的 `` `scripts/review-package` ``——实测从用户项目 CWD 执行报 `No such file or directory`(脚本真实存在,文档写法解析不到)。**与本次修的那批不同**:属 runtime skill(禁 `${CLAUDE_PLUGIN_ROOT}`),唯一可行修法是**暴露为 `tf` 子命令**——已登记 **P1-69**(含证据链与替代解评估),不在本次范围内实施。
38
+ - **skill-reviewer 复验 → 可转 PASS**:C1 闭合(新探针:base + 端变体传目录 / 传 base.md **均 PASS**,原 `EXIT=1` 的互斥论据失效);6 Major 全闭合;8 Minor 中 6 闭合、2 项经复核**由评审方主动撤回**(release-archivist 描述性写法、⑥ 与 reference 的分层重复);另有 2 项本轮改动引入的新观察,**已在 P5 前闭合**:
39
+ - **观察 A(合并断言掩盖单端残缺)**:`target=both` 时若 c-end 只有 typography,合并跑仍 PASS。修法(零代码):Step 6 增加「**按端各跑一次**(`--variant b-end` / `--variant c-end`)」并在 SKILL.md / creation-flow 双处写明——`--variant c-end` 单跑报 3 项 FAIL(已固化为测试判据)。
40
+ - **观察 B(无关 md 可补齐缺失段)**:同目录 `notes.md` 含 `## spacing` 等段即可把 FAIL 洗成 PASS。修法:变体识别**收紧为约定集**(`*-end.md` + `variants/` 子目录),非约定命名用 `--variant <name>` 显式纳入(逃生通道);含必选段但未被纳入的 md **显式告警**列出(不静默补齐、也不静默忽略)。3 例测试固化。
41
+ - **lint 盲区加固**:`skill-path-convention.test.mjs` 正则补 `node ./scripts/x`(显式相对前缀)与 `node --flag scripts/x`(解释器带参数)两种形态 + 各自正向控制——正是上一轮 grep 漏检的同款盲区(当前语料零实例,属预防性加固)。
42
+ - **前瞻风险记录**:三个 skill 目前依赖 `${CLAUDE_PLUGIN_ROOT}` 且不在 `RUNTIME_SKILLS` 名单(测试绿);但 **design-system 由 prototype 运行期调用**——若平台策略将其收进 runtime 名单,guard / primer / importer 的调用方式需整体改造。已记入设计文档附录 A.4 第 7 行与 `design-token-guard.mjs` 头部注释。
43
+ - **复验期间的一次外部操作已独立核实无污染**:plugin-validator 披露其误在仓库根执行 `install-zcode --local .` 并已自行清理;我已核实 `.zcode/` 恢复为原 3 个受跟踪文件、无未跟踪残留、全仓 `git status` 仅含本次变更。
44
+
45
+ ### Fixed(P5 提交期发现)
46
+
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)都在查"文件引用是否存在",而没有一条检查"文件是否真的会被提交"——已作为教训记入本轮复盘。
48
+
49
+ ### Tests
50
+
51
+ - 新增 4 个测试文件:`design-token-guard.test.mjs`(23) + `gen-primer.test.mjs`(9) + `token-extract.test.mjs`(7) + `skill-path-convention.test.mjs`(3),合计 **42 个新用例**
52
+ - 全量 **935/935 通过**(原 893);`npm run check-versions` 全绿
53
+ - **P4 双评审闭环**:plugin-validator(1 Major + 8 Warning,全处置)+ skill-reviewer(1 Critical + 6 Major + 8 Minor,全处置)
54
+
55
+ ### Fixed(P4 门禁发现:skill-reviewer 一轮,含 1 Critical)
56
+
57
+ - **【Critical C1】guard 的「单文件 9 段」模型与文档的「base + 端变体」拆分布局互斥**——`variant-schema.md` 明确 base 品牌层**不含** typography/spacing/layout/motion(随端变化,由端变体承载),而 guard 只接单个 md 且断言全 9 段 → **任何按文档创建的系统在 Step 6 落盘时被硬校验判 FAIL / exit 1**,返工死锁(P4 实证:合规拆分布局 exit=1 且 4 项 MISSING;而转换器产出的单文件 9 段版本 PASS——测试 fixture 站在工具侧,形成假保障)。**修法(补强代码)**:guard 输入解析支持**目录 / base.md / 变体文件**三种形态,主体不完整时自动合并端变体(`--variant <name>` 可限定;主体已含全 9 段则单文件模式,不卷入同目录无关 md);合并按 base 优先、组件表按名去重(端差异行不重复计数);无可合并变体时输出诊断提示。**证据**:`tests/lib/design-token-guard.test.mjs` 新增 6 例(拆分布局 base+变体过校验、目录输入、`--variant` 无匹配回退、单文件模式、L3 检测面、去重)。
58
+ - **M1 L3 业务模式层对合规系统恒为假红灯**:检测面只读传入的 md,而唯一写「页面范式」的是 `gen-primer.mjs` 生成的 **primer.md**(L3 不读)→ 任何按规范创建的系统恒 ❌。修法:检测面 = 合并后文本 + 同目录 `primer.md`,并在报告中说明「设计系统侧只引用,节奏表在 prototype layouts.md」的归属。
59
+ - **M2 模板库起点是死路**:`workflow-bootstrap` B4.6 的模板库分支**直接调转换器**、不经 design-system skill → 产出 `contract: v1` 但**无 primer** → prototype Step 0 稳定 `blocked`,且链路上三份文件都没提「还要生成 primer」。修法:B4.6 模板库分支改为**委托 `/team-flow:design-system`**(由该 skill 呈现 registry 并续跑 Step 5 评审 → Step 6 落盘,含 primer + guard);SKILL.md Step 0 同步写明;转换器保持纯确定性转换(不自动生成 primer——避免用户人工核对配色后 primer 立即过期),输出提示改为**本脚本所在插件目录的绝对路径**且列出完整下一步链。
60
+ - **M3 `variant-schema.md` 迭代口径自相矛盾**:「新组件进变体 `components`」与同文件「契约表全量真源在 base / 变体不再重复清单」直接冲突——按前者操作会破坏本版要建立的「消除双份维护」。已改为「新组件进 base 契约表,端特有点写变体覆盖说明」。
61
+ - **M4 prototype 侧旧单文件路径残留 5 处 + description 越界**:`prototype/SKILL.md` 的 description 宣告了本属 design-system 的「创建/维护」职责(两个 skill 争夺触发)且引用 v0.19.0 起已废弃的 `design-system.md`;正文 5 处(用途/产出结构树/硬原则/内核/膨胀防控)同源残留。已统一为 `.team-flow/design-system/`(base + 端变体),产出结构树删除旧文件行并加注存放位置;横展同批修复 `prototype-env-scout.md`(3 处)、`builder-methodology.md`、`craft/anti-ai-slop.md`、`template.html` 与 scaffold `design-tokens.css` 的渲染说明。
62
+ - **M5 `orchestration-flow.md` 派发输入契约未同步**:builder 派发清单仍写 `design-system.md` 且缺 `design_system_path`/`variant`/`prototype_root`/`mode`——而 `builder-methodology.md` 要求读 `<variant>.md`,该 `<variant>` **无来源**。已按 v0.54.0 契约补齐(含 showcase 模式豁免说明);env-scout 探查项同步升级(合并后 9 段完整度 / primer 新鲜度 / 契约表分档)。
63
+ - **M6 确定性数值在两份文档间冲突**(spacious 字号 18 vs 17 / `--space-4` 固定 16 vs 密度 12-16-20 / 字体栈两版 / `--focus-ring` 与 `--elev-raised` 几何有无):收敛为**单一真相源** `token-derivation.md`(数值权威)——density 改为明确倍率语义(×0.75 / ×1.0 / ×1.25 作用于 4px 基准阶梯,`--space-4` = 12/16/20);字体栈取更完整的系统栈(含 `Segoe UI`,与 `design-system-import.mjs` 一致);A2 几何与 `template.html` / `preview-template.html` 对齐;dark 主题 `--accent` 提亮改为**有界确定性**(对比度 <4.5:1 时按 10% 步长至多 3 次取首个达标值,仍不足则记入 `extensions` 交人工,不静默继续)。`creation-flow.md` 顶部加权威指向。
64
+ - 杂项(skill-reviewer Minor):`showcase-board-c-end.md` 覆盖数「合计 18 类」错 → **本板 16 类 + 两板合计覆盖 20 类基线全量**(原注释把 b-end 已覆盖的 4 类误列为除外);`variant-schema.md` 目录树补 `primer.md`/`pending.md`/`showcase/`,并写明**交互/轻量的 variants 亦必填**(guard 会判违规);`design-system-architect.md` 删除写死的年份注记、段落标题 `design-system.md` → `base.md`。
65
+ - **平台分发策略遵守**:release-archivist 属 **runtime skill**(9 个 runtime-dependent skill 之一,禁 `${CLAUDE_PLUGIN_ROOT}`——Cursor/ZCODE 等宿主无该变量,由 `platform-runtime-distribution.test.mjs` 守护),故其两处脚本引用改为**描述性写法**(「插件内 `scripts/…`(引用,非调用)」),不用宿主变量。
66
+
67
+ ### Fixed(P4 门禁发现:plugin-validator)
68
+
69
+ - **【阻断级】插件内脚本/模板调用路径全部裸相对路径**(plugin-validator Major):4 个新特性的 11 处调用写成 `node scripts/x.mjs` —— Bash 的 CWD 是**用户项目**,而插件零拷贝安装(marketplace,本插件推荐安装方式)时插件位于缓存目录,两者永不相等 → 模板导入 / primer digest 校验 / token 提取 / guard 四件全部不可执行;最严重处 `builder-methodology.md:27` 的 `--check` **exit code 是分支判据**(exit 0 继续 / exit 2 blocked),路径失败把确定性分支退化为猜测。修复:11 处统一改为 `${CLAUDE_PLUGIN_ROOT}/…`(对齐 `workflow-bootstrap` / `install-cursor.mjs` 既有范式与 `$SKILL_DIR` 同类解法)。**机械预防**:新增 `tests/lib/skill-path-convention.test.mjs`(正/负向控制 + 全量语料扫描),把「裸相对路径」从每轮人工审查变成 CI 可拦截的 lint。
70
+ - **plugin.json 描述缺 3 个 first-class skill**(plugin-validator Minor):`design-system` / `test-strategy` / `project-initialize` 自引入起从未进入 marketplace 描述(`design-system` 为 v0.19.0 起缺失,本轮成为主线能力后更显突兀)→ 两份 manifest 同步补全。
71
+ - `release-archivist/SKILL.md:288` 的设计方案引用改为 workspace 相对写法(`team-flow-workspace/docs/…`),对齐 `workflow-bootstrap/SKILL.md:122`——同一文档两类引用写法并存。
72
+ - `skills/prototype/references/builder-methodology.md:54` 的「8 个 section 骨架」→ **14 个**:`layouts.md` 实际已有 14 个骨架(v0.24.0 扩至 C 端 6 个),该表述自 v0.24.0 起滞后;`prototype/SKILL.md:52` 已正确,横展确认全插件仅此一处残留。
73
+
74
+ ### Known Deviations(记录在案)
75
+
76
+ - `skills/release-archivist/SKILL.md`(297→305 行,lint 计数)与 `skills/workflow-bootstrap/SKILL.md`(267→280 行,lint 计数)超出 250 行建议线——**存量既存超长**(同批超长另有 `workflow-start` 302 / `ce-brainstorm` 263 / `architecture-design` 260,本次未触碰);本次新增内容已按渐进式披露做成指针(细节在 `references/closing-procedures.md`),净增 +7/+12 行记录在案,治理待办见 Roadmap。
77
+
7
78
  ## [0.53.0] - 2026-09-10
8
79
 
9
80
  ### Added(架构台账回写门禁:`arch-merged` 维度 + B' 时序前移)
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.53.0 | 阶段: {{state}} | 工作流: {{workflow}}
11
+ # team-flow v0.54.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.53.0**。
10
+ 当前发布版本:**v0.54.0**。
11
11
 
12
12
  ---
13
13
 
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # team-flow
2
2
 
3
- > 当前版本:`v0.53.0`
3
+ > 当前版本:`v0.54.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
 
@@ -21,12 +21,13 @@ You are a write-focused builder. You read design artifacts (HTML/CSS/JS from the
21
21
 
22
22
  | Parameter | Description |
23
23
  |-----------|-------------|
24
- | `design_files_dir` | 设计稿目录路径(e.g., `prototype/designs/`) |
25
- | `design_system_dir` | 设计系统目录路径(e.g., `prototype/design-system/`) |
26
- | `output_dir` | 原型输出目录路径(e.g., `prototype/runnable/`) |
27
- | `requirements` | 构建要求(可选:响应式、性能目标、浏览器兼容性) |
24
+ | `design_system_path` | 设计系统 base.md 路径(e.g., `.team-flow/design-system/base.md`) |
25
+ | `confirmed_plan` | 已确认的原型方案(页面清单/组件清单/导航流) |
26
+ | `prd_path` | PRD 路径(页面内容依据) |
27
+ | `prototype_root` | 原型输出根目录(e.g., `prototype/`) |
28
+ | `mode` | (可选)`default` \| `showcase`——showcase 模式用于设计系统展示板(输入换为 showcase-board brief + 设计系统草案,见 references/builder-methodology.md) |
28
29
 
29
- If `design_files_dir` or `design_system_dir` is missing or unreadable, report `BLOCKED` with reason `INPUT_ERROR`.
30
+ If `design_system_path` or `confirmed_plan` or `prd_path` is missing or unreadable, report `BLOCKED` with reason `INPUT_ERROR`(showcase 模式豁免 `confirmed_plan`/`prd_path`)。
30
31
 
31
32
  ## Output Contract
32
33
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: prototype-env-scout
3
- description: 原型环境探查(prototype skill 内部编排步骤①)。只读探查设计系统现状(9 段 schema 完整度)、原型仓库分支、PRD 版本、已有页面,产出环境简报 + 推荐原型方案设计 + readiness verdict。只读,不写 prototype/,不改 design-system.md。
3
+ description: 原型环境探查(prototype skill 内部编排步骤①)。只读探查设计系统现状(base + 端变体 9 段 schema 完整度 + primer 新鲜度)、原型仓库分支、PRD 版本、已有页面,产出环境简报 + 推荐原型方案设计 + readiness verdict。只读,不写 prototype/,不改 design-system.md。
4
4
 
5
5
  model: inherit
6
6
  color: cyan
@@ -11,13 +11,13 @@ 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 `design-system.md` 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; writing `.team-flow/design-system/` is `design-system-architect`'s job.
15
15
 
16
16
  ## Invocation Contract
17
17
 
18
18
  The dispatch prompt provides (some may be absent — probe to discover):
19
19
  - `prd_path` or a hint to locate the current PRD version (e.g., `requirement/v1/prd.md`).
20
- - `design_system_path` (from `prototype.designSystem` config) or a hint to find `design-system.md`.
20
+ - `design_system_path` (from `prototype.designSystem` config) or a hint to find `.team-flow/design-system/`.
21
21
  - `prototype_root` (default `prototype/`).
22
22
  - The intent: new prototype from scratch / iterate on existing / sync after a change.
23
23
 
@@ -105,7 +105,7 @@ Produce:
105
105
  ```
106
106
 
107
107
  ## Red Lines
108
- - Do NOT write to `prototype/` or edit `design-system.md` — you are read-only.
108
+ - Do NOT write to `prototype/` or edit `.team-flow/design-system/` — you are read-only.
109
109
  - Do NOT draw the prototype — that is `prototype-builder`'s job.
110
110
  - A missing design system is normally NOT your blocker — flag it via `needs_design_system` verdict for the orchestrator to decide.
111
111
 
@@ -43,6 +43,7 @@ writebacks:
43
43
  arch_merge: "merged N docs | skipped"
44
44
  prototype_sync: "synced N pages | no UX delta | conflicts: N"
45
45
  compound_promotion: "promoted N learnings | no learnings"
46
+ design_system_pending: "N items pending (needs user confirmation) | none" # v0.54.0 ⑥:只读检查 .team-flow/design-system/pending.md,不执行 iterate
46
47
  summary: "..." # closing summary + any WARNs needing user acceptance
47
48
  ```
48
49
 
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.53.0`
129
+ - Current: `v0.54.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.53.0",
4
+ "version": "0.54.0",
5
5
  "contextFileName": "GEMINI.md"
6
6
  }
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env bash
2
- # v0.53.0: auto-sync CLI version with plugin version
2
+ # v0.54.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.53.0"
8
+ PLUGIN_VERSION="0.54.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.53.0.
6
+ Current version: v0.54.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.53.0",
3
+ "version": "0.54.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,7 +1,7 @@
1
1
  {
2
2
  "name": "team-flow",
3
- "version": "0.53.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.",
3
+ "version": "0.54.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) + 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"
7
7
  },
@@ -0,0 +1,238 @@
1
+ #!/usr/bin/env node
2
+ // design-system-import.mjs — open-design DESIGN.md → team-flow base.md 转换器(v0.54.0,设计 §4.5.2)
3
+ //
4
+ // 解析 open-design 九节 DESIGN.md,映射到 team-flow 的 9 段 schema(A1/A2/B-slot + 组件契约表 + principles/governance)。
5
+ // 关键约束:**A 类转换后必须补齐完整度**(palette 阶梯 / A2 派生公式 / B-slot 别名 / 组件契约表基线)——
6
+ // open-design 原文没有这些,转换器按 team-flow 规则生成。
7
+ //
8
+ // Usage: node scripts/design-system-import.mjs <DESIGN.md 路径> [--out <base.md 路径>] [--id <标识>]
9
+ // 输出后建议运行:node scripts/guard/design-token-guard.mjs <base.md>
10
+
11
+ import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'node:fs';
12
+ import { resolve, dirname, basename, join } from 'node:path';
13
+ import { fileURLToPath } from 'node:url';
14
+
15
+ const argv = process.argv.slice(2);
16
+ const outIdx = argv.indexOf('--out');
17
+ const outArg = outIdx !== -1 ? argv[outIdx + 1] : null;
18
+ const idIdx = argv.indexOf('--id');
19
+ const idArg = idIdx !== -1 ? argv[idIdx + 1] : null;
20
+ const positional = argv.filter((a, i) => !a.startsWith('--') && !(outIdx !== -1 && i === outIdx + 1) && !(idIdx !== -1 && i === idIdx + 1));
21
+ const srcPath = positional[0];
22
+
23
+ if (!srcPath) {
24
+ console.error('Usage: node scripts/design-system-import.mjs <DESIGN.md 路径> [--out <base.md 路径>] [--id <标识>]');
25
+ process.exit(1);
26
+ }
27
+ const srcAbs = resolve(srcPath);
28
+ if (!existsSync(srcAbs)) {
29
+ console.error(`DESIGN.md not found: ${srcAbs}`);
30
+ process.exit(1);
31
+ }
32
+
33
+ const src = readFileSync(srcAbs, 'utf-8');
34
+ const id = idArg || basename(dirname(srcAbs));
35
+
36
+ // ── 解析 open-design 九节 ──
37
+
38
+ function grab(pattern) {
39
+ const m = src.match(pattern);
40
+ return m ? m[1].trim() : null;
41
+ }
42
+
43
+ const title = grab(/^#\s+(.+)$/m) || `Design System Inspired by ${id}`;
44
+ const category = grab(/> Category:\s*(.+)/) || 'Uncategorized';
45
+ const summary = grab(/>\s*(?!Category)(.+\S)/) || '';
46
+
47
+ // A 类模板格式:`**Primary:** \`#hex\``
48
+ let primary = grab(/\*\*Primary:\*\*\s*`(#[0-9a-fA-F]{3,8})`/);
49
+ let surface = grab(/\*\*Surface:\*\*\s*`(#[0-9a-fA-F]{3,8})`/);
50
+ let text = grab(/\*\*Text:\*\*\s*`(#[0-9a-fA-F]{3,8})`/);
51
+
52
+ // B 类精细格式 fallback:找 brand/accent/primary 上下文附近的 hex(自动提取,需人工核对)
53
+ let autoExtracted = false;
54
+ if (!primary) {
55
+ const m = src.match(/(?:brand|accent|primary)[^\n]{0,100}?(#[0-9a-fA-F]{6})/i);
56
+ if (m) { primary = m[1]; autoExtracted = true; }
57
+ }
58
+ if (!surface) {
59
+ const m = src.match(/(?:background|surface|canvas)[^\n]{0,100}?(#[0-9a-fA-F]{6})/i);
60
+ surface = m ? m[1] : '#FFFFFF';
61
+ if (m) autoExtracted = true;
62
+ }
63
+ if (!text) {
64
+ const m = src.match(/(?:text|foreground)[^\n]{0,100}?(#[0-9a-fA-F]{6})/i);
65
+ text = m ? m[1] : '#111827';
66
+ if (m) autoExtracted = true;
67
+ }
68
+
69
+ const secondary = grab(/\*\*Secondary:\*\*\s*`(#[0-9a-fA-F]{3,8})`/);
70
+ const success = grab(/\*\*Success:\*\*\s*`(#[0-9a-fA-F]{3,8})`/) || '#16A34A';
71
+ const warning = grab(/\*\*Warning:\*\*\s*`(#[0-9a-fA-F]{3,8})`/) || '#D97706';
72
+ const danger = grab(/\*\*Danger:\*\*\s*`(#[0-9a-fA-F]{3,8})`/) || '#DC2626';
73
+ const families = grab(/\*\*Families:\*\*\s*(.+)/) || 'primary=Inter, display=Inter, mono=ui-monospace';
74
+ const scale = grab(/\*\*Scale:\*\*\s*(.+)/) || '12/14/16/20/24/32';
75
+ const spacingScale = grab(/\*\*Spacing scale:\*\*\s*(.+)/) || '4/8/12/16/24/32';
76
+
77
+ if (!primary) {
78
+ console.error(`未能从 ${srcAbs} 解析出 Primary 色。`);
79
+ console.error('A 类格式需 `**Primary:** \\`#hex\\``;B 类格式自动提取失败。');
80
+ console.error('B 类设计系统建议走人工路径:浏览参考文档 → 提取配色 → 用 create-from-code 或手工创建。');
81
+ process.exit(1);
82
+ }
83
+ if (autoExtracted) {
84
+ console.warn('⚠️ B 类格式:配色为自动提取(brand/surface/text 上下文匹配),**请人工核对后再采用**。');
85
+ }
86
+
87
+ // 字体族解析:primary=X, display=Y, mono=Z → 系统栈兜底(零依赖:不引 webfont,仅保留字体名首选 + 系统栈)
88
+ function fontStack(family) {
89
+ const f = (family || 'Inter').trim().replace(/^['"]|['"]$/g, '');
90
+ const isMono = /mono|code|menlo|consolas/i.test(f);
91
+ if (isMono) return `'${f}', ui-monospace, SFMono-Regular, Menlo, monospace`;
92
+ return `'${f}', -apple-system, 'Segoe UI', system-ui, 'PingFang SC', 'Microsoft YaHei', sans-serif`;
93
+ }
94
+ const famMap = Object.fromEntries(families.split(',').map(p => {
95
+ const [k, v] = p.split('=').map(x => (x || '').trim());
96
+ return [k, v];
97
+ }));
98
+ const fontDisplay = fontStack(famMap.display || famMap.primary);
99
+ const fontBody = fontStack(famMap.primary);
100
+ const fontMono = fontStack(famMap.mono || 'ui-monospace');
101
+
102
+ // 字号阶梯:open-design 的 "12/14/16/20/24/32" → type scale 名称映射
103
+ const scaleNums = scale.split('/').map(s => s.trim()).filter(Boolean);
104
+ const typeScale = scaleNums.slice(0, 7).map((v, i) => {
105
+ const names = ['--text-xs', '--text-sm', '--text-base', '--text-lg', '--text-xl', '--text-2xl', '--text-3xl'];
106
+ return `${names[i]}: ${v}px`;
107
+ }).join(';') || '--text-xs: 12px;--text-sm: 14px;--text-base: 16px;--text-lg: 20px;--text-xl: 24px;--text-2xl: 32px';
108
+
109
+ // ── 组件契约表基线(20 类,来自 design-system-architect.md 的完整基线)──
110
+
111
+ const CONTRACT_ROWS = [
112
+ '| Button | 交互 | primary / secondary / ghost / danger | sm / md / lg | default / hover / focus-visible / active / disabled / loading | 触发动作 | 用颜色单独传状态 |',
113
+ '| Input | 交互 | default / error / success | sm / md / lg | default / focus / disabled / readonly / error / filled | 文本录入 | 无 label |',
114
+ '| Select | 交互 | default / multiple / searchable | sm / md / lg | default / focus / disabled / error / open | 选项选择 | 超 10 项不用搜索 |',
115
+ '| Checkbox | 交互 | default / indeterminate | sm / md | default / hover / focus / disabled / checked | 多选 | — |',
116
+ '| Radio | 交互 | default | sm / md | default / focus / disabled / selected | 单选 | 超 7 项改用 Select |',
117
+ '| Switch | 交互 | default | md | default / focus / disabled / on / off | 二元开关 | 高危操作须确认 |',
118
+ '| Tag | 轻量 | default / success / warning / danger / info | sm / md | default / hover / closable¹ | 状态标记 | 用作按钮 |',
119
+ '| Icon | 豁免 | — | sm / md / lg | — | 语义图示 | emoji |',
120
+ '| Avatar | 轻量 | circle / square | sm / md / lg | default / fallback / loading | 用户标识 | — |',
121
+ '| Tooltip | 轻量 | default | — | hidden / visible | 补充说明 | 承载关键操作 |',
122
+ '| Modal | 交互 | default / confirm / destructive | sm / md / lg | open / loading / error / closing | 阻断式交互 | 嵌套 Modal |',
123
+ '| Drawer | 交互 | left / right / bottom | sm / md / lg | open / loading / error | 侧边任务面板 | — |',
124
+ '| Tabs | 交互 | line / pill | — | default / active / disabled / loading | 内容分组 | 超 7 个 tab |',
125
+ '| Table | 交互 | default / compact / striped | — | default / loading / empty / error / selected | 结构化数据 | 无分页超长列表 |',
126
+ '| Form | 交互 | single / two-column | — | untouched / dirty / submitted-pending / error | 字段集合 | 单页超 20 字段 |',
127
+ '| Card | 交互 | default / interactive / stat | — | default / hover / selected / loading | 内容容器 | 嵌套超 2 层 |',
128
+ '| Pagination | 交互 | default / simple | sm / md | default / disabled / loading | 分页导航 | — |',
129
+ '| FilterBar | 交互 | default / collapsible | — | default / expanded / applied | 筛选条件集合 | — |',
130
+ '| EmptyState | 豁免 | default / filtered / error | — | — | 空态承载 | 只有"暂无数据" |',
131
+ '| Toast | 交互 | success / warning / error / info | — | entering / visible / exiting | 轻量反馈 | 承载需用户操作的信息 |',
132
+ ];
133
+
134
+ // ── 生成 base.md ──
135
+
136
+ const base = `# ${title}
137
+
138
+ > a11y: WCAG 2.2 AA(对比度 4.5:1 / 大字 3:1 / 焦点可见 / 键盘可达)
139
+
140
+ > 由 open-design 设计系统 \`${id}\`(Category: ${category})转换生成(scripts/design-system-import.mjs v0.54.0)。
141
+ > ${summary}
142
+ > 来源归因:open-design(nexu-io)MIT License,"inspired by" 逆向工程描述,非官方资产。
143
+
144
+ ## color
145
+
146
+ **A1-identity(8 必选)**
147
+ - \`--bg\`: color-mix(in oklab, var(--surface), var(--fg) 3%)
148
+ - \`--surface\`: ${surface}
149
+ - \`--fg\`: ${text}
150
+ - \`--muted\`: color-mix(in oklab, var(--fg), var(--surface) 45%)
151
+ - \`--border\`: color-mix(in oklab, var(--fg), var(--surface) 88%)
152
+ - \`--accent\`: ${primary}
153
+ - \`--font-display\`: ${fontDisplay}
154
+ - \`--font-body\`: ${fontBody}
155
+
156
+ **语义色**:success ${success} / warning ${warning} / danger ${danger}${secondary ? ` / secondary ${secondary}` : ''}
157
+
158
+ **A2-derived(color-mix 公式)**:--accent-hover / --accent-active / --focus-ring / --elev-raised(公式见 token-derivation.md)
159
+
160
+ **B-slot 别名**:--fg-2 → var(--fg) / --meta → var(--muted) / --border-soft → var(--border) / --surface-warm → var(--surface)
161
+
162
+ ## typography
163
+
164
+ - 字阶:${typeScale}
165
+ - 行高:正文 1.5 / 标题 1.2
166
+ - 字重:400(正文)/ 500-600(标题)
167
+
168
+ ## spacing
169
+
170
+ - 阶梯(4 基数):${spacingScale.split('/').map((v, i) => `${v.trim()}px`).join(' / ')}
171
+
172
+ ## layout
173
+
174
+ - 栅格 12 列 / 断点 sm(640) md(1024) lg(1440) / 容器 max-width 1200px
175
+
176
+ ## components
177
+
178
+ | 组件 | 类型 | variants | sizes | states | 用途 | 禁止 |
179
+ |------|------|----------|-------|--------|------|------|
180
+ ${CONTRACT_ROWS.join('\n')}
181
+
182
+ ## motion
183
+
184
+ - duration 150–250ms / easing ease-out(\`cubic-bezier(0.2, 0, 0, 1)\`)
185
+
186
+ ## voice
187
+
188
+ - 语气:${category} 语境的简洁专业表达——具体文案要求由项目 PRD 补充。
189
+
190
+ ## brand
191
+
192
+ - 品牌主色:${primary}(accent 用法:主 CTA / 链接 / 选中态)
193
+
194
+ ## anti-patterns
195
+
196
+ 1. 禁止内联样式漂移
197
+ 2. 禁止非 token 颜色
198
+ 3. ${category} 语境:不得引入与来源风格冲突的装饰效果
199
+
200
+ ## palette
201
+
202
+ - neutral / primary / success / warning / danger 各 50–900 阶梯(primary 以 ${primary} 为 500 锚点,公式见 token-derivation.md)
203
+
204
+ ## principles
205
+
206
+ 1. 一致性优先于局部创意——同类信息用同一呈现
207
+ 2. 清晰优于装饰——信息层级先于视觉效果
208
+ 3. 可访问性默认开启——所有交互元素满足 WCAG AA
209
+
210
+ ## governance
211
+
212
+ - contract: v1
213
+ - version: 0.1.0
214
+ - 负责人: {项目角色}
215
+ - 弃用策略: 组件弃用需在 changelog 记录 + 保留 1 个迭代周期
216
+ - changelog: 见文末"变更履历"段
217
+
218
+ ## 变更履历
219
+
220
+ | 时间 | 变更内容 | 来源 |
221
+ |------|---------|------|
222
+ | ${new Date().toISOString().slice(0, 10)} | 从 open-design \`${id}\` 转换生成 | design-system-import.mjs |
223
+ `;
224
+
225
+ const outPath = outArg ? resolve(outArg) : resolve(`.team-flow/design-system/base.md`);
226
+ mkdirSync(dirname(outPath), { recursive: true });
227
+ writeFileSync(outPath, base, 'utf-8');
228
+
229
+ console.log(`base.md 已生成:${outPath}`);
230
+ console.log(` 来源:open-design ${id}(${category})`);
231
+ console.log(` accent=${primary} / surface=${surface} / text=${text}`);
232
+ console.log(` 组件契约表:20 类基线(待审阅调整)`);
233
+ // 提示中的脚本路径用**本脚本所在插件目录**解析(绝对路径,可直接复制执行)——
234
+ // 裸 `node scripts/...` 在插件零拷贝安装下不解析(v0.54.0 P4 根因)。
235
+ const pluginDir = dirname(dirname(fileURLToPath(import.meta.url)));
236
+ console.log('\n下一步(由 design-system skill 的 Step 5 评审 → Step 6 落盘承接):');
237
+ console.log(` 1) node ${join(pluginDir, 'scripts', 'gen-primer.mjs')} ${outPath} # 生成 primer(组件白名单 + digest,缺失会阻断 prototype Step 0)`);
238
+ console.log(` 2) node ${join(pluginDir, 'scripts', 'guard', 'design-token-guard.mjs')} ${dirname(outPath)} # 硬校验 + 六层审计`);