@aibyzero/byz 0.1.1 → 0.1.3
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/CHANGELOG.md +20 -0
- package/README.md +34 -24
- package/dist/cli.js +22 -14
- package/dist/core/export-html/template.css +1066 -0
- package/dist/core/export-html/template.html +55 -0
- package/dist/core/export-html/template.js +1864 -0
- package/dist/core/export-html/vendor/highlight.min.js +1213 -0
- package/dist/core/export-html/vendor/marked.min.js +78 -0
- package/dist/fast.js +64 -0
- package/dist/modes/interactive/assets/clankolas.png +0 -0
- package/dist/modes/interactive/theme/dark.json +90 -0
- package/dist/modes/interactive/theme/light.json +89 -0
- package/dist/modes/interactive/theme/theme-schema.json +352 -0
- package/dist/runtime/bundle/chunks/{chunk-CCRJHU72.js → chunk-QY7DJQRI.js} +2 -2
- package/dist/runtime/bundle/chunks/github-copilot.js +1 -1
- package/dist/runtime/bundle/cli.js +1 -1
- package/dist/runtime/bundle/index.js +1 -1
- package/dist/runtime/bundle/rpc-entry.js +1 -1
- package/dist/runtime/core/resource-loader.d.ts +1 -0
- package/dist/runtime/core/resource-loader.d.ts.map +1 -1
- package/dist/runtime/core/resource-loader.js +8 -3
- package/dist/runtime/core/resource-loader.js.map +1 -1
- package/dist/workflows.js +4 -131
- package/package.json +2 -1
- package/workflows/cm-plugin/LICENSE +21 -0
- package/workflows/cm-plugin/README.md +195 -0
- package/workflows/cm-plugin/VERSION +1 -0
- package/workflows/cm-plugin/agents/cm-plugin-backend-agent.md +34 -0
- package/workflows/cm-plugin/agents/cm-plugin-extension-agent.md +35 -0
- package/workflows/cm-plugin/agents/cm-plugin-ui-agent.md +34 -0
- package/workflows/cm-plugin/commands/cm-plugin-ai-nodes/N1-init.md +60 -0
- package/workflows/cm-plugin/commands/cm-plugin-ai-nodes/N2-enter-feature.md +51 -0
- package/workflows/cm-plugin/commands/cm-plugin-ai-nodes/N3-execute-task.md +32 -0
- package/workflows/cm-plugin/commands/cm-plugin-ai-nodes/N4-review.md +58 -0
- package/workflows/cm-plugin/commands/cm-plugin-ai-nodes/N5-mark-done.md +80 -0
- package/workflows/cm-plugin/commands/cm-plugin-ai-nodes/N6-qa-eval.md +69 -0
- package/workflows/cm-plugin/commands/cm-plugin-ai-nodes/N7-context.md +23 -0
- package/workflows/cm-plugin/commands/cm-plugin-ai-nodes/N8-finish.md +61 -0
- package/workflows/cm-plugin/commands/cm-plugin-prd-modes/brownfield.md +13 -0
- package/workflows/cm-plugin/commands/cm-plugin-prd-modes/change-mode.md +130 -0
- package/workflows/cm-plugin/commands/cm-plugin-prd-modes/greenfield.md +82 -0
- package/workflows/cm-plugin/commands/cm-plugin:ai.md +75 -0
- package/workflows/cm-plugin/commands/cm-plugin:check.md +66 -0
- package/workflows/cm-plugin/commands/cm-plugin:fix.md +100 -0
- package/workflows/cm-plugin/commands/cm-plugin:idea.md +29 -0
- package/workflows/cm-plugin/commands/cm-plugin:init.md +145 -0
- package/workflows/cm-plugin/commands/cm-plugin:prd.md +403 -0
- package/workflows/cm-plugin/commands/cm-plugin:refactor.md +147 -0
- package/workflows/cm-plugin/commands/cm-plugin:rewrite.md +90 -0
- package/workflows/cm-plugin/commands/cm-plugin:scout.md +202 -0
- package/workflows/cm-plugin/docs//346/265/213/350/257/225/346/214/207/345/274/225-/345/277/253/351/200/237/344/270/212/346/211/213.md +189 -0
- package/workflows/cm-plugin/docs//351/207/215/346/236/204/346/265/201/347/250/213/350/256/276/350/256/241/README.md +17 -0
- package/workflows/cm-plugin/docs//351/207/215/346/236/204/346/265/201/347/250/213/350/256/276/350/256/241/refactor-flow.excalidraw +3650 -0
- package/workflows/cm-plugin/docs//351/207/215/346/236/204/346/265/201/347/250/213/350/256/276/350/256/241/refactor-flow.mp4 +0 -0
- package/workflows/cm-plugin/docs//351/207/215/346/236/204/346/265/201/347/250/213/350/256/276/350/256/241/refactor-flow.png +0 -0
- package/workflows/cm-plugin/docs//351/207/215/346/236/204/346/265/201/347/250/213/350/256/276/350/256/241/refactor-flow.spec.json +223 -0
- package/workflows/cm-plugin/package.json +33 -0
- package/workflows/cm-plugin/skills/cm-plugin-backend-engineer/SKILL.md +100 -0
- package/workflows/cm-plugin/skills/cm-plugin-devops-engineer/NOTICE.md +14 -0
- package/workflows/cm-plugin/skills/cm-plugin-devops-engineer/SKILL.md +120 -0
- package/workflows/cm-plugin/skills/cm-plugin-devops-engineer/references/cws-ci-cd.md +139 -0
- package/workflows/cm-plugin/skills/cm-plugin-devops-engineer/references/cws-submission-checklist.md +87 -0
- package/workflows/cm-plugin/skills/cm-plugin-doc-syncer/SKILL.md +149 -0
- package/workflows/cm-plugin/skills/cm-plugin-extension-engineer/SKILL.md +105 -0
- package/workflows/cm-plugin/skills/cm-plugin-product-manager/SKILL.md +83 -0
- package/workflows/cm-plugin/skills/cm-plugin-qa-engineer/NOTICE.md +14 -0
- package/workflows/cm-plugin/skills/cm-plugin-qa-engineer/SKILL.md +134 -0
- package/workflows/cm-plugin/skills/cm-plugin-qa-engineer/references/cws-scan-checklist.md +136 -0
- package/workflows/cm-plugin/skills/cm-plugin-qa-engineer/references/cws-violation-codes.md +68 -0
- package/workflows/cm-plugin/skills/cm-plugin-ui-engineer/SKILL.md +94 -0
- package/workflows/cm-plugin/skills/codebase-context/SKILL.md +489 -0
- package/workflows/cm-plugin/skills/darwin-skill/NOTICE.md +24 -0
- package/workflows/cm-plugin/skills/darwin-skill/README.md +272 -0
- package/workflows/cm-plugin/skills/darwin-skill/SKILL.md +492 -0
- package/workflows/cm-plugin/skills/darwin-skill/references/runtime-neutrality.md +68 -0
- package/workflows/cm-plugin/skills/darwin-skill/references/skilllens-evidence.md +142 -0
- package/workflows/cm-plugin/skills/darwin-skill/scripts/screenshot.mjs +71 -0
- package/workflows/cm-plugin/skills/darwin-skill/templates/result-card-dark.html +698 -0
- package/workflows/cm-plugin/skills/darwin-skill/templates/result-card-white.html +444 -0
- package/workflows/cm-plugin/skills/darwin-skill/templates/result-card.html +616 -0
- package/workflows/cm-plugin/skills/idea-to-prd/SKILL.md +289 -0
- package/workflows/cm-plugin/skills/idea-to-prd/references/domains/trading.md +97 -0
- package/workflows/cm-plugin/skills/idea-to-prd/references/example-prd.md +92 -0
- package/workflows/cm-plugin/templates/arch-reference.md +55 -0
- package/workflows/cm-plugin/templates/auto-update/cm-announce.sh +19 -0
- package/workflows/cm-plugin/templates/auto-update/cm-update.sh +251 -0
- package/workflows/cm-plugin/templates/dashboard/dashboard.html +153 -0
- package/workflows/cm-plugin/templates/dashboard/serve.sh +10 -0
- package/workflows/cm-plugin/templates/e2e/extension-harness.ts +110 -0
- package/workflows/cm-plugin/templates/e2e/smoke.spec.example.ts +51 -0
- package/workflows/cm-plugin/templates/hooks/pre-commit-cm-task-check +33 -0
- package/workflows/cm-plugin/templates/pixel/cm-pixel.html +388 -0
- package/workflows/cm-plugin/templates/pixel/cm-pixel.sh +212 -0
- package/workflows/cm-plugin/templates/pixel/dev/README.md +20 -0
- package/workflows/cm-plugin/templates/pixel/dev/atlas-preview.png +0 -0
- package/workflows/cm-plugin/templates/pixel/dev/build.py +55 -0
- package/workflows/cm-plugin/templates/pixel/dev/sheets/roguelikeChar_transparent.png +0 -0
- package/workflows/cm-plugin/templates/pixel/dev/sheets/roguelikeCity_tilemap.png +0 -0
- package/workflows/cm-plugin/templates/pixel/dev/sheets/roguelikeIndoor_transparent.png +0 -0
- package/workflows/cm-plugin/templates/pixel/dev/template.html +388 -0
- package/workflows/cm-plugin/templates/pixel/serve.sh +12 -0
- package/workflows/cm-plugin/templates/refactor/cm-refactor-denies.json +14 -0
- package/workflows/cm-plugin/templates/rules/backend-api.md +36 -0
- package/workflows/cm-plugin/templates/rules/chrome-extension.md +53 -0
- package/workflows/cm-plugin/templates/rules/coding-style.md +44 -0
- package/workflows/cm-plugin/templates/rules/frontend.md +32 -0
- package/workflows/cm-plugin/templates/rules/git-workflow.md +25 -0
- package/workflows/cm-plugin/templates/rules/security.md +31 -0
- package/workflows/cm-plugin/templates/rules/testing.md +36 -0
- package/workflows/cm-plugin/templates/scripts/cm-plugin-codex.sh +52 -0
- package/workflows/cm-plugin/templates/scripts/cm-plugin-log.sh +41 -0
- package/workflows/cm-plugin/templates/scripts/cm-plugin-preflight.sh +60 -0
- package/workflows/cm-plugin/templates/statusline/cm-plugin-statusline.sh +73 -0
- package/workflows.lock.json +4 -3
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# Scan Checklist — Detection Patterns
|
|
2
|
+
|
|
3
|
+
Run these grep/search patterns against the extension source code.
|
|
4
|
+
|
|
5
|
+
## 1. Remote Code Execution (Blue Argon) — CRITICAL
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# External script tags
|
|
9
|
+
grep -rn '<script.*src=.*http' src/ --include="*.html"
|
|
10
|
+
# eval usage
|
|
11
|
+
grep -rn 'eval(' src/ --include="*.ts" --include="*.js" --include="*.tsx"
|
|
12
|
+
# Function constructor
|
|
13
|
+
grep -rn 'new Function(' src/ --include="*.ts" --include="*.js"
|
|
14
|
+
# Dynamic import from URL
|
|
15
|
+
grep -rn "import(.*http" src/ --include="*.ts" --include="*.js"
|
|
16
|
+
# fetch + eval pattern
|
|
17
|
+
grep -rn "fetch.*then.*eval\|fetch.*\.text().*Function" src/
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
**Pass if**: Zero matches.
|
|
21
|
+
|
|
22
|
+
## 2. Code Obfuscation (Red Titanium) — CRITICAL
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# Base64 encoded strings (long ones, >100 chars)
|
|
26
|
+
grep -rn "atob\|btoa" src/ --include="*.ts" --include="*.js"
|
|
27
|
+
# String.fromCharCode patterns
|
|
28
|
+
grep -rn "String\.fromCharCode" src/ --include="*.ts" --include="*.js"
|
|
29
|
+
# Hex-encoded strings
|
|
30
|
+
grep -rn '\\x[0-9a-f]\{2\}\\x[0-9a-f]\{2\}' src/
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**Pass if**: Zero matches or justified usage (e.g., atob for JWT decoding — note in report).
|
|
34
|
+
|
|
35
|
+
## 3. Excessive Permissions (Purple Potassium) — HIGH
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# List all declared permissions
|
|
39
|
+
cat manifest.json | jq '.permissions, .host_permissions, .optional_permissions'
|
|
40
|
+
# Check for <all_urls>
|
|
41
|
+
grep -n '<all_urls>\|*://*/*' manifest.json
|
|
42
|
+
# Check for broad host permissions
|
|
43
|
+
grep -n '"http" | "https"' manifest.json
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Then**: For each permission, grep source code for its API usage. Flag unused permissions.
|
|
47
|
+
|
|
48
|
+
| Permission | Verify usage of |
|
|
49
|
+
|------------|----------------|
|
|
50
|
+
| `tabs` | `chrome.tabs.query` (URL/title access) |
|
|
51
|
+
| `history` | `chrome.history.*` |
|
|
52
|
+
| `bookmarks` | `chrome.bookmarks.*` |
|
|
53
|
+
| `cookies` | `chrome.cookies.*` |
|
|
54
|
+
| `webRequest` | `chrome.webRequest.*` |
|
|
55
|
+
| `downloads` | `chrome.downloads.*` |
|
|
56
|
+
|
|
57
|
+
## 4. Missing Privacy Policy (Purple Lithium) — HIGH
|
|
58
|
+
|
|
59
|
+
Check if extension collects any user data:
|
|
60
|
+
```bash
|
|
61
|
+
# Storage of user data
|
|
62
|
+
grep -rn "chrome\.storage\|localStorage\|indexedDB" src/
|
|
63
|
+
# Network requests (might send data)
|
|
64
|
+
grep -rn "fetch(\|XMLHttpRequest\|axios\|\.post(" src/
|
|
65
|
+
# Identity/auth
|
|
66
|
+
grep -rn "chrome\.identity\|chrome\.cookies" src/
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**If any match**: Privacy policy is REQUIRED. Check manifest for `"privacy_policy"` field.
|
|
70
|
+
|
|
71
|
+
## 5. Missing Metadata (Yellow Zinc) — HIGH
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# Check manifest has required fields
|
|
75
|
+
cat manifest.json | jq '{name, description, icons, version}'
|
|
76
|
+
# Check icon files exist
|
|
77
|
+
for size in 16 48 128; do ls icons/icon${size}.png 2>/dev/null || echo "MISSING: icon${size}.png"; done
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**Also verify**: Description is meaningful (not generic), icons are non-placeholder.
|
|
81
|
+
|
|
82
|
+
## 6. Single Purpose (Red Magnesium) — HIGH
|
|
83
|
+
|
|
84
|
+
Read manifest `description` and all entrypoints. Flag if:
|
|
85
|
+
- Multiple unrelated features (e.g., ad blocker + weather widget)
|
|
86
|
+
- New tab override doing unrelated things
|
|
87
|
+
- Content scripts on `<all_urls>` without clear single purpose
|
|
88
|
+
|
|
89
|
+
## 7. Insecure Data Transmission (Purple Copper) — HIGH
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
# HTTP URLs (not HTTPS)
|
|
93
|
+
grep -rn "http://" src/ --include="*.ts" --include="*.js" | grep -v "localhost\|127\.0\.0\.1"
|
|
94
|
+
# Sensitive data in URL params
|
|
95
|
+
grep -rn "password=\|token=\|key=\|secret=" src/ | grep -v ".env\|config"
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## 8. Keyword Stuffing (Yellow Argon) — MEDIUM
|
|
99
|
+
|
|
100
|
+
Check manifest `description` and `name` for:
|
|
101
|
+
- Repeated keywords
|
|
102
|
+
- List of competitor names
|
|
103
|
+
- Unrelated buzzwords
|
|
104
|
+
|
|
105
|
+
## 9. Minimum Functionality (Yellow Potassium) — MEDIUM
|
|
106
|
+
|
|
107
|
+
Flag if:
|
|
108
|
+
- Only `manifest.json` and icons exist (no JS/TS)
|
|
109
|
+
- Extension only opens an external URL
|
|
110
|
+
- Popup just shows a link to a website
|
|
111
|
+
|
|
112
|
+
## 10. Crypto Mining (Grey Silicon) — CRITICAL
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
grep -rn "coinhive\|cryptonight\|mineralt\|webminer\|coin-hive" src/
|
|
116
|
+
grep -rn "WebAssembly.*mining\|hashrate\|nonce.*increment" src/
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## 11. Copyright Circumvention (Blue Zinc) — CRITICAL
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
# Video/audio download patterns
|
|
123
|
+
grep -rn "youtube.*download\|download.*video\|saveAs.*blob" src/
|
|
124
|
+
grep -rn "paywall\|bypass.*subscription\|unlock.*premium" src/
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## 12. Data Collection Without Consent (Purple Nickel) — HIGH
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
# Browsing history collection
|
|
131
|
+
grep -rn "chrome\.history\|chrome\.webNavigation" src/
|
|
132
|
+
# Tab URL tracking
|
|
133
|
+
grep -rn "chrome\.tabs\.onUpdated\|tab\.url" src/
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
If found, verify: Is consent dialog shown before collection?
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Chrome Web Store Violation Codes
|
|
2
|
+
|
|
3
|
+
Reference: https://developer.chrome.com/docs/webstore/troubleshooting
|
|
4
|
+
|
|
5
|
+
## CRITICAL — Immediate Rejection
|
|
6
|
+
|
|
7
|
+
| Code | Name | Description |
|
|
8
|
+
|------|------|-------------|
|
|
9
|
+
| Blue Argon | Remote Code Execution | eval(), external scripts, remote code loading |
|
|
10
|
+
| Red Titanium | Code Obfuscation | Base64 encoding, char encoding (minification OK) |
|
|
11
|
+
| Grey Silicon | Cryptocurrency Mining | Mining on user machines |
|
|
12
|
+
| Blue Zinc | Copyright Circumvention | Paywall bypass, video downloaders |
|
|
13
|
+
| Blue Copper | Unauthorized Downloads | Facilitating piracy |
|
|
14
|
+
| Blue Titanium | Enforcement Circumvention | Evading review process |
|
|
15
|
+
|
|
16
|
+
## HIGH — Very Likely Rejection
|
|
17
|
+
|
|
18
|
+
| Code | Name | Description |
|
|
19
|
+
|------|------|-------------|
|
|
20
|
+
| Purple Potassium | Excessive Permissions | Requesting unused or unnecessary permissions |
|
|
21
|
+
| Purple Lithium | Missing Privacy Policy | Collecting data without privacy policy |
|
|
22
|
+
| Yellow Zinc | Missing Metadata | No icons, description, or screenshots |
|
|
23
|
+
| Red Magnesium | Single Purpose Violation | Multiple unrelated features |
|
|
24
|
+
| Red Nickel | Deceptive Behavior | Functionality doesn't match description |
|
|
25
|
+
| Red Copper | Impersonation | Copying other extensions or brands |
|
|
26
|
+
| Purple Copper | Insecure Transmission | Sending user data over HTTP |
|
|
27
|
+
| Purple Nickel | No Data Disclosure | Collecting data without consent |
|
|
28
|
+
| Purple Magnesium | Data Handling Violation | Unnecessary browsing activity collection |
|
|
29
|
+
| Red Zinc | Deceptive Installation | Misleading marketing or CTAs |
|
|
30
|
+
| Yellow Magnesium | Non-Functional | Extension doesn't work as described |
|
|
31
|
+
|
|
32
|
+
## MEDIUM — May Cause Rejection
|
|
33
|
+
|
|
34
|
+
| Code | Name | Description |
|
|
35
|
+
|------|------|-------------|
|
|
36
|
+
| Yellow Argon | Keyword Stuffing | Spam keywords in metadata |
|
|
37
|
+
| Yellow Potassium | Minimum Functionality | No real value or features |
|
|
38
|
+
| Yellow Nickel | Spam | Duplicate extensions, fake reviews |
|
|
39
|
+
| Yellow Lithium | Redirection Only | Just launches another app/site |
|
|
40
|
+
| Grey Titanium | Undisclosed Affiliates | Hidden affiliate links |
|
|
41
|
+
| Blue Nickel | Override API Bypass | Modifying new tab without Overrides API |
|
|
42
|
+
|
|
43
|
+
## CONTENT — Content Policy
|
|
44
|
+
|
|
45
|
+
| Code | Name | Description |
|
|
46
|
+
|------|------|-------------|
|
|
47
|
+
| Grey Zinc | Illegal Activities | Facilitating illegal activities |
|
|
48
|
+
| Grey Copper | Online Gambling | Gambling functionality |
|
|
49
|
+
| Grey Lithium | Pornographic Content | Sexually explicit material |
|
|
50
|
+
| Grey Magnesium | Hate Content | Hate speech or discrimination |
|
|
51
|
+
| Grey Nickel | Non-Family-Safe | Adult content without "Mature" flag |
|
|
52
|
+
| Grey Potassium | Violent Content | Gratuitous violence or harassment |
|
|
53
|
+
|
|
54
|
+
## Appeal Process
|
|
55
|
+
|
|
56
|
+
1. Review rejection email for specific violation code
|
|
57
|
+
2. Fix ALL identified issues
|
|
58
|
+
3. Submit appeal via Chrome Web Store Developer Dashboard
|
|
59
|
+
4. Provide detailed explanation of changes made
|
|
60
|
+
5. Typical response time: 1-3 business days
|
|
61
|
+
|
|
62
|
+
## Key Rules
|
|
63
|
+
|
|
64
|
+
- **Minification is OK** (webpack/vite output) — obfuscation is NOT
|
|
65
|
+
- **activeTab > host_permissions** — always prefer narrowest permission
|
|
66
|
+
- **Privacy policy required** if ANY user data is collected/transmitted
|
|
67
|
+
- **Single purpose**: one clear, defined functionality per extension
|
|
68
|
+
- **Description must match** actual functionality exactly
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cm-plugin-ui-engineer
|
|
3
|
+
description: UI 还原工程师 Skill,把已确认的设计基准像素级还原为生产代码(token 先行、原子顺序、按交付形态量化验收:Web 用 BackstopJS、App 用 Maestro+模拟器截图);有基准才出场,不做业务逻辑
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# cm-plugin-ui-engineer — UI 还原工程师
|
|
7
|
+
|
|
8
|
+
把设计基准工程化还原进项目代码库。**管"像不像",不管"能不能用"**——业务逻辑、状态、API 归 cm-plugin-extension-engineer。
|
|
9
|
+
|
|
10
|
+
## 出场条件(有基准才出场)
|
|
11
|
+
|
|
12
|
+
仅当 feature 存在**已确认的设计基准**(`specs/{N}.{feature}/design-baseline/`,由 /cm-plugin:prd 阶段生成并经人审规格确认)时,才生成和执行 UI 还原任务。无基准 → 本角色不出场,UI 由前端按现有行为实现。
|
|
13
|
+
|
|
14
|
+
**执行期零决策**:方向确认已在规格期完成(人审规格时看过原型/基准),本 skill 执行时不得中途向用户征求设计意见;发现基准缺失或矛盾 → 上报,不脑补。
|
|
15
|
+
|
|
16
|
+
## 职责边界
|
|
17
|
+
|
|
18
|
+
- **管**:design token、纯展示组件(props 驱动)、静态页面结构、样式、资产、像素级验收
|
|
19
|
+
- **不管**:业务逻辑/状态/API(→ cm-plugin-extension-engineer)、设计基准生成(→ /cm-plugin:prd 阶段)
|
|
20
|
+
- **契约**:组件契约(组件名 / props / 事件)写在 design.md,与前端的交接以此为准,适用三级契约协议(只报不改)
|
|
21
|
+
|
|
22
|
+
## 工作流程
|
|
23
|
+
|
|
24
|
+
### 1. 读取基准
|
|
25
|
+
|
|
26
|
+
- `specs/{N}.{feature}/design-baseline/`:截图、导出的 HTML/CSS、token 提取物
|
|
27
|
+
- design.md 的组件契约与基准路径
|
|
28
|
+
- **不得修改基准文件**;基准与需求矛盾 → 上报
|
|
29
|
+
|
|
30
|
+
### 2. Token 先行(共享状态纪律)
|
|
31
|
+
|
|
32
|
+
先建立/对齐 design token(颜色、间距、字号、圆角、阴影 → Tailwind theme 或 CSS 变量),后续所有组件**只引用 token,不写裸值**。
|
|
33
|
+
|
|
34
|
+
**token 是跨 feature 共享状态**:
|
|
35
|
+
|
|
36
|
+
- 新增 token → 自由添加
|
|
37
|
+
- **修改既有 token 值 → 按契约偏差处理**:写入汇报「契约相关」栏,由主流程评估波及的已完成页面,必要时问人——绝不默默改(一个颜色值的变更会让已验收页面全部变样)
|
|
38
|
+
|
|
39
|
+
### 3. 原子顺序还原
|
|
40
|
+
|
|
41
|
+
token → 基础组件(按钮/输入框/标签)→ 组合组件(卡片/表单)→ 页面。不跳级——页面还原中发现缺基础组件,先补组件再拼页面。
|
|
42
|
+
|
|
43
|
+
- 遵循项目组件目录约定,新组件入公共目录确保复用
|
|
44
|
+
- 组件纯 props 驱动,不含业务逻辑;接口与 design.md 组件契约一致
|
|
45
|
+
- 响应式:按基准标注的断点逐档实现,未标注的断点行为上报确认(规格期遗漏的补充问题)
|
|
46
|
+
|
|
47
|
+
### 4. 交互态核对
|
|
48
|
+
|
|
49
|
+
对照基准中的状态设计(hover / active / disabled / loading / 空态 / 错误态)逐一实现。基准缺失的状态 → 上报(规格期应已确认过一轮,执行期仍缺失说明规格有洞)。
|
|
50
|
+
|
|
51
|
+
### 5. 反 AI slop 与品牌资产纪律
|
|
52
|
+
|
|
53
|
+
- **品牌资产协议**:logo、品牌色、字体一律使用基准中的真实资产文件,**禁止凭记忆编造色值或找相似替代**
|
|
54
|
+
- **反 AI slop 清单**(无基准细节可依时的兜底审美纪律):不用紫蓝渐变默认色、不用 emoji 充当图标、不无脑圆角+阴影卡片、间距用 token 刻度不用随机值
|
|
55
|
+
|
|
56
|
+
### 6. 量化验收(按 CLAUDE.md 交付形态选链,二选一)
|
|
57
|
+
|
|
58
|
+
**popup / options / side panel 等浏览器可渲染表面 —— BackstopJS 链:**
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
npx backstop test # reference = design-baseline 截图, test = 还原页面截图
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
- **默认 mismatch ≤ 1%**(`.claude/rules/` 有规定时以 rules 为准)
|
|
65
|
+
- 特殊效果(复杂渐变、毛玻璃、动效帧)白名单制:列明白名单项及理由,其余差异修复后复测
|
|
66
|
+
- 逐断点跑一遍;差异报告随任务汇报输出,供 N6 可视化回归复用
|
|
67
|
+
- **像素基准档的交互验收**:按 design.md 提取的交互走查清单逐条 E2E 断言(跳转目标、状态切换、操作反馈)——**UI 像了但交互不 1:1,同样是验收失败**
|
|
68
|
+
|
|
69
|
+
**App(React Native / Expo)—— Maestro 链:**
|
|
70
|
+
|
|
71
|
+
App 产物不在浏览器里,BackstopJS/Playwright 不适用;react-native-web 的浏览器渲染只可用于开发期快速目检,**不作为任何验收证据**。
|
|
72
|
+
|
|
73
|
+
- **交互验收**:Maestro flow(YAML)逐条断言 design.md 的交互走查清单(跳转目标、状态切换、操作反馈),在 iOS/Android 模拟器上执行
|
|
74
|
+
- **像素验收**:Maestro `takeScreenshot` 采集模拟器截图,与 design-baseline 截图分辨率对齐后逐屏对比(odiff/pixelmatch,默认 mismatch ≤ 1%,白名单制同上)
|
|
75
|
+
- **环境降级**:本机无模拟器或装不上 Maestro → 上报并降级为 Expo Go 真机人工对照(并排截图发人确认),METRICS 备注"App 像素验收降级"——**不得静默改用浏览器截图充当验收**
|
|
76
|
+
|
|
77
|
+
**两条链共同要求**:**首个页面任务的汇报必须附"实现 vs 基准"并排截图**(App 形态截图必须来自模拟器/真机)——人眼对照点前置到第一个页面完成时,不等全部做完(历史事故教训)
|
|
78
|
+
|
|
79
|
+
## 常见坑
|
|
80
|
+
|
|
81
|
+
| 问题 | 处理 |
|
|
82
|
+
| ---- | ---- |
|
|
83
|
+
| 改全局 token 导致已验收页面变样 | 修改既有 token 值必须走契约偏差上报,不默默改 |
|
|
84
|
+
| 硬编码 hex/px 绕过 token | 全部走 token 引用,review 时 grep 裸值 |
|
|
85
|
+
| 字体渲染差异导致像素对比误报 | 对比容器锁定字体与尺寸,阈值内噪声不追 |
|
|
86
|
+
| 只还原了理想态 | 交互态清单逐项核对,缺失上报 |
|
|
87
|
+
| 组件 props 与前端预期不一致 | 以 design.md 组件契约为准,偏差只报不改 |
|
|
88
|
+
|
|
89
|
+
## 输出
|
|
90
|
+
|
|
91
|
+
- 创建/修改的文件列表(token / 组件 / 页面 / 资产)
|
|
92
|
+
- BackstopJS 对比结果(各断点 mismatch 值 + 白名单项)
|
|
93
|
+
- **契约相关**:组件契约实现情况及偏差、token 变更清单(无则写"无")
|
|
94
|
+
- 需要其他工种配合的事项(前端可接线的组件清单及 props)
|