project-rules

project-rules is a cursor rule for Cursor from nuwax-ai/nuwax. It costs 11 tokens per session (2,233 once invoked), scanned A, original, Apache-2.0.

A set of development rules for a React 18 frontend built with UmiJS, Ant Design, TypeScript, and related tools. The rules cover naming, components, styling, state, and performance.

In plain words
What is it for?
Use it when adding or changing React components, routes, styles, state management, forms, tables, or graph visualisations in this project.
Why use it?
It gives contributors shared conventions for building and maintaining the project, reducing inconsistent code and avoidable frontend problems.

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/nuwax-ai/nuwax/project-rules
Clone the repo
git clone --depth 1 https://github.com/nuwax-ai/nuwax

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 project-rules

README.md
[![agentmods](https://agentmods.dev/badge/rules/nuwax-ai/nuwax/project-rules.svg)](https://agentmods.dev/rules/nuwax-ai/nuwax/project-rules)
Your own site
<a href="https://agentmods.dev/rules/nuwax-ai/nuwax/project-rules"><img src="https://agentmods.dev/badge/rules/nuwax-ai/nuwax/project-rules.svg" alt="Measured on agentmods" height="20"></a>
Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,233 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.00011 $0.02233
Opus 5 $0.00005 $0.01117
Sonnet 5 $0.00002 $0.00447
Haiku 4.5 $0.00001 $0.00223

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

Security

Grade A, and why

project-rules 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 3d 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/project-rules.mdc · 250 lines

How it starts

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

智能体平台前端项目开发规则

项目概述

这是一个基于 React 18 + UmiJS Max + Ant Design 的智能体平台前端项目,提供智能体开发、管理和使用的完整解决方案。

技术栈规范

核心技术

  • 前端框架: React 18 (函数组件 + Hooks)
  • UI 组件库: Ant Design 5.x + ProComponents
  • 图形引擎: AntV X6 (流程图、图可视化)
  • 框架工具: UmiJS Max 4.x (约定式路由、插件体系)
  • 状态管理: UmiJS 内置 model (主要方案)
  • 类型检查: TypeScript 5.x
  • 样式方案: CSS Modules + Less (禁止全局污染)
  • 包管理: pnpm (Node.js > 18.0.0)

代码规范

文件命名
  • 组件文件:PascalCase (如 UserProfile.tsx)
  • 工具文件:camelCase (如 formatDate.ts)
  • 样式文件:与组件同名 (如 UserProfile.less)
  • 类型文件:camelCase + .types.ts 后缀
组件开发规范
// 组件必须包含详细注释
/**
 * 用户资料组件
 * @param {Object} props - 组件属性
 * @param {string} props.userId - 用户ID
 * @param {boolean} props.editable - 是否可编辑
 * @param {Function} props.onSave - 保存回调
 * @returns {JSX.Element} 用户资料组件
 */
interface UserProfileProps {
  userId: string;
  editable?: boolean;
  onSave?: (data: UserData) => void;
}

const UserProfile: React.FC<UserProfileProps> = ({ userId, editable = false, onSave }) => {
  // 组件实现
};
性能优化要求
  • 使用 useMemo 缓存计算结果
  • 使用 useCallback 缓存函数引用
  • 路由和组件必须懒加载
  • 表单、表格优先使用 ProComponents
  • 图形功能统一使用 AntV X6
状态管理规范
  • 全局状态使用 UmiJS model
  • 局部状态使用 useState/useReducer
  • 避免 props 层层传递
  • 异步请求封装在 services/ 目录
样式规范
// 使用 CSS Modules,避免全局污染
.userProfile {
  // 组件样式
  &__header {
    // 子元素样式
  }
  
  &--editable {
    // 修饰符样式
  }
}

AppDev Web IDE 开发规范

文件结构规范

  • 页面组件: pages/AppDev/components/ 目录下
  • 自定义 Hooks: hooks/useAppDev*.ts 命名规范
  • 状态管理: 使用 models/appDev.ts 中的 useAppDevStore
  • API 服务: services/appDev.ts 统一管理

核心 Hooks 使用

// 文件管理
const fileManagement = useAppDevFileManagement({
  projectId: workspace.projectId,
  onFileSelect: setActiveFile,
  onFileContentChange: updateFileContent,
});

// AI 聊天
const chat = useAppDevChat({
  projectId: workspace.projectId,
  onMessage: handleMessage,
});

// 开发服务器
const server = useAppDevServer({
  projectId: workspace.projectId,
  onStatusChange: handleServerStatus,
});

Read the full file on GitHub · 250 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. 3d ago First seen · 250 lines · 11 tokens per session scan A 2aae8061c8e0

Subscribe to this mod's changes

project-rules is a cursor rule published in the GitHub repository nuwax-ai/nuwax (874 stars, last pushed 6d ago), licensed Apache-2.0. It adds 11 tokens to every session and 2,233 once invoked, about $0.0001 per session on Opus 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-08-30.