@teamix-evo/skills 0.8.0 → 0.9.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/manifest.json CHANGED
@@ -10,8 +10,8 @@
10
10
  {
11
11
  "id": "teamix-evo-manage",
12
12
  "name": "teamix-evo-manage",
13
- "description": "Single entry point for the teamix-evo lifecycle: scaffold a new project, install the AI coding system into an existing repo, run / update / inspect / remove any teamix-evo package, and drive the placeholder→real UI migration loop after `npm create teamix-evo`.\nTRIGGER when: (CLI) user runs or asks about `teamix-evo init` / `teamix-evo update` / `teamix-evo tokens ...` / `teamix-evo skills ...` / `teamix-evo ui ...` / `teamix-evo biz-ui ...` / `teamix-evo templates ...` / `teamix-evo lint ...` / `teamix-evo logs ...` / `teamix-evo restore ...` / `teamix-evo switch ...`, or `npm create teamix-evo` / `pnpm create teamix-evo`; (模糊初始化) \"初始化一个项目\"、\"初始化一个工程\"、\"初始化一个 teamix-evo 工程\"、\"初始化一个 Teamix Evo 项目\"、\"create a teamix-evo project\"、\"set up teamix-evo from scratch\"、\"new teamix-evo app\"; (具名变体初始化) \"初始化一个 opentrek 工程 / op 工程 / OpenTrek 项目 / 探索者项目\"、\"初始化一个云管 / 云管控制台 / 云管项目 / uni-manager 工程 / 云管工程\"、\"new opentrek/uni-manager project\"; (AI coding 接入) \"给现有仓库装 teamix-evo\"、\"现有项目装一下 skills + ui\"、\"接入 AI coding 体系\"、\"装 teamix-evo 进这个项目\"、\"add teamix-evo to existing repo\"、\"install AI coding system\"、\"接入 opentrek 研发体系\"、\"接入 op 研发体系\"、\"接入 OpenTrek 研发体系\"、\"接入 opentrek 研发系统\"、\"接入 op 研发系统\"、\"接入云管研发体系\"、\"接入云管研发系统\"、\"接入 uni-manager 研发体系\"、\"接入 uni-manager 研发系统\"、\"接入统一管理研发体系\"; (更新检测) \"升级 teamix-evo\"、\"看看哪些要升级\"、\"update teamix-evo\"、\"check what needs updating\"、\"refresh installed teamix-evo packages\"; (组件源码升级 — ADR 0040) \"升级 ui\"、\"升级业务组件\"、\"升级 button\"、\"生成 ui staging\"、\"生成 biz-ui staging\"、\"upgrade ui\"、\"upgrade biz-ui\"、\"upgrade ui component\"、\"stage ui upgrade\"、\"teamix-evo ui upgrade\"、\"teamix-evo biz-ui upgrade\"; (卸载 / 清单) \"卸载 teamix-evo\"、\"看看装了哪些 teamix-evo 资源\"、\"remove the design system\"、\"list installed\"; (placeholder→real 升级) \"升级 UI\"、\"接入真组件\"、\"替换 placeholder\"、\"upgrade UI\"、\"replace placeholders\"、\"swap in real components\"、\"make the UI real\", or user opens / edits `src/components/_placeholder/**`, project contains `.teamix-evo/create/pending-ui.json`, literal `@teamix-evo:placeholder` tag in code; (状态文件) user touches `.teamix-evo/config.json`、`.teamix-evo/manifest.json`、`.teamix-evo/create/pending-ui.json`.\nSKIP: any content task — generating components, pages, services, or reviewing screens; changes to `src/` files outside the migration loop, design tokens, or business logic. Those go to teamix-evo-code-opentrek or teamix-evo-design-opentrek. SKIP if the user is mid-flow inside an already-initialized project asking to \"新增页面 / 加按钮 / 调接口\" — that's coding work, not lifecycle. SKIP pure styling / token tweaks — those go to ESLint + `tokens.overrides.css`.\nCoordinates with: teamix-evo-design-opentrek (visual side after a screen is generated)、teamix-evo-code-opentrek (file placement / reuse rules) — manage is the entry point and precedes content skills, never co-triggers.",
14
- "version": "0.2.0",
13
+ "description": "Single entry point for the teamix-evo lifecycle: scaffold a new project, install the AI coding system into an existing repo, run / update / inspect / remove any teamix-evo package, and drive the placeholder→real UI migration loop after `npm create teamix-evo`.\nTRIGGER when: (CLI) user runs or asks about `teamix-evo init` / `teamix-evo update` / `teamix-evo tokens ...` / `teamix-evo skills ...` / `teamix-evo ui ...` / `teamix-evo biz-ui ...` / `teamix-evo templates ...` / `teamix-evo lint ...` / `teamix-evo logs ...` / `teamix-evo restore ...` / `teamix-evo switch ...`, or `npm create teamix-evo` / `pnpm create teamix-evo`; (模糊初始化) \"初始化一个项目\"、\"初始化一个工程\"、\"初始化一个 teamix-evo 工程\"、\"初始化一个 Teamix Evo 项目\"、\"create a teamix-evo project\"、\"set up teamix-evo from scratch\"、\"new teamix-evo app\"; (具名变体初始化) \"初始化一个 opentrek 工程 / op 工程 / OpenTrek 项目 / 探索者项目\"、\"初始化一个云管 / 云管控制台 / 云管项目 / uni-manager 工程 / 云管工程\"、\"new opentrek/uni-manager project\"; (AI coding 接入) \"给现有仓库装 teamix-evo\"、\"现有项目装一下 skills + ui\"、\"接入 AI coding 体系\"、\"装 teamix-evo 进这个项目\"、\"add teamix-evo to existing repo\"、\"install AI coding system\"、\"接入 opentrek 研发体系\"、\"接入 op 研发体系\"、\"接入 OpenTrek 研发体系\"、\"接入 opentrek 研发系统\"、\"接入 op 研发系统\"、\"接入云管研发体系\"、\"接入云管研发系统\"、\"接入 uni-manager 研发体系\"、\"接入 uni-manager 研发系统\"、\"接入统一管理研发体系\"; (更新检测) \"升级 teamix-evo\"、\"看看哪些要升级\"、\"update teamix-evo\"、\"check what needs updating\"、\"refresh installed teamix-evo packages\"; (组件源码升级 — ADR 0040) \"升级 ui\"、\"升级业务组件\"、\"升级 button\"、\"生成 ui staging\"、\"生成 biz-ui staging\"、\"upgrade ui\"、\"upgrade biz-ui\"、\"upgrade ui component\"、\"stage ui upgrade\"、\"teamix-evo ui upgrade\"、\"teamix-evo biz-ui upgrade\"; (卸载 / 清单) \"卸载 teamix-evo\"、\"看看装了哪些 teamix-evo 资源\"、\"remove the design system\"、\"list installed\"; (placeholder→real 升级) \"升级 UI\"、\"接入真组件\"、\"替换 placeholder\"、\"upgrade UI\"、\"replace placeholders\"、\"swap in real components\"、\"make the UI real\", or user opens / edits `src/components/_placeholder/**`, project contains `.teamix-evo/create/pending-ui.json`, literal `@teamix-evo:placeholder` tag in code; (旧工程迁移) \"迁移旧项目\"、\"重建老工程\"、\"把旧项目搬过来\"、\"旧项目分析\"、\"旧系统翻新\"、\"legacy migration\"、\"migrate old project\"、\"rebuild from existing\"、\"refactor from old codebase\"、\"从旧项目迁移过来\"、\"用旧项目做参考重建\"、\"分析旧项目并迁移\"; (状态文件) user touches `.teamix-evo/config.json`、`.teamix-evo/manifest.json`、`.teamix-evo/create/pending-ui.json`.\nSKIP: any content task — generating components, pages, services, or reviewing screens; changes to `src/` files outside the migration loop, design tokens, or business logic. Those go to teamix-evo-code-opentrek or teamix-evo-design-opentrek. SKIP if the user is mid-flow inside an already-initialized project asking to \"新增页面 / 加按钮 / 调接口\" — that's coding work, not lifecycle. SKIP pure styling / token tweaks — those go to ESLint + `tokens.overrides.css`.\nCoordinates with: teamix-evo-design-opentrek (visual side after a screen is generated)、teamix-evo-code-opentrek (file placement / reuse rules) — manage is the entry point and precedes content skills, never co-triggers.",
14
+ "version": "0.4.0",
15
15
  "source": "src/teamix-evo-manage",
16
16
  "ides": ["qoder", "claude"],
17
17
  "updateStrategy": "managed",
@@ -70,8 +70,8 @@
70
70
  {
71
71
  "id": "teamix-evo-upgrade",
72
72
  "name": "teamix-evo-upgrade",
73
- "description": "Help the user adopt token renames in `.teamix-evo/.upgrade-hints/tokens-<ts>.json` AND component source upgrades in `.teamix-evo/.upgrade-staging/{ui,biz-ui}-<ts>/` after `teamix-evo update` / `teamix-evo tokens update` / `teamix-evo switch` / `teamix-evo ui upgrade` / `teamix-evo biz-ui upgrade`. Read each hint or staging manifest, scan the project for usages or compare current vs incoming source, propose codemod / file-replace diffs, apply only after explicit user approval, then archive processed inputs.\nTRIGGER when: user references `.teamix-evo/.upgrade-hints/`、`.teamix-evo/.upgrade-staging/`、`tokens-*.json` hint files、`ui-*` or `biz-ui-*` staging directories、phrases like \"处理 token 改名\"、\"应用 codemod\"、\"扫一下 legacy token\"、\"升级 token 引用\"、\"更新 token 名\"、\"组件升级\"、\"ui-staging\"、\"biz-ui staging\"、\"apply ui staging\"、\"apply biz-ui staging\"、\"应用组件升级\"、\"apply token rename codemod\"、\"adopt token rename hints\"、\"scan for legacy tokens\"、\"token rename upgrade\"、\"component source upgrade\"、\"review ui staging diff\"; AI sees output of `teamix-evo update` / `teamix-evo tokens update` / `teamix-evo switch --apply` / `teamix-evo ui upgrade` / `teamix-evo biz-ui upgrade` mentioning `💡 token rename hint:` or `staging at .teamix-evo/.upgrade-staging/...` and the user wants to follow up; user opens any `.teamix-evo/.upgrade-hints/tokens-*.json` or any file under `.teamix-evo/.upgrade-staging/{ui,biz-ui}-*/`.\nSKIP: any other lifecycle work — `init` / `update` orchestration / variant switch itself / install / uninstall / generating staging (defer to teamix-evo-manage); pure visual or design changes (defer to teamix-evo-design-<variant>); any code authoring unrelated to the rename / staging window (defer to teamix-evo-code-<variant>); refuse to auto-apply — never write source code without explicit per-file user confirmation.\nCoordinates with: teamix-evo-manage (manage drives the upgrade flow that emits hints + staging; this skill consumes the resulting files).",
74
- "version": "0.1.0",
73
+ "description": "Help the user adopt token renames in `.teamix-evo/.upgrade-hints/tokens-<ts>.json` AND component source upgrades in `.teamix-evo/.upgrade-staging/{ui,biz-ui}-<ts>/` after `teamix-evo update` / `teamix-evo tokens update` / `teamix-evo switch` / `teamix-evo ui upgrade` / `teamix-evo biz-ui upgrade`. Read each hint or staging manifest, scan the project for usages or compare current vs incoming source, propose codemod / file-replace diffs, apply only after explicit user approval, then archive processed inputs.\nTRIGGER when: user references `.teamix-evo/.upgrade-hints/`、`.teamix-evo/.upgrade-staging/`、`tokens-*.json` hint files、`ui-*` or `biz-ui-*` staging directories、phrases like \"处理 token 改名\"、\"应用 codemod\"、\"扫一下 legacy token\"、\"升级 token 引用\"、\"更新 token 名\"、\"组件升级\"、\"ui-staging\"、\"biz-ui staging\"、\"apply ui staging\"、\"apply biz-ui staging\"、\"应用组件升级\"、\"apply token rename codemod\"、\"adopt token rename hints\"、\"scan for legacy tokens\"、\"token rename upgrade\"、\"component source upgrade\"、\"review ui staging diff\"、\"token 治理\"、\"tokens diagnose\"、\"tokens treat\"、\"治理计划\"、\".treatment-plan.md\"、\"baseline 锁定\"、\"token 反哺\"、\"清理 token 违规\"、\"token cleanup\"、\"lint baseline\"、\"降违规\"、\"全部治理\"; AI sees output of `teamix-evo update` / `teamix-evo tokens update` / `teamix-evo switch --apply` / `teamix-evo ui upgrade` / `teamix-evo biz-ui upgrade` mentioning `💡 token rename hint:` or `staging at .teamix-evo/.upgrade-staging/...` and the user wants to follow up; AI sees output of `teamix-evo init` showing token-discipline ESLint warnings and the user wants to clean up; user opens any `.teamix-evo/.upgrade-hints/tokens-*.json` or any file under `.teamix-evo/.upgrade-staging/{ui,biz-ui}-*/` or `.teamix-evo/.treatment-plan.md`.\nSKIP: any other lifecycle work — `init` / `update` orchestration / variant switch itself / install / uninstall / generating staging (defer to teamix-evo-manage); pure visual or design changes (defer to teamix-evo-design-<variant>); any code authoring unrelated to the rename / staging window (defer to teamix-evo-code-<variant>); refuse to auto-apply — never write source code without explicit per-file user confirmation.\nCoordinates with: teamix-evo-manage (manage drives the upgrade flow that emits hints + staging; this skill consumes the resulting files).",
74
+ "version": "0.2.0",
75
75
  "source": "src/teamix-evo-upgrade",
76
76
  "ides": ["qoder", "claude"],
77
77
  "updateStrategy": "managed",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamix-evo/skills",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Skills (AI IDE capabilities) for Teamix Evo",
5
5
  "type": "module",
6
6
  "files": [
@@ -9,15 +9,6 @@
9
9
  "src",
10
10
  "_template"
11
11
  ],
12
- "devDependencies": {
13
- "@clack/prompts": "^0.8.0",
14
- "tsx": "^4.0.0",
15
- "@teamix-evo/registry": "0.9.0"
16
- },
17
- "publishConfig": {
18
- "access": "public",
19
- "registry": "https://registry.npmjs.org/"
20
- },
21
12
  "scripts": {
22
13
  "validate": "tsx scripts/validate-skills.ts",
23
14
  "scaffold:skill": "tsx scripts/scaffold-skill.ts",
@@ -25,5 +16,14 @@
25
16
  "typecheck": "echo 'no ts source'",
26
17
  "lint": "echo 'no ts source'",
27
18
  "build": "echo 'pure resource package, no build needed'"
19
+ },
20
+ "devDependencies": {
21
+ "@teamix-evo/registry": "workspace:*",
22
+ "@clack/prompts": "^0.8.0",
23
+ "tsx": "^4.0.0"
24
+ },
25
+ "publishConfig": {
26
+ "access": "public",
27
+ "registry": "https://registry.npmjs.org/"
28
28
  }
29
- }
29
+ }
@@ -467,7 +467,7 @@ CSS 变量已在 dark 模式下自动切换。手动 `dark:` 会绕过主题系
467
467
 
