@teamix-evo/skills 0.5.0 → 0.7.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 (75) hide show
  1. package/manifest.json +23 -37
  2. package/package.json +2 -2
  3. package/src/teamix-evo-design-opentrek/SKILL.md +210 -42
  4. package/src/teamix-evo-design-opentrek/boundaries.md +3 -3
  5. package/src/teamix-evo-design-opentrek/components.md +41 -40
  6. package/src/teamix-evo-design-opentrek/examples/detail-ai-gateway-1.html +1069 -0
  7. package/src/teamix-evo-design-opentrek/examples/detail-ai-gateway-instance.html +941 -0
  8. package/src/teamix-evo-design-opentrek/examples/detail-page-api-doc.html +906 -0
  9. package/src/teamix-evo-design-opentrek/examples/detail-page-config.html +993 -0
  10. package/src/teamix-evo-design-opentrek/examples/detail-page-monitor.html +1339 -0
  11. package/src/teamix-evo-design-opentrek/examples/detail-page.html +933 -0
  12. package/src/teamix-evo-design-opentrek/examples/settings-page.html +1119 -0
  13. package/src/teamix-evo-design-opentrek/examples/standard-card-list.html +1094 -0
  14. package/src/teamix-evo-design-opentrek/examples/standard-table-list.html +1361 -0
  15. package/src/teamix-evo-design-opentrek/examples/wizard-form-page.html +877 -0
  16. package/src/teamix-evo-design-opentrek/flows.md +85 -12
  17. package/src/teamix-evo-design-opentrek/foundations.md +9 -9
  18. package/src/teamix-evo-design-opentrek/generation-flow.md +15 -3
  19. package/src/teamix-evo-design-opentrek/pages/detail-page/SKILL.md +260 -0
  20. package/src/teamix-evo-design-opentrek/pages/detail-page/patterns/api-doc-detail.md +163 -0
  21. package/src/teamix-evo-design-opentrek/pages/detail-page/patterns/comparison-detail.md +100 -0
  22. package/src/teamix-evo-design-opentrek/pages/detail-page/patterns/monitor-detail.md +190 -0
  23. package/src/teamix-evo-design-opentrek/pages/detail-page/patterns/resource-detail.md +148 -0
  24. package/src/teamix-evo-design-opentrek/pages/form-page/SKILL.md +362 -0
  25. package/src/teamix-evo-design-opentrek/pages/list-page/SKILL.md +286 -0
  26. package/src/teamix-evo-design-opentrek/pages/list-page/_shared/action-column-spec.md +60 -0
  27. package/src/teamix-evo-design-opentrek/pages/list-page/_shared/column-meta-rules.md +117 -0
  28. package/src/teamix-evo-design-opentrek/pages/list-page/_shared/search-combo-spec.md +194 -0
  29. package/src/teamix-evo-design-opentrek/pages/list-page/_shared/state-action-pattern.md +51 -0
  30. package/src/teamix-evo-design-opentrek/pages/list-page/patterns/advanced-filter-list.md +94 -0
  31. package/src/teamix-evo-design-opentrek/pages/list-page/patterns/card-list.md +558 -0
  32. package/src/teamix-evo-design-opentrek/pages/list-page/patterns/drawer-list.md +76 -0
  33. package/src/teamix-evo-design-opentrek/pages/list-page/patterns/expandable-list.md +70 -0
  34. package/src/teamix-evo-design-opentrek/pages/list-page/patterns/l2-sidebar-list.md +73 -0
  35. package/src/teamix-evo-design-opentrek/pages/list-page/patterns/standard-list.md +198 -0
  36. package/src/teamix-evo-design-opentrek/patterns/color-mapping.md +1 -1
  37. package/src/teamix-evo-design-opentrek/patterns/detail-page.md +217 -152
  38. package/src/teamix-evo-design-opentrek/patterns/form-page.md +437 -231
  39. package/src/teamix-evo-design-opentrek/patterns/list-page.md +220 -292
  40. package/src/teamix-evo-design-opentrek/patterns/page-types.md +40 -130
  41. package/src/teamix-evo-design-opentrek/rules/_assets/OP_AGENT RUNTIME.svg +1 -0
  42. package/src/teamix-evo-design-opentrek/rules/_assets/OP_AI GATEWAY.svg +1 -0
  43. package/src/teamix-evo-design-opentrek/rules/_assets/OP_AI STUDIO.svg +1 -0
  44. package/src/teamix-evo-design-opentrek/rules/_assets/OP_DEV-2.svg +1 -0
  45. package/src/teamix-evo-design-opentrek/rules/_assets/OP_LOGO.svg +1 -0
  46. package/src/teamix-evo-design-opentrek/rules/_assets/OP_OPS.svg +1 -0
  47. package/src/teamix-evo-design-opentrek/rules/boundaries.rules.json +3 -3
  48. package/src/teamix-evo-design-opentrek/rules/business-mapping.json +124 -0
  49. package/src/teamix-evo-design-opentrek/rules/common-components.json +924 -0
  50. package/src/teamix-evo-design-opentrek/rules/component-specs.json +1083 -0
  51. package/src/teamix-evo-design-opentrek/rules/design-tokens.css +433 -0
  52. package/src/teamix-evo-design-opentrek/rules/design-tokens.json +2798 -0
  53. package/src/teamix-evo-design-opentrek/rules/layout-rules.json +218 -0
  54. package/src/teamix-evo-design-opentrek/rules/page-flow.json +351 -0
  55. package/src/teamix-evo-design-opentrek/rules/page-frame.json +241 -0
  56. package/src/teamix-evo-design-opentrek/rules/page-header-spec.md +123 -0
  57. package/src/teamix-evo-design-opentrek/rules/page-types.json +206 -0
  58. package/src/teamix-evo-design-opentrek/rules/sidebar-spec.md +217 -0
  59. package/src/teamix-evo-design-opentrek/rules/styling.json +188 -0
  60. package/src/teamix-evo-design-opentrek/rules/token-mapping.md +284 -0
  61. package/src/teamix-evo-design-uni-manager/SKILL.md +1 -1
  62. package/src/teamix-evo-design-uni-manager/boundaries.md +3 -3
  63. package/src/teamix-evo-design-uni-manager/brand.md +1 -1
  64. package/src/teamix-evo-design-uni-manager/components.md +30 -28
  65. package/src/teamix-evo-design-uni-manager/foundations.md +21 -21
  66. package/src/teamix-evo-design-uni-manager/generation-flow.md +3 -1
  67. package/src/teamix-evo-design-uni-manager/patterns/detail-page.md +1 -1
  68. package/src/teamix-evo-design-uni-manager/patterns/form-page.md +18 -18
  69. package/src/teamix-evo-design-uni-manager/patterns/list-page.md +29 -29
  70. package/src/teamix-evo-design-uni-manager/patterns/page-types.md +11 -11
  71. package/src/teamix-evo-design-uni-manager/philosophy.md +1 -1
  72. package/src/teamix-evo-design-uni-manager/rules/boundaries.rules.json +3 -3
  73. package/src/teamix-evo-manage/SKILL.md +288 -121
  74. package/src/teamix-evo-upgrade/SKILL.md +298 -0
  75. package/src/teamix-evo-design-opentrek/patterns/sidebar.md +0 -122
