@teamix-evo/skills 0.12.1 → 0.13.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/README.md +1 -1
- package/manifest.json +11 -28
- package/package.json +2 -2
- package/src/teamix-evo-code-opentrek/SKILL.md +13 -13
- package/src/teamix-evo-code-opentrek/api-layering.md +53 -44
- package/src/teamix-evo-code-opentrek/checklist.md +24 -24
- package/src/teamix-evo-code-opentrek/file-structure.md +55 -36
- package/src/teamix-evo-code-opentrek/forms-and-validation.md +17 -16
- package/src/teamix-evo-code-opentrek/reuse-first.md +6 -9
- package/src/teamix-evo-code-opentrek/testing.md +14 -14
- package/src/teamix-evo-code-uni-manager/SKILL.md +15 -15
- package/src/teamix-evo-code-uni-manager/api-layering.md +74 -58
- package/src/teamix-evo-code-uni-manager/checklist.md +28 -28
- package/src/teamix-evo-code-uni-manager/error-and-loading.md +2 -2
- package/src/teamix-evo-code-uni-manager/file-structure.md +77 -62
- package/src/teamix-evo-code-uni-manager/forms-and-validation.md +17 -15
- package/src/teamix-evo-code-uni-manager/reuse-first.md +7 -10
- package/src/teamix-evo-code-uni-manager/routing-and-codesplit.md +1 -1
- package/src/teamix-evo-code-uni-manager/testing.md +37 -37
- package/src/teamix-evo-design-opentrek/SKILL.md +17 -20
- package/src/teamix-evo-design-opentrek/boundaries.md +1 -1
- package/src/teamix-evo-design-opentrek/checklist.md +5 -5
- package/src/teamix-evo-design-opentrek/components.md +19 -19
- package/src/teamix-evo-design-opentrek/examples/standard-card-list.html +1 -1
- package/src/teamix-evo-design-opentrek/examples/standard-table-list.html +1 -1
- package/src/teamix-evo-design-opentrek/foundations.md +6 -6
- package/src/teamix-evo-design-opentrek/pages/dashboard-page/SKILL.md +18 -19
- package/src/teamix-evo-design-opentrek/pages/dashboard-page/patterns/dashboard-opentrek.md +6 -6
- package/src/teamix-evo-design-opentrek/pages/detail-page/SKILL.md +24 -25
- package/src/teamix-evo-design-opentrek/pages/detail-page/patterns/api-doc-detail.md +3 -7
- package/src/teamix-evo-design-opentrek/pages/detail-page/patterns/comparison-detail.md +3 -7
- package/src/teamix-evo-design-opentrek/pages/detail-page/patterns/monitor-detail.md +3 -7
- package/src/teamix-evo-design-opentrek/pages/detail-page/patterns/resource-detail.md +10 -10
- package/src/teamix-evo-design-opentrek/pages/form-page/SKILL.md +26 -27
- package/src/teamix-evo-design-opentrek/pages/list-page/SKILL.md +35 -36
- package/src/teamix-evo-design-opentrek/pages/list-page/_shared/item-card-spec.md +41 -32
- package/src/teamix-evo-design-opentrek/pages/list-page/patterns/card-list-opentrek.md +10 -10
- package/src/teamix-evo-design-opentrek/pages/list-page/patterns/card-list.md +23 -23
- package/src/teamix-evo-design-opentrek/pages/list-page/patterns/standard-list-opentrek.md +8 -8
- package/src/teamix-evo-design-opentrek/pages/list-page/patterns/standard-list.md +8 -8
- package/src/teamix-evo-design-opentrek/patterns/color-mapping.md +2 -2
- package/src/teamix-evo-design-opentrek/patterns/dashboard.md +1 -1
- package/src/teamix-evo-design-opentrek/patterns/detail-page.md +9 -9
- package/src/teamix-evo-design-opentrek/patterns/form-page.md +6 -6
- package/src/teamix-evo-design-opentrek/patterns/list-page.md +9 -9
- package/src/teamix-evo-design-opentrek/patterns/page-types.md +3 -3
- package/src/teamix-evo-design-opentrek/principles.md +541 -0
- package/src/teamix-evo-design-opentrek/rules/common-components.json +206 -76
- package/src/teamix-evo-design-opentrek/rules/component-specs.json +2 -2
- package/src/teamix-evo-design-opentrek/rules/page-frame.json +197 -193
- package/src/teamix-evo-design-opentrek/{generation-flow.md → workflow.md} +141 -22
- package/src/teamix-evo-design-uni-manager/SKILL.md +5 -5
- package/src/teamix-evo-design-uni-manager/boundaries.md +2 -2
- package/src/teamix-evo-design-uni-manager/brand.md +1 -1
- package/src/teamix-evo-design-uni-manager/checklist.md +2 -2
- package/src/teamix-evo-design-uni-manager/components.md +11 -11
- package/src/teamix-evo-design-uni-manager/foundations.md +7 -7
- package/src/teamix-evo-design-uni-manager/generation-flow.md +3 -3
- package/src/teamix-evo-manage/SKILL.md +111 -709
- package/src/teamix-evo-manage/init.md +98 -0
- package/src/teamix-evo-manage/migrate.md +100 -0
- package/src/teamix-evo-manage/rearchitect-capture-guide.md +174 -0
- package/src/teamix-evo-manage/rearchitect.md +373 -0
- package/src/teamix-evo-manage/update-component-staging.md +188 -0
- package/src/teamix-evo-manage/update-token-rename.md +126 -0
- package/src/teamix-evo-manage/update-token-treatment.md +116 -0
- package/src/teamix-evo-manage/update.md +213 -0
- package/src/teamix-evo-design-opentrek/brand.md +0 -154
- package/src/teamix-evo-design-opentrek/pages/list-page/_shared/search-combo-spec.md +0 -194
- package/src/teamix-evo-design-opentrek/philosophy.md +0 -98
- package/src/teamix-evo-design-opentrek/rules/README.md +0 -39
- package/src/teamix-evo-design-opentrek/rules/_assets/OP_AGENT RUNTIME.svg +0 -1
- package/src/teamix-evo-design-opentrek/rules/_assets/OP_AI GATEWAY.svg +0 -1
- package/src/teamix-evo-design-opentrek/rules/_assets/OP_AI STUDIO.svg +0 -1
- package/src/teamix-evo-design-opentrek/rules/_assets/OP_DEV-2.svg +0 -1
- package/src/teamix-evo-design-opentrek/rules/_assets/OP_LOGO.svg +0 -1
- package/src/teamix-evo-design-opentrek/rules/_assets/OP_OPS.svg +0 -1
- package/src/teamix-evo-design-opentrek/rules/layout-rules.json +0 -218
- package/src/teamix-evo-design-opentrek/rules/page-header-spec.md +0 -123
- package/src/teamix-evo-design-opentrek/rules/sidebar-spec.md +0 -217
- package/src/teamix-evo-upgrade/SKILL.md +0 -431
- /package/src/teamix-evo-design-opentrek/{rules/boundaries.rules.json → boundaries.json} +0 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Part A — Token rename adoption
|
|
2
|
+
|
|
3
|
+
## What is a hint file
|
|
4
|
+
|
|
5
|
+
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:
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
.teamix-evo/
|
|
9
|
+
└── .upgrade-hints/
|
|
10
|
+
└── tokens-2026-06-12T03-15-00-000Z.json
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Schema v1 payload (every field is required except `description` per rename):
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"schemaVersion": 1,
|
|
18
|
+
"ts": "2026-06-12T03:15:00.000Z",
|
|
19
|
+
"package": "tokens",
|
|
20
|
+
"trigger": "update",
|
|
21
|
+
"fromVariant": "opentrek",
|
|
22
|
+
"toVariant": "opentrek",
|
|
23
|
+
"fromVersion": "0.5.0",
|
|
24
|
+
"toVersion": "0.6.5",
|
|
25
|
+
"renames": [
|
|
26
|
+
{
|
|
27
|
+
"sinceVersion": "0.6.0",
|
|
28
|
+
"from": "--color-old",
|
|
29
|
+
"to": "--color-new"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"sinceVersion": "0.6.5",
|
|
33
|
+
"from": "--space-x",
|
|
34
|
+
"to": "--space-h",
|
|
35
|
+
"description": "horizontal axis rename"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
> `trigger` is `"update"` for version-bump hints and `"switch"` for variant-switch hints. Both consume the same way — only the framing line differs.
|
|
42
|
+
|
|
43
|
+
## Workflow (5 steps, never skip step 4)
|
|
44
|
+
|
|
45
|
+
### A1 · Discover
|
|
46
|
+
|
|
47
|
+
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).
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
ls -1 .teamix-evo/.upgrade-hints/tokens-*.json 2>/dev/null
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
If the directory is missing or empty, tell the user:
|
|
54
|
+
|
|
55
|
+
> 当前没有待处理的 token rename hint。这通常意味着最近一次 `tokens update` / `switch` 没有跨过 rename 节点;你可以继续做你原本的事。
|
|
56
|
+
|
|
57
|
+
### A2 · Aggregate
|
|
58
|
+
|
|
59
|
+
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).
|
|
60
|
+
|
|
61
|
+
Surface a one-line summary per hint to the user:
|
|
62
|
+
|
|
63
|
+
> `tokens-…06-12T03-15-00-000Z.json` · update · opentrek 0.5.0 → 0.6.5 · 2 renames
|
|
64
|
+
|
|
65
|
+
### A3 · Scan
|
|
66
|
+
|
|
67
|
+
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:
|
|
68
|
+
|
|
69
|
+
| `from` shape | Where to search | Tooling |
|
|
70
|
+
| --------------------------------------------- | -------------------------------------------------------------------------- | ---------------- |
|
|
71
|
+
| CSS variable (`--color-old`) | `src/**/*.{ts,tsx,js,jsx,css,scss,md,mdx}` + `tokens/tokens.overrides.css` | grep / Grep tool |
|
|
72
|
+
| Tailwind class fragment (e.g. `bg-color-old`) | `src/**/*.{ts,tsx,jsx}` + `index.html` | grep |
|
|
73
|
+
| Token JSON path (`color.old`) | `tokens/**/*.json` if any | grep |
|
|
74
|
+
|
|
75
|
+
Explicitly exclude:
|
|
76
|
+
|
|
77
|
+
- `node_modules/**`、`dist/**`、`build/**`、`.next/**`
|
|
78
|
+
- Anything under `.teamix-evo/snapshots/**` (those are restore points, not live code)
|
|
79
|
+
- The hint file itself
|
|
80
|
+
|
|
81
|
+
For each occurrence collect: file path, 1-based line number, the matched line.
|
|
82
|
+
|
|
83
|
+
### A4 · Propose & ask (HARD GATE)
|
|
84
|
+
|
|
85
|
+
For every `from → to` rename, show a diff hunk and **ask the user per file** before touching it. Use this template:
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
─── tokens/tokens.overrides.css (1 occurrence) ───
|
|
89
|
+
- 12 | color: var(--color-old);
|
|
90
|
+
+ 12 | color: var(--color-new);
|
|
91
|
+
|
|
92
|
+
─── src/components/Banner.tsx (3 occurrences) ───
|
|
93
|
+
- 18 | className="text-[var(--color-old)]"
|
|
94
|
+
+ 18 | className="text-[var(--color-new)]"
|
|
95
|
+
…
|
|
96
|
+
|
|
97
|
+
应用这些修改?(y / n / per-file)
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
`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 — frozen boundary (用户源码由用户确认后才改).
|
|
101
|
+
|
|
102
|
+
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.
|
|
103
|
+
|
|
104
|
+
### A5 · Archive processed hints
|
|
105
|
+
|
|
106
|
+
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:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
mkdir -p .teamix-evo/.upgrade-hints/.processed
|
|
110
|
+
mv .teamix-evo/.upgrade-hints/tokens-<ts>.json .teamix-evo/.upgrade-hints/.processed/
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Tell the user the file moved and that they can `git diff` to review the rewrites + the hint move in one shot.
|
|
114
|
+
|
|
115
|
+
> 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 flow later.
|
|
116
|
+
|
|
117
|
+
## Edge cases (token rename)
|
|
118
|
+
|
|
119
|
+
| Situation | Response |
|
|
120
|
+
| --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
|
|
121
|
+
| 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`. |
|
|
122
|
+
| `from` token literally not found in `src/**` | Tell the user the rename is "已经无影响" and ask whether to archive the hint anyway. |
|
|
123
|
+
| 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). |
|
|
124
|
+
| User says "全部接受" / "apply all" | Still show every diff before applying. Bulk-confirm is fine, **silent apply is not**. |
|
|
125
|
+
| 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. |
|
|
126
|
+
| 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. |
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# Part C — Token treatment pipeline
|
|
2
|
+
|
|
3
|
+
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 flow guides the user through it.
|
|
4
|
+
|
|
5
|
+
> **Coordinates with**: [update-token-rename.md](update-token-rename.md) (Part A) handles _rename_ hints from upstream version bumps; Part C handles _project-internal_ violations detected by ESLint rules.
|
|
6
|
+
|
|
7
|
+
## When to trigger
|
|
8
|
+
|
|
9
|
+
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; user opens any `.teamix-evo/.treatment-plan.md`.
|
|
10
|
+
|
|
11
|
+
SKIP: rename hints (Part A), component source upgrades (Part B), design decisions (defer to design skill).
|
|
12
|
+
|
|
13
|
+
## C1 · Diagnose
|
|
14
|
+
|
|
15
|
+
Run the diagnosis to understand the current violation landscape:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx teamix-evo@latest tokens diagnose
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
This produces `.teamix-evo/.treatment-plan.md` — a tiered treatment plan classifying violations into:
|
|
22
|
+
|
|
23
|
+
| Phase | Description | Automation |
|
|
24
|
+
| ---------------- | -------------------------------------------------------------- | ---------- |
|
|
25
|
+
| L1-structure | Token file structure issues (via `tokens audit`) | audit |
|
|
26
|
+
| L2-format | Color format normalisation (`hsl()` → CSS v4) | full-auto |
|
|
27
|
+
| L3-semantic-auto | Tailwind scale → semantic tokens | full-auto |
|
|
28
|
+
| L3-semantic-semi | Arbitrary values → tokens (AI-guided) | semi-auto |
|
|
29
|
+
| L3-manual | Requires human judgment (radius, border, dark mode) | manual |
|
|
30
|
+
| reflect | High-frequency color literals → project-level token candidates | analysis |
|
|
31
|
+
|
|
32
|
+
Present the plan overview to the user and ask which phases they want to tackle now.
|
|
33
|
+
|
|
34
|
+
## C2 · Treat (automated codemods)
|
|
35
|
+
|
|
36
|
+
For full-auto phases (L2 + L3-auto), run the treatment pipeline:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Dry-run first (recommended)
|
|
40
|
+
npx teamix-evo@latest tokens treat
|
|
41
|
+
|
|
42
|
+
# Apply changes
|
|
43
|
+
npx teamix-evo@latest tokens treat --apply
|
|
44
|
+
|
|
45
|
+
# Apply + lock baseline
|
|
46
|
+
npx teamix-evo@latest tokens treat --apply --lock-baseline
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
The pipeline executes 4 codemods in order:
|
|
50
|
+
|
|
51
|
+
1. `hsl-to-v4` — HSL function → CSS v4 color syntax
|
|
52
|
+
2. `hex-to-token` — hardcoded hex → semantic token reference
|
|
53
|
+
3. `tw-scale-to-semantic` — raw Tailwind color scale → semantic class
|
|
54
|
+
4. `space-to-gap` — space utility → gap utility
|
|
55
|
+
|
|
56
|
+
After execution, a treatment report is generated at `.teamix-evo/.treatment-reports/<timestamp>.md` showing per-rule before/after deltas.
|
|
57
|
+
|
|
58
|
+
### Workflow
|
|
59
|
+
|
|
60
|
+
1. **Always dry-run first** — show the user the match counts and ask for confirmation
|
|
61
|
+
2. Show the delta table from the report
|
|
62
|
+
3. If the user approves, re-run with `--apply`
|
|
63
|
+
4. Ask whether to lock the baseline (`--lock-baseline`)
|
|
64
|
+
|
|
65
|
+
## C3 · Semi-auto treatment (AI-guided)
|
|
66
|
+
|
|
67
|
+
For `L3-semantic-semi` violations (`no-arbitrary-tw-value`):
|
|
68
|
+
|
|
69
|
+
1. Read the treatment plan's L3-semi section for the list of violations
|
|
70
|
+
2. For each violation, read the file context and suggest the closest semantic token
|
|
71
|
+
3. Present a diff hunk per file (same template as [update-token-rename.md](update-token-rename.md) step A4)
|
|
72
|
+
4. **HARD GATE** — never auto-apply; get per-file confirmation
|
|
73
|
+
|
|
74
|
+
## C4 · Reflect (token 反哺)
|
|
75
|
+
|
|
76
|
+
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:
|
|
77
|
+
|
|
78
|
+
1. Scan remaining violations and cluster by color value + frequency
|
|
79
|
+
2. Present a table of candidates (color → suggested token name → occurrence count → files)
|
|
80
|
+
3. Colors appearing ≥ 3 times are candidates for project-level tokens
|
|
81
|
+
4. Guide the user to add chosen tokens to `tokens/tokens.overrides.css`
|
|
82
|
+
5. After adding tokens, re-run `tokens treat` to pick up the new mappings
|
|
83
|
+
|
|
84
|
+
## C5 · Baseline lock
|
|
85
|
+
|
|
86
|
+
Once the user is satisfied with the treatment level:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
npx teamix-evo@latest tokens treat --apply --lock-baseline
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
This writes `.teamix-evo/tokens-baseline.json` — a snapshot of current violation counts. Future `tokens treat` runs will compare against this baseline.
|
|
93
|
+
|
|
94
|
+
**CI integration**: add to `package.json` scripts:
|
|
95
|
+
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"scripts": {
|
|
99
|
+
"lint:baseline": "teamix-evo tokens treat --lock-baseline && git diff --exit-code .teamix-evo/tokens-baseline.json"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
If violations exceed the locked baseline, CI fails — preventing regression.
|
|
105
|
+
|
|
106
|
+
## C6 · Edge cases
|
|
107
|
+
|
|
108
|
+
| Situation | Response |
|
|
109
|
+
| ------------------------------------------------- | -------------------------------------------------------------------------- |
|
|
110
|
+
| No ESLint config / teamix-evo rules not installed | Tell the user to run `teamix-evo init` first to set up the lint rules. |
|
|
111
|
+
| No `src/` directory | Ask which directory to scan; default to `packages/*/src` in monorepo. |
|
|
112
|
+
| Codemod not found | Skip gracefully; the pipeline only runs available codemods. |
|
|
113
|
+
| User wants to skip a phase | Respect the choice; only run requested phases. |
|
|
114
|
+
| Baseline already exists | Show current vs baseline comparison before re-locking. |
|
|
115
|
+
| Treatment report shows 0 delta | All violations are either semi-auto or manual; guide user to C3/C4. |
|
|
116
|
+
| User says "全部治理" | Run diagnose → treat --apply → reflect in sequence, but confirm each step. |
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
# Update (Teamix Evo 套件更新)
|
|
2
|
+
|
|
3
|
+
> **前置条件**:当前目录已接入 teamix-evo(`.teamix-evo/` 存在)。
|
|
4
|
+
> 非 teamix-evo 工程执行时被 `assertCommandPrecondition` 拒绝。
|
|
5
|
+
|
|
6
|
+
本文件覆盖 **持续更新**(tokens / skills / ui / biz-ui / blocks 版本追踪 + staging 生成 + apply)。
|
|
7
|
+
|
|
8
|
+
更新应用的三条独立 workflow 拆分到子文件:
|
|
9
|
+
|
|
10
|
+
| 子文件 | 覆盖范围 | 触发关键词 |
|
|
11
|
+
| -------------------------------------------------------------- | -------------------------------------- | ---------------------------------------------- |
|
|
12
|
+
| [update-token-rename.md](update-token-rename.md) | Part A — Token rename adoption | token 改名 / rename hint / `.upgrade-hints/` |
|
|
13
|
+
| [update-component-staging.md](update-component-staging.md) | Part B — Component source staging apply| staging / apply / `.upgrade-staging/` |
|
|
14
|
+
| [update-token-treatment.md](update-token-treatment.md) | Part C — Token treatment pipeline | token 治理 / diagnose / treat / baseline / 反哺|
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## §0 · 资源升级覆盖总览
|
|
19
|
+
|
|
20
|
+
| 资源类型 | 升级方式 | 用户操作 |
|
|
21
|
+
| --- | --- | --- |
|
|
22
|
+
| tokens | `tokens update` — 刷新 regenerable,frozen 保留 | CLI 自动 |
|
|
23
|
+
| skills | `skills update` — 版本对比 + 覆写/managed merge | CLI 自动 |
|
|
24
|
+
| ui / biz-ui / blocks | `ui update` / `biz-ui update` / `blocks update` → staging → 逐个 apply | AI 引导逐个确认 |
|
|
25
|
+
| **AGENTS.md** | `skills update` / `switch` 后自动刷新 managed 区段 | CLI 自动(非关键,失败只 warn) |
|
|
26
|
+
| **lint 规则包** | `update` 报告展示当前版本,提示 `pnpm update` 检查更新 | 用户手动 `pnpm update` |
|
|
27
|
+
| **config.json** | CLI 读取时 Zod `.transform()` 自动 v1→v2 迁移,无感 | 无需操作 |
|
|
28
|
+
| **manifest.json** | 当前 v1,无 migration 需求;未来版本同 config.json 模式 | 无需操作 |
|
|
29
|
+
|
|
30
|
+
## §1 · 顶层更新入口
|
|
31
|
+
|
|
32
|
+
**触发**:用户表达"更新 / update / 升级套件 / 升级组件 / 看看有什么新版 / 更新 ui"等关键词。
|
|
33
|
+
|
|
34
|
+
**一行命令**:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npx teamix-evo@latest update # 输出当前安装状态报告
|
|
38
|
+
npx teamix-evo@latest update --json # JSON 格式(供 AI 消费)
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
`update` 输出已安装资产清单后,根据用户意图引导调用对应子命令。
|
|
42
|
+
|
|
43
|
+
## §2 · 单 skill 升级("升级 manage skill / 升级 design skill")
|
|
44
|
+
|
|
45
|
+
**触发**:用户明确指定要升级某个 skill(如"升级 teamix-evo-manage / 更新 design skill / update manage skill")。
|
|
46
|
+
|
|
47
|
+
**命令**:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npx teamix-evo@latest skills update <skill-id> # 指定 skill
|
|
51
|
+
npx teamix-evo@latest skills update <skill-id> --dry-run # 先预览
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## §3 · 组件源码升级(`teamix-evo ui update` / `teamix-evo biz-ui update`)
|
|
55
|
+
|
|
56
|
+
**触发**:用户表达"升级 ui / 升级业务组件 / 升级 button / 看看哪些组件有新版 / update ui / update biz-ui / stage ui update"等关键词。
|
|
57
|
+
|
|
58
|
+
> 这里是**版本演进**(installed 资源 → 上游新版 → staging → 逐个 apply),是安装完成后跟随上游发布的升级流程。
|
|
59
|
+
|
|
60
|
+
**一行命令**:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npx teamix-evo@latest ui update # 全量 staging。仅在 `teamix-evo` / `mixed` lineage 产出
|
|
64
|
+
npx teamix-evo@latest ui update button input # 只 stage 指定组件
|
|
65
|
+
npx teamix-evo@latest biz-ui update # 变体感知的 biz-ui staging
|
|
66
|
+
npx teamix-evo@latest blocks update # blocks staging
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
> `ui upgrade` / `biz-ui upgrade` / `blocks upgrade` 仍可使用(hidden alias),但推荐使用 `update`。
|
|
70
|
+
|
|
71
|
+
**lineage 分三档**(CLI 只在前两者上产出 staging):
|
|
72
|
+
|
|
73
|
+
| lineage | CLI 会产出 staging? | AI 开场白 |
|
|
74
|
+
| --------------- | -------------------- | --------------------------------------------------------------------------------- |
|
|
75
|
+
| `teamix-evo` | 是 | 走 staging → [update-component-staging.md](update-component-staging.md) 流程逐件 review |
|
|
76
|
+
| `mixed` | 是 | 升级项优先,末了与用户商量 foreign 组件(未登记)去留 |
|
|
77
|
+
| `shadcn-native` | 否 | 告诉用户他是 shadcn 原生,建议先 `teamix-evo migrate` 迁移到 teamix-evo |
|
|
78
|
+
| `custom-only` | 否 | 跳过。告诉用户"现有组件不在 manifest 中,升级只针对 teamix-evo 安装资产" |
|
|
79
|
+
|
|
80
|
+
**AI 引导决策树**:
|
|
81
|
+
|
|
82
|
+
1. **先识别 lineage**:`ui update` 的输出会带 `lineage=...`。根据表选开场白。
|
|
83
|
+
2. **路径 A(`teamix-evo` / `mixed`)**:
|
|
84
|
+
- CLI 生成 staging 后会输出 `staging at .teamix-evo/.upgrade-staging/<dir>` + risk 汇总。复述给用户。
|
|
85
|
+
- **应用 staging 走 [update-component-staging.md](update-component-staging.md) 流程** — 逐个展示 diff,按 risk 分批让用户确认后才复制 incoming.tsx 到 src(逐文件 hard gate)。
|
|
86
|
+
- **不要手工复制!**`incoming.tsx` 已是 alias 重写过的、可直接覆盖。但走 [update-component-staging.md](update-component-staging.md) 流程能带 archive 动作 + risk-aware UX。
|
|
87
|
+
3. **路径 B(`shadcn-native`)**:告知用户 "CLI 不会为 shadcn 原生仓生成 staging",提示他走 `teamix-evo migrate` 迁移到 teamix-evo 后再升级。
|
|
88
|
+
4. **路径 C(用户误走 `--apply`)**:CLI 会拒绝 + 打印 "请走本 skill 升级流程"。重复该提示,引导走路径 A。
|
|
89
|
+
5. **路径 D(foreign 组件)**:staging 中的 `riskLevel: foreign` 是未登记文件(`mixed` lineage)— 不要表达为"要升级";作为联动信息告诉用户,让他决定是否 `teamix-evo ui add <id>` 收纳、删掉、或保留。
|
|
90
|
+
|
|
91
|
+
**身份划分清单**:
|
|
92
|
+
|
|
93
|
+
- **CLI**:检测 lineage / 生成 staging / 算 risk。**从不写 `src/components/{ui,business}`**。
|
|
94
|
+
- **AI(本 skill)**:识别意图、跳起 CLI 命令、复述结果、在路径 A 上继续 [update-component-staging.md](update-component-staging.md) 流程。
|
|
95
|
+
- **[update-component-staging.md](update-component-staging.md)**:读 staging、逐文件 diff 征同意、apply、archive。
|
|
96
|
+
|
|
97
|
+
**不要**:
|
|
98
|
+
|
|
99
|
+
- 不要自己在 SKILL.md hub 里复制 staging 文件到 `src` — 那是 [update-component-staging.md](update-component-staging.md) 的职责。
|
|
100
|
+
- 不要听到"升级 ui"就打 `ui add` — `add` 是装进去,`update` 是已装后追上上游。
|
|
101
|
+
- 不要在 `shadcn-native` lineage 强行跳 staging;CLI 跳过是预期行为。
|
|
102
|
+
|
|
103
|
+
## §4 · 组件源码 promotion(`teamix-evo ui promote-to-biz` — Init 落地计划 §C.3 / §C.4)
|
|
104
|
+
|
|
105
|
+
**触发**:用户表达"把 ui 组件融进 biz-ui / 把 button 提级成业务组件 / promote ui to business / 把 staging 里的差异融合到 business 层 / 多模式融合 / wrapper + preset 叠加 / 双轨 coexist / 把上游版和自家版同时保留"等关键词;或在 §3 走完 staging 后用户问"能不能直接生成业务包装组件"。
|
|
106
|
+
|
|
107
|
+
> 这是 §3 的**下游**:§3 只生成 `.upgrade-staging/`,§4 才把条目按 AI 推荐的 `recommendedModes` 真正落地到 `src/components/business/` 并维护 manifest。**条目的 8 模式判定全部由 staging meta 给出**,本 skill 只做分组、确认、转发命令。
|
|
108
|
+
|
|
109
|
+
**一行命令**:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
npx teamix-evo@latest ui promote-to-biz # 默认融合最新 ui-* staging 中所有可自动模式条目
|
|
113
|
+
npx teamix-evo@latest ui promote-to-biz button card # 只融合指定 id
|
|
114
|
+
npx teamix-evo@latest ui promote-to-biz --modes Wrapper,Preset # 强制覆盖 staging 推荐模式
|
|
115
|
+
npx teamix-evo@latest ui promote-to-biz --migrate-imports # Coexist 模式时连带 src/** 改 import 到 legacy-<id>
|
|
116
|
+
npx teamix-evo@latest ui promote-to-biz --keep-original-names # Coexist 模式 export 不前缀化 Legacy
|
|
117
|
+
npx teamix-evo@latest ui promote-to-biz --dry-run # 计划态:列模式分组 + 文件变更预览,不写盘
|
|
118
|
+
npx teamix-evo@latest ui promote-to-biz --staging-dir <path> # 指定 staging 目录(不指定则取最新 ui-* 目录)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**8 模式分组语义**:
|
|
122
|
+
|
|
123
|
+
| Mode | 终结? | 产物 |
|
|
124
|
+
| -------------- | ------ | -------------------------------------------------------------------------------- |
|
|
125
|
+
| `Coexist` | 是 | `business/legacy-<id>.tsx`(用户版改名 `Legacy<Foo>`)+ `ui/<id>.tsx` 回填上游版 |
|
|
126
|
+
| `Fork` | 是 | `business/<id>.tsx`(直接搬用户版,无上游对应) |
|
|
127
|
+
| `TokenOnly` | 是 | **不创建文件**,引导用户改 `tokens/tokens.overrides.css` |
|
|
128
|
+
| `ManualReview` | 是 | **不创建文件**,列入待办交用户决策 |
|
|
129
|
+
| `Preset` | 可叠加 | `business/<id>.tsx` import 上游 + `defaultProps` |
|
|
130
|
+
| `Wrapper` | 可叠加 | `business/<id>.tsx` 包装上游 + 业务 state/effect |
|
|
131
|
+
| `Variant` | 可叠加 | `business/<id>.tsx` 扩展上游 cva(上游未 export → 触发 ManualReview) |
|
|
132
|
+
| `Compose` | 可叠加 | `business/<id>.tsx` 拼装多个上游原子 |
|
|
133
|
+
|
|
134
|
+
> 叠加规则:`Coexist` / `Fork` / `TokenOnly` / `ManualReview` 互斥(终结);`Preset + Wrapper + Variant + Compose` 任意组合,叠加顺序内 → 外为 `variant > wrapper > preset`。
|
|
135
|
+
|
|
136
|
+
**AI 引导决策树(5 步闭环)**:
|
|
137
|
+
|
|
138
|
+
1. **读 staging meta** —— 让 CLI 帮拿(`teamix-evo ui update` 输出 staging 路径),打开 `.teamix-evo/.upgrade-staging/<latest-ui-*>/meta.json` 阅读所有 entries 的 `id` / `recommendedModes` / `confidence` / `reasons` / `featureVector`。
|
|
139
|
+
2. **按主模式分组展示** —— 取每个 entry 的第一个 mode 作为分组键;列表给用户:
|
|
140
|
+
- `Coexist (3): button, dialog, dropdown-menu` → 双轨并存,会改 import 路径
|
|
141
|
+
- `Wrapper+Preset (2): card, badge` → 业务包装 + 默认值
|
|
142
|
+
- `TokenOnly (4): separator, label, ...` → 只需改 tokens.overrides.css
|
|
143
|
+
- `ManualReview (1): table` → 置信度 < 0.6,需要用户先看 diff
|
|
144
|
+
3. **每组逐一询问** —— 对每组先展示 `current.tsx` ↔ `incoming.tsx` 关键 diff(用户要看才展),再问"是否按推荐模式 promote?yes/no/调整模式"。
|
|
145
|
+
- 用户改模式时复述新 mode list,再调 `--modes` 参数。
|
|
146
|
+
- `Coexist` 分组要明确告诉用户:默认**不**重写既有 `import .../ui/<id>` 引用,加 `--migrate-imports` 才统改为 `legacy-<id>`。
|
|
147
|
+
4. **逐组调 promote-to-biz** —— 每组一次命令调用,传该组所有 id;先 `--dry-run` 看 FileChange 四桶(new/modified/deleted/backed-up),用户 OK 后去 dry-run 真写。
|
|
148
|
+
5. **收尾输出未处理 + import skipped 清单** —— 命令结束后复述:
|
|
149
|
+
- `manualReview: [...]` 让用户人工抉择(看 diff 或拆 family)
|
|
150
|
+
- `tokenOnly: [...]` 引导走 `tokens audit`
|
|
151
|
+
- `importRewrite.skipped: [{file, line, reason}]` 列出动态 import / 别名 export / 模板字符串这些 regex 重写不到的位置,让用户人工处理
|
|
152
|
+
- `failed: [...]`(如果有)逐条说明失败原因
|
|
153
|
+
|
|
154
|
+
**身份划分清单**:
|
|
155
|
+
|
|
156
|
+
- **CLI(`ui promote-to-biz`)**:执行备份、写 `business/`、回填 `ui/`、按 spec 重写 `src/**` 静态 import、改 manifest。
|
|
157
|
+
- **AI(本 skill)**:读 meta、分组、展示 diff、征用户同意、转命令;**不**自己写文件、**不**自己改 import。
|
|
158
|
+
- **[update-component-staging.md](update-component-staging.md)**:管 §3 staging → src 的 1:1 替换;**不**做模式分流,本场景才做。
|
|
159
|
+
|
|
160
|
+
**不要**:
|
|
161
|
+
|
|
162
|
+
- 不要绕过 staging 直接调 `promote-to-biz`:CLI 拒收(命令依赖 staging meta)。
|
|
163
|
+
- 不要把 `Coexist` 当 `Replace` 用:默认双轨,旧 import **不**自动迁移,要 `--migrate-imports`。
|
|
164
|
+
- 不要忽略 `importRewrite.skipped`:那批位置 CLI 故意放弃,必须告诉用户人工处理。
|
|
165
|
+
- 不要建议用户手改 `manifest.json`:promoted 登记由 CLI 写,污染了走 `restore`。
|
|
166
|
+
|
|
167
|
+
## §5 · AGENTS.md 自动刷新
|
|
168
|
+
|
|
169
|
+
AGENTS.md 中的 managed 区段(`<!-- teamix-evo:managed:start id="teamix-evo-skills" -->`)由 CLI 自动维护,用户无需手动操作。
|
|
170
|
+
|
|
171
|
+
**自动刷新时机**:
|
|
172
|
+
|
|
173
|
+
- `skills update` — 更新 skill 后立即用当前 variant + 所有 project-scope skill ids 重生 managed 区段
|
|
174
|
+
- `switch` — 切 variant 后用新 variant + 当前 project-scope skill ids 重生 managed 区段
|
|
175
|
+
|
|
176
|
+
刷新使用 `mode: 'merge-managed'`,只替换 managed 区段内容,用户在 managed 区段外的自定义笔记不受影响。
|
|
177
|
+
|
|
178
|
+
**异常处理**:AGENTS.md 刷新是非关键步骤,失败只输出 warn 日志,不影响主流程返回值。
|
|
179
|
+
|
|
180
|
+
**手动触发**:如果 AGENTS.md 缺失或 managed 区段被意外删除,跑 `teamix-evo init`(幂等,会跳过已完成步骤,只重生缺失部分)。
|
|
181
|
+
|
|
182
|
+
## §6 · lint 规则包版本检测
|
|
183
|
+
|
|
184
|
+
`@teamix-evo/eslint-config` 和 `@teamix-evo/stylelint-config` 是 npm devDependencies,由用户的包管理器管理版本。
|
|
185
|
+
|
|
186
|
+
**升级方式**:
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
pnpm update @teamix-evo/eslint-config @teamix-evo/stylelint-config
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
**`teamix-evo update` 报告**会展示:
|
|
193
|
+
|
|
194
|
+
- 当前已安装的 lint 包版本
|
|
195
|
+
- 升级提示命令
|
|
196
|
+
|
|
197
|
+
**config 文件(`eslint.config.js` / `stylelint.config.cjs`)是用户所有**,CLI 不会在 update 流程中覆盖或修改。如果 lint 包大版本升级导致 config 格式变化,由 AI skill 引导用户手动迁移。
|
|
198
|
+
|
|
199
|
+
## §7 · config.json / manifest.json schema 迁移
|
|
200
|
+
|
|
201
|
+
**config.json**(`.teamix-evo/config.json`)已建立 read-time migration 模式:
|
|
202
|
+
|
|
203
|
+
- `ProjectConfigSchema` 使用 `z.discriminatedUnion('schemaVersion', [V1, V2]).transform()` 实现 v1→v2 自动迁移
|
|
204
|
+
- CLI 每次读取 config 时自动升级,写回时用最新 schema version
|
|
205
|
+
- 用户无感,无需手动操作
|
|
206
|
+
|
|
207
|
+
**manifest.json**(`.teamix-evo/manifest.json`)当前 v1,暂无 migration 需求。未来版本变更时沿用 config.json 的 Zod discriminatedUnion + transform 模式。
|
|
208
|
+
|
|
209
|
+
**开发者参考**:新增 schema 版本时:
|
|
210
|
+
|
|
211
|
+
1. 新建 `ProjectConfigV3Schema`(或 `InstalledManifestV2Schema`)
|
|
212
|
+
2. 在 discriminatedUnion 里加入新版本
|
|
213
|
+
3. transform 里加 v(N-1)→vN 迁移链
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
# Brand — OpenTrek 视觉调性 + 文案语气 + 正反例
|
|
2
|
-
|
|
3
|
-
> OpenTrek 服务于运维与平台管理场景。本文是品牌定标尺:所有视觉、文案决策不应越过这里定义的边界。
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## 1. 视觉风格五维
|
|
8
|
-
|
|
9
|
-
| 维度 | 定位 | 具体表现 | 对立面(禁止) |
|
|
10
|
-
| ------------ | -------- | ---------------------------------------------------------------------------------- | -------------------- |
|
|
11
|
-
| **色彩情绪** | 沉稳专业 | 品牌主色 `#0055EE` (hsl(218.6 100% 46.7%)) + 高对比信息层级 | 花哨多彩、渐变堆叠 |
|
|
12
|
-
| **信息密度** | 高效紧凑 | 单屏承载核心操作,减少翻页 | 大面积留白、装饰占位 |
|
|
13
|
-
| **视觉层次** | 克制有序 | 间距、字重、色彩建立 3 级层级 | 多重强调、全部高亮 |
|
|
14
|
-
| **交互反馈** | 即时确定 | 操作后 200ms 内明确反馈 | 模糊状态、静默 |
|
|
15
|
-
| **圆角风格** | 中圆角 | OpenTrek v4.1:`rounded-md` (8px) / `rounded-lg` (12px);legacy `rounded-sm` (4px) | 全直角、超大圆角 |
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
## 2. 情感矩阵
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
可信赖 ████████████████████ 95% ← 不可让步
|
|
23
|
-
高效率 ███████████████████░ 90% ← 不可让步
|
|
24
|
-
专业感 ██████████████████░░ 85%
|
|
25
|
-
现代感 ████████████████░░░░ 75%
|
|
26
|
-
亲和力 ███████████░░░░░░░░░ 55% ← 次要,不刻意追求
|
|
27
|
-
趣味性 ████░░░░░░░░░░░░░░░░ 20% ← 极度克制
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
> "可信赖" 与 "高效率" 是不能让步的两根支柱。"亲和力" 与 "趣味性" 刻意低,避免在严肃场景产生轻浮感。
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
## 3. 品牌个性
|
|
35
|
-
|
|
36
|
-
| 特征 | 描述 | 设计映射 |
|
|
37
|
-
| -------- | ------------------------------ | ------------------------------ |
|
|
38
|
-
| **稳定** | 云基础设施核心诉求是"不出问题" | 一致的布局骨架、可预期的交互 |
|
|
39
|
-
| **透明** | 用户需要知道系统正在做什么 | 状态指示器、进度反馈、操作确认 |
|
|
40
|
-
| **掌控** | 管理员需要"全局在握"的感觉 | 数据概览、筛选能力、批量操作 |
|
|
41
|
-
| **专注** | 运维操作容错率低 | 清晰的信息层级、防误操作确认 |
|
|
42
|
-
|
|
43
|
-
### Moodboard 参考
|
|
44
|
-
|
|
45
|
-
- 开发者控制台:Vercel、Linear、Datadog、PlanetScale
|
|
46
|
-
- 现代企业 SaaS:Notion Admin、Stripe Dashboard
|
|
47
|
-
- 工程化文档:Tailwind / shadcn / Radix UI Docs
|
|
48
|
-
|
|
49
|
-
---
|
|
50
|
-
|
|
51
|
-
## 4. 文案语气总体风格
|
|
52
|
-
|
|
53
|
-
> **精确 > 友好。简短 > 完整。可执行 > 可理解。**
|
|
54
|
-
>
|
|
55
|
-
> 不卖萌、不感叹、不"恭喜你"。所有文案以**"是否帮助用户做下一步决策"**为唯一评价标准。
|
|
56
|
-
|
|
57
|
-
### 4.1 语气矩阵
|
|
58
|
-
|
|
59
|
-
| 场景 | 语气 | ✅ 正例 | ❌ 反例 |
|
|
60
|
-
| ----------- | ---------------- | ---------------------------------- | ---------------------- |
|
|
61
|
-
| 标题 / 导航 | 名词、定语短句 | "实例列表" / "安全组规则" | "你的实例们" |
|
|
62
|
-
| 引导说明 | 简洁、可执行 | "选择资源后,可执行批量操作" | "快来选个资源试试吧~" |
|
|
63
|
-
| 主操作按钮 | 动宾结构、≤ 5 字 | "创建实例" / "释放资源" | "去创建一个新的实例" |
|
|
64
|
-
| 危险按钮 | 名词 + 动作 | "永久删除" / "立即停机" | "确认" / "OK" |
|
|
65
|
-
| 错误提示 | 具体原因 + 建议 | "实例正在运行中,请先停止后再删除" | "操作失败,请重试" |
|
|
66
|
-
| 成功反馈 | 已完成的事实 | "已释放 3 个实例" | "操作成功!🎉" |
|
|
67
|
-
| 空状态 | 解释 + 入口 | "暂无实例。创建第一个实例以开始" | "这里空空如也~" |
|
|
68
|
-
| 加载提示 | 进行时 | "正在加载实例…" | "马上就好~" |
|
|
69
|
-
|
|
70
|
-
### 4.2 写作规范
|
|
71
|
-
|
|
72
|
-
1. **动词在前** — 按钮以动词开头:「创建项目」非「项目创建」
|
|
73
|
-
2. **避免歧义** — 「删除」与「释放」严格区分(删除不可恢复 / 释放进入回收站)
|
|
74
|
-
3. **不省略主语** — 错误信息指出"什么"出错:「实例 i-xxx 启动失败」非「启动失败」
|
|
75
|
-
4. **量词精确** — "已删除 3 项" 而非 "已删除几项"
|
|
76
|
-
5. **主动语态** — "系统已保存配置" 而非 "配置已被系统保存"
|
|
77
|
-
|
|
78
|
-
### 4.3 标点与排版
|
|
79
|
-
|
|
80
|
-
- 按钮文字 / 表头标签:**不加**句号
|
|
81
|
-
- 描述、提示、说明:**完整句子** + 句号
|
|
82
|
-
- 列表项格式统一(全加句号 或 全不加)
|
|
83
|
-
- 中英文 / 中数字之间加 1 空格:`已选 3 项 / 共 128 项`
|
|
84
|
-
- 数字使用半角;区间用 `~`(中文)/ `–`(英文)
|
|
85
|
-
- 时间格式统一:`2026-05-14 10:23:45`(ISO-like)
|
|
86
|
-
|
|
87
|
-
---
|
|
88
|
-
|
|
89
|
-
## 5. 危险操作专用文案(硬约束)
|
|
90
|
-
|
|
91
|
-
破坏性操作(删除、释放、强制重启)必须满足:
|
|
92
|
-
|
|
93
|
-
| 元素 | 规则 | 示例 |
|
|
94
|
-
| -------------------- | ---------------- | ------------------------------------------------------------------------- |
|
|
95
|
-
| **AlertDialog 标题** | 陈述句而非疑问句 | ✅「永久删除实例 i-xxx」 ❌「确定要删除吗?」 |
|
|
96
|
-
| **正文** | 列出具体后果 | ✅「该实例的数据盘将被释放且不可恢复。关联的快照(共 2 个)将一并删除。」 |
|
|
97
|
-
| **确认按钮** | 重复动作动词 | ✅「永久删除」 ❌「确认」 |
|
|
98
|
-
| **取消按钮** | 用「取消」 | ❌「不」/「再想想」 |
|
|
99
|
-
|
|
100
|
-
---
|
|
101
|
-
|
|
102
|
-
## 6. AI 场景文案规则
|
|
103
|
-
|
|
104
|
-
AI 助手在生成回复时遵循:
|
|
105
|
-
|
|
106
|
-
- **不使用**第一人称「我」(避免拟人化)→ 用「OpenTrek AI」或省略主语
|
|
107
|
-
- 操作建议必须给出**确定性** + **量化影响**:「建议将实例规格升级至 ecs.g7.large(预计成本 +¥120/月)」
|
|
108
|
-
- 不确定时**明确表达**:「此问题可能由 A、B 两个原因引起,建议先排查 A」
|
|
109
|
-
- 拒绝执行不可逆操作时给出明确原因 + 替代路径
|
|
110
|
-
|
|
111
|
-
---
|
|
112
|
-
|
|
113
|
-
## 7. 视觉正反例对照
|
|
114
|
-
|
|
115
|
-
### 7.1 布局
|
|
116
|
-
|
|
117
|
-
| ✅ 正例 | ❌ 反例 |
|
|
118
|
-
| ---------------------------------------------------------------- | ---------------------------------------- |
|
|
119
|
-
| ListPage 搜索/筛选固定顶部,表格自适应高度,分页固定底部 | 同一页面同时使用左右两套 Sidebar |
|
|
120
|
-
| 表单左对齐标签,字段按"必填 → 可选"排序,主操作右下角 | 主操作按钮放在一屏之外(需滚动才能看到) |
|
|
121
|
-
| 详情页 Tab 顺序:基本信息 → 监控 → 配置 → 操作日志(按使用频率) | 表单字段按字母顺序排序(忽略业务优先级) |
|
|
122
|
-
|
|
123
|
-
### 7.2 色彩
|
|
124
|
-
|
|
125
|
-
| ✅ 正确 | ❌ 错误 |
|
|
126
|
-
| -------------------------------------------------------------------- | ------------------------------------ |
|
|
127
|
-
| 主色仅用于主行动点(CTA 按钮、当前选中项、品牌标识) | 用主色表示"错误"状态 |
|
|
128
|
-
| 状态色:`destructive` = 错误/删除;绿/黄按业务语义;图表用 `chart-*` | 把 `destructive` 红色用在 Tab 选中态 |
|
|
129
|
-
| 暗色模式直接切换 CSS 变量,不重写组件 | 同一页面 4 种以上"重要"按钮颜色 |
|
|
130
|
-
|
|
131
|
-
### 7.3 动效
|
|
132
|
-
|
|
133
|
-
| ✅ 正确 | ❌ 错误 |
|
|
134
|
-
| -------------------------------------------------------- | ------------------------------------------------------ |
|
|
135
|
-
| Hover 色彩切换 `transition-colors duration-150 ease-out` | 给 width / height / margin 加过渡(性能差 + 布局抖动) |
|
|
136
|
-
| 弹窗入场 `zoom-in-95 + fade-in` 300ms | 整页加载用复杂 Loader + 进度条(用 Skeleton 即可) |
|
|
137
|
-
| Skeleton 占位 → 数据到达后 `fade-in` | 微交互动效超过 200ms(hover 不应让用户等待) |
|
|
138
|
-
|
|
139
|
-
### 7.4 圆角与阴影对应表
|
|
140
|
-
|
|
141
|
-
> **完整对应表见 [foundations.md §6.3 圆角 × 阴影对应表](./foundations.md#63-圆角--阴影对应表)** — 圆角与阴影必须同档对应,这是 foundations 层的语义归一规则,brand 层不再重复。
|
|
142
|
-
|
|
143
|
-
---
|
|
144
|
-
|
|
145
|
-
## 8. 品牌自检
|
|
146
|
-
|
|
147
|
-
- [ ] 文案动词在前,按钮 ≤ 5 字
|
|
148
|
-
- [ ] 错误提示含主语 + 原因 + 建议
|
|
149
|
-
- [ ] 危险操作 AlertDialog 标题用陈述句、按钮用动作动词
|
|
150
|
-
- [ ] 不出现 emoji 表情、感叹号过多、拟人化主语「我」
|
|
151
|
-
- [ ] 主色仅用于 CTA 与当前选中态,不滥用
|
|
152
|
-
- [ ] 圆角阴影同档对应(rounded-md ↔ shadow-sm ↔ rounded-lg ↔ shadow-md/xl)
|
|
153
|
-
- [ ] 动效仅 transition-colors / opacity / transform,禁 width/height/margin
|
|
154
|
-
- [ ] 中英文之间有空格,时间格式统一 ISO-like
|