468
468
  ---
469
469
 
470
- ## I1-I4 · 图标规则
470
+ ## I1-I5 · 图标 & 导入规则
471
471
 
472
472
  ### [ERROR] I1 · 按钮内图标用 data-icon 属性定位
473
473
 
@@ -507,6 +507,12 @@ CSS 变量已在 dark 模式下自动切换。手动 `dark:` 会绕过主题系
507
507
 
508
508
  > 检查: eslint `teamix-evo/icon-from-lucide` (拦截 import 自非配置图标库)
509
509
 
510
+ ### [WARN] I5 · 禁止从 shadcn-ui/ 遗留目录导入组件
511
+
512
+ `teamix-evo init` 在存量项目中将原有 `ui/` 目录搬迁至 `shadcn-ui/` 后,新组件统一从 `@/components/ui/` 导入。遗留的 `@/components/shadcn-ui/` 引用应逐步迁移。
513
+
514
+ > 检查: eslint `teamix-evo/no-legacy-shadcn-import` (warn 级别,渐进迁移)
515
+
510
516
  ---
511
517
 
512
518
  ## Overlay 组件选型表
@@ -386,6 +386,16 @@
386
386
  "lintRule": "teamix-evo/icon-from-lucide",
387
387
  "boundaryAnchor": "boundaries.md#error-i4--按项目配置的-iconlibrary-导入",
388
388
  "status": "active"
389
+ },
390
+ {
391
+ "id": "I5",
392
+ "group": "component",
393
+ "rule": "禁止从 shadcn-ui/ 遗留目录导入组件",
394
+ "severity": "WARN",
395
+ "scope": "global",
396
+ "lintRule": "teamix-evo/no-legacy-shadcn-import",
397
+ "boundaryAnchor": "boundaries.md#warn-i5--禁止从-shadcn-ui-遗留目录导入组件",
398
+ "status": "active"
389
399
  }
390
400
  ]
391
401
  }
@@ -460,7 +460,7 @@ CSS 变量已在 dark 模式下自动切换(uni-manager `theme.css` 内置)
460
460
 
461
461
  ---
462
462
 
463
- ## UM1-UM3 · Uni-Manager 专有云一致性硬约束
463
+ ## UM1-UM4 · Uni-Manager 专有云一致性硬约束
464
464
 
465
465
  > 来自 ADR 0030 / Teamix-UI 规范 doc 15-16-20。这三条是 uni-manager 区别于 opentrek 的核心硬约束,与"一致性是云管平台生命线"的哲学主张呼应(philosophy.md §1)。
466
466
 
@@ -541,6 +541,12 @@ CSS 变量已在 dark 模式下自动切换(uni-manager `theme.css` 内置)
541
541
 
542
542
  > 检查: 无 lint (人工评审 / scenario-instantiator subagent)
543
543
 
544
+ ### [WARN] UM4 · 禁止从 shadcn-ui/ 遗留目录导入组件
545
+
546
+ `teamix-evo init` 在存量项目中将原有 `ui/` 目录搬迁至 `shadcn-ui/` 后,新组件统一从 `@/components/ui/` 导入。遗留的 `@/components/shadcn-ui/` 引用应逐步迁移。
547
+
548
+ > 检查: eslint `teamix-evo/no-legacy-shadcn-import` (warn 级别,渐进迁移)
549
+
544
550
  ---
545
551
 
546
552
  ## Overlay 组件选型表
@@ -413,6 +413,16 @@
413
413
  "lintRule": null,
414
414
  "boundaryAnchor": "boundaries.md#error-um3--跨云资源列表与详情必须标注-cloudbadge--scope-uni-manager",
415
415
  "status": "active"
416
+ },
417
+ {
418
+ "id": "UM4",
419
+ "group": "component",
420
+ "rule": "禁止从 shadcn-ui/ 遗留目录导入组件",
421
+ "severity": "WARN",
422
+ "scope": "global",
423
+ "lintRule": "teamix-evo/no-legacy-shadcn-import",
424
+ "boundaryAnchor": "boundaries.md#warn-um4--禁止从-shadcn-ui-遗留目录导入组件",
425
+ "status": "active"
416
426
  }
417
427
  ]
418
428
  }
@@ -1,9 +1,9 @@
1
1
  ---
2
2
  name: teamix-evo-manage
3
3
  description: |
4
- Single entry point for the teamix-evo lifecycle: scaffold a new project, install the AI coding system into an existing repo, run / update / inspect / remove any teamix-evo package, and drive the placeholder→real UI migration loop after `npm create teamix-evo`.
5
- TRIGGER when: (CLI) user runs or asks about `teamix-evo init` / `teamix-evo update` / `teamix-evo tokens ...` / `teamix-evo skills ...` / `teamix-evo ui ...` / `teamix-evo biz-ui ...` / `teamix-evo templates ...` / `teamix-evo lint ...` / `teamix-evo logs ...` / `teamix-evo restore ...` / `teamix-evo switch ...`, or `npm create teamix-evo` / `pnpm create teamix-evo`; (模糊初始化) "初始化一个项目"、"初始化一个工程"、"初始化一个 teamix-evo 工程"、"初始化一个 Teamix Evo 项目"、"create a teamix-evo project"、"set up teamix-evo from scratch"、"new teamix-evo app"; (具名变体初始化) "初始化一个 opentrek 工程 / op 工程 / OpenTrek 项目 / 探索者项目"、"初始化一个云管 / 云管控制台 / 云管项目 / uni-manager 工程 / 云管工程"、"new opentrek/uni-manager project"; (AI coding 接入) "给现有仓库装 teamix-evo"、"现有项目装一下 skills + ui"、"接入 AI coding 体系"、"装 teamix-evo 进这个项目"、"add teamix-evo to existing repo"、"install AI coding system"、"接入 opentrek 研发体系"、"接入 op 研发体系"、"接入 OpenTrek 研发体系"、"接入 opentrek 研发系统"、"接入 op 研发系统"、"接入云管研发体系"、"接入云管研发系统"、"接入 uni-manager 研发体系"、"接入 uni-manager 研发系统"、"接入统一管理研发体系"; (更新检测) "升级 teamix-evo"、"看看哪些要升级"、"update teamix-evo"、"check what needs updating"、"refresh installed teamix-evo packages"; (组件源码升级 — ADR 0040) "升级 ui"、"升级业务组件"、"升级 button"、"生成 ui staging"、"生成 biz-ui staging"、"upgrade ui"、"upgrade biz-ui"、"upgrade ui component"、"stage ui upgrade"、"teamix-evo ui upgrade"、"teamix-evo biz-ui upgrade"; (卸载 / 清单) "卸载 teamix-evo"、"看看装了哪些 teamix-evo 资源"、"remove the design system"、"list installed"; (placeholder→real 升级) "升级 UI"、"接入真组件"、"替换 placeholder"、"upgrade UI"、"replace placeholders"、"swap in real components"、"make the UI real", or user opens / edits `src/components/_placeholder/**`, project contains `.teamix-evo/create/pending-ui.json`, literal `@teamix-evo:placeholder` tag in code; (状态文件) user touches `.teamix-evo/config.json`、`.teamix-evo/manifest.json`、`.teamix-evo/create/pending-ui.json`.
6
- SKIP: any content task — generating components, pages, services, or reviewing screens; changes to `src/` files outside the migration loop, design tokens, or business logic. Those go to teamix-evo-code-opentrek or teamix-evo-design-opentrek. SKIP if the user is mid-flow inside an already-initialized project asking to "新增页面 / 加按钮 / 调接口" — that's coding work, not lifecycle. SKIP pure styling / token tweaks — those go to ESLint + `tokens.overrides.css`.
4
+ Single entry point for the teamix-evo lifecycle: scaffold a new project skeleton, install the AI coding system into an existing repo via `teamix-evo init`, inspect / remove any teamix-evo package, manage component-source upgrades, and drive old-project migration/rebuild.
5
+ TRIGGER when: (CLI) user runs or asks about `teamix-evo init` / `teamix-evo tokens ...` / `teamix-evo skills ...` / `teamix-evo ui ...` / `teamix-evo biz-ui ...` / `teamix-evo blocks ...` / `teamix-evo lint ...` / `teamix-evo logs ...` / `teamix-evo restore ...` / `teamix-evo switch ...`, or `npm create teamix-evo` / `pnpm create teamix-evo`; (模糊初始化) "初始化一个项目"、"初始化一个工程"、"初始化一个 teamix-evo 工程"、"初始化一个 Teamix Evo 项目"、"create a teamix-evo project"、"set up teamix-evo from scratch"、"new teamix-evo app"; (具名变体初始化) "初始化一个 opentrek 工程 / op 工程 / OpenTrek 项目 / 探索者项目"、"初始化一个云管 / 云管控制台 / 云管项目 / uni-manager 工程 / 云管工程"、"new opentrek/uni-manager project"; (AI coding 接入) "给现有仓库装 teamix-evo"、"现有项目装一下 skills + ui"、"接入 AI coding 体系"、"装 teamix-evo 进这个项目"、"add teamix-evo to existing repo"、"install AI coding system"、"接入 opentrek 研发体系"、"接入 op 研发体系"、"接入 OpenTrek 研发体系"、"接入 opentrek 研发系统"、"接入 op 研发系统"、"接入云管研发体系"、"接入云管研发系统"、"接入 uni-manager 研发体系"、"接入 uni-manager 研发系统"、"接入统一管理研发体系"; (组件源码升级 — ADR 0040) "升级 ui"、"升级业务组件"、"升级 button"、"生成 ui staging"、"生成 biz-ui staging"、"upgrade ui"、"upgrade biz-ui"、"upgrade ui component"、"stage ui upgrade"、"teamix-evo ui upgrade"、"teamix-evo biz-ui upgrade"; (卸载 / 清单) "卸载 teamix-evo"、"看看装了哪些 teamix-evo 资源"、"remove the design system"、"list installed"; (旧工程迁移) "迁移旧项目"、"重建老工程"、"把旧项目搬过来"、"旧项目分析"、"旧系统翻新"、"legacy migration"、"migrate old project"、"rebuild from existing"、"refactor from old codebase"、"从旧项目迁移过来"、"用旧项目做参考重建"、"分析旧项目并迁移"; (状态文件) user touches `.teamix-evo/config.json`、`.teamix-evo/manifest.json`.
6
+ SKIP: any content task — generating components, pages, services, or reviewing screens; changes to `src/` files outside the component upgrade flow, design tokens, or business logic. Those go to teamix-evo-code-opentrek or teamix-evo-design-opentrek. SKIP if the user is mid-flow inside an already-initialized project asking to "新增页面 / 加按钮 / 调接口" — that's coding work, not lifecycle. SKIP pure styling / token tweaks — those go to ESLint + `tokens.overrides.css`.
7
7
  Coordinates with: teamix-evo-design-opentrek (visual side after a screen is generated)、teamix-evo-code-opentrek (file placement / reuse rules) — manage is the entry point and precedes content skills, never co-triggers.
