ui-cross-platform

ui-cross-platform is a cursor rule for Cursor from zhangdszq/teamclaw. It costs 0 tokens per session (494 once invoked), scanned A, original, Apache-2.0.

A rule for designing user interfaces that work consistently on Windows and macOS. It covers platform differences such as fonts, window controls, scrolling, display scaling, and shortcut labels.

In plain words
What is it for?
Use it when changing an interface in an app that runs on Windows and macOS, including Electron apps.
Why use it?
The same interface can look or behave differently across operating systems, especially with Windows display scaling and window controls.

Cursor rule for Cursor

Install

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.

agentmods
npx agentmods add rules/zhangdszq/teamclaw/ui-cross-platform
Clone the repo
git clone --depth 1 https://github.com/zhangdszq/teamclaw

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ui-cross-platform

README.md
[![agentmods](https://agentmods.dev/badge/rules/zhangdszq/teamclaw/ui-cross-platform.svg)](https://agentmods.dev/rules/zhangdszq/teamclaw/ui-cross-platform)
Your own site
<a href="https://agentmods.dev/rules/zhangdszq/teamclaw/ui-cross-platform"><img src="https://agentmods.dev/badge/rules/zhangdszq/teamclaw/ui-cross-platform.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 494 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What 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.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00494
Opus 5 $0.00000 $0.00247
Sonnet 5 $0.00000 $0.00099
Haiku 4.5 $0.00000 $0.00049

Measured 5d ago against content hash d3245e66e3d6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ui-cross-platform 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 5d ago.

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.

.cursor/rules/ui-cross-platform.mdc · 64 lines

What it actually says

UI 跨平台兼容(Windows & macOS)

修改任何 UI 界面时,必须同时考虑 Windows 和 macOS 的差异。

字体

/* ❌ BAD */
font-family: -apple-system, BlinkMacSystemFont;

/* ✅ GOOD */
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

滚动条

/* macOS 默认隐藏,Windows 始终显示,需统一样式 */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 3px; }

窗口标题栏 / 拖拽区域

  • macOS 交通灯按钮在左,Windows 关闭按钮在右
  • 使用 -webkit-app-region: drag 时,确保 Windows 下点击区域不遮挡交互元素
  • Electron 中通过 process.platform 判断平台,分别渲染自定义标题栏
const isMac = process.platform === 'darwin';
// macOS 不需要自定义最小化/最大化/关闭按钮
{!isMac && <WindowControls />}

间距与字号

  • Windows 系统 DPI 缩放(125%、150%)可能导致布局错位,避免使用奇数像素值
  • 关键布局使用 remflex,而非固定 px

快捷键文案

/* ❌ BAD */
<span>⌘K</span>

/* ✅ GOOD */
const isMac = process.platform === 'darwin';
<span>{isMac ? '⌘K' : 'Ctrl+K'}</span>

检查清单

  • 字体 fallback 包含 Segoe UI(Windows)
  • 滚动条样式在两个平台均可见
  • 标题栏/拖拽区域在 Windows 和 macOS 下布局正确
  • 快捷键文案根据平台动态显示
  • 在 125%/150% DPI 下验证布局不错位
Changes

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.

  1. 5d ago First seen · 64 lines · 494 tokens per session scan A d3245e66e3d6

Subscribe to this mod's changes

ui-cross-platform is a cursor rule published in the GitHub repository zhangdszq/teamclaw (113 stars, last pushed 5mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 494 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.