Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/wcoreing/wworkbench/compat-uigit clone --depth 1 https://github.com/wcoreing/WWorkbenchWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.00718 |
| Opus 5 | $0.00000 | $0.00359 |
| Sonnet 5 | $0.00000 | $0.00144 |
| Haiku 4.5 | $0.00000 | $0.00072 |
Grade A, and why
compat-ui scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
Compat 交互层
Compat 修 Wails/WebView 兼容性,不是视觉 UI 框架。长相可继续用 wn-* 或套 Ant / shadcn。
进口
import { pressProps, Select, ModalPortal, installFocusGate, chromeProps, focusHogProps } from '../components/compat'
旧路径 utils/press、components/Select、components/ModalPortal 仅为兼容 re-export,新代码不要再用。
硬契约
- 命令控件(Tab、工具条、弹窗取消/保存、右键菜单项、树节点命令)→ 必须
pressProps,禁止裸onClick做切换与提交。 - 业务下拉 → 必须用
Select,或自绘弹出并接useOutsideDismiss;禁止原生<select>(系统层会吞第一次外点)。 - 弹层 → 用
ModalPortal挂到document.body;弹窗内容区对 backdrop 做onPointerDownstopPropagation。 - 菜单/下拉的外点关闭 → 必须听
pointerdown(见useDismissOnPointerDown),禁止click/mousedown。pressProps会preventDefault(pointerdown)从而取消后续 mouse 事件;用click关菜单会导致「产品轨要点两次」。 - 切产品线 →
setActiveProduct会dismissOverlays();Select/菜单须useDismissOverlays订阅,避免隐藏页 portal 挡住产品轨。 - 焦点域(FocusGate):
- 抢焦内容(xterm / Monaco)→
data-ww-focus-hog或focusHogProps()/registerFocusHog - 命令壳(产品轨、顶栏)→
data-ww-chrome或chromeProps()(浮层盖住时坐标转发) AppShell已installFocusGate():内容区持焦时点到 任意命令控件(button/.wn-select-trigger/ 产品轨等)先 blur,首击必达- 查询栏 Select、工具条、Tab 都靠这条,不必再逐个标 chrome
- 不要再为产品轨单独写坐标 capture hack
- 抢焦内容(xterm / Monaco)→
套其他 UI 框架
// 外观用第三方,交互走 Compat
<AntButton {...pressProps(onSave)}>保存</AntButton>
<Select className="your-skin" value={v} options={opts} onChange={setV} />
不要做
- 为每个业务再写一套 Select / press
- 用全局事件 hack 去「修复」原生 select
- 把颜色、布局、Form 引擎塞进 Compat
- 在业务里重复实现「从终端失焦再点轨」逻辑(应走 FocusGate)
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 48 lines · 0 tokens per session scan A bbcec69327a0
compat-ui is a cursor rule published in the GitHub repository wcoreing/WWorkbench (23 stars, last pushed 6d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 718 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
cursorrules
Cursor rule "cursorrules" from lktiep/cortex-hub, covering cortex hub (mandatory), during work, error protocol and ending.
xcf-ai-guide
XCF (Xcode MCP Server) is a powerful Swift-based automation tool designed to streamline Xcode project management for AI assistants. This guide provides comprehensive instructions for integrating XCF into AI-powered development workflows.
xcf-quickref
Cursor rule "xcf-quickref" from CodeFreezeAI/xcf, covering xcf quick reference guide 🚀, 🎛️ xcf core actions, permissions & project management, build & execute and system & analysis.
xcf-user-guide
XCF (Xcode MCP Server) is a powerful, Swift-native automation tool designed to revolutionize your Xcode development workflow. This guide provides an in-depth look at installation, configuration, and usage of XCF.
performance-optimization-patterns
Performance optimization patterns for database queries, React components, and API efficiency in POS System.
business-logic-patterns
Comprehensive business logic patterns for POS System domain understanding, user journeys, and workflow optimization.