8
8
  ---
9
9
 
@@ -12,18 +12,20 @@ description: |
12
12
  Single entry skill for the **teamix-evo** toolkit lifecycle. Covers six scenarios:
13
13
 
14
14
  1. Fuzzy init → ask user to pick a tokens variant.
15
- 2. Named-variant init → infer variant from business name, run scaffold directly.
15
+ 2. Named-variant init → infer variant from business name, run scaffold + init directly.
16
16
  3. Adopt teamix-evo into an existing npm repo via `teamix-evo init` (普通版接入, no scaffold step).
17
- 4. Update detection — only refresh what's already installed, including 4e component-source upgrade staging(`ui upgrade` / `biz-ui upgrade`).
17
+ 4. Component-source upgrade (组件源码升级 ADR 0040).
18
18
  5. Uninstall.
19
- 6. Placeholderreal UI migration loop (post-`npm create teamix-evo`).
19
+ 6. Old-project migration (旧工程迁移重建) analyze old project via repo-wiki + source reading, generate phased migration plan, AI-driven page-by-page rebuild in the new project.
20
+
21
+ > **Note**: The top-level `teamix-evo update` command has been removed (ADR 0043). For tokens/skills updates, use `teamix-evo tokens update` / `teamix-evo skills update` directly. For component-source upgrades, use `teamix-evo ui upgrade` / `teamix-evo biz-ui upgrade`.
20
22
 
21
23
  ## 安装方式
22
24
 
23
25
  本 skill 是 **entry skill**(lifecycle orchestrator),manifest 里声明 `scope: "global"`。**推荐全局安装一次**:
24
26
 
25
27
  ```bash
26
- npx teamix-evo skills add teamix-evo-manage --scope global
28
+ npx teamix-evo skills add teamix-evo-manage --scope global -y
27
29
  ```
28
30
 
29
31
  `skills add`(默认 project scope)与 `npm create teamix-evo` **不会**自动装本 skill —— bulk 模式按 scope 自动跳过(ADR 0033)。如果用户在项目级显式 `skills add teamix-evo-manage --scope project`,CLI 给出"推荐 global"warning 但仍装入(用户自负责),代价是后续 IDE 会同时识别全局与项目两份副本。
@@ -53,14 +55,16 @@ npx teamix-evo@latest skills update --dry-run # 预览,不写盘
53
55
  ```text
54
56
  用户的指令命中本 skill
55
57
  ├── 目录里有 `.teamix-evo/`?
56
- │ 是 ──▶ 4 (更新) / 5 (卸载)
58
+ │ 是 ──▶ 用户提到「迁移 / 重建 / migrate / 旧项目 / legacy」?
59
+ │ │ 是 ──▶ 6 (旧工程迁移重建)
60
+ │ │ 否 ──▶ 4 (组件升级) / 5 (卸载) / 各子命令按需调用
57
61
  │ 否 ──▶ 继续
58
62
  ├── 用户说出业务名 / variant?
59
63
  │ 是 ──▶ 2 (具名变体初始化) — 用「业务名→variant 映射表」推断
60
64
  │ 否 ──▶ 继续
61
65
  ├── 目录是空的(或只有 .git / README.md)?
62
66
  │ 是 ──▶ 1 (模糊初始化) — 询问 variant 后转 2
63
- │ 否 ──▶ 3 (普通版接入) — `teamix-evo init` 一键检测 + wizard + 6 类冲突 + 静默落地
67
+ │ 否 ──▶ 3 (普通版接入) — `teamix-evo init` 8 步流水线 + 薄版冲突检测
64
68
  ```
65
69
 
66
70
  ## 业务名 → variant 映射
