@teamix-evo/skills 0.3.0 → 0.4.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 (66) hide show
  1. package/manifest.json +61 -45
  2. package/package.json +2 -2
  3. package/{skills/teamix-evo-coding-conventions → src/teamix-evo-code-opentrek}/SKILL.md +18 -18
  4. package/{skills/teamix-evo-coding-conventions → src/teamix-evo-code-opentrek}/checklist.md +2 -2
  5. package/{skills/teamix-evo-coding-conventions → src/teamix-evo-code-opentrek}/reuse-first.md +25 -17
  6. package/src/teamix-evo-code-uni-manager/SKILL.md +95 -0
  7. package/src/teamix-evo-code-uni-manager/api-layering.md +370 -0
  8. package/src/teamix-evo-code-uni-manager/checklist.md +193 -0
  9. package/src/teamix-evo-code-uni-manager/error-and-loading.md +389 -0
  10. package/src/teamix-evo-code-uni-manager/file-structure.md +339 -0
  11. package/src/teamix-evo-code-uni-manager/forms-and-validation.md +459 -0
  12. package/src/teamix-evo-code-uni-manager/reuse-first.md +188 -0
  13. package/src/teamix-evo-code-uni-manager/routing-and-codesplit.md +450 -0
  14. package/src/teamix-evo-code-uni-manager/testing.md +396 -0
  15. package/src/teamix-evo-design-opentrek/SKILL.md +71 -0
  16. package/src/teamix-evo-design-opentrek/boundaries.md +513 -0
  17. package/src/teamix-evo-design-opentrek/brand.md +154 -0
  18. package/src/teamix-evo-design-opentrek/checklist.md +83 -0
  19. package/src/teamix-evo-design-opentrek/components.md +245 -0
  20. package/src/teamix-evo-design-opentrek/flows.md +51 -0
  21. package/src/teamix-evo-design-opentrek/foundations.md +271 -0
  22. package/src/teamix-evo-design-opentrek/generation-flow.md +185 -0
  23. package/src/teamix-evo-design-opentrek/patterns/dashboard.md +31 -0
  24. package/src/teamix-evo-design-opentrek/patterns/detail-page.md +202 -0
  25. package/src/teamix-evo-design-opentrek/patterns/form-page.md +289 -0
  26. package/src/teamix-evo-design-opentrek/patterns/list-page.md +334 -0
  27. package/src/teamix-evo-design-opentrek/patterns/page-types.md +154 -0
  28. package/src/teamix-evo-design-opentrek/philosophy.md +96 -0
  29. package/src/teamix-evo-design-opentrek/rules/README.md +39 -0
  30. package/src/teamix-evo-design-opentrek/rules/boundaries.rules.json +391 -0
  31. package/src/teamix-evo-design-uni-manager/SKILL.md +73 -0
  32. package/src/teamix-evo-design-uni-manager/boundaries.md +564 -0
  33. package/src/teamix-evo-design-uni-manager/brand.md +202 -0
  34. package/src/teamix-evo-design-uni-manager/checklist.md +115 -0
  35. package/src/teamix-evo-design-uni-manager/components.md +254 -0
  36. package/src/teamix-evo-design-uni-manager/flows.md +63 -0
  37. package/src/teamix-evo-design-uni-manager/foundations.md +258 -0
  38. package/src/teamix-evo-design-uni-manager/generation-flow.md +194 -0
  39. package/src/teamix-evo-design-uni-manager/patterns/dashboard.md +95 -0
  40. package/src/teamix-evo-design-uni-manager/patterns/detail-page.md +224 -0
  41. package/src/teamix-evo-design-uni-manager/patterns/form-page.md +329 -0
  42. package/src/teamix-evo-design-uni-manager/patterns/list-page.md +356 -0
  43. package/src/teamix-evo-design-uni-manager/patterns/page-types.md +165 -0
  44. package/src/teamix-evo-design-uni-manager/philosophy.md +106 -0
  45. package/src/teamix-evo-design-uni-manager/rules/README.md +49 -0
  46. package/src/teamix-evo-design-uni-manager/rules/boundaries.rules.json +418 -0
  47. package/src/teamix-evo-manage/SKILL.md +281 -0
  48. package/skills/teamix-evo-design-rules/SKILL.md +0 -86
  49. package/skills/teamix-evo-design-rules/boundaries.md +0 -89
  50. package/skills/teamix-evo-design-rules/checklist.md +0 -108
  51. package/skills/teamix-evo-design-rules/generation-flow.md +0 -142
  52. package/skills/teamix-evo-design-rules/prompts/page-design.md +0 -148
  53. package/skills/teamix-evo-design-rules-opentrek/SKILL.md +0 -48
  54. package/skills/teamix-evo-design-rules-opentrek/brand-rules.md +0 -74
  55. package/skills/teamix-evo-design-rules-uni-manager/SKILL.md +0 -51
  56. package/skills/teamix-evo-design-rules-uni-manager/ai-scenarios.md +0 -51
  57. package/skills/teamix-evo-design-rules-uni-manager/command-center.md +0 -108
  58. package/skills/teamix-evo-design-rules-uni-manager/danger-ops.md +0 -87
  59. package/skills/teamix-evo-manage/SKILL.md +0 -178
  60. package/skills/teamix-evo-ui-upgrade/SKILL.md +0 -75
  61. /package/{skills/teamix-evo-coding-conventions → src/teamix-evo-code-opentrek}/api-layering.md +0 -0
  62. /package/{skills/teamix-evo-coding-conventions → src/teamix-evo-code-opentrek}/error-and-loading.md +0 -0
  63. /package/{skills/teamix-evo-coding-conventions → src/teamix-evo-code-opentrek}/file-structure.md +0 -0
  64. /package/{skills/teamix-evo-coding-conventions → src/teamix-evo-code-opentrek}/forms-and-validation.md +0 -0
  65. /package/{skills/teamix-evo-coding-conventions → src/teamix-evo-code-opentrek}/routing-and-codesplit.md +0 -0
  66. /package/{skills/teamix-evo-coding-conventions → src/teamix-evo-code-opentrek}/testing.md +0 -0
