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/lawofall/agentcore/color-tokensgit clone --depth 1 https://github.com/Lawofall/AgentCoreWrote 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.
[](https://agentmods.dev/rules/lawofall/agentcore/color-tokens)<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>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.
| Model | Per session | Once 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 |
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.
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 彩度。
禁止
- 硬编码调色板与 hex:
bg-blue-500、text-red-600、#3B82F6、bg-[#...]。唯一彩色出口是语义 token。 hsl(var(--…))包裹:token 已是 OKLCH,hsl()会产出非法值。- 拿
accent当成功色:accent是中性 hover 表面。成功一律success。 - 绕过 token 新建散色变量:先评估能否复用,必须新增则进
packages/design-tokens/tokens.css。
登记例外
- 文件类型图标(
react-material-icon-themeviaFileTypeIcon/DirTypeIcon):SVG 内嵌品牌色(npm/git/md…),勿再包text-*染色;禁借此例外在业务 UI 散写 hex。
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.
- today Changed · +2 lines eae63f9248ec
- 5d ago First seen · 37 lines · 0 tokens per session scan A d853ee625673
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.
Other cursor rules, from other repositories
project-overview
Core project architecture, patterns, and conventions for the AI Documentation Generator.
design
All tasks related to updating frontend components, CSS, and general styling.
code-patterns
Python code style and recurring patterns (config, logging, errors, paths).
mobile-responsive
Mobile responsiveness patterns — breakpoints, navbar collapse, scrollable tabs, CSS conventions.
frontend
Demo Shop frontend guidance.
shadcn-tailwind-guide
本规范定义了使用 shadcn/ui 和 Tailwind CSS 开发新组件的标准流程和最佳实践。.