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/n9e/fe/tailwind-usagegit clone --depth 1 https://github.com/n9e/feWhat 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.00593 |
| Opus 5 | $0.00000 | $0.00296 |
| Sonnet 5 | $0.00000 | $0.00119 |
| Haiku 4.5 | $0.00000 | $0.00059 |
Grade A, and why
tailwind-usage 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
样式:Tailwind 优先 + 少量 Less
全局约定(颜色变量、最小改动等)见 .cursor/rules/app.mdc。
原则
- 能直接用 Tailwind 表达的(布局、间距、排版、圆角、常见交互态)→ 用 Tailwind。
- Tailwind 不划算或做不到的 → 少量 Less/CSS,选择器尽量收束在页面/模块根类名下。
- 同一视觉属性不要同时被 Tailwind 与 Less 争抢(避免难排查的覆盖问题)。
优先用 Tailwind
- 容器布局:
flex/grid/gap/ 内外边距 / 对齐。 - 业务界面:按钮、表单外观、文案层级、状态色(需与主题变量一致时,用已有 Tailwind 主题映射或 CSS 变量类,不硬编码色值)。
- 局部状态:
hover/focus/disabled等。 - 仅当前组件使用的展示类样式。
用 Less / 普通 CSS 更合适的情况
- 覆盖第三方组件内部结构(如 antd 深层节点、复杂表格头)。
- 全局或跨多页复用的 token、keyframes、无法用工具类清晰表达的动画。
- 强依赖复杂选择器(深层后代、兄弟组合、兼容向 hack 等)。
Less/CSS 侧要求:
- 选择器尽量局部化;嵌套不宜过深(≤3 层为宜)。
- 不复制一套与 Tailwind 等价的冗长规则。
实践技巧
- 可在
className中使用 antd 定向写法(如[&_.ant-input-affix-wrapper])以减少裸 Less。 - 单处
className过长时,抽成本地常量字符串或小组件,不要为此回到大段 Less。 - 改旧页面时优先增量迁移:先动当前需求触及的区块(如工具栏、列表行),再逐步收拢公共块。
自检
- 是否出现 Tailwind 与 Less 同时控制同一属性?
- 是否新增了大段可被 Tailwind 替代的 Less?
- 明暗主题下视觉是否与现有变量体系一致?
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 First seen · 47 lines · 0 tokens per session scan A fba48ff439bc
tailwind-usage is a cursor rule published in the GitHub repository n9e/fe (302 stars, last pushed today), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 593 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-09-01.
Other cursor rules, from other repositories
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
typescript
Changes to these high-fan-out internals can affect every message, delta, element, or rerun. Keep work in them minimal, and benchmark changes with representative stress-test apps.
coolify-ai-docs
Master reference to all Coolify AI documentation in .ai/ directory.
python_lib
Tips and guidelines specific to the development of the Streamlit Python library, not applicable to scripts and e2e tests.
specs
This directory contains product and tech specs for Streamlit features.