@@ -81,44 +85,49 @@ CLI 二进制名 `teamix-evo`(+ 脚手架独立二进制 `create-teamix-evo`
81
85
 
82
86
  | Group | Verb | 用途 |
83
87
  | ------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
84
- | **create** | `npm create teamix-evo [dir]` | 一站式脚手架:scaffold + tokens + skills + ui + lint |
85
- | **init** | `init [-y] [--dry-run] [--variant <v>] [--cwd <dir>]` | 普通版接入:把 teamix-evo 注入已有 npm 工程(三分支决策树 + 6 类冲突检测 + wizard) |
86
- | **update** | `update [--dry-run] [--cwd <dir>]` | 套件级升级 orchestrator:tokens → skills([ADR 0019](docs/adr/0019)) |
88
+ | **create** | `npm create teamix-evo [dir] [-y]` | 骨架脚手架:模板 + variant overlay + package.json merge + .mcp.json + 依赖安装 + git init(`-y` 跳过交互走推荐默认);完成后需跑 `teamix-evo init` 装入 AI 套件 |
89
+ | **init** | `init [-y] [--dry-run] [--variant <v>] [--cwd <dir>]` | 8 步流水线:tokens → skills → agents-md ui-init ui-add biz-ui-add → lint → gitignore(8 类冲突检测 + `--force` 跳过) |
87
90
  | **switch** | `switch <new-variant> [--apply] [-y] [--cwd <dir>]` | 切到目标 variant:dry-run 默认,`--apply` 才真写;自动 snapshot + token rename hint |
88
91
  | **restore** | `restore [<ts>] [--list] [-y] [--cwd <dir>]` | 失败回滚:从 snapshot 还原 `.teamix-evo/`,pre-restore 自身可逆(ADR 0019 §2) |
89
92
  | **tokens** | `init <variant>` | 初始化指定变体的 design tokens(`<variant>` 必填) |
90
93
  | | `list-variants` | 列出所有可选变体 |
91
94
  | | `list` | 列出已装 tokens 资源 |
92
- | | `update` | 刷新 regenerable tokens(frozen 保留,[ADR 0003](docs/adr/0003) |
95
+ | | `update` | 刷新 regenerable tokens(frozen 保留,ADR 0003) |
93
96
  | | `uninstall` | 卸载 tokens |
94
- | **skills** | `init` | 自举:按 variant + scope 装全部匹配 skill([ADR 0034](docs/adr/0034) verb 分工) |
97
+ | | `audit` | 审计 `tokens.overrides.css`:冗余 / 有效 / 推荐迁移 / 项目特有(v3↔v4 语义比较) |
98
+ | | `diagnose` | 分级治理报告:跑 lint → 按 L1/L2/L3 分类 → 产出 `.treatment-plan.md`(ADR 0042) |
99
+ | | `treat` | 一键流水线:按 diagnose 顺序执行 codemod → 前后基线对比 → 降幅报告(ADR 0042) |
100
+ | | `reflect` | Token 反哺:检测频次 ≥ 3 的业务色值 → 提议命名 → 写入 overrides(ADR 0042) |
101
+ | | `codemod <name>` | 单独跑指定 codemod(hsl-to-v4 / hex-to-token / tw-scale-to-semantic / space-to-gap / arbitrary-to-token) |
102
+ | **skills** | `init` | 自举:按 variant + scope 装全部匹配 skill(ADR 0034 verb 分工) |
95
103
  | | `add <name...>` | 增量装指定 skill |
96
104
  | | `list` (alias `ls`) | 列出全部 skill(`--installed` 仅已装) |
97
- | | `update [name...]` | 升级已装 skill([ADR 0035](docs/adr/0035) 双闸 + `--scope` + `--dry-run`) |
105
+ | | `update [name...]` | 升级已装 skill(ADR 0035 双闸 + `--scope` + `--dry-run`) |
98
106
  | | `uninstall [ids...]` | 卸载 skill |
99
- | | `doctor` | 检测 source ↔ IDE 镜像漂移([ADR 0013](docs/adr/0013) |
107
+ | | `doctor` | 检测 source ↔ IDE 镜像漂移(ADR 0013) |
100
108
  | | `sync [name...]` | 重新镜像到 IDE 路径(不升版本) |
101
109
  | **ui** | `init` | 初始化 ui 配置(aliases / icon / tsx / rsc) |
102
110
  | | `add <id...>` | 安装 UI 组件(auto-resolve registryDependencies,frozen) |
103
111
  | | `list` | 列出 UI 组件(`--installed` / `--include-deprecated`) |
104
- | | `upgrade [id...]` | 生成 ui 升级 staging(仅写 `.upgrade-staging/`,[ADR 0040](docs/adr/0040);skill 应用) |
112
+ | | `upgrade [id...]` | 生成 ui 升级 staging(仅写 `.upgrade-staging/`,ADR 0040;skill 应用) |
105
113
  | | `promote-to-biz [ids...]` | 把 ui staging 条目按 8 模式(Coexist/Preset/Wrapper/Compose/Variant/Fork/TokenOnly/ManualReview)落地到 `src/components/business/` + manifest(Init 落地计划 §C.3) |
106
114
  | **biz-ui** | `add <id...>` | 安装业务组件(`--variant` 必填) |
107
115
  | | `list` | 列出变体下的业务组件 |
108
116
  | | `list-variants` | 列出可用业务组件变体 |
109
- | | `upgrade [id...]` | 生成 biz-ui 升级 staging(变体感知,[ADR 0040](docs/adr/0040);skill 应用) |
110
- | **templates** | `add <id...>` | 安装页面模板(`--variant` 必填)⚠️ AI 默认不主动调用([ADR 0031](docs/adr/0031) |
111
- | | `list` | 列出变体下的模板 |
112
- | | `list-variants` | 列出可用模板变体 |
117
+ | | `upgrade [id...]` | 生成 biz-ui 升级 staging(变体感知,ADR 0040;skill 应用) |
118
+ | **blocks** | `add <id...>` | 安装 marketing block(Hero / Features / CTA 等落地页区块,ADR 0044 |
119
+ | | `list` | 列出可用 blocks(`--installed` 仅已装;`--json` 机器可读) |
120
+ | | `upgrade [id...]` | 生成 blocks 升级 staging(ADR 0040;通过 teamix-evo-upgrade skill 应用) |
121
+ | **templates** | ~~`add` / `list` / `list-variants`~~ | ⚠️ 已废弃,请改用 `teamix-evo blocks`(ADR 0044) |
113
122
  | **lint** | `init` | 初始化 ESLint + Stylelint token-discipline 规则 |
114
123
  | **logs** | `analyze` | 汇总 vibe-logger JSONL(tool / tag / MCP 频次) |
115
124
  | | `trace` | 会话级调用链回溯(按 prompt / session 过滤) |
116
125
 
117
126
  > **脚注**
118
127
  >
119
- > - `tokens` / `biz-ui` / `templates` 共享 variant 名空间([ADR 0014](docs/adr/0014)),与 `tokens init` 选定 variant 一致。
120
- > - `skills init` vs `add`:init 无 ids = 自举全部匹配 skill;add 必填 ids = 增量([ADR 0034](docs/adr/0034))。
121
- > - 源镜像模型([ADR 0013](docs/adr/0013)):规范副本在 `.teamix-evo/skills-source/`,IDE 镜像在 `.qoder/skills/` 与 `.claude/skills/`。
128
+ > - `tokens` / `biz-ui` 共享 variant 名空间(ADR 0014),与 `tokens init` 选定 variant 一致。`blocks` 是 token-driven、variant 无关的独立包(ADR 0044)。
129
+ > - `skills init` vs `add`:init 无 ids = 自举全部匹配 skill;add 必填 ids = 增量(ADR 0034)。
130
+ > - 源镜像模型(ADR 0013):规范副本在 `.teamix-evo/skills-source/`,IDE 镜像在 `.qoder/skills/` 与 `.claude/skills/`。
122
131
 
123
132
  ### 动态查询(详细选项 & 实时清单)
124
133
 
@@ -136,6 +145,8 @@ npx create-teamix-evo --help # 脚手架帮助
136
145
  | ------------------------ | ------------------------------------- |
137
146
  | UI 组件列表 / 搜索 | `list_components` / `find_components` |
138
147
  | 组件详情(props / deps) | `get_component_meta` |
148
+ | Blocks 列表 / 搜索 | `blocks_list` / `blocks_find` |
149
+ | Block 详情 | `blocks_get` |
139
150
  | Skill 列表 / 搜索 | `skills_list` / `skills_find` |
140
151
  | Skill 详情 | `skills_get` |
141
152
  | Design tokens | `tokens_list` / `tokens_search` |
@@ -157,30 +168,44 @@ npx create-teamix-evo --help # 脚手架帮助
157
168
 
158
169
  **触发**:用户在「业务名 → variant 映射」中能锁定 variant,或场景 1 询问后得到答复。
159
170
 
160
- **唯一命令**:
171
+ ### 第一步:生成骨架
161
172
 
162
173
  ```bash
163
- npm create teamix-evo@latest <dir> --variant <name>
164
- # 或 pnpm create teamix-evo <dir> --variant <name>
174
+ npm create teamix-evo@latest <dir> --variant <name> -y
175
+ # 或 pnpm create teamix-evo <dir> --variant <name> -y
165
176
  ```
166
177
 
167
- `create-teamix-evo` `console` preset(默认且当前唯一)会自动一站式落地:
178
+ > `-y` 跳过包管理器 / git init 等交互,全部走推荐默认值(pm=auto、git=true)。
168
179
 
169
- | 阶段 | 产物 |
170
- | ---- | ---------------------------------------------------------------------------------------------------------- |
171
- | 1 | Vite + React + TS scaffold(`src/`、`vite.config.ts` 等) |
172
- | 2 | `tokens init <variant>` → 根 `tokens/` 目录(`tokens.theme.css` / `tokens.overrides.css`) |
173
- | 3 | `skills add design-<variant> code-<variant>` → 项目级装 2 个 variant 内容 skill(manage 不在内,见 ADR 0033) |
174
- | 4 | `ui init` → `.teamix-evo/config.json` |
175
- | 5 | `ui add` → 真组件源码(button / card / input / form / table 等) |
176
- | 6 | `lint init` → ESLint + Stylelint 配置 |
180
+ `create-teamix-evo` `console` preset(默认且当前唯一)只做骨架生成:
177
181
 
178
- > 提示:`teamix-evo-manage` entry skill,推荐**全局**装一次(`npx teamix-evo skills add teamix-evo-manage --scope global`)。create CLI 不会装它到 project,scaffold 完成后的 next-steps 会提示用户。
182
+ | 阶段 | 产物 |
183
+ | ---- | ------------------------------------------------ |
184
+ | 1 | Vite + React + TS scaffold(base template 复制) |
185
+ | 2 | variant overlay(变体专属配置覆盖) |
186
+ | 3 | package.json merge(合并依赖) |
187
+ | 4 | `.mcp.json` 写入 |
188
+ | 5 | 依赖安装(`pnpm install` / `npm install`) |
189
+ | 6 | git init |
190
+
191
+ > **注意**:`create` 不再调用 `teamix-evo/core` 的任何函数(ADR 0043),它只生成纯静态骨架。
192
+
193
+ ### 第二步:装入 AI 套件
179
194
 
180
- **完成后告知用户**:
195
+ 骨架完成后,`create` 的 next-steps 会提示用户跑:
181
196
 
182
197
  ```bash
183
198
  cd <dir>
199
+ npx teamix-evo init --variant <name> -y
200
+ ```
201
+
202
+ 该命令走场景 3 的 8 步流水线,装入 tokens / skills / ui 组件 / lint 等全套资产。
203
+
204
+ > 提示:`teamix-evo-manage` 是 entry skill,推荐**全局**装一次(`npx teamix-evo skills add teamix-evo-manage --scope global`)。create CLI 不会装它到 project,scaffold 完成后的 next-steps 会提示用户。
205
+
206
+ **全部完成后告知用户**:
207
+
208
+ ```bash
184
209
  pnpm dev # 立刻可跑
185
210
  pnpm typecheck # 验证零类型错误
186
211
  ```
@@ -200,34 +225,40 @@ npx teamix-evo init [-y] [--dry-run] [--variant <name>] [--cwd <dir>]
200
225
  | 当前目录状态 | init 反应 |
201
226
  | ------------------------------------- | --------------------------------------------------- |
202
227
  | 空目录 / 仅含 `.git` 等可忽略文件 | ⚠ 提示改用 `npm create teamix-evo@latest`(场景 2) |
203
- | 已有 `.teamix-evo/` | 提示改用 `update` / `doctor`(场景 4) |
228
+ | 已有 `.teamix-evo/` | 已初始化,每步幂等短路自动跳过已完成步骤 |
204
229
  | 有 `package.json` 但无 `.teamix-evo/` | ✓ 走主路径 |
205
230
 
206
- ### 主路径六步流水线
231
+ ### 主路径八步流水线
207
232
 
208
- | # | 步骤 | 关键 | 行为 |
209
- | --- | --------- | ---- | -------------------------------------------------------------------------------------- |
210
- | 1 | tokens | ✓ | 写 `tokens/`,顺带装 design skill;旧路径单文件命中 `migrate` 策略时自动提层迁移 |
211
- | 2 | skills | ✓ | 项目级装 `teamix-evo-code-<variant>`(manage 全局装一次,design 由 1 顺带 — ADR 0033) |
212
- | 3 | agents-md | – | 生成根 `AGENTS.md`,managed-region 可重生(ADR 0038) |
213
- | 4 | ui-init | ✓ | 写 `components.json` + `packages.ui` 配置 |
214
- | 5 | ui-add | – | 装基线 13 个组件(`uiSelection='all'` 则装全集) |
215
- | 6 | lint | – | `runLintInit`(ESLint + Stylelint |
233
+ | # | 步骤 | 关键 | 行为 |
234
+ | --- | ---------- | ---- | -------------------------------------------------------------------------------------- |
235
+ | 1 | tokens | ✓ | 写 `tokens/`,顺带装 design skill;旧路径单文件命中 `migrate` 策略时自动提层迁移 |
236
+ | 2 | skills | ✓ | 项目级装 `teamix-evo-code-<variant>`(manage 全局装一次,design 由 1 顺带 — ADR 0033) |
237
+ | 3 | agents-md | – | 生成根 `AGENTS.md`,managed-region 可重生(ADR 0038) |
238
+ | 4 | ui-init | ✓ | 写 `components.json` + `packages.ui` 配置 |
239
+ | 5 | ui-add | – | 装全量 UI 组件源码(overwrite 模式) |
240
+ | 6 | biz-ui-add | – | 装当前 variant 下全量业务组件(无可用则 skip |
241
+ | 7 | lint | – | `runLintInit`(ESLint + Stylelint) |
242
+ | 8 | gitignore | – | 追加 teamix-evo runtime 规则到 `.gitignore` |
216
243
 
217
244
  > 关键步骤失败 → 后续关键步骤短路成 `skip(aborted)`;非关键步骤失败不阻断整体。
218
245
 
219
- ### 6 类冲突(wizard 逐项询问策略)
246
+ ### 8 类冲突(薄版检测 — ADR 0043 §3)
220
247
 
221
- | 冲突键 | 已实现策略 |
222
- | ----------------- | ------------------------------------------------- |
223
- | `tokens` | `migrate` / `overwrite` / `skip` |
224
- | `agents-md` | `merge-managed` / `overwrite` / `skip` |
225
- | `components-json` | `overwrite` / `skip` |
226
- | `shadcn-source` | `overwrite` / `skip-existing` / `skip` |
227
- | `tailwind-config` | 仅 `skip`(其它策略待批次 4 managed-region 引擎) |
228
- | `index-css` | 仅 `skip`(其它策略待批次 4 managed-region 引擎) |
248
+ init 前自动 `detectConflicts(cwd)` 扫描,产出结构化报告;发现冲突时终止并输出,由 AI 层决策下一步。`--force` 跳过全部检测。
229
249
 
230
- > wizard 给每项一个推荐策略;`-y` 全走推荐默认值;`--dry-run` 只打印计划不写文件。
250
+ | 冲突键 | 检测对象 |
251
+ | ------------------ | --------------------------------------- |
252
+ | `tokens` | `tokens/` 目录已存在 |
253
+ | `agents-md` | 根 `AGENTS.md` 已存在 |
254
+ | `components-json` | `.teamix-evo/config.json` 已存在 |
255
+ | `shadcn-source` | `src/components/ui/` 下已有组件文件 |
256
+ | `tailwind-config` | `tailwind.config.*` 已存在 |
257
+ | `index-css` | `src/index.css` 含现有 token import |
258
+ | `eslint-config` | `.eslintrc*` / `eslint.config.*` 已存在 |
259
+ | `stylelint-config` | `.stylelintrc*` 已存在 |
260
+
261
+ > `--force` 跳过全部冲突检测,overwrite 所有已有文件;`--dry-run` 只打印计划不写文件。
231
262
 
232
263
  #### tokens `migrate` 策略(W1.4 提层兼容)
233
264
 
@@ -247,78 +278,13 @@ CLI 在 partial 状态会打印“恢复指引”面板:失败步骤名、错
247
278
 
248
279
  - 已落地的 step 列表 + variant / IDE / scope。
249
280
  - `pendingConflictWork`(如有):批次 4 上线后用 `teamix-evo conflict resolve` 收尾。
250
- - 全局 entry skill:若 `~/.qoder/skills/teamix-evo-manage` 不存在,补一句 `npx teamix-evo skills add teamix-evo-manage --scope global`(ADR 0033)。
251
-
252
- ### Post-init AI 串场(5 步闭环)
253
-
254
- > CLI `init` 完成后,末尾会打印 Next Steps 板块,并提示「让 AI 接力」。当用户在 IDE 内触发本 skill 接力时,按以下 5 步顺序走完闭环;每步执行前先告知用户即将做什么,执行后回报关键统计。
255
-
256
- | # | 步骤 | 命令 / 操作 | 目的 | 何时跳过 |
257
- | --- | --------------- | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------- |
258
- | 1 | adopt | `npx teamix-evo ui add --adopt --dry-run` → 确认后去 dry-run | 把项目里现有的 `src/components/{ui,business}/**` + hooks/utils 全量纳管到 manifest(strategy=frozen,标 `sourceLineage=detected`),不动文件内容 | 项目无 `src/components/` |
259
- | 2 | upgrade staging | `npx teamix-evo ui upgrade`(再 `biz-ui upgrade`) | 生成 `.upgrade-staging/`,每条目带 `featureVector` + `recommendedModes` + `confidence`(ADR 0040) | adopt 0 件 / 全部 frozen 一致 |
260
- | 3 | tokens audit | `npx teamix-evo tokens audit`(C.5 上线后)/ 暂用人工读 `tokens/tokens.overrides.css` | 4 类输出:冗余删除 / 有效保留 / 推荐迁移 / 项目特有;与 `theme.css` 做 v3↔v4 语义比较 | overrides 0 变量 |
261
- | 4 | AGENTS.md 回填 | 读根 `AGENTS.md` managed 区域之外的内容,按 heading 归类(UI 设计 / 代码研发 / 项目特有),把项目特有规则塞回 managed 区域之前 | 让用户私有规范与 Skills 注入区共存,不被 `init --merge-managed` 覆盖 | 用户文件全为 managed-only |
262
- | 5 | lint | `npx teamix-evo lint init`(如未跑)+ `pnpm lint` | token-discipline 兜底;error 数内嵌报告 | 已跑过且 0 error |
263
-
264
- 执行约定:
265
-
266
- - **每步前**先用一句话告诉用户「即将做什么 + 命令是什么」,等用户回 `OK / 跳过` 再动手;不要批量静默连发。
267
- - **每步后**汇总数字:`adopted=N foreign=M / staged=K / overrides 删 X 留 Y / AGENTS.md 增 Z 段 / lint error=E`。
268
- - **遇 ManualReview / foreign / 推荐迁移**:列出来交给用户决策,不替用户改代码。
269
- - 5 步走完,输出一段 `done` 总结 + 后续可走的命令(`ui promote-to-biz` / `restore` / `update`)。
281
+ - 全局 entry skill:若 `~/.qoder/skills/teamix-evo-manage` 不存在,补一句 `npx teamix-evo skills add teamix-evo-manage --scope global -y`(ADR 0033)。
270
282
 
271
283
  ## 场景 4 · 升级
272
284
 
273
- > **概念区分**:"升级 teamix-evo"= 升级**整个 AI 套件**(所有已装包);"升级 manage skill / 升级某个 skill"= 只升级指定的 skill。根据用户表述判断走哪条路径。
274
-
275
- ### 4a · 套件级升级("升级 teamix-evo / update teamix-evo")
276
-
277
- **触发**:用户说"升级 teamix-evo / 看看哪些要升级 / update teamix-evo / 升级套件 / refresh installed teamix-evo packages"。
278
-
279
- **一行命令**:
280
-
281
- ```bash
282
- npx teamix-evo@latest update # 实际执行 tokens → skills 升级
283
- npx teamix-evo@latest update --dry-run # 只看升级计划,不写任何文件
284
- ```
285
-
286
- **orchestrator 两步管线**(ADR 0003 三态 + ADR 0035 短路):
287
-
288
- | 步骤 | 包 | 语义 | 失败后果 |
289
- | ---- | ------ | -------------------------------- | ---------------------------------- |
290
- | 1 | tokens | regenerable 覆盖 + frozen 保留 | **关键步骤**:失败时中止后续 |
291
- | 2 | skills | lock ∩ scope ∩ version-diff 短路 | 非关键:记录失败但不中止已完成步骤 |
292
-
293
- > ui / biz-ui / templates 是 frozen(ADR 0019)— 不参与 bulk update。如用户想覆盖单个组件,引导用 `ui add <id> --overwrite`。
294
-
295
- **AI 引导决策树**:
285
+ > **注意**:顶层 `teamix-evo update` 命令已移除(ADR 0043)。tokens / skills 升级请直接使用对应子命令(`tokens update` / `skills update`)。组件源码升级走 `ui upgrade` / `biz-ui upgrade`。
296
286
 
297
- 1. **先推荐 dry-run**:执行 `npx teamix-evo@latest update --dry-run`。
298
- 2. 根据输出告知用户:
299
- - `dry-run` 步骤全 `·` up-to-date → 「已是最新版本,无需升级」。
300
- - 有版本 bump 计划 → 确认后去掉 `--dry-run` 执行。
301
- 3. 执行后根据 CLI 输出的 STEP_ICON 反馈:
302
- - 全 `✔` → 告知升级完成 + 版本变化。
303
- - 含 `✖`(partial)→ CLI 已打印「恢复指引」面板,复述给用户:
304
- - 哪个步骤失败 + 错误信息
305
- - 建议修复后重跑 `teamix-evo update`(每步幂等,version-diff 短路自动跳过已完成步骤)
306
- - 全 `⊘` skip → 告知相应包未安装,如需添加走场景 3。
307
-
308
- **不要**给未安装的包做 install — 那是场景 2/3 的事。
309
- **不要**手动拼 `tokens update` + `skills update` — 统一用 `teamix-evo update`。
310
-
311
- #### Token rename 收尾(可选,仅当 CLI 输出 `💡 token rename hint:` 时)
312
-
313
- `tokens update` / `switch --apply` 跳过了 rename 节点时,CLI 会在 `.teamix-evo/.upgrade-hints/tokens-<ts>.json` 写一份改名索引。这是**被动提示** — CLI 永远不会自动改写 `src/**`(frozen 边界,ADR 0019 §D4)。
314
-
315
- 要项:
316
-
317
- - 告诉用户 hint 文件路径;
318
- - 引导用户调 [`teamix-evo-upgrade`](../teamix-evo-upgrade/SKILL.md) skill 处理 codemod(扫描 `src/**` + `tokens/tokens.overrides.css`,逐文件 diff 征同意后才修改);
319
- - 未检测到 hint 时则安静跳过,不要装作有 codemod 要跑。
320
-
321
- ### 4b · 单 skill 升级("升级 manage skill / 升级 design skill")
287
+ ### 4a · skill 升级(“升级 manage skill / 升级 design skill”)
322
288
 
323
289
  **触发**:用户明确指定要升级某个 skill(如"升级 teamix-evo-manage / 更新 design skill / update manage skill")。
324
290
 
@@ -329,7 +295,7 @@ npx teamix-evo@latest skills update <skill-id> # 指定 skill
329
295
  npx teamix-evo@latest skills update <skill-id> --dry-run # 先预览
330
296
  ```
331
297
 
332
- ### 4c · variant 切换(`teamix-evo switch` — ADR 0019 task #7)
298
+ ### 4b · variant 切换(`teamix-evo switch` — ADR 0019 task #7)
333
299
 
334
300
  **触发**:用户表达“切到 uni-manager / 切到云管 / 换个 variant / switch 到 opentrek / 迁到探索者体系 / variant migration”。
335
301
 
@@ -358,7 +324,7 @@ npx teamix-evo@latest switch <new-variant> --apply -y # 跳二次确认(destru
358
324
  4. 成功后:
359
325
  - CLI 输出 `priorVariant: <old>` / `variant: <new>`,`config.json` 已记录备查;
360
326
  - 若 CLI 输出 `💡 token rename hint:` — 引导用户走 [`teamix-evo-upgrade`](../teamix-evo-upgrade/SKILL.md) skill 扫 `src/**` 与 `tokens.overrides.css`。
361
- 5. 失败:switch 执行前会自动 `reason="switch"` snapshot,`partial` 状态可走场景 4d `restore`。
327
+ 5. 失败:switch 执行前会自动 `reason="switch"` snapshot,`partial` 状态可走场景 4c `restore`。
362
328
 
363
329
  **不要**:
364
330
 
@@ -366,9 +332,9 @@ npx teamix-evo@latest switch <new-variant> --apply -y # 跳二次确认(destru
366
332
  - 不要为了“保留用户业务代码”去手动改 `src/**`:frozen 资源完全交给 codemod skill,CLI 仓抱不越界。
367
333
  - 不要把 `switch` 当作“调个 token 样式”的快捷手段 — 它是跨 variant 迁移,仅在业务名变更 / 双 variant 互迁时使用。
368
334
 
369
- ### 4d · 失败回滚(`teamix-evo restore` — ADR 0019 §2)
335
+ ### 4c · 失败回滚(`teamix-evo restore` — ADR 0019 §2)
370
336
 
371
- **触发**:`init` / `update` 出现 `partial` 状态后用户希望**完全回退**到执行前的 `.teamix-evo/` 状态(而不是修原因后续跑)。
337
+ **触发**:`init` / `switch` 出现 `partial` 状态后用户希望**完全回退**到执行前的 `.teamix-evo/` 状态(而不是修原因后续跑)。
372
338
 
373
339
  **两步**:
374
340
 
@@ -377,21 +343,21 @@ npx teamix-evo restore --list # 列出可用 snapshot(最新在前)
377
343
  npx teamix-evo restore <ts> # 回滚到指定 snapshot(默认带二次确认,-y 跳过)
378
344
  ```
379
345
 
380
- snapshot 由 `init` / `update` / `variant switch` 在执行前**自动**生成,默认保留最近 5 个;reason 字段标识来源(`init` / `update` / `switch` / `restore` / `manual`)。
346
+ snapshot 由 `init` / `switch` 在执行前**自动**生成,默认保留最近 5 个;reason 字段标识来源(`init` / `switch` / `restore` / `manual`)。
381
347
 
382
348
  **关键性质 — restore 自身可逆**:`restore <ts>` 在覆盖前会再做一次 `reason="restore"` 的安全 snapshot,所以即便回滚错版本也可以再 `restore --list` 找回前一个状态。
383
349
 
384
350
  **AI 引导**:
385
351
 
386
- - 优先推荐 `修因 + 重跑 init/update`(`partial` 状态恢复的常规路径) — 每步幂等,version-diff 短路。
352
+ - 优先推荐 `修因 + 重跑 init`(`partial` 状态恢复的常规路径) — 每步幂等,version-diff 短路。
387
353
  - 仅当用户明确表达"恢复到执行前 / 撤销这次升级 / 全部退回"时才走 `restore`。
388
354
  - 回滚后告知用户:已执行 `restore <ts>`,本次操作前的状态已存为新 `reason=restore` snapshot 备查。
389
355
 
390
- ### 4e · 组件源码升级(`teamix-evo ui upgrade` / `teamix-evo biz-ui upgrade` — [ADR 0040](docs/adr/0040)
356
+ ### 4d · 组件源码升级(`teamix-evo ui upgrade` / `teamix-evo biz-ui upgrade` — ADR 0040)
391
357
 
392
358
  **触发**:用户表达“升级 ui / 升级业务组件 / 升级 button / 看看哪些组件有新版 / upgrade ui / upgrade biz-ui / stage ui upgrade”等关键词。
393
359
 
394
- > 这里是**版本演进**(installed 资源 → 上游新版 → staging → 逐个 apply),与场景 6 “placeholder→real 首次填充”是两条路:场景 6 是初体验起点(`pending-ui.json`),这里是安装完成后跟随上游发布。
360
+ > 这里是**版本演进**(installed 资源 → 上游新版 → staging → 逐个 apply),是安装完成后跟随上游发布的升级流程。
395
361
 
396
362
  **一行命令**:
397
363
 
@@ -402,7 +368,7 @@ npx teamix-evo biz-ui upgrade # 变体感知的 biz-ui staging
402
368
  npx teamix-evo biz-ui upgrade --apply # 错误:CLI 不写 src,guidance 走 teamix-evo-upgrade skill
403
369
  ```
404
370
 
405
- 运行 `teamix-evo update` 时,orchestrator 中也会自动跳过一次 `ui:planned` / `biz-ui:planned`,产出同样的 staging 目录。
371
+ 运行 `teamix-evo ui upgrade` 时,也会自动跳过一次 `ui:planned` / `biz-ui:planned`,产出同样的 staging 目录。
406
372
 
407
373
  **lineage 分三档**(CLI 只在前两者上产出 staging):
408
374
 
@@ -415,7 +381,7 @@ npx teamix-evo biz-ui upgrade --apply # 错误:CLI 不写 src,guidance
415
381
 
416
382
  **AI 引导决策树**:
417
383
 
418
- 1. **先识别 lineage**:`teamix-evo update` 的 step detail / `ui upgrade` 的输出都会带 `lineage=...`。根据表选开场白。
384
+ 1. **先识别 lineage**:`ui upgrade` 的输出会带 `lineage=...`。根据表选开场白。
419
385
  2. **路径 A(`teamix-evo` / `mixed`)**:
420
386
  - CLI 生成 staging 后会输出 `staging at .teamix-evo/.upgrade-staging/<dir>` + risk 汇总。复述给用户。
421
387
  - **应用 staging 交给 [`teamix-evo-upgrade`](../teamix-evo-upgrade/SKILL.md) skill** — 它会逐个展示 diff,按 risk 分批让用户确认后才复制 incoming.tsx 到 src(逐文件 hard gate)。
@@ -436,11 +402,11 @@ npx teamix-evo biz-ui upgrade --apply # 错误:CLI 不写 src,guidance
436
402
  - 不要听到“升级 ui”就打 `ui add` — `add` 是装进去,`upgrade` 是已装后追上上游。
437
403
  - 不要在 `shadcn-native` lineage 强行跳 staging;CLI 跳过是预期行为。
438
404
 
439
- ### 4f · 组件源码 promotion(`teamix-evo ui promote-to-biz` — Init 落地计划 §C.3 / §C.4)
405
+ ### 4e · 组件源码 promotion(`teamix-evo ui promote-to-biz` — Init 落地计划 §C.3 / §C.4)
440
406
 
441
- **触发**:用户表达“把 ui 组件融进 biz-ui / 把 button 提级成业务组件 / promote ui to business / 把 staging 里的差异融合到 business 层 / 多模式融合 / wrapper + preset 叠加 / 双轨 coexist / 把上游版和自家版同时保留”等关键词;或在场景 4e 走完 staging 后用户问“能不能直接生成业务包装组件”。
407
+ **触发**:用户表达“把 ui 组件融进 biz-ui / 把 button 提级成业务组件 / promote ui to business / 把 staging 里的差异融合到 business 层 / 多模式融合 / wrapper + preset 叠加 / 双轨 coexist / 把上游版和自家版同时保留”等关键词;或在场景 4d 走完 staging 后用户问“能不能直接生成业务包装组件”。
442
408
 
443
- > 这是 §4e 的**下游**:4e 只生成 `.upgrade-staging/`,4f 才把条目按 AI 推荐的 `recommendedModes` 真正落地到 `src/components/business/` 并维护 manifest。**条目的 8 模式判定全部由 staging meta 给出**,本 skill 只做分组、确认、转发命令。
409
+ > 这是 §4d 的**下游**:4d 只生成 `.upgrade-staging/`,4e 才把条目按 AI 推荐的 `recommendedModes` 真正落地到 `src/components/business/` 并维护 manifest。**条目的 8 模式判定全部由 staging meta 给出**,本 skill 只做分组、确认、转发命令。
444
410
 
445
411
  **一行命令**:
446
412
 
@@ -483,7 +449,7 @@ npx teamix-evo ui promote-to-biz --staging-dir <path> # 指定 staging 目录
483
449
  4. **逐组调 promote-to-biz** —— 每组一次命令调用,传该组所有 id;先 `--dry-run` 看 FileChange 四桶(new/modified/deleted/backed-up),用户 OK 后去 dry-run 真写。
484
450
  5. **收尾输出未处理 + import skipped 清单** —— 命令结束后复述:
485
451
  - `manualReview: [...]` 让用户人工抉择(看 diff 或拆 family)
486
- - `tokenOnly: [...]` 引导走场景 6 / `tokens audit`
452
+ - `tokenOnly: [...]` 引导走 `tokens audit`
487
453
  - `importRewrite.skipped: [{file, line, reason}]` 列出动态 import / 别名 export / 模板字符串这些 regex 重写不到的位置,让用户人工处理
488
454
  - `failed: [...]`(如果有)逐条说明失败原因
489
455
 
@@ -491,7 +457,7 @@ npx teamix-evo ui promote-to-biz --staging-dir <path> # 指定 staging 目录
491
457
 
492
458
  - **CLI(`ui promote-to-biz`)**:执行备份、写 `business/`、回填 `ui/`、按 spec 重写 `src/**` 静态 import、改 manifest(promoted 资源记入虚拟包 `@teamix-evo/biz-ui-promoted`)。
493
459
  - **AI(本 skill)**:读 meta、分组、展示 diff、征用户同意、转命令;**不**自己写文件、**不**自己改 import。
494
- - **`teamix-evo-upgrade` skill**:管 §4e staging → src 的 1:1 替换;**不**做模式分流,本场景才做。
460
+ - **`teamix-evo-upgrade` skill**:管 §4d staging → src 的 1:1 替换;**不**做模式分流,本场景才做。
495
461
 
496
462
  **不要**:
497
463
 
@@ -512,6 +478,169 @@ npx teamix-evo ui promote-to-biz --staging-dir <path> # 指定 staging 目录
512
478
 
513
479
  `tokens uninstall` 默认保留 `managed` 文件以保护用户编辑;`--keep-files` 完全保留物理文件,只清 manifest。
514
480
 
481
+ ## 场景 6 · 旧工程迁移重建(Old-Project Migration)
482
+
483
+ **触发**:用户在已初始化的 teamix-evo 项目中说"迁移旧项目 / 重建老工程 / 把旧项目搬过来 / 旧项目分析 / 旧系统翻新 / legacy migration / migrate old project / rebuild from existing project / refactor from old codebase / 从旧项目迁移过来 / 用旧项目做参考重建 / 分析旧项目并迁移"。
484
+
485
+ > **前提**:当前目录已有 `.teamix-evo/config.json`(即已走完场景 1/2/3 的初始化)。若当前目录未初始化,先引导用户完成初始化再回到本场景。
486
+
487
+ ### AI 行为协议(三阶段闭环)
488
+
489
+ #### Phase A · 信息收集
490
+
491
+ 1. **询问旧项目路径** — 向用户索取旧项目的**绝对路径**(`<old-path>`)。可选附加:旧项目运行后的可访问 URL(用于后续截图 / 功能比对)。
492
+ 2. **检测 repo-wiki** — 检查 `<old-path>/.qoder/repowiki/` 是否存在且非空:
493
+ - 存在 → 进入步骤 3。
494
+ - 不存在 → 告知用户:"旧项目尚未生成 repo-wiki,请先在旧项目目录使用 Qoder 生成 repo-wiki,完成后告诉我。"等待用户确认后重检。
495
+ 3. **读取 repo-wiki** — 增量读取 `<old-path>/.qoder/repowiki/` 目录内容。优先读中文版(`repowiki/zh/`),其次英文版(`repowiki/en/`)。按文件名语义识别:
496
+ - 项目总览 / 概述
497
+ - 目录结构 / 模块划分
498
+ - 页面 / 路由清单
499
+ - API 端点清单
500
+ - 数据模型 / 类型定义
501
+ - 依赖清单
502
+
503
+ > 不一次性读完全部内容(token 预算有限)。先读概览 + 路由,后续按需深入。
504
+ 4. **补充读取**(若 repo-wiki 不完整)— 直接读旧项目的:
505
+ - `package.json`(依赖 / scripts)
506
+ - 路由配置文件(`src/routes/`、`src/router/`、`pages/` 目录等)
507
+ - 目录结构(`ls src/`)
508
+ 5. **识别旧项目技术栈** — 从依赖和代码判断,记录以下维度:
509
+ - UI 框架(antd / element-ui / arco-design / mui / naive-ui / 自研)
510
+ - 路由方案(react-router / vue-router / next.js / umi)
511
+ - 状态管理(redux / mobx / zustand / pinia / vuex)
512
+ - HTTP 客户端(axios / fetch / umi-request / swr / react-query)
513
+ - 构建工具(webpack / vite / umi / next / create-react-app)
514
+
515
+ #### Phase B · 计划生成
516
+
517
+ 6. **生成迁移计划文件** — 写入 `.teamix-evo/migrate-plan.md`,格式如下:
518
+
519
+ ```markdown
520
+ # Migration Plan
521
+
522
+ ## Progress
523
+ - **Status**: in-progress
524
+ - **Completed**: 0 / <总条目数>
525
+ - **Current phase**: Phase 0 — Global Infrastructure
526
+ - **Last updated**: <ISO 时间戳>
527
+
528
+ ## Metadata
529
+ - **Source**: <旧项目绝对路径>
530
+ - **Target variant**: <当前项目 variant>
531
+ - **Generated**: <ISO 时间戳>
532
+ - **Old stack**: <框架> + <UI 库> + <路由> + <HTTP 客户端> + <状态管理>
533
+ - **Source URL**: <用户提供的运行地址,可选>
534
+
535
+ ## Component Mapping (AI via MCP find_components 动态生成)
536
+
537
+ | Old | New (teamix-evo) | Notes |
538
+ |-----|-------------------|-------|
539
+ | ... | ... | ... |
540
+
541
+ ## Phase 0: Global Infrastructure
542
+
543
+ - [ ] **Routing** — 路由结构搭建
544
+ - [ ] **API client** — HTTP 客户端 + 拦截器
545
+ - [ ] **Auth** — 鉴权流程
546
+ - [ ] **Layout** — 全局壳(导航 / 侧边栏 / 面包屑)
547
+ - [ ] **Global state** — 全局状态管理
548
+ - [ ] **Theme** — 主题对齐(tokens.overrides.css)
549
+
550
+ ## Phase 1: <页面名> (complexity: <simple|medium|complex>)
551
+
552
+ - Route: `<路由路径>`
553
+ - [ ] **<子任务>** — <描述> (<使用组件>)
554
+ - [ ] **API integration** — <接口列表>
555
+
556
+ ## Phase N: ...
557
+ ```
558
+
559
+ **组件映射生成规则**:通过 MCP `find_components` / `list_components` 查询 teamix-evo 注册表,逐个匹配旧项目使用的 UI 组件,动态填写映射表。
560
+
561
+ 7. **展示计划摘要** — 向用户复述:
562
+ - 总页面数
563
+ - 按复杂度分布(简单 / 中等 / 复杂)
564
+ - 建议执行顺序
565
+ - 询问用户是否调整顺序、跳过某些页面、或补充遗漏页面
566
+
567
+ > Phase B → Phase C 之间**必须**有用户的明确确认(go-ahead)。
568
+
569
+ #### Phase C · 执行
570
+
571
+ 8. **读取当前进度** — 读 `.teamix-evo/migrate-plan.md` 顶部 Progress 区块。若 Status 为 `done` → 告知用户迁移已全部完成。否则找到第一个未完成(`[ ]`)的条目。
572
+ 9. **三轨采集(每页开发前必做)** — 进入一个页面的开发前,必须先收集三轨信息:
573
+ a. **Wiki 轨**:读旧项目 repo-wiki 中该页面相关的描述(功能说明、业务规则、数据流)
574
+ b. **源码轨**:读旧项目该页面的全部源文件(页面组件 + 子组件 + 页面内弹窗 Dialog / 抽屉 Drawer / 确认框等)
575
+ c. **截图轨**:通过浏览器访问旧项目运行地址,对该页面进行截图。截图范围须覆盖:
576
+ - 页面默认态(列表 / 表单 / 详情等主视图)
577
+ - 页面内所有弹窗(Dialog / Modal)的打开态
578
+ - 页面内所有抽屉(Drawer / Sheet)的打开态
579
+ - 关键交互状态(空态 / 加载态 / 错误态,若能触发)
580
+
581
+ > 三轨齐备后,向用户确认:"已采集完 <页面名> 的 wiki、源码、截图,开始实现?"用户确认后才动手。若截图不可用(旧项目未运行),告知用户并以 wiki + 源码两轨继续,标注"无截图参考,视觉还原需用户人工校对"。
582
+
583
+ 10. **逐条实现** — 对每个 checklist 条目:
584
+ a. 通过 MCP `find_components` / `get_component_meta` 查询可用组件
585
+ b. 遵循 `teamix-evo-code-<variant>` skill 规范生成代码(reuse-first / file-structure / api-layering)
586
+ c. 遵循 `teamix-evo-design-<variant>` skill 规范处理页面布局,参照截图还原视觉
587
+ d. 完成后更新 `.teamix-evo/migrate-plan.md`:将对应条目标记为 `[x]`,同步更新顶部 Progress(Completed 计数 + Current phase + Last updated)
588
+ e. 向用户汇报进度,格式:`✅ <条目名> 完成(<已完成数>/<总数>)| 当前阶段:<Phase 名>`
589
+ 11. **验证** — 每完成一个页面后:
590
+ - 列出该页面的功能检查点(从旧代码提取的关键交互:CRUD / 筛选 / 分页 / 权限 / 弹窗流程等)
591
+ - 若有截图,建议用户对比新旧页面视觉差异
592
+ - 跑 `pnpm typecheck` 确认零类型错误
593
+
594
+ #### Phase D · 全量 Review
595
+
596
+ 12. **全部页面完成后** — 当 Progress 中 Completed 等于总条目数时:
597
+ - 将 Status 更新为 `review`
598
+ - 向用户提示:"所有页面已迁移完成,建议进行一轮整体 review。是否现在开始?"
599
+ - 用户确认后,逐页面列出 review 检查点:
600
+ - 功能完整性(对照旧项目关键流程)
601
+ - 视觉还原度(对照截图)
602
+ - 路由可达性(所有页面是否串通)
603
+ - 全局一致性(Layout / 导航 / 权限守卫是否统一)
604
+ - review 全部通过后,将 Status 更新为 `done`
605
+ 13. **会话恢复** — 若 AI 进入新会话:
606
+ - 读 `.teamix-evo/migrate-plan.md` 顶部 Progress 区块快速获取整体进度(Status / Completed / Current phase)
607
+ - `in-progress` → 定位第一个 `[ ]` 条目,从断点处继续
608
+ - `review` → 进入 Phase D review 流程
609
+ - `done` → 告知用户迁移已完成
610
+
611
+ ### 身份划分清单
612
+
613
+ - **AI(本 skill — manage)**:询问路径 → 检测 repo-wiki → 生成/管理 `migrate-plan.md` → 进度追踪 → 会话恢复定位。
614
+ - **AI(`teamix-evo-code-<variant>`)**:生成每页实际代码时遵循 reuse-first / file-structure / api-layering 规范。Phase C 执行时自动应用。
615
+ - **AI(`teamix-evo-design-<variant>`)**:页面级布局 / 视觉设计决策。迁移新页面时并行参考。
616
+ - **用户**:提供旧项目路径 / 确认 repo-wiki 已生成 / 审核迁移计划 / 可选提供运行 URL / 确认每页实现结果。
617
+ - **CLI**:无新命令。执行阶段复用 `teamix-evo ui add <id>`(若发现有未安装的 UI 组件需要补装)。
618
+
619
+ ### 边缘情况
620
+
621
+ | 情况 | 处理 |
622
+ | ---- | ---- |
623
+ | repo-wiki 不存在 | 提示用户先在旧项目执行 repo-wiki 生成命令 |
624
+ | repo-wiki 不完整(缺路由/API 等) | 直接读旧项目源码补充(路由配置 / package.json / 目录结构) |
625
+ | 旧项目是 Vue / Angular(非 React) | 正常分析,概念映射无框架壁垒(路由→路由、组件→组件),新项目统一生成 React |
626
+ | 旧项目是 monorepo | 让用户指定具体 package 路径作为 `<old-path>` |
627
+ | 页面极复杂(>500 行、多子路由) | 拆为多个 checklist 子条目,标记 complexity: complex |
628
+ | `.teamix-evo/migrate-plan.md` 已存在 | 询问用户三选一:(a) 恢复进度继续、(b) 重新生成(覆盖)、(c) 查看当前计划 |
629
+ | 新项目已有部分页面 | 跳过已存在的页面,或标记为 verify-only |
630
+ | token 预算不足以完成全部分析 | 停止读取,基于已有信息生成部分计划,标注"后续会话补充" |
631
+
632
+ ### 不要
633
+
634
+ - **不要**在无 repo-wiki 且源码量大时一次性读完全部文件 — 分批按需读取。
635
+ - **不要**跳过 Phase B 直接写代码 — 必须先生成 `migrate-plan.md` 让用户审核确认。
636
+ - **不要**复制旧项目的组件源码到新项目 — 走 reuse-first 查 `@teamix-evo/ui` 注册表匹配。
637
+ - **不要**搬迁旧项目的样式体系(CSS-in-JS / less / sass / antd theme) — 新项目用 design tokens + Tailwind v4。
638
+ - **不要**原样搬入旧 node_modules 依赖 — 仅迁移业务必需的第三方库(如图表库、富文本编辑器)。
639
+ - **不要**在用户未确认计划前开始实现。
640
+ - **不要**试图单次会话完成全部迁移 — 大项目分多次会话,每次完成若干页面后让用户验证。
641
+ - **不要**破坏 `migrate-plan.md` 的 `- [ ]` / `- [x]` 格式 — 后续会话靠它恢复进度。
642
+ - **不要**修改旧项目的任何文件 — 旧项目只读。
643
+
515
644
  ## 配置文件(信息性)
516
645
 
517
646
  | 路径 | 所有者 | 说明 |
@@ -524,14 +653,15 @@ npx teamix-evo ui promote-to-biz --staging-dir <path> # 指定 staging 目录
524
653
 
525
654
  ## 常见错误与恢复路径(P8 — failures must be observable)
526
655
 
527
- | 症状 | 原因 | 恢复路径 |
528
- | -------------------------------------------------- | ------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
529
- | `Unknown tokens variant "..."` | 拼写错误或上游未发布该 variant | `npx teamix-evo tokens list-variants` 列出当前可用 |
530
- | `Target directory already contains a .teamix-evo/` | 误用 `npm create teamix-evo` 进已装目录 | 改走场景 4(更新)或场景 3(增量装) |
531
- | `UI not initialized`(跑 `ui add` 时) | 未先跑 `ui init` | `npx teamix-evo ui init -y` 然后再 `ui add` |
532
- | Vite/Tailwind 跑起来没样式 | `src/index.css` 缺少 tokens / Tailwind 导入 | 检查 `src/index.css` 的 `@import` 顺序 |
533
- | Skills 在 IDE 不触发 | `.qoder/skills/` 或 `.claude/skills/` 漂移 | `npx teamix-evo skills doctor` 然后 `skills sync` |
534
- | 想完全回退 `init` / `update` 这次执行 | partial / 升级后想撤销到执行前状态 | `teamix-evo restore --list` 看可用 snapshot,然后 `teamix-evo restore <ts>`(回滚自身可逆 — ADR 0019 §2) |
656
+ | 症状 | 原因 | 恢复路径 |
657
+ | -------------------------------------------------- | ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
658
+ | `Unknown tokens variant "..."` | 拼写错误或上游未发布该 variant | `npx teamix-evo tokens list-variants` 列出当前可用 |
659
+ | `Target directory already contains a .teamix-evo/` | 误用 `npm create teamix-evo` 进已装目录 | init 每步幂等短路,直接重跑 `teamix-evo init` 即可 |
660
+ | `UI not initialized`(跑 `ui add` 时) | 未先跑 `ui init` | `npx teamix-evo ui init -y` 然后再 `ui add` |
661
+ | Vite/Tailwind 跑起来没样式 | `src/index.css` 缺少 tokens / Tailwind 导入 | 检查 `src/index.css` 的 `@import` 顺序 |
662
+ | Skills 在 IDE 不触发 | `.qoder/skills/` 或 `.claude/skills/` 漂移 | `npx teamix-evo skills doctor` 然后 `skills sync` |
663
+ | 想完全回退 `init` / `switch` 这次执行 | partial / 升级后想撤销到执行前状态 | `teamix-evo restore --list` 看可用 snapshot,然后 `teamix-evo restore <ts>`(回滚自身可逆 — ADR 0019 §2) |
664
+ | `init` 卡在多选 IDE / wizard 环节 | @clack multiselect 交互不熟悉(空格=切换选中,回车=提交) | 命令加 `-y` 跳过全部交互(推荐);或在 multiselect 界面用 `空格` 切换选项、`回车` 提交 |
535
665
 
536
666
  <!-- teamix-evo:managed:end id="core" -->
537
667
 
@@ -2,7 +2,7 @@
2
2
  name: teamix-evo-upgrade
3
3
  description: |
4
4
  Help the user adopt token renames in `.teamix-evo/.upgrade-hints/tokens-<ts>.json` AND component source upgrades in `.teamix-evo/.upgrade-staging/{ui,biz-ui}-<ts>/` after `teamix-evo update` / `teamix-evo tokens update` / `teamix-evo switch` / `teamix-evo ui upgrade` / `teamix-evo biz-ui upgrade`. Read each hint or staging manifest, scan the project for usages or compare current vs incoming source, propose codemod / file-replace diffs, apply only after explicit user approval, then archive processed inputs.
5
- TRIGGER when: user references `.teamix-evo/.upgrade-hints/`、`.teamix-evo/.upgrade-staging/`、`tokens-*.json` hint files、`ui-*` or `biz-ui-*` staging directories、phrases like "处理 token 改名"、"应用 codemod"、"扫一下 legacy token"、"升级 token 引用"、"更新 token 名"、"组件升级"、"ui-staging"、"biz-ui staging"、"apply ui staging"、"apply biz-ui staging"、"应用组件升级"、"apply token rename codemod"、"adopt token rename hints"、"scan for legacy tokens"、"token rename upgrade"、"component source upgrade"、"review ui staging diff"; AI sees output of `teamix-evo update` / `teamix-evo tokens update` / `teamix-evo switch --apply` / `teamix-evo ui upgrade` / `teamix-evo biz-ui upgrade` mentioning `💡 token rename hint:` or `staging at .teamix-evo/.upgrade-staging/...` and the user wants to follow up; user opens any `.teamix-evo/.upgrade-hints/tokens-*.json` or any file under `.teamix-evo/.upgrade-staging/{ui,biz-ui}-*/`.
5
+ TRIGGER when: user references `.teamix-evo/.upgrade-hints/`、`.teamix-evo/.upgrade-staging/`、`tokens-*.json` hint files、`ui-*` or `biz-ui-*` staging directories、phrases like "处理 token 改名"、"应用 codemod"、"扫一下 legacy token"、"升级 token 引用"、"更新 token 名"、"组件升级"、"ui-staging"、"biz-ui staging"、"apply ui staging"、"apply biz-ui staging"、"应用组件升级"、"apply token rename codemod"、"adopt token rename hints"、"scan for legacy tokens"、"token rename upgrade"、"component source upgrade"、"review ui staging diff"、"token 治理"、"tokens diagnose"、"tokens treat"、"治理计划"、".treatment-plan.md"、"baseline 锁定"、"token 反哺"、"清理 token 违规"、"token cleanup"、"lint baseline"、"降违规"、"全部治理"; AI sees output of `teamix-evo update` / `teamix-evo tokens update` / `teamix-evo switch --apply` / `teamix-evo ui upgrade` / `teamix-evo biz-ui upgrade` mentioning `💡 token rename hint:` or `staging at .teamix-evo/.upgrade-staging/...` and the user wants to follow up; AI sees output of `teamix-evo init` showing token-discipline ESLint warnings and the user wants to clean up; user opens any `.teamix-evo/.upgrade-hints/tokens-*.json` or any file under `.teamix-evo/.upgrade-staging/{ui,biz-ui}-*/` or `.teamix-evo/.treatment-plan.md`.
6
6
  SKIP: any other lifecycle work — `init` / `update` orchestration / variant switch itself / install / uninstall / generating staging (defer to teamix-evo-manage); pure visual or design changes (defer to teamix-evo-design-<variant>); any code authoring unrelated to the rename / staging window (defer to teamix-evo-code-<variant>); refuse to auto-apply — never write source code without explicit per-file user confirmation.
7
7
  Coordinates with: teamix-evo-manage (manage drives the upgrade flow that emits hints + staging; this skill consumes the resulting files).
8
8
  ---
@@ -17,7 +17,7 @@ description: |
17
17
  npx teamix-evo skills add teamix-evo-upgrade --scope global
18
18
  ```
19
19
 
20
- `skills init`(项目级自举)与 `npm create teamix-evo` **不会**自动装本 skill —— bulk 模式按 scope 自动跳过([ADR 0033](../../docs/adr/0033-entry-skill-global-only-scope.md))。如果用户在项目级显式 `skills add teamix-evo-upgrade --scope project`,CLI 给出「推荐 global」warning 但仍装入(用户自负责),代价是后续 IDE 会同时识别全局与项目两份副本。
20
+ `skills init`(项目级自举)与 `npm create teamix-evo` **不会**自动装本 skill —— bulk 模式按 scope 自动跳过(ADR 0033)。如果用户在项目级显式 `skills add teamix-evo-upgrade --scope project`,CLI 给出「推荐 global」warning 但仍装入(用户自负责),代价是后续 IDE 会同时识别全局与项目两份副本。
21
21
 
22
22
  与 [`teamix-evo-manage`](../teamix-evo-manage/SKILL.md) 同属 lifecycle 工具,分工:manage 负责 orchestration(init / update / switch / 触发 staging 生成),本 skill 负责 staging / hints 的逐文件 hard-gate apply。
23
23
 
@@ -257,12 +257,14 @@ Parse `meta.json`. Pick the opening message based on `lineage`:
257
257
 
258
258
  Iterate `entries` and bucket by `riskLevel`:
259
259
 
260
- - **`unchanged`** — just announce “以下组件未变,跳过” (list ids on one line).
261
- - **`upgradable-low`** — group all together, **one** confirmation prompt (“这些升级较安全,是否一起应用?”).
260
+ - **`unchanged`** — just announce "以下组件未变,跳过" (list ids on one line).
261
+ - **`upgradable-low`** — ⤵️ HARD GATE:仍然逐个展示 diff + y/n,禁止合并为一次性批量确认。速度优先时可缩短 diff 显示(只展示 hints 摘要),但每个组件必须独立确认。
262
262
  - **`upgradable-medium`** — walk one-by-one with a short hint summary, ask y/n/per-file (see B4).
263
263
  - **`risky`** — force per-component review; spell out every `hints[]` entry verbatim before showing the diff.
264
264
  - **`breaking`** — do **not** offer auto-replace. Tell the user upstream removed the entry, ask if they want to delete the local file or keep it as a custom component (likely a re-naming — cross-check `removedExports`).
265
- - **`foreign`** — list separately (“以下组件不在 manifest 中,可能是你手工添加的”), ask whether to register, delete, or leave alone.
265
+ - **`foreign`** — list separately ("以下组件不在 manifest 中,可能是你手工添加的"), ask whether to register, delete, or leave alone.
266
+
267
+ > **分级原则(B0)**:每个 risk level 必须独立分组展示,不得将不同 risk level 的组件混在同一批次提问。即使用户要求「全部应用」,也必须按 risk level 分组逐个展示。
266
268
 
267
269
  ### B4 · Propose & ask (HARD GATE)
268
270
 
@@ -280,7 +282,9 @@ For each non-unchanged entry the user has agreed to consider, render the diff wi
280
282
 
281
283
  Application = **copy `incoming.tsx` over the file at `current.target`**, atomically. Do not partial-merge — the staging is whole-file.
282
284
 
283
- **Never auto-apply.** If the user is silent, default to no. If the user says “全部接受” / “apply all”, still show every diff (one screen each) before writing.
285
+ **Never auto-apply.** If the user is silent, default to no.
286
+
287
+ ⚠️ HARD GATE:即使用户说 "全部接受" / "apply all",**仍然必须逐文件展示 diff**(每个组件一屏),用户看完后才写入。禁止将多个组件的 diff 合并展示或静默批量应用。
284
288
 
285
289
  If a file's `riskLevel` is `breaking` and the user opts to delete the file, do that explicitly with a confirmed `rm` command — not silently.
286
290
 
@@ -308,3 +312,120 @@ If the user wants to **defer** the entire staging (not per-entry skip), leave it
308
312
  | User says “全部接受” / “apply all” | Still show every diff before applying. Bulk-confirm is fine, **silent apply is not**. |
309
313
  | `lineage=mixed` with `foreign` entries | After upgradable-\* are processed, walk foreign entries one-by-one and ask: register (out of scope here — redirect to `teamix-evo ui add <id>`), delete, or leave. |
310
314
  | User asks to handle an old staging dir that's already in `.processed/` | Read the manifest from `.processed/`, re-render diffs, decide whether to re-apply or remove permanently. |
315
+
316
+ # Part C — Token treatment pipeline
317
+
318
+ After `teamix-evo init` lands tokens + ESLint rules, the project often has pre-existing token violations (hardcoded colors, raw Tailwind scales, etc.). The CLI provides a **diagnose → treat → reflect → baseline-lock** pipeline to systematically clean them up. This skill guides the user through it.
319
+
320
+ > **Coordinates with**: Part A (token rename adoption) handles _rename_ hints from upstream version bumps; Part C handles _project-internal_ violations detected by ESLint rules.
321
+
322
+ ## When to trigger
323
+
324
+ TRIGGER when: user references "token 治理"、"tokens diagnose"、"tokens treat"、"治理计划"、".treatment-plan.md"、"baseline 锁定"、"token 反哺"、"清理 token 违规"、"token cleanup"、"lint baseline"、"降违规"、AI sees output of `teamix-evo init` showing token-discipline ESLint warnings and the user wants to follow up.
325
+
326
+ SKIP: rename hints (Part A), component source upgrades (Part B), design decisions (defer to design skill).
327
+
328
+ ## C1 · Diagnose
329
+
330
+ Run the diagnosis to understand the current violation landscape:
331
+
332
+ ```bash
333
+ npx teamix-evo tokens diagnose
334
+ ```
335
+
336
+ This produces `.teamix-evo/.treatment-plan.md` — a tiered treatment plan classifying violations into:
337
+
338
+ | Phase | Description | Automation |
339
+ | ---------------- | -------------------------------------------------------------- | ---------- |
340
+ | L1-structure | Token file structure issues (via `tokens audit`) | audit |
341
+ | L2-format | Color format normalisation (`hsl()` → CSS v4) | full-auto |
342
+ | L3-semantic-auto | Tailwind scale → semantic tokens | full-auto |
343
+ | L3-semantic-semi | Arbitrary values → tokens (AI-guided) | semi-auto |
344
+ | L3-manual | Requires human judgment (radius, border, dark mode) | manual |
345
+ | reflect | High-frequency color literals → project-level token candidates | analysis |
346
+
347
+ Present the plan overview to the user and ask which phases they want to tackle now.
348
+
349
+ ## C2 · Treat (automated codemods)
350
+
351
+ For full-auto phases (L2 + L3-auto), run the treatment pipeline:
352
+
353
+ ```bash
354
+ # Dry-run first (recommended)
355
+ npx teamix-evo tokens treat
356
+
357
+ # Apply changes
358
+ npx teamix-evo tokens treat --apply
359
+
360
+ # Apply + lock baseline
361
+ npx teamix-evo tokens treat --apply --lock-baseline
362
+ ```
363
+
364
+ The pipeline executes 4 codemods in order:
365
+
366
+ 1. `hsl-to-v4` — HSL function → CSS v4 color syntax
367
+ 2. `hex-to-token` — hardcoded hex → semantic token reference
368
+ 3. `tw-scale-to-semantic` — raw Tailwind color scale → semantic class
369
+ 4. `space-to-gap` — space utility → gap utility
370
+
371
+ After execution, a treatment report is generated at `.teamix-evo/.treatment-reports/<timestamp>.md` showing per-rule before/after deltas.
372
+
373
+ ### Workflow
374
+
375
+ 1. **Always dry-run first** — show the user the match counts and ask for confirmation
376
+ 2. Show the delta table from the report
377
+ 3. If the user approves, re-run with `--apply`
378
+ 4. Ask whether to lock the baseline (`--lock-baseline`)
379
+
380
+ ## C3 · Semi-auto treatment (AI-guided)
381
+
382
+ For `L3-semantic-semi` violations (`no-arbitrary-tw-value`):
383
+
384
+ 1. Read the treatment plan's L3-semi section for the list of violations
385
+ 2. For each violation, read the file context and suggest the closest semantic token
386
+ 3. Present a diff hunk per file (same template as Part A step 4)
387
+ 4. **HARD GATE** — never auto-apply; get per-file confirmation
388
+
389
+ ## C4 · Reflect (token 反哺)
390
+
391
+ After automated treatment, remaining `no-color-literal` violations often reveal project-specific colors not covered by the design system. Suggest the user run reflect analysis:
392
+
393
+ 1. Scan remaining violations and cluster by color value + frequency
394
+ 2. Present a table of candidates (color → suggested token name → occurrence count → files)
395
+ 3. Colors appearing ≥ 3 times are candidates for project-level tokens
396
+ 4. Guide the user to add chosen tokens to `tokens/tokens.overrides.css`
397
+ 5. After adding tokens, re-run `tokens treat` to pick up the new mappings
398
+
399
+ ## C5 · Baseline lock
400
+
401
+ Once the user is satisfied with the treatment level:
402
+
403
+ ```bash
404
+ npx teamix-evo tokens treat --apply --lock-baseline
405
+ ```
406
+
407
+ This writes `.teamix-evo/tokens-baseline.json` — a snapshot of current violation counts. Future `tokens treat` runs will compare against this baseline.
408
+
409
+ **CI integration**: add to `package.json` scripts:
410
+
411
+ ```json
412
+ {
413
+ "scripts": {
414
+ "lint:baseline": "teamix-evo tokens treat --lock-baseline && git diff --exit-code .teamix-evo/tokens-baseline.json"
415
+ }
416
+ }
417
+ ```
418
+
419
+ If violations exceed the locked baseline, CI fails — preventing regression.
420
+
421
+ ## C6 · Edge cases
422
+
423
+ | Situation | Response |
424
+ | ------------------------------------------------- | -------------------------------------------------------------------------- |
425
+ | No ESLint config / teamix-evo rules not installed | Tell the user to run `teamix-evo init` first to set up the lint rules. |
426
+ | No `src/` directory | Ask which directory to scan; default to `packages/*/src` in monorepo. |
427
+ | Codemod not found | Skip gracefully; the pipeline only runs available codemods. |
428
+ | User wants to skip a phase | Respect the choice; only run requested phases. |
429
+ | Baseline already exists | Show current vs baseline comparison before re-locking. |
430
+ | Treatment report shows 0 delta | All violations are either semi-auto or manual; guide user to C3/C4. |
431
+ | User says "全部治理" | Run diagnose → treat --apply → reflect in sequence, but confirm each step. |
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Teamix Evo Contributors
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.