frontend

frontend is a cursor rule for Cursor from Zleap-AI/Zleap-Agent. It costs 0 tokens per session (1,249 once invoked), scanned A, original, Apache-2.0.

A set of frontend design rules for the web package, covering shared colors, spacing, components, text sizes, animations, and translation support.

In plain words
What is it for?
Use it when building or reviewing web pages and components that should follow the project's design system, including dark-mode states and multiple languages.
Why use it?
It keeps the interface consistent and prevents one-off colors, sizes, and animation settings from spreading through the code. Automated checks can catch many violations during continuous integration, the process that tests changes before they are merged.

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/zleap-ai/zleap-agent/frontend
Clone the repo
git clone --depth 1 https://github.com/Zleap-AI/Zleap-Agent

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 frontend

README.md
[![agentmods](https://agentmods.dev/badge/rules/zleap-ai/zleap-agent/frontend.svg)](https://agentmods.dev/rules/zleap-ai/zleap-agent/frontend)
Your own site
<a href="https://agentmods.dev/rules/zleap-ai/zleap-agent/frontend"><img src="https://agentmods.dev/badge/rules/zleap-ai/zleap-agent/frontend.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 1,249 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.01249
Opus 5 $0.00000 $0.00624
Sonnet 5 $0.00000 $0.00250
Haiku 4.5 $0.00000 $0.00125

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

Security

Grade A, and why

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

packages/web/.cursor/rules/frontend.mdc · 49 lines

How it starts

The opening of the file, as written. The whole thing — 49 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Zleap Web 前端规范

目标:生产级、可开源、对标 codex 质感的中性克制 UI,铜金/琥珀为唯一强调色。

设计 token(单一真源在 app/globals.css

  • 颜色一律走语义 token,禁止 className 内写 #hex / rgb() / oklch() / Tailwind 调色板色阶(emerald-500sky-50text-white…)。
    • 中性骨架:bg-backgroundbg-cardbg-mutedtext-foregroundtext-muted-foregroundborder-border
    • 强调色:仅关键交互用 primary(发送、主操作、active)。
    • 状态色:success / warning / info / danger,软底用 bg-success/10 text-success 等(自带 dark 适配)。
  • 间距 / 圆角 / 阴影 / 字号一律走 scale,禁止任意值 [Npx] / text-[Npx] / inline style={{ fontSize }}
    • 字号:text-2xs(11px) / text-xs / text-sm / text-base
    • 动效:className 时长走 duration-[var(--duration-base)](fast / slow 同理换 token 名)+ ease-out / ease-spring(后两者经 @theme 已映射到 token,等同 --ease-*);禁止 Tailwind 原生步进时长(如 duration-300)与任意自定义缓动(ad-hoc cubic-bezier 的方括号写法)。framer-motion 不能读 CSS 变量,统一从 @/lib/motionEASE_OUT / EASE_SPRING / DURATION / SPRING_PANEL / SPRING_SNAPPY)取值,禁止内联 stiffness/duration 字面量。
    • hover 抬升统一 hover:-translate-y-px(克制,1px)。
    • 以上由 scripts/check-web-design-tokens.mjs 在 CI 强制(pnpm check:design);components/ui/* 生成的 shadcn 原语不受动效规则约束。
  • 例外(数据驱动):用户可配置的 space/avatar accent 色经 inline style 注入是允许的;品牌 wordmark canvas 渲染、文档纸面预览(PPTX/HTML)可保留固定色。
  • 别名收敛:surfacecardsurface-2mutedinkforegroundborder-strongborder 为旧别名(与规范 token 1:1 映射),新代码一律用右侧规范名。

组件库

  • 交互元素必须用 @/components/ui/*ButtonIconButtonInputTextareaSelectDialog…),禁止裸写 <button> / <input> / <textarea>
  • 按钮走 Buttonvariant / size 体系,禁止自建按钮样式体系。
    • 图标按钮一律用 IconButton(强制 aria-label,统一 focus/hover/disabled);尺寸 icon-xs(24)/icon-sm(28)/icon(32)。
    • 例外:内容复合的可点元素(列表行、文件树节点、分段切换、富 chip)可保留 <button>,但必须自带 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50(行内可加 ring-inset)。
  • 弹窗页脚统一 ManageDialog + ManageDialogFooterActions(ghost 取消 + primary 确认,busy 自带 spinner);表单字段统一 ManageFieldlabel/description/error/required);行内状态徽标统一 ManageStatusBadgesize="sm" 用于密集列表行)。
  • 空态 / 加载态 / 卡片 / 列表行用 @/components/shared@/components/ui 的统一原语,禁止每处重写。
  • 对话框表单统一用 ManageDialog + useEntityFormDialog,不再复制 reset/submit/toast 样板。
  • 数据请求走 lib/services/*,组件内不直接 fetch/拼接 API 逻辑。

Read the full file on GitHub · 49 lines

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 · 49 lines · 0 tokens per session scan A 4200cbdf9519

Subscribe to this mod's changes

frontend is a cursor rule published in the GitHub repository Zleap-AI/Zleap-Agent (218 stars, last pushed 1mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,249 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.