color-tokens

color-tokens is a cursor rule for Cursor from Lawofall/AgentCore. It costs 0 tokens per session (882 once invoked), scanned A, original, MIT.

A rule set for choosing interface colors through shared semantic design tokens. These tokens are named meanings such as primary, success, notice, or destructive rather than fixed color values.

In plain words
What is it for?
Use it when writing CSS or Tailwind classes to style notices, failures, destructive actions, execution states, warnings, Git changes, and keyboard focus using the project’s defined tokens.
Why use it?
It keeps colors consistent across the product and prevents different kinds of messages, statuses, and risks from being confused.

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/lawofall/agentcore/color-tokens
Clone the repo
git clone --depth 1 https://github.com/Lawofall/AgentCore

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 color-tokens

README.md
[![agentmods](https://agentmods.dev/badge/rules/lawofall/agentcore/color-tokens.svg)](https://agentmods.dev/rules/lawofall/agentcore/color-tokens)
Your own site
<a href="https://agentmods.dev/rules/lawofall/agentcore/color-tokens"><img src="https://agentmods.dev/badge/rules/lawofall/agentcore/color-tokens.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 882 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.00882
Opus 5 $0.00000 $0.00441
Sonnet 5 $0.00000 $0.00176
Haiku 4.5 $0.00000 $0.00088

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

Security

Grade A, and why

color-tokens 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 today.

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/color-tokens.mdc · 39 lines

What it actually says

配色 token 规范

只用语义 token,颜色由主题统一定义。三层语义与禁令见下;产品侧一句摘要 → UI-Pattern索引.md §配色要点。阴影 / 键盘焦点不是色 → 同文「层叠与焦点」。

三层(禁止把「没做成」和「会伤数据」涂成同一种红)

语义
A 用户面提示 横幅 / Toast / 表单失败行 primary = 需要你(去配置 / 拍板);灰 noticeChipNeutral = 可恢复中断(限流 / 请稍候 / 发送失败);红 destructive = 危险操作(删除 / 覆盖 / 拒绝)。停止生成(输入区主控件)走 IconButton inverse(前景实心底),不占用红
B 执行态 run / 工具 / 节点 pending→muted、running→primary、completed→success、failed→destructive 红点。整卡用户提示走 A,禁因 failed 把横幅刷红
C 分类 git 字母、风险高中低、截断、弱源、录音中、diff 删行 可用 --warning / 红当分类色,≠ 状态。禁把 --warning token 改成灰

同形发送/回合提示:有配置 action → primary,否则 noticeChipNeutral。加载失败 / 表单 alert / 无 action 的 Toast:行内 muted(手机 .error--fg),Toast 图标 muted。需要你(额度将尽 / 冲突说明条 / 公告 critical / 去配去建):primary;覆盖/用云端选中态仍 destructive。StatusTone 不恢复 warning。分类色(git 删行、风险「致命」、录音)与执行态红点不收进用户面档。

单一定义源

OKLCH 语义色单源:packages/design-tokens/tokens.css 桌面 / mobile-light.css 手机)。需要新颜色 → 先加进 packages/design-tokens/tokens.css,再视需要映射 Tailwind 类。

暗色大面近中性(chroma ≤0.006),品牌蓝只走 primary / 状态;层叠 canvas < card < popover;侧栏深于画布。数字只改 tokens.css .dark。禁把暗色表面重新涂满 255 蓝;禁借表面调整回头推高 primary 彩度。

禁止

  • 硬编码调色板与 hexbg-blue-500text-red-600#3B82F6bg-[#...]。唯一彩色出口是语义 token。
  • hsl(var(--…)) 包裹:token 已是 OKLCH,hsl() 会产出非法值。
  • accent 当成功色accent 是中性 hover 表面。成功一律 success
  • 绕过 token 新建散色变量:先评估能否复用,必须新增则进 packages/design-tokens/tokens.css

登记例外

  • 文件类型图标react-material-icon-theme via FileTypeIcon / DirTypeIcon):SVG 内嵌品牌色(npm/git/md…),勿再包 text-* 染色;禁借此例外在业务 UI 散写 hex。
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. today Changed · +2 lines eae63f9248ec
  2. 5d ago First seen · 37 lines · 0 tokens per session scan A d853ee625673

Subscribe to this mod's changes

color-tokens is a cursor rule published in the GitHub repository Lawofall/AgentCore (81 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 882 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.