app

app is a cursor rule for Cursor from n9e/fe. It costs 693 tokens per session, scanned A, original, Apache-2.0.

A set of coding rules for a TypeScript and React frontend project. It covers the project layout, component style, data handling, errors, forms, and theme colours.

In plain words
What is it for?
It guides work on React components, routing, state, API errors, forms, styling, and internationalisation in the specified project.
Why use it?
It gives contributors consistent conventions for changing the application and helps prevent assumptions about its structure or behaviour.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit It guides work on React components, routing, state, API errors, forms, styling, and internationalisation in the specified project.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/n9e/fe/app
View source ↗ n9e/fe
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.

Clone the repo
git clone --depth 1 https://github.com/n9e/fe

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 app

README.md
[![agentmods](https://agentmods.dev/badge/rules/n9e/fe/app/github.svg)](https://agentmods.dev/rules/n9e/fe/app)
Your own site
<a href="https://agentmods.dev/rules/n9e/fe/app"><img src="https://agentmods.dev/badge/rules/n9e/fe/app/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for app

Your own site · 80×15
<a href="https://agentmods.dev/rules/n9e/fe/app"><img src="https://agentmods.dev/badge/rules/n9e/fe/app.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 693 This file is loaded in full into every session.
When invoked 693 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00693 $0.00693
Opus 5.5 $0.00277 $0.00277
Sonnet 5.5 $0.00139 $0.00139
Haiku 4.5 $0.00069 $0.00069

Measured 1mo ago against content hash dcf7979043a7, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

app 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 1mo 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/app.mdc · 53 lines

What it actually says

N9E 前端项目

目录速览

src/
├── components/     # 通用 UI 与业务无关的基础组件
├── pages/          # 路由页面
├── plus/           # Plus 扩展(datasource、parcels 等,路径别名 plus:/*)
├── plugins/        # 数据源等插件化功能(含 Explorer/Dashboard 等)
├── store/          # Zustand 等状态
├── services/       # 接口与领域服务
├── utils/          # 工具函数
├── routers/        # 路由配置
├── theme/          # 主题与 CSS 变量(如 variable.css)
├── locales/        # 国际化资源
├── assets/         # 静态资源
├── types/          # 全局类型
├── App.tsx
└── main.tsx

技术栈与风格

  • TypeScript + React Hooks;优先函数组件,避免 class 组件。
  • 组件 Props 使用 interface 显式声明,避免 any。
  • 遵循仓库既有格式与 Prettier 配置;改动保持最小范围,不重写无关模块。
  • 不臆测接口或业务逻辑;上下文不足时说明缺口或反问。
  • 类型收窄优先使用原生接口:用 Array.isArray 代替 _.isArray,用 typeof x === 'number' 代替 _.isNumber,用 x == null 代替 _.isNil,以此类推。lodash 的类型守卫函数在缺少 @types/lodash 时不会被 TypeScript 识别为类型守卫,导致 unknown 类型无法收窄。

数据与错误

  • 异步请求须有错误处理(try/catch、.catch、onError 等,与现有模式一致)。

折叠面板与表单

  • antd 的 Collapse.Panel 初始折叠时不会挂载内容。面板内包含需要参与校验、回填或提交的 Form.Item / Form.List 时,必须添加 forceRender,确保字段注册到 Form;仅用于展示的内容不需要添加。

样式与颜色

  • 颜色、主题相关值使用 src/theme/variable.css(及现有主题体系)中的变量,避免魔法色值。
  • Tailwind 与 Less 的分工、反模式与迁移方式 见 .cursor/rules/tailwind-usage.mdc(匹配 src/**/*.{ts,tsx,less,css} 时自动注入)。

测试

  • 使用 Vitest + Testing Library。
  • 测试文件命名:*.test.ts / *.test.tsx 或 *.spec.ts / *.spec.tsx,与待测文件同目录或约定目录即可。
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. 1mo ago First seen · 53 lines · 693 tokens per session scan A dcf7979043a7

Subscribe to this mod's changes

app is a cursor rule published in the GitHub repository n9e/fe (307 stars, last pushed 2d ago), licensed Apache-2.0. It adds 693 tokens to every session, about $0.0028 per session on Opus 5.5. 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.