@@ -0,0 +1,298 @@
1
+ ---
2
+ name: teamix-evo-upgrade
3
+ description: |
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}-*/`.
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
+ Coordinates with: teamix-evo-manage (manage drives the upgrade flow that emits hints + staging; this skill consumes the resulting files).
8
+ ---
9
+
10
+ # teamix-evo-upgrade
11
+
12
+ This skill consumes two complementary upgrade artefacts the CLI produces during upgrades and the consumer must adopt by hand under the [ADR 0019](../../../../docs/adr/0019-project-upgrade-flow.md) **frozen-on-add boundary** (after first-time install via `npm create teamix-evo` / `teamix-evo init` / `ui add`, the CLI never overwrites existing files under `src/components/{ui,business}/**`; upgrades go through staging instead of in-place rewrites):
13
+
14
+ 1. **Token rename hints** — `.teamix-evo/.upgrade-hints/tokens-<ts>.json` (variable-level rewrites under `src/**` + `tokens/tokens.overrides.css`).
15
+ 2. **Component source staging** — `.teamix-evo/.upgrade-staging/{ui,biz-ui}-<ts>/` (per-component file replacements under `src/components/{ui,business}/**`, see [ADR 0040](../../../../docs/adr/0040-component-source-layer-upgrade-flow.md)).
16
+
17
+ Both flows share the same shape (discover → read → propose → hard-gate confirm → archive); they only differ in the artefact they consume. Token-rename details are in part A, component-source details are in part B.
18
+
19
+ # Part A — Token rename adoption
20
+
21
+ ## What is a hint file
22
+
23
+ When `teamix-evo tokens update` bumps a variant version that ships a `renames` log, or `teamix-evo switch --apply` lands on a new variant whose history contains renames, the CLI writes a single JSON file:
24
+
25
+ ```
26
+ .teamix-evo/
27
+ └── .upgrade-hints/
28
+ └── tokens-2026-06-12T03-15-00-000Z.json
29
+ ```
30
+
31
+ Schema v1 payload (every field is required except `description` per rename):
32
+
33
+ ```json
34
+ {
35
+ "schemaVersion": 1,
36
+ "ts": "2026-06-12T03:15:00.000Z",
37
+ "package": "tokens",
38
+ "trigger": "update",
39
+ "fromVariant": "opentrek",
40
+ "toVariant": "opentrek",
41
+ "fromVersion": "0.5.0",
42
+ "toVersion": "0.6.5",
43
+ "renames": [
44
+ {
45
+ "sinceVersion": "0.6.0",
46
+ "from": "--color-old",
47
+ "to": "--color-new"
48
+ },
49
+ {
50
+ "sinceVersion": "0.6.5",
51
+ "from": "--space-x",
52
+ "to": "--space-h",
53
+ "description": "horizontal axis rename"
54
+ }
55
+ ]
56
+ }
57
+ ```
58
+
59
+ > `trigger` is `"update"` for version-bump hints and `"switch"` for variant-switch hints. Both consume the same way — only the framing line differs.
60
+
61
+ ## Workflow (5 steps, never skip step 4)
62
+
63
+ ### 1 · Discover
64
+
65
+ List every hint file under `.teamix-evo/.upgrade-hints/`. Sort newest-first by filename (the `tokens-<fs-ts>.json` ts is filesystem-safe and lexically chronological).
66
+
67
+ ```bash
68
+ ls -1 .teamix-evo/.upgrade-hints/tokens-*.json 2>/dev/null
69
+ ```
70
+
71
+ If the directory is missing or empty, tell the user:
72
+
73
+ > 当前没有待处理的 token rename hint。这通常意味着最近一次 `tokens update` / `switch` 没有跨过 rename 节点;你可以继续做你原本的事。
74
+
75
+ ### 2 · Aggregate
76
+
77
+ Read each hint and aggregate the `renames` arrays into a single `from → to` map. When two hints rename the same token (rare — usually means a token was renamed twice across versions), the **newest hint wins** and the older mapping is discarded (treat the chain as resolved).
78
+
79
+ Surface a one-line summary per hint to the user:
80
+
81
+ > `tokens-…06-12T03-15-00-000Z.json` · update · opentrek 0.5.0 → 0.6.5 · 2 renames
82
+
83
+ ### 3 · Scan
84
+
85
+ For each `from` token, run a project-wide search across the consumer-owned surface (never read `node_modules/` or `dist/`). The exact glob set depends on which token shape the rename targets:
86
+
87
+ | `from` shape | Where to search | Tooling |
88
+ | --------------------------------------------- | -------------------------------------------------------------------------- | ---------------- |
89
+ | CSS variable (`--color-old`) | `src/**/*.{ts,tsx,js,jsx,css,scss,md,mdx}` + `tokens/tokens.overrides.css` | grep / Grep tool |
90
+ | Tailwind class fragment (e.g. `bg-color-old`) | `src/**/*.{ts,tsx,jsx}` + `index.html` | grep |
91
+ | Token JSON path (`color.old`) | `tokens/**/*.json` if any | grep |
92
+
93
+ Explicitly exclude:
94
+
95
+ - `node_modules/**`、`dist/**`、`build/**`、`.next/**`
96
+ - Anything under `.teamix-evo/snapshots/**` (those are restore points, not live code)
97
+ - The hint file itself
98
+
99
+ For each occurrence collect: file path, 1-based line number, the matched line.
100
+
101
+ ### 4 · Propose & ask (HARD GATE)
102
+
103
+ For every `from → to` rename, show a diff hunk and **ask the user per file** before touching it. Use this template:
104
+
105
+ ```
106
+ ─── tokens/tokens.overrides.css (1 occurrence) ───
107
+ - 12 | color: var(--color-old);
108
+ + 12 | color: var(--color-new);
109
+
110
+ ─── src/components/Banner.tsx (3 occurrences) ───
111
+ - 18 | className="text-[var(--color-old)]"
112
+ + 18 | className="text-[var(--color-new)]"
113
+
114
+
115
+ 应用这些修改?(y / n / per-file)
116
+ ```
117
+
118
+ `per-file` lets the user pick file-by-file. Default to **no** if the user is silent. **Never auto-apply.** This is the entire reason the rename pipeline exists — ADR 0019 frozen boundary.
119
+
120
+ If the user declines a particular file, record it in your reply (`保留:src/legacy/old-page.tsx — 用户选择不替换`) so they can come back to it later.
121
+
122
+ ### 5 · Archive processed hints
123
+
124
+ After (and only after) the user has either accepted or explicitly skipped every rename in a hint file, **move the hint into the archive subdirectory** so subsequent runs don't re-prompt:
125
+
126
+ ```bash
127
+ mkdir -p .teamix-evo/.upgrade-hints/.processed
128
+ mv .teamix-evo/.upgrade-hints/tokens-<ts>.json .teamix-evo/.upgrade-hints/.processed/
129
+ ```
130
+
131
+ Tell the user the file moved and that they can `git diff` to review the rewrites + the hint move in one shot.
132
+
133
+ > If the user wants to **defer** an entire hint (not just per-file skip), leave it in place and tell them they can re-run this skill later.
134
+
135
+ ## Edge cases
136
+
137
+ | Situation | Response |
138
+ | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
139
+ | Hint file fails JSON parse / wrong schemaVersion | Print the file path + the parse error; **do not** delete it. Suggest the user inspect or run `teamix-evo restore --list`. |
140
+ | `from` token literally not found in `src/**` | Tell the user the rename is "已经无影响" and ask whether to archive the hint anyway. |
141
+ | Multiple hint files pending | Process newest-first one hint at a time — never batch across hints (keeps the diff small and the user in control). |
142
+ | User says "全部接受" / "apply all" | Still show every diff before applying. Bulk-confirm is fine, **silent apply is not**. |
143
+ | Project has no `src/` (library / monorepo root) | Ask the user which directory to scan; default to `packages/*/src` if a `pnpm-workspace.yaml` is present. |
144
+ | User asks to handle an old hint that's already in `.processed/` | Read it from `.processed/`, re-run scan, and let the user decide whether to apply again or remove it permanently. |
145
+
146
+ ## What this skill is NOT
147
+
148
+ - **Not** a CLI command — there is no `teamix-evo upgrade`. The CLI emits hints + staging; this skill consumes them.
149
+ - **Not** a token authority — only consumes the rename log declared by the upstream tokens pack (registry `TokensVariantEntry.renames`).
150
+ - **Not** a refactor robot — diff-then-confirm is mandatory, the user owns every byte under `src/**`.
151
+ - **Not** the place to discuss new token names or design decisions — those flow through the design skill.
152
+
153
+ # Part B — Component source upgrade
154
+
155
+ When `teamix-evo update` (auto-staging step), `teamix-evo ui upgrade [id]`, or `teamix-evo biz-ui upgrade [id]` runs, the CLI compares the consumer's installed component source against the latest upstream package contents and writes a **staging directory**:
156
+
157
+ ```
158
+ .teamix-evo/.upgrade-staging/
159
+ └── ui-2026-06-12T12-00-00-000Z/
160
+ ├── meta.json # UpgradeStagingManifest
161
+ ├── button/
162
+ │ ├── current.tsx # what is on disk now
163
+ │ └── incoming.tsx # alias-rewritten upstream source
164
+ └── …
165
+ ```
166
+
167
+ > **v1 note** — CLI does **not** pre-render `diff.unified.patch`. The schema's `diffRelPath` field is reserved for a future v2 emitter; today this skill diffs `current.tsx` against `incoming.tsx` on the fly (B4).
168
+
169
+ The CLI **never writes** into `src/components/{ui,business}/**` — frozen boundary, [ADR 0019](../../../../docs/adr/0019-project-upgrade-flow.md) + [ADR 0040](../../../../docs/adr/0040-component-source-layer-upgrade-flow.md). This skill is the only path to land staged changes.
170
+
171
+ ## Staging manifest payload (schema v1)
172
+
173
+ ```json
174
+ {
175
+ "schemaVersion": 1,
176
+ "ts": "2026-06-12T12:00:00.000Z",
177
+ "package": "ui",
178
+ "trigger": "ui-upgrade",
179
+ "fromVersion": "0.7.0",
180
+ "toVersion": "0.8.0",
181
+ "lineage": "teamix-evo",
182
+ "summary": {
183
+ "total": 4,
184
+ "byRisk": { "unchanged": 1, "upgradable-medium": 2, "risky": 1 }
185
+ },
186
+ "entries": [
187
+ {
188
+ "id": "button",
189
+ "category": "ui",
190
+ "current": {
191
+ "target": "src/components/ui/button.tsx",
192
+ "hash": "sha256:…",
193
+ "sourceLineage": "teamix-evo"
194
+ },
195
+ "incoming": {
196
+ "sourceVersion": "0.8.0",
197
+ "hash": "sha256:…",
198
+ "relPath": "button/incoming.tsx"
199
+ },
200
+ "diff": {
201
+ "riskLevel": "upgradable-medium",
202
+ "hints": ["new export: ButtonGroup"],
203
+ "filesChangedCount": 1
204
+ }
205
+ }
206
+ ]
207
+ }
208
+ ```
209
+
210
+ `riskLevel` values (from [ADR 0040 §D3](../../../../docs/adr/0040-component-source-layer-upgrade-flow.md)):
211
+
212
+ | level | meaning | suggested handling |
213
+ | ------------------- | -------------------------------------------------------------------- | ----------------------------------- |
214
+ | `unchanged` | hash identical — nothing to do | skip silently |
215
+ | `upgradable-low` | single file, no new/removed exports or cva variants | batch confirm |
216
+ | `upgradable-medium` | new exports / new cva variants / multi-file | per-file confirm |
217
+ | `risky` | removed exports / removed cva variants / props rename | discuss each, surface hints |
218
+ | `breaking` | upstream removed the entry entirely | flag explicitly, never auto-replace |
219
+ | `foreign` | file exists in `src/` but no upstream / no installed manifest record | leave untouched, ask for intent |
220
+
221
+ ## Workflow (5 steps, never skip step 4)
222
+
223
+ ### B1 · Discover
224
+
225
+ ```bash
226
+ ls -1d .teamix-evo/.upgrade-staging/{ui,biz-ui}-*/ 2>/dev/null | sort -r
227
+ ```
228
+
229
+ If the directory is missing or empty:
230
+
231
+ > 当前没有待应用的组件升级 staging。请先跑 `teamix-evo update` / `teamix-evo ui upgrade [id]` / `teamix-evo biz-ui upgrade [id]` 生成。
232
+
233
+ ### B2 · Read manifest & frame the opening line
234
+
235
+ Parse `meta.json`. Pick the opening message based on `lineage`:
236
+
237
+ | lineage | opening line template |
238
+ | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
239
+ | `teamix-evo` | `检测到 X 个组件,其中 Y 个有变化(unchanged=A, upgradable-low=B, medium=C, risky=D, breaking=E)。准备逐个 review。` |
240
+ | `mixed` | `检测到 Z 个 teamix-evo 组件 + W 个未登记组件(foreign=F)。先处理可升级项,最后与你商量 foreign 组件去留。` |
241
+ | `shadcn-native` | `你当前是 shadcn 原生安装(未使用 teamix-evo 的资产)。升级前建议先迁移到 teamix-evo 谱系(run 「teamix-evo ui init」重新安装),或者手动对齐调谐表。是否继续详细对比?` (CLI 这种情况不会生成 staging,但用户可能手工走到这一步) |
242
+ | `custom-only` | (CLI skip 了,不会出现在 staging 中 — 若出现是异常,请提示用户检查) |
243
+
244
+ ### B3 · Group by risk
245
+
246
+ Iterate `entries` and bucket by `riskLevel`:
247
+
248
+ - **`unchanged`** — just announce “以下组件未变,跳过” (list ids on one line).
249
+ - **`upgradable-low`** — group all together, **one** confirmation prompt (“这些升级较安全,是否一起应用?”).
250
+ - **`upgradable-medium`** — walk one-by-one with a short hint summary, ask y/n/per-file (see B4).
251
+ - **`risky`** — force per-component review; spell out every `hints[]` entry verbatim before showing the diff.
252
+ - **`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`).
253
+ - **`foreign`** — list separately (“以下组件不在 manifest 中,可能是你手工添加的”), ask whether to register, delete, or leave alone.
254
+
255
+ ### B4 · Propose & ask (HARD GATE)
256
+
257
+ For each non-unchanged entry the user has agreed to consider, render the diff with **the same template as Part A step 4** but use file replacement instead of inline rewrite. Read `current.tsx` + `incoming.tsx` and compute the diff on the fly (v1 does not pre-render `diff.unified.patch` — if the entry's `diff.diffRelPath` is set in a future schema version, prefer that file as the source of truth).
258
+
259
+ ```
260
+ ─── src/components/ui/button.tsx · risk=upgradable-medium · hints: new export: ButtonGroup ───
261
+ @@ -1,3 +1,5 @@
262
+ export const Button = (props: any) => null;
263
+ +
264
+ +export const ButtonGroup = (props: any) => null;
265
+
266
+ 应用?(y / n / per-file)
267
+ ```
268
+
269
+ Application = **copy `incoming.tsx` over the file at `current.target`**, atomically. Do not partial-merge — the staging is whole-file.
270
+
271
+ **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.
272
+
273
+ 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.
274
+
275
+ ### B5 · Archive staging
276
+
277
+ After every entry has either been applied or explicitly skipped:
278
+
279
+ ```bash
280
+ mkdir -p .teamix-evo/.upgrade-staging/.processed
281
+ mv .teamix-evo/.upgrade-staging/<dir> .teamix-evo/.upgrade-staging/.processed/
282
+ ```
283
+
284
+ Tell the user the directory was archived and that `git diff` will show every accepted file replacement plus the staging move in one shot.
285
+
286
+ If the user wants to **defer** the entire staging (not per-entry skip), leave it in place — they can re-run this skill later.
287
+
288
+ ## Edge cases (component source)
289
+
290
+ | Situation | Response |
291
+ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
292
+ | `meta.json` parse error / wrong schemaVersion | Print the path + parse error; **do not** delete it. Suggest `teamix-evo ui upgrade` re-run or `teamix-evo restore --list`. |
293
+ | `current.tsx` differs from `entry.current.target` on disk | The user edited locally since CLI generated staging. Show both diffs (your edits vs incoming), let them merge by hand; do not silently overwrite. |
294
+ | User passes `--apply` to a CLI upgrade command | The CLI itself rejects with frozen-boundary guidance. Re-route them here. |
295
+ | Multiple staging directories pending | Process newest-first one staging at a time — never batch across staging dirs (different `fromVersion/toVersion`, different baseline). |
296
+ | User says “全部接受” / “apply all” | Still show every diff before applying. Bulk-confirm is fine, **silent apply is not**. |
297
+ | `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. |
298
+ | 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. |
@@ -1,122 +0,0 @@
1
- # Sidebar Pattern — OpenTrek 侧边栏统一规范
2
-
3
- > ⚠️ **Prerequisites**: 你必须已在 [generation-flow.md](../generation-flow.md) Step 3 确认布局包含侧边栏,或由翻新/验证路径引导到这里。
4
-
5
- > AI 生成或翻新页面时必须引用本规则。所有色值与尺寸通过 token 引用,禁止硬编码。Token 真值见 `tokens/tokens.theme.css`。
6
-
7
- ---
8
-
9
- ## 1. 宽度与定位
10
-
11
- | 状态 | Token | 业务含义 |
12
- | ------ | --------------------------- | ------------------------------- |
13
- | 展开态 | `--layout-sidebar-width` | 侧边栏展开宽度 |
14
- | 收起态 | `--sidebar-collapsed-width` | 仅图标,居中对齐于中轴线 |
15
- | 顶部条 | `--topbar-height` | 与 Sidebar 顶部对齐,区分品牌区 |
16
-
17
- **布局规则**:
18
-
19
- - Sidebar 走 `position: fixed; top: 0; left: 0; bottom: 0; z-index: 100`
20
- - 主内容区通过 `margin-left: var(--layout-sidebar-width)` 补偿
21
- - **禁止**:把 Sidebar + 主内容区放进一个 flex 容器(不可预期的滚动行为)
22
-
23
- ---
24
-
25
- ## 2. 结构变体(2 选 1,按信息架构层级)
26
-
27
- ### 2.1 三级结构(默认)
28
-
29
- 适用:信息架构需要 3 层归类(顶层业务域 / 中层主导航 / 底层细分)。
30
-
31
- ```
32
- aside.sidebar
33
- ├─ div.sidebar-header ← 品牌区
34
- ├─ div.sidebar-content ← 滚动容器
35
- │ ├─ div.sidebar-group-label ← 分组标题(可重复)
36
- │ ├─ ul.sidebar-menu
37
- │ │ └─ li > a.sidebar-menu-item
38
- │ └─ ul.sidebar-sub-menu ← 主菜单展开后显示
39
- │ └─ li > a.sidebar-menu-item
40
- ├─ div.sidebar-divider
41
- └─ div.sidebar-footer
42
- ```
43
-
44
- ### 2.2 二级结构(v4.1 新增)
45
-
46
- 适用:主菜单项语义对等,无需分组标题归类。
47
-
48
- - **禁止** `div.sidebar-group-label`
49
- - 所有主菜单项放进同一个 `ul.sidebar-menu`
50
- - 子菜单项与主菜单项**文字 x 坐标对齐**(同列),层级关系由展开箭头 + 字号 + 背景色表现,**不**通过左缩进
51
- - 子菜单项不带 `.item-icon`,只有文字
52
-
53
- ### 2.3 选型决策
54
-
55
- | 信息架构层级深度 | 选用 |
56
- | ---------------- | ---------- |
57
- | 3 层归类 | threeLevel |
58
- | 2 层归类 | twoLevel |
59
-
60
- > 与菜单项**个数无关**,只看信息架构。
61
-
62
- ---
63
-
64
- ## 3. 颜色映射(v4.1 品牌化)
65
-
66
- | 槽位 | 用途 |
67
- | ----------------------------------- | ------------------------------------------- |
68
- | `--color-sidebar` | 侧边栏背景 |
69
- | `--color-sidebar-foreground` | 默认文字 |
70
- | `--color-sidebar-active` | 选中项背景(v4.1 走灰色,区别 hover) |
71
- | `--color-sidebar-active-foreground` | 选中项文字(OpenTrek 蓝) |
72
- | `--color-sidebar-hover` | hover 态背景 |
73
- | `--color-sidebar-title` | sidebar-group-label 文字 |
74
- | `--color-sidebar-item-muted` | 二级文字 / 次要项 |
75
- | `--color-sidebar-primary` | 品牌强调(`#0055EE`)— 高亮 logo / 选中态等 |
76
- | `--color-sidebar-border` | 分隔线 |
77
- | `--color-sidebar-ring` | 焦点圈 |
78
-
79
- **禁止**:
80
-
81
- - 直接用 `bg-blue-600` / `text-gray-500` 这类原始 Tailwind 色
82
- - 在 sidebar 内消费 `--color-primary` / `--color-foreground`(应走 sidebar 命名空间)
83
-
84
- ---
85
-
86
- ## 4. 收起态行为
87
-
88
- - 宽度 `--sidebar-collapsed-width`,`overflow: visible`(支持 flyout 浮层溢出)
89
- - 滚动能力下移到 `.sidebar-content`(`overflow-y: auto; overflow-x: hidden`)
90
- - 仅显示图标,隐藏所有文字(label / group title / count / expand-icon)
91
- - 选中态用 `--color-sidebar-active` 灰色背景,**不**显示左侧高亮条
92
- - 过渡走 `width var(--duration-normal) var(--easing-ease)`
93
- - 菜单项 40×40px,`border-radius: var(--radius-md)`,`li { display: flex; justify-content: center }` 保证居中于中轴线
94
-
95
- ---
96
-
97
- ## 5. Footer / Header 槽位
98
-
99
- | 槽位 | 内容 |
100
- | ---------------- | ----------------------------------------------------- |
101
- | sidebar-header | 展开态:品牌 logo;收起态:方形 logo +hover 展开 icon |
102
- | sidebar-avatar | 用户头像 |
103
- | sidebar-username | 用户名(收起态隐藏) |
104
- | sidebar-more | 更多操作触发器 |
105
-
106
- ---
107
-
108
- ## 6. 禁止清单(硬约束)
109
-
110
- - [ERROR] 扁平化结构(直接 `<a>` 挂在 `nav`/`div` 下,无 `ul > li` 包裹)
111
- - [ERROR] Sidebar 整体使用 flex 布局(必须 `fixed` 定位)
112
- - [ERROR] 省略 `sidebar-content` 滚动容器
113
- - [ERROR] twoLevel 变体出现 `sidebar-group-label`
114
- - [ERROR] 无子菜单的菜单项出现 expand-icon 或 `data-toggle`(expand-icon 仅出现在有 `sidebar-sub-menu` 的主菜单项)
115
- - [WARN] 在 sidebar 里直接消费 `--color-primary`(应走 `--color-sidebar-primary`)
116
- - [WARN] 二级结构子菜单文字起点低于主菜单文字 x(隐藏层级关系)
117
-
118
- ---
119
-
120
- ## 7. 引用关系
121
-
122
- 本规则是 OpenTrek sidebar 的 **single source of truth**。其他 skill 文件(page-frame / common-components / 子技能)须 `$ref` 本文件,禁止重复定义或冲突覆写。