@@ -0,0 +1,281 @@
1
+ ---
2
+ name: teamix-evo-manage
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 tokens ...` / `teamix-evo skills ...` / `teamix-evo ui ...` / `teamix-evo biz-ui ...` / `teamix-evo templates ...` / `teamix-evo logs ...`, 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"; (卸载 / 清单) "卸载 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`.
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
+ ---
9
+
10
+ # teamix-evo-manage
11
+
12
+ Single entry skill for the **teamix-evo** toolkit lifecycle. Covers six scenarios:
13
+
14
+ 1. Fuzzy init → ask user to pick a tokens variant.
15
+ 2. Named-variant init → infer variant from business name, run scaffold directly.
16
+ 3. AI coding install on existing repo (no scaffold step).
17
+ 4. Update detection — only refresh what's already installed.
18
+ 5. Uninstall.
19
+ 6. Placeholder → real UI migration loop (post-`npm create teamix-evo`).
20
+
21
+ <!-- teamix-evo:managed:start id="core" -->
22
+
23
+ ## 决策树(动手前必看)
24
+
25
+ ```text
26
+ 用户的指令命中本 skill
27
+ ├── 目录里有 `.teamix-evo/`?
28
+ │ 是 ──▶ 4 (更新) / 5 (卸载) / 6 (placeholder→real,见 `pending-ui.json`)
29
+ │ 否 ──▶ 继续
30
+ ├── 用户说出业务名 / variant?
31
+ │ 是 ──▶ 2 (具名变体初始化) — 用「业务名→variant 映射表」推断
32
+ │ 否 ──▶ 继续
33
+ ├── 目录是空的(或只有 .git / README.md)?
34
+ │ 是 ──▶ 1 (模糊初始化) — 询问 variant 后转 2
35
+ │ 否 ──▶ 3 (AI coding 接入) — 跳过 scaffold,只跑 tokens/skills/ui init
36
+ ```
37
+
38
+ ## 业务名 → variant 映射
39
+
40
+ > 用户表述业务时,按下表锁定 variant,**不再询问**。表外的关键词必须询问。
41
+
42
+ | 用户原话(中/英) | variant |
43
+ | ----------------------------------------------------------------------------- | ------------- |
44
+ | 云管 / 云管控制台 / 云管项目 / 云管工程 / uni-manager / unimanager / 统一管理 | `uni-manager` |
45
+ | op / opentrek / OpenTrek / 探索者 | `opentrek` |
46
+ | _未提及业务,只说"做一个工程"_ | **询问** |
47
+
48
+ 校验:`npx teamix-evo tokens list-variants` 列出当前 `@teamix-evo/tokens` 包内所有变体;若上表中的关键词指向尚未发布的变体,先告知用户该 variant 还未上线。
49
+
50
+ ## CLI 命令面(完整)
51
+
52
+ CLI 二进制名 `teamix-evo`,所有命令都从这里发起。命令名以 `tokens`、`skills`、`ui`、`biz-ui`、`templates`、`logs` 六个 group 组织。
53
+
54
+ ### Tokens(`@teamix-evo/tokens`)
55
+
56
+ | 目标 | 命令 |
57
+ | ------------ | ------------------------------------------------------------------- |
58
+ | 初始化 | `npx teamix-evo tokens init <variant>`(`<variant>` 必填,无默认) |
59
+ | 列出可选变体 | `npx teamix-evo tokens list-variants` |
60
+ | 列出已装资源 | `npx teamix-evo tokens list` |
61
+ | 升级 | `npx teamix-evo tokens update`(stub — 见 [ADR 0019](docs/adr/0019)) |
62
+ | 卸载 | `npx teamix-evo tokens uninstall [-y] [--keep-files]` |
63
+
64
+ - **`<variant>` 必填**。`tokens init` 之前必须先确定 variant(决策树或业务名映射)。
65
+ - `tokens update` 当前是 stub;权宜方案:删除 `.teamix-evo/tokens-lock.json` 与根 `tokens/`,重跑 `tokens init <variant>`。
66
+ - 资源分类(frozen / regenerable / managed)详见 [ADR 0003](docs/adr/0003-update-strategy-tri-state.md):`tokens.overrides.css` 是 `frozen`,用户改写永不被覆盖;`tokens.theme.css` / `tokens/base.tokens.json` 是 `regenerable`,每次 `update` 完整重写。ADR 0020 之后,`tokens init` 不再向工程根落 `AGENTS.md` / `DESIGN.md` 等 `managed` 文件 —— 设计纲领由 `teamix-evo-design-<variant>` skill 自包含。
67
+
68
+ ### Skills(`@teamix-evo/skills`)
69
+
70
+ | 目标 | 命令 |
71
+ | -------- | ---------------------------------------- |
72
+ | 全量装 | `npx teamix-evo skills add` |
73
+ | 增量装 | `npx teamix-evo skills add <name...>` |
74
+ | 列出全部 | `npx teamix-evo skills list`(alias `ls`) |
75
+ | 列出已装 | `npx teamix-evo skills list --installed` |
76
+ | 升级 | `npx teamix-evo skills update` |
77
+ | 卸载 | `npx teamix-evo skills uninstall [-y]` |
78
+ | 漂移检测 | `npx teamix-evo skills doctor` |
79
+ | 重新镜像 | `npx teamix-evo skills sync [name...]` |
80
+
81
+ `skills add` 模式:
82
+
83
+ - **Bulk**(无位置参数):装 manifest 中所有 skill;已装的项目返回 `already-added`。
84
+ - **Incremental**(指定 id):只装列出的 skill;已装的跳过(用 `update` 刷新)。
85
+
86
+ 首次交互式(无既有配置且无 flag 时):
87
+
88
+ 1. 多选 IDE:**Qoder** / **Claude Code**(默认两者,至少一个)。等价 `--ide qoder,claude`。
89
+ 2. Scope:**project**(默认,`.qoder/.claude` 在 cwd)/ **global**(`~/.qoder/~/.claude`)。等价 `--scope project|global`。
90
+
91
+ 源镜像模型([ADR 0013](docs/adr/0013)):规范副本在 `.teamix-evo/skills/`,IDE 镜像在 `.qoder/skills/` 与 `.claude/skills/`。`doctor` 检测漂移,`sync` 重镜像(不升版本)。
92
+
93
+ ### UI 组件(`@teamix-evo/ui`)
94
+
95
+ | 目标 | 命令 |
96
+ | ---------- | -------------------------------------- |
97
+ | 初始化 | `npx teamix-evo ui init [-y]` |
98
+ | 增加 entry | `npx teamix-evo ui add <id...>` |
99
+ | 列出 entry | `npx teamix-evo ui list [--installed]` |
100
+
101
+ - `ui init` 写 `.teamix-evo/config.json` 的 `packages.ui`(aliases / iconLibrary / tsx / rsc)。可交互元素的 `cursor: pointer` 由组件源码内显式声明,不再有全局 `preferences.css` —— 见 [ADR 0023](docs/adr/0023-cursor-pointer-explicit-in-component-source.md)
102
+ - `ui add` 自动解析 `registryDependencies`,组件源码写入 `src/components/ui/<id>.tsx`(frozen),并报告还需 `pnpm add` 的 npm 包。
103
+ - 没有 `ui upgrade` 子命令 — placeholder→real 迁移由本 skill 的「场景 6」直接驱动,内部调 `ui add`。
104
+
105
+ ### 业务组件(`@teamix-evo/biz-ui`)
106
+
107
+ | 目标 | 命令 |
108
+ | ---------- | ---------------------------------------------------- |
109
+ | 列出变体 | `npx teamix-evo biz-ui list-variants` |
110
+ | 增加 entry | `npx teamix-evo biz-ui add <id...> --variant <name>` |
111
+
112
+ - `--variant <name>` 必填(没有 auto-detect)。
113
+ - [ADR 0014](docs/adr/0014-ui-biz-ui-templates-tier.md):`tokens` / `biz-ui` / `templates` 共享 variant 名空间,与 `tokens init` 选定的 variant 一致。
114
+
115
+ ### 页面模板(`@teamix-evo/templates`)
116
+
117
+ > ⚠️ **AI 默认不主动调用本 group**(见 [ADR 0031](docs/adr/0031-skill-templates-decoupling.md))。页面骨架由 `teamix-evo-design-<variant>` skill 的 `patterns/*.md` 驱动 ui + biz-ui 拼装;仅在用户**显式**说"用 templates 包装 frozen 骨架"时,才跳转本 group 命令。
118
+
119
+ | 目标 | 命令 |
120
+ | ---------- | ------------------------------------------------------- |
121
+ | 列出变体 | `npx teamix-evo templates list-variants` |
122
+ | 增加 entry | `npx teamix-evo templates add <id...> --variant <name>` |
123
+
124
+ 同 `biz-ui` 的变体规则。模板源码写入 `src/templates/<id>.tsx`(frozen)。
125
+
126
+ ### 日志(`@teamix-evo/logs`)
127
+
128
+ | 目标 | 命令 |
129
+ | ---------- | ----------------------------------- |
130
+ | 分析调用链 | `npx teamix-evo logs analyze [...]` |
131
+
132
+ - 读 vibe-logger 输出 `.log/ai/**/*.jsonl`,做 AI 调用链可视化。诊断 `runTokensInit` / `runUiAdd` 等编排流程时用。
133
+
134
+ ## 场景 1 · 模糊初始化
135
+
136
+ **触发**:用户说"初始化一个项目 / 工程",未指明 variant。
137
+
138
+ **步骤**:
139
+
140
+ 1. 确认目录(默认 `./<project-name>`,可由用户改)。
141
+ 2. 列出 variants(`tokens list-variants` 的输出),让用户选(`AskUserQuestion`):
142
+ - OpenTrek(opentrek):AI 副驾驶 / 通用中后台
143
+ - Uni-Manager(uni-manager):云资源管理(大屏 / 拓扑 / 7 类 AI 场景)
144
+ 3. 转场景 2,带上选定 variant 直跑。
145
+
146
+ ## 场景 2 · 具名变体初始化(空目录 → 完整工程)
147
+
148
+ **触发**:用户在「业务名 → variant 映射」中能锁定 variant,或场景 1 询问后得到答复。
149
+
150
+ **唯一命令**:
151
+
152
+ ```bash
153
+ npm create teamix-evo@latest <dir> --variant <name>
154
+ # 或 pnpm create teamix-evo <dir> --variant <name>
155
+ ```
156
+
157
+ `create-teamix-evo` 的 `console` preset(默认且当前唯一)会自动一站式落地:
158
+
159
+ | 阶段 | 产物 |
160
+ | ---- | ---------------------------------------------------------------------------------------- |
161
+ | 1 | Vite + React + TS scaffold(`src/`、`vite.config.ts` 等) |
162
+ | 2 | `tokens init <variant>` → 根 `tokens/` 目录(`tokens.theme.css` / `tokens.overrides.css`) |
163
+ | 3 | `skills add` → `.qoder/skills/` + `.claude/skills/`(出厂 3 skill) |
164
+ | 4 | `ui init` → `.teamix-evo/config.json` |
165
+ | 5 | `ui add button` → 真组件源码;Card / Input / Form / Table 以 `_placeholder/` 占位 |
166
+ | 6 | `.teamix-evo/create/pending-ui.json` → 4 个 placeholder 待迁移 |
167
+
168
+ **完成后告知用户**:
169
+
170
+ ```bash
171
+ cd <dir>
172
+ pnpm dev # 立刻可跑
173
+ pnpm typecheck # 验证零类型错误
174
+ ```
175
+
176
+ 并提示:「placeholder 占位组件想换真组件?对我说"升级 UI"/"替换 placeholder",我会进入场景 6 逐个迁移。」
177
+
178
+ ## 场景 3 · AI coding 接入(现有仓库)
179
+
180
+ **触发**:用户已有 React/TS/Vite 仓库(已 `npm install` / 有 `package.json`),只想装 AI coding 体系。
181
+
182
+ **关键判断**:
183
+
184
+ - 跳过 scaffold(用户已有 `package.json`、`vite.config.ts`、`src/`)。
185
+ - `npm create teamix-evo` 会拒绝非空目录(除非 `--force` 且不含 `.teamix-evo/`),所以这里改用单包 CLI。
186
+
187
+ **步骤**:
188
+
189
+ ```bash
190
+ # 1. 确定 variant(若用户未说,按映射表 / 询问)
191
+ npx teamix-evo tokens list-variants
192
+ npx teamix-evo tokens init <variant> # 装 tokens(写 tokens/ 与 .teamix-evo/tokens-lock.json)
193
+
194
+ # 2. 装 skills(同源 Qoder + Claude)
195
+ npx teamix-evo skills add # 默认两个 IDE 镜像,project scope
196
+
197
+ # 3. 装 ui 配置
198
+ npx teamix-evo ui init -y
199
+ npx teamix-evo ui add button # 可选:先装一个真组件验证
200
+ ```
201
+
202
+ **结束时告诉用户**:
203
+
204
+ - 已装的 skill 列表(从 `skills list --installed`)、tokens variant、ui aliases。
205
+ - 接下来怎么用:写新页面就触发 `teamix-evo-design-opentrek` / `teamix-evo-code-opentrek`。
206
+
207
+ ## 场景 4 · 更新检测
208
+
209
+ **触发**:用户说"升级 / 看看哪些要升级 / update teamix-evo"。
210
+
211
+ **步骤**:
212
+
213
+ 1. 读 `.teamix-evo/config.json` 的 `packages` 字段,看哪些已装(tokens / skills / ui / biz-ui / templates)。
214
+ 2. 对每个已装包,跑对应 `list --installed`(若有该子命令)与上游 manifest 比对版本。
215
+ 3. 仅对**已装**的包做 update:
216
+ - `npx teamix-evo tokens update`(stub — 仍提示用户清 + 重装)
217
+ - `npx teamix-evo skills update`
218
+ - 没有 `ui update`(组件升级走场景 6 的语义合并 + AI 协作)
219
+ 4. 检测 `.teamix-evo/create/pending-ui.json` 是否存在;存在则提示「还有 placeholder 未迁移,要现在进入场景 6 吗?」
220
+
221
+ **不要**给未安装的包做 install — 那是场景 2/3 的事。
222
+
223
+ ## 场景 5 · 卸载
224
+
225
+ **触发**:用户说"卸载 teamix-evo / remove the design system"。
226
+
227
+ | 范围 | 命令 |
228
+ | --------------------------------------------- | ----------------------------------------------------- |
229
+ | Tokens | `npx teamix-evo tokens uninstall [-y] [--keep-files]` |
230
+ | Skills | `npx teamix-evo skills uninstall [-y]` |
231
+ | (UI 不提供卸载,组件源码用户拥有 → 用户手动删) | |
232
+
233
+ `tokens uninstall` 默认保留 `managed` 文件以保护用户编辑;`--keep-files` 完全保留物理文件,只清 manifest。
234
+
235
+ ## 场景 6 · placeholder → real UI 升级循环
236
+
237
+ **触发**:`pending-ui.json` 存在 / 用户说"升级 UI / 替换 placeholder / upgrade UI / replace placeholders" / 用户编辑 `src/components/_placeholder/**` / grep `@teamix-evo:placeholder` 命中。
238
+
239
+ **5 步循环**(对 `pendingComponents` 每个条目重复):
240
+
241
+ 1. **读** `.teamix-evo/create/pending-ui.json` 拿 `pendingComponents` 列表(每条含 `id` 如 `card` / `input` / `form` / `table` 与当前 placeholder 路径)。
242
+ 2. **装真组件**:`npx teamix-evo ui add <id>` → `src/components/ui/<id>.tsx`。**[ADR 0006](docs/adr/0006-ui-upgrade-no-baseline.md)**:无 baseline diff,真组件直接覆盖。
243
+ 3. **迁移引用点**:把 `@/components/_placeholder/<Name>` 替换为 `@/components/ui/<id>`。**真组件的 prop API 可能与 placeholder 不同**(prop 名 / 必填项 / slot 形态),逐个 call site 改对。**不要**靠 `as any` 压住类型错误 — prop 差异是有意的。
244
+ 4. **删 placeholder 文件** — 全部 import 迁完后删源文件;再 grep 一次旧路径,确认零命中。
245
+ 5. **更新** `pending-ui.json`:移除已迁移的条目;`pendingComponents` 空了就删整文件。
246
+
247
+ 循环完后:再 grep `@teamix-evo:placeholder` 字面 tag,任何残留都是漏网的占位,要再迁移或删除。
248
+
249
+ **告警**:
250
+
251
+ - placeholder 顶部的 `@teamix-evo:placeholder` 是字面 canary,不能留进生产代码。
252
+ - Form / Table / DataTable 真组件可能需要 Provider(`FormProvider`、`useReactTable` 等)— 在消费侧补 wiring,**不要**把 wiring 包回 `_placeholder/`。
253
+ - 每迁完一个组件,跑一次 `pnpm typecheck`,有错先修干净再迁下一个。
254
+
255
+ ## 配置文件(信息性)
256
+
257
+ | 路径 | 所有者 | 说明 |
258
+ | ------------------------------------ | ---------- | --------------------------------------- |
259
+ | `.teamix-evo/config.json` | CLI | 已装包清单、版本、IDE / scope |
260
+ | `.teamix-evo/manifest.json` | CLI | 已装资源 ledger;diff / uninstall 的依据 |
261
+ | `.teamix-evo/create/pending-ui.json` | create CLI | 场景 6 的迁移清单;迁完即删 |
262
+ | `tokens/tokens.overrides.css` | 用户 | 业务自定义 token 覆盖(`frozen`) |
263
+
264
+ **不要**手编 `config.json` / `manifest.json`,用对应 CLI 子命令。
265
+
266
+ ## 常见错误与恢复路径(P8 — failures must be observable)
267
+
268
+ | 症状 | 原因 | 恢复路径 |
269
+ | -------------------------------------------------- | ------------------------------------------- | ---------------------------------------------------------- |
270
+ | `Unknown tokens variant "..."` | 拼写错误或上游未发布该 variant | `npx teamix-evo tokens list-variants` 列出当前可用 |
271
+ | `Target directory already contains a .teamix-evo/` | 误用 `npm create teamix-evo` 进已装目录 | 改走场景 4(更新)或场景 3(增量装) |
272
+ | `UI not initialized`(跑 `ui add` 时) | 未先跑 `ui init` | `npx teamix-evo ui init -y` 然后再 `ui add` |
273
+ | Vite/Tailwind 跑起来没样式 | `src/index.css` 缺少 tokens / Tailwind 导入 | 检查 `src/index.css` 的 `@import` 顺序 |
274
+ | `pending-ui.json` 已删但仍有 `_placeholder/` 文件 | 场景 6 中漏迁某个 import | grep `@teamix-evo:placeholder` 与 `_placeholder/` 双管验证 |
275
+ | Skills 在 IDE 不触发 | `.qoder/skills/` 或 `.claude/skills/` 漂移 | `npx teamix-evo skills doctor` 然后 `skills sync` |
276
+
277
+ <!-- teamix-evo:managed:end id="core" -->
278
+
279
+ ## Notes for the user
280
+
281
+ > 这部分内容由你自由编辑。CLI 升级时只会替换 `id="core"` 区段,不会动这里的笔记。
@@ -1,86 +0,0 @@
1
- ---
2
- name: teamix-evo-design-rules
3
- description: |
4
- Apply teamix-evo design system rules when AI is asked to generate or review a full UI screen / page (variant-neutral baseline).
5
- TRIGGER when: user asks to "新建 / 优化 / 重构 一个页面"、"做一个列表页 / 详情页 / 表单页 / 仪表盘"、"create / review / refactor a page、screen、dashboard、template"; intent involves layout structure, page-level information density, or multi-component composition; file write under `src/pages/**` or `src/templates/**`.
6
- SKIP: single-component edits like "加个按钮"、"改 input 的 label"、"调 card 的 padding"、"add a tooltip" — those go to teamix-evo-coding-conventions; pure tokens / theme override edits — those go to ESLint and `tokens.overrides.css`; pure code refactor with no visual change; teamix-evo lifecycle commands — those go to teamix-evo-manage.
7
- Coordinates with: teamix-evo-design-rules-<variant> (always layered when same-named variant is installed in `.teamix-evo/design/pack.lock.json`); teamix-evo-coding-conventions (run alongside when the screen also creates new files).
8
- ---
9
-
10
- # teamix-evo-design-rules
11
-
12
- This skill is the **AI dispatcher** for teamix-evo page-level UI work. It does **not** restate design rules; it routes the AI to the canonical content under `.teamix-evo/design/**` and to the skill's own behavioral helpers.
13
-
14
- <!-- teamix-evo:managed:start id="core" -->
15
-
16
- ## How this skill is meant to be used
17
-
18
- 1. **Read the intent** the user gave you. Extract: (a) what page type — list / form / detail / dashboard / empty / review-pass — and (b) what domain entity (order / user / tenant / …).
19
- 2. **Fetch canonical content via MCP** (preferred path — see "Content access" below). Do not write code based on training-data assumptions about how a "list page" should look — read the project's actual rules first.
20
- 3. **Layer the variant overlay** if `.teamix-evo/design/pack.lock.json` shows a `variant` and a `teamix-evo-design-rules-<variant>` skill is also installed. The overlay's TRIGGER fires automatically when the baseline triggers; read it after the canonical patterns file but before generating.
21
- 4. **Run the 6-step generation flow** in [`generation-flow.md`](generation-flow.md). It's the behavioral procedure (intent → shell → IA → components → tokens → checklist).
22
- 5. **Apply the boundaries** in [`boundaries.md`](boundaries.md) — hard NOs (no inline color, no off-system icons, no arbitrary radius).
23
- 6. **Self-check** against [`checklist.md`](checklist.md) before declaring done. Cite each item explicitly: pass / fail / N/A.
24
-
25
- ## Content access — MCP first, file paths as fallback
26
-
27
- The canonical design content lives in `.teamix-evo/design/**` in the consumer project. There are two equivalent ways to read it. **Prefer MCP tool calls** when available — they return focused slices and work in IDEs that don't expose the project filesystem to AI.
28
-
29
- | What you need | MCP call (preferred) | File path (fallback) |
30
- | --- | --- | --- |
31
- | Principles + one-line definitions | `design_list_principles` | `.teamix-evo/design/philosophy/principles.md` |
32
- | Tokens (semantic / base / theme.css) | `design_get_tokens` | `.teamix-evo/tokens/*` |
33
- | Discover available patterns | `design_list_patterns` | `ls .teamix-evo/design/patterns/` |
34
- | Read one pattern in full | `design_get_pattern { id: "<stem>" }` | `.teamix-evo/design/patterns/<stem>.md` |
35
- | Brand tone / voice / examples | `design_get_brand` | `.teamix-evo/design/brand/{tone,voice,examples}.md` |
36
-
37
- If the IDE has no MCP transport (or the `design` group is not loaded), fall back to file-path reads against the same directory tree. The content is identical — only the access path differs.
38
-
39
- ## Dispatch table — page type → canonical content
40
-
41
- For each page-type intent, fetch **primary** content first, then **secondary** when the task touches that aspect (e.g. a list page with empty state needs `empty` as well).
42
-
43
- | Page type | Trigger keywords | Primary (read first) | Secondary |
44
- | --- | --- | --- | --- |
45
- | **list** | "列表页"、"管理"、"查询"、"批量"、"list page"、"index page"、"CRUD list" | `design_get_pattern { id: "page-types" }` § ListPage | `design_get_pattern { id: "journeys" }`, `design_get_pattern { id: "flows" }` |
46
- | **form** | "新建"、"创建"、"编辑"、"表单页"、"form"、"create page"、"edit page"、"wizard" | `design_get_pattern { id: "page-types" }` § FormPage | `design_get_tokens` (typography + spacing) |
47
- | **detail** | "详情页"、"信息页"、"概览"、"detail page"、"resource page"、"profile" | `design_get_pattern { id: "page-types" }` § DetailPage | `design_get_pattern { id: "journeys" }` |
48
- | **dashboard** | "仪表盘"、"概览大盘"、"监控"、"分析"、"dashboard"、"overview" | `design_get_pattern { id: "page-types" }` § Dashboard | `design_get_tokens` (effects, motion) |
49
- | **empty** | "空态"、"空状态"、"无数据"、"无结果"、"empty state"、"zero state" | `design_get_pattern { id: "page-types" }` § 设计要点 (空状态行) | `design_get_brand` (voice + examples — 空态文案口吻) |
50
- | **review-pass** | "审查页面"、"对照规范"、"review this screen"、"check against design rules" | [`checklist.md`](checklist.md) (skill-internal) | [`boundaries.md`](boundaries.md), then walk the relevant page-type row above |
51
-
52
- If the intent matches multiple rows (e.g. "build a list page with empty state"), fetch **all matched primaries** before generating.
53
-
54
- If the intent matches no row, default to `list` (CRUD pages dominate B-end work); if even that feels wrong, ask the user instead of guessing.
55
-
56
- **Discovery first when uncertain**: if you don't know whether a pattern exists for a niche page type, call `design_list_patterns` first to see the full index — it includes variant-specific patterns (e.g. `cloud-page-types`) that may match better than the baseline.
57
-
58
- ## Variant overlay rule
59
-
60
- If `.teamix-evo/design/pack.lock.json` records a non-default `variant` (e.g. `opentrek`, `uni-manager`), the matching `teamix-evo-design-rules-<variant>` skill auto-triggers alongside this one. Its content **overlays** (overrides on conflict) what's in the dispatch table. Always read the overlay AFTER the baseline canonical content, never instead of it.
61
-
62
- Variant skills typically point at variant-specific patterns surfaced via `design_list_patterns` with `variantSpecific: true` (e.g. `cloud-page-types`, `cloud-resource-management`). When both a baseline and a variant pattern exist for the same intent, **prefer the variant pattern**. Trust the variant skill's own dispatch.
63
-
64
- ## Behavioral helpers (skill-internal — keep reading these here)
65
-
66
- | File | Purpose |
67
- | --- | --- |
68
- | [`generation-flow.md`](generation-flow.md) | 6-step decision tree (intent → shell → IA → components → tokens → checklist). Behavioral procedure for AI, not design rules. |
69
- | [`boundaries.md`](boundaries.md) | Hard NO list (refuse / refactor when violated). |
70
- | [`checklist.md`](checklist.md) | 10-section self-review before declaring "done". |
71
- | [`prompts/page-design.md`](prompts/page-design.md) | Drop-in prompt template the IDE can prefill the user's intent into. |
72
-
73
- ## Coordination with other skills
74
-
75
- - [`teamix-evo-coding-conventions`](../teamix-evo-coding-conventions/SKILL.md) — file placement / reuse-first / API layering. Run alongside this skill when the page generation also writes new files; this skill never overrides coding conventions on file placement.
76
- - `teamix-evo-design-rules-opentrek` — OpenTrek brand-specific overlay (tone / voice / brand color usage).
77
- - `teamix-evo-design-rules-uni-manager` — Cloud-management overlay (AI scenarios A–G, danger ops, command center, topology).
78
- - [`teamix-evo-manage`](../teamix-evo-manage/SKILL.md) — lifecycle (`init` / `update` / `uninstall`). Out of scope here.
79
-
80
- <!-- teamix-evo:managed:end id="core" -->
81
-
82
- ## Project notes
83
-
84
- > Free-form notes the user can add — CLI update will not overwrite below this section.
85
-
86
- (empty)
@@ -1,89 +0,0 @@
1
- # AI 设计发散边界
2
-
3
- > teamix-evo 是一个**沉稳克制**的设计语言基线。AI 创造性发散的空间是有限的,但在限定边界内仍有充分自由。
4
- > 本文件是变体中立基线 — 变体专属边界(如 OpenTrek 品牌色用法 / uni-manager 大屏特殊许可)见对应 `teamix-evo-design-rules-<variant>` skill。
5
-
6
- ---
7
-
8
- ## 1. 可以自由发散的方面
9
-
10
- | 方面 | 自由度说明 |
11
- |------|----------|
12
- | **布局方式** | 网格 / 弹性 / 非对称布局,在 Zone Map 约束内自由 |
13
- | **组件组合** | 不受限于已有页面模板,可创造新组合 |
14
- | **数据可视化** | 选择最适合数据特征的图表类型 |
15
- | **信息架构** | Tab / Accordion / 平铺等组织方式自由选择 |
16
- | **空状态创意** | 空状态和引导态的视觉表达可发挥 |
17
- | **微交互细节** | 在动效系统范围内添加合理反馈 |
18
- | **图标选择** | 在统一图标库(Lucide / Radix Icons)内自由选 |
19
- | **文案润色** | 在变体的 `brand/voice.md`(若有)语气规范内优化措辞 |
20
-
21
- ---
22
-
23
- ## 2. 必须遵守的硬约束
24
-
25
- | 约束 | 说明 |
26
- |------|------|
27
- | **色彩** | 必须在定义的 Palette 范围内(base + chart + sidebar),不得引入新色 |
28
- | **字号** | 必须在定义的 10 档字号表内(text-xs ~ text-6xl) |
29
- | **字重** | 仅 normal/medium/semibold/bold 四档 |
30
- | **圆角** | 必须使用 sm/md/lg/xl/full 五档 |
31
- | **间距** | 必须基于 4px 网格 |
32
- | **组件 API** | 必须与 shadcn/ui 对齐,不得 fork 源码 |
33
- | **动效时长** | 必须在 150 / 200 / 300 / 500ms 四档内 |
34
- | **z-index** | 必须使用 base/dropdown/sticky/overlay/modal/toast/tooltip 七档 |
35
- | **危险确认** | 删除 / 释放等破坏性操作 **必须** 二次确认 |
36
- | **无障碍** | 对比度 ≥ 4.5:1,最小点击区域 44×44,键盘可达 |
37
-
38
- ---
39
-
40
- ## 3. 场景特殊许可(变体扩展)
41
-
42
- 特殊许可由具体变体定义,不在中性基线内。常见入口:
43
-
44
- - **大屏 / Cockpit / 营销 / AI 卡片**:见所装变体的 `foundations/effects-*.md`
45
- - **AI 副驾驶专属动效**:见所装变体的 `foundations/motion-*.md`
46
- - **品牌色 / 装饰元素**:见所装变体的 `brand/`
47
-
48
- 变体特殊许可仅在该场景的页面壳层内生效,**不传播到全局**。
49
-
50
- ---
51
-
52
- ## 4. 灰色地带(需要 AI 判断)
53
-
54
- | 维度 | 判断依据 |
55
- |------|---------|
56
- | **信息密度** | 用户角色:管理员 / 高强度操作用户 → 高;轻度业务用户 → 中 |
57
- | **动效复杂度** | 动效分级 L1/L2/L3,按场景重要性选择 |
58
- | **视觉层次数** | 简单页面 2–3 级,复杂页面最多 4 级 |
59
- | **组件尺寸** | 内容量 + 屏幕空间,移动端优先 default size |
60
- | **使用 Sheet 还是 Dialog** | 复杂表单 → Sheet;简单确认 → Dialog |
61
- | **使用主色还是次要色** | 同屏不超过 3 个 primary 焦点 |
62
-
63
- ---
64
-
65
- ## 5. 决策原则(不确定时)
66
-
67
- 按优先级降序:
68
-
69
- 1. **Safety > Predictability > Clarity > Efficiency**
70
- 2. **保守 > 激进** —— 宁可简洁,不要过度设计
71
- 3. **一致 > 新颖** —— 与已有页面保持统一
72
- 4. **复用 > 创造** —— 优先用已有组件
73
- 5. **数据驱动 > 主观判断** —— 不确定时用最常见的模式
74
-
75
- ---
76
-
77
- ## 6. 红线清单(绝对禁止)
78
-
79
- 无论场景如何,以下行为**永远禁止**:
80
-
81
- - 硬编码颜色 / 间距 / 字号
82
- - 装饰性动效(弹跳、彩带、爆炸特效)
83
- - 拟人化 AI 文案("我"、"哈"、"嘿,亲~")
84
- - 用 emoji 替代图标(除非用户明确要求)
85
- - 危险操作无二次确认
86
- - 状态仅靠颜色(无图标 + 文字)
87
- - Fork shadcn/ui 组件源码以实现样式差异
88
- - 在普通业务页面使用渐变背景(变体大屏 / 营销许可除外)
89
- - 使用 `outline-none` 后未提供替代 focus 样式
@@ -1,108 +0,0 @@
1
- # AI 设计检查清单
2
-
3
- > AI 生成 UI 代码后,**必须**逐项核对以下清单。任何一项未通过都不应交付。
4
- > 本文件是变体中立基线 — 变体专属检查项(如品牌色用法 / AI 场景验收 / 大屏只读)见对应 `teamix-evo-design-rules-<variant>` skill。
5
-
6
- ---
7
-
8
- ## 1. 色彩
9
-
10
- - [ ] 所有颜色使用设计 Token(CSS 变量 / Tailwind Token 类名)
11
- - [ ] **未硬编码** 任何颜色值(如 `#333`、`rgb(...)` 、`#fff`)
12
- - [ ] 主色使用不超过 **3 个焦点点位**
13
- - [ ] 语义色正确绑定业务含义(`destructive` 仅用于危险,不滥用红色)
14
- - [ ] 文字对比度 ≥ 4.5:1(WCAG AA)
15
- - [ ] 页面色彩种类不超过 **5 种**
16
- - [ ] 暗色模式适配通过 CSS 变量自动切换,不硬编码 `dark:` 颜色
17
-
18
- ## 2. 排版
19
-
20
- - [ ] 页面只有 **1 个 H1**(`text-3xl font-bold`)
21
- - [ ] 字重变化不超过 **3 种**(normal / medium / semibold / bold 中选 3)
22
- - [ ] 字号变化不超过 **4 档**
23
- - [ ] 中文正文字号 ≥ **14px**(`text-sm`),表格密集场景 ≥ 12px
24
- - [ ] 正文行宽 **60–80 字符**(超过限宽 `max-w-prose`)
25
- - [ ] 数字 / ID / Hash 使用 `font-mono` 或 `tabular-nums`
26
- - [ ] 行高满足要求(正文 ≥ 1.5)
27
-
28
- ## 3. 圆角
29
-
30
- - [ ] 同层级元素圆角一致
31
- - [ ] 嵌套元素圆角递减(内层 ≤ 外层)
32
- - [ ] 圆角使用 `rounded-sm/md/lg/xl/full` 五档之一
33
- - [ ] **禁用** `rounded-3xl` 及以上"超大圆角"
34
- - [ ] 同组件实例圆角一致(不可一个 `lg` 一个 `md`)
35
-
36
- ## 4. 间距
37
-
38
- - [ ] 所有间距值为 **4px 倍数**(来自 Tailwind spacing 刻度)
39
- - [ ] 未使用 5px / 7px / 15px 等非网格值
40
- - [ ] 同层级元素间距一致
41
- - [ ] 嵌套递减(卡片 24px → 内 Section 16px → Field 8px)
42
- - [ ] 卡片内边距 = **24px** (`p-6`)
43
- - [ ] Dialog 内边距 = **24px** (`p-6`)
44
- - [ ] 表单字段间距 = **16px** (`space-y-4`)
45
-
46
- ## 5. 阴影
47
-
48
- - [ ] 阴影等级与 z-index 层级对应(不可"低层级用大阴影")
49
- - [ ] hover 升一级阴影,**不可跳级**(sm → md ✓ / sm → lg ✗)
50
- - [ ] 暗色模式阴影透明度 ≥ 0.3 或改用边框
51
- - [ ] 阴影方向统一为正下方偏移
52
- - [ ] 不使用 `inset shadow` 模拟边框
53
-
54
- ## 6. 动效
55
-
56
- - [ ] 每个动效都有明确目的(引导 / 反馈 / 空间关系)
57
- - [ ] 时长在 **150 / 200 / 300 / 500ms** 四档内
58
- - [ ] 仅动画 `transform` 和 `opacity`
59
- - [ ] **未动画** `width` / `height` / `margin`
60
- - [ ] 支持 `prefers-reduced-motion`(媒体查询降级)
61
- - [ ] hover 反馈 ≤ 200ms
62
-
63
- ## 7. 一致性
64
-
65
- - [ ] 组件样式与 shadcn/ui 标准一致(未私自 fork 源码)
66
- - [ ] 页面壳层符合 Zone Map 命名约定
67
- - [ ] 交互模式符合 Web 平台标准(不发明新交互)
68
- - [ ] 文案术语统一(参照所装变体的 `business/domain.md`,若有)
69
- - [ ] 危险操作的二次确认 UI 一致(AlertDialog destructive variant)
70
- - [ ] 同类操作出现在同样的位置(Zone 约束)
71
-
72
- ## 8. 安全
73
-
74
- - [ ] 删除 / 释放 / 强制重启 → AlertDialog 二次确认
75
- - [ ] 危险操作的 AlertDialog 列出**资源标识 + 影响范围**
76
- - [ ] 高危操作(永久删除资源 / 不可恢复操作)需输入资源名校验
77
- - [ ] 无权限操作隐藏或禁用(不"看得见点不动")
78
- - [ ] 软删除优于硬删除(可恢复路径)
79
-
80
- ## 9. 可访问性
81
-
82
- - [ ] 交互元素使用语义标签(`button` / `a` / `input`)
83
- - [ ] 图片有 `alt` 文本(装饰性图片用 `alt=""`)
84
- - [ ] 表单字段有 `<label htmlFor>` 关联
85
- - [ ] **颜色不是传达信息的唯一手段**(状态 = 颜色 + 图标 + 文字)
86
- - [ ] Focus ring 可见(不 `outline-none` 后忘记替代方案)
87
- - [ ] 键盘可达所有功能(Tab 顺序合理)
88
- - [ ] 危险按钮有 `aria-label` 或描述性文字
89
-
90
- ## 10. 响应式
91
-
92
- - [ ] 不使用固定宽度(除非明确需要)
93
- - [ ] 使用 flexbox / grid 实现自适应
94
- - [ ] 关键内容在 768px 宽度下仍可访问
95
- - [ ] 表格在窄屏降级为列表 / 横向滚动
96
- - [ ] 毛玻璃效果在低端设备降级为不透明
97
-
98
- ---
99
-
100
- ## 红线(一票否决)
101
-
102
- 任何一条触发即必须重写:
103
-
104
- 1. **硬编码任何视觉值**(颜色 / 间距 / 字号 / 圆角)
105
- 2. **危险操作无二次确认**
106
- 3. **状态仅用颜色表达**(无图标 + 文字)
107
- 4. **使用了 width/height 动画**
108
- 5. **页面有多个 H1**