ui-ux-pro-max
UI/UX design intelligence for web, mobile, and desktop. This skill should be used when designing, building, reviewing, or fixing interfaces, including pages, components, design systems, accessibility, interaction, responsive layout, typography, color, charts, and stack-specific UI implementation. Searchable local data: 79 searchable styles (50 active), 192 product palettes and reasoning profiles, 74 font pairings, 119 UX guidelines, 105 icons, 17 GSAP presets, 25 chart types, and 22 stacks.
1How It Works & Mechanism
The core is an onboard local BM25 search engine: implemented purely in the Python standard library with zero third-party dependencies and zero runtime network access; data files are resolved relatively via __file__, making the skill directory itself the knowledge base, capable of running in any plugin root.
import csv import difflib import re from pathlib import Path from math import log from collections import defaultdict
Hit evaluation relies on dual thresholds of BM25 score + keyword coverage, proactively abstaining (returning empty rather than weak data) on low confidence; SKILL.md reciprocally mandates '0 hits -> retry once -> if still empty, explicitly state it is from built-in defaults', providing dual protection against hallucination.
abstain = (top_score <= threshold["min_score"] or coverage < threshold["min_coverage"] or (threshold["min_margin"] > 0 and top_score - runner_up_score < threshold["min_margin"]))
17 search domains + 22 technology stacks are declaratively driven by CSV_CONFIG and stack CSVs (each domain restricting search_cols and output_cols); retrieval scores exclusively against restricted columns of specified CSVs, inherently eliminating noise from irrelevant fields.
"style": { "file": "styles.csv",
--design-system is an orchestration pipeline rather than mere concatenation: determines category by product domain -> applies ui-reasoning.csv inference rules -> executes weighted multi-domain search across style/color/landing/typography -> outputs a coherent set of patterns, styles, palettes, fonts, effects, and anti-patterns.
This aggregates product/style/color/landing/typography matches, applies reasoning rules from `ui-reasoning.csv`, and returns pattern, style, colors, typography, effects, and anti-patterns to avoid.
Decision rules use a constrained DSL rather than executable code: reasoning_contract.py performs only deterministic parsing and rewriting while explicitly declaring 'never execute data', validating action prefixes against an allowlist (constraint/style/pattern/mode); data poisoning causes at most rule-matching errors rather than arbitrary code execution.
"""Return deterministic mutations and an audit trail; never execute data."""
Persistence uses a 'Master + Overrides' model with conservative disk writing: --persist strictly requires --output-dir, sanitizes project names via safe_slug ([a-z0-9_-] to prevent path traversal), and uses temp + NamedTemporaryFile + os.link for atomic exclusive publishing—existing MASTER.md files are skipped by default, and --force requires explicit user authorization to overwrite.
def safe_slug(name, fallback: str = "default") -> str:
The workflow contract formalizes 'no guessing' into a query discipline: Step 1 detects the actual stack (package.json/pubspec.yaml/*.xcodeproj, prompting if undetected, forbidding hardcoded defaults) -> Step 2 design system -> Step 3 on-demand domain search -> Step 4 stack guidelines; queries enforce a single dominant intent + 2-5 words + one constraint.
If nothing is detectable and stack guidance matters, ask the user. **Never assume a stack**
2Core Capabilities
3External Dependencies
| Kind | Dependency / Endpoint |
|---|---|
| network | 运行时零外联(search.py/core.py/design_system.py/reasoning_contract.py 均无网络模块——import 审计全标准库) |
| network | 维护期(仓库 CI refresh-catalogs.yml,非 skill 运行时、不随 skill 分发):Google Fonts Developer API 快照 |
| network | 维护期:官方 google/fonts 仓库许可证元数据 sparse clone |
| package | 维护期:npm 安装 pin 版 @phosphor-icons/core 与 @phosphor-icons/react(--ignore-scripts)导出图标清单 |
4Recommended Governance & Evidence
- scripts/: Local script or command execution: python3 scripts/search.py — invoked manually by the agent per SKILL.md instructions (single CLI invocation: --domain/--de
- 本地工作目录: File I/O and artifact output: Written to design-system/<project-slug>/MASTER.md and associated paths strictly when explicitly triggered via --persist + --output-dir
5Second-Pass Verification
- [ok] 运行时零网络 — search.py 头 import(argparse/json/sys/io + 本地三模块)与 core/design_system/reasoning_contract 的 import 全为标准库;scripts/ 全树 grep requests/urllib/socket/http/curl/wget 零命中(tests 内 URL 为数据校验用字面量)。
- [ok] 功能声明数字 vs 实际数据行数 — 行级计数:styles 88(50 active+29 supplemental+9 deprecated=可检索 79)、products/ui-reasoning/colors 192、typography 74、google-fonts 1934、ux-guidelines 119、icons 105、motion 17、charts 25、landing 34、stacks 22 文件 1260 行——与 description 及 catalog-summary.json 完全一致,无夸大。
- [ok] 持久化写盘面(防穿越/原子/不覆盖) — design_system.py 精读:safe_slug 只留 [a-z0-9_-]、NamedTemporaryFile 写入 + os.link 排他发布、FileExistsError 默认跳过、--force 分支才覆盖;与 SKILL.md 'skips writing and leaves it untouched unless you also pass --force' 一致。
- [ok] 决策规则无执行面 — reasoning_contract.py 无 eval/exec/subprocess/动态 import;ALLOWED_CONDITIONS/ACTION_PREFIXES/TOKEN_RE 白名单 + ValueError;docstring 'never execute data.'。
- [ok] 凭证/env 读取 — 运行时唯一 env 读取 = design_system.py:615 COLORTERM;无 keychain/.env/密钥文件访问;CI 工作流使用的 GOOGLE_FONTS_API_KEY 为 GitHub secrets(仓库侧,非本机)。
- [ok] 外部依赖真实性 — 3 条『维护期』条目逐一在 .github/workflows/refresh-catalogs.yml 65/91/121-123 行找到真实调用点;运行时外部依赖为空。
- [ok] stars/活跃度/commit — GitHub API:stars 126346、pushed_at 2026-09-06T11:29:23Z、MIT;本地 git HEAD == pin 4aad0584d92131626b16d4ff4d77f0455385013c(2026-09-06 18:29:23 +0700)。
- [ok] 分级校准(六档范式) — 运行自带 stdlib 本地脚本 + 显式触发本地写、无网络外发、无凭证 → blue(旧文件曾记 green,按 2026-09-09 统一分档准则校准为 blue);reason 已重写。
6Verdict & Scenarios
7d01e476eb54034d…