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/neoshopcn/neo-admin/10-backendgit clone --depth 1 https://github.com/neoshopcn/neo-adminWhat 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.00844 | $0.00844 |
| Opus 5 | $0.00422 | $0.00422 |
| Sonnet 5 | $0.00169 | $0.00169 |
| Haiku 4.5 | $0.00084 | $0.00084 |
Grade A, and why
10-backend 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.
How it starts
The opening of the file, as written. The whole thing — 226 lines — stays where its author put it; the contents beside it link to each section on GitHub.
🧠 路由规范(必须遵守)
-
后台所有路由统一定义在:
routes/admin.php
-
不允许写在:
- routes/web.php
- routes/api.php
-
必须使用:
Route::prefix('admin')->name('admin.')->group(function () {
-
admin 仅作为 URL 前缀,不作为目录结构
🧩 路由分层
页面路由(content)
- 路径:/admin/content/*
- 使用 Controller::__invoke
- 返回 Blade 页面
示例:
Route::get('users', UserManageController::class)
API 路由(api)
- 路径:/admin/api/*
- 返回 JsonResponse
- 使用标准 CRUD 方法
🔐 权限规范(必须)
权限命名统一:
- list → xxx:list
- view → xxx:view
- create → xxx:create
- edit → xxx:edit
- delete → xxx:delete
使用方式
-
页面路由:
->middleware('admin.perm:xxx:list')
-
API 路由:
每个操作单独权限控制
🧱 Controller 规范
Content Controller(页面)
- 命名:*ManageController / *Controller
- 使用 __invoke()
- 返回 view()
示例:
return view('admin.xxx.index', [ 'neo' => $config ]);
API Controller
-
命名空间:App\Http\Controllers\Admin\Api
-
返回 JsonResponse
-
使用标准方法:
- index
- show
- store
- update
- destroy
📦 响应规范(必须统一)
使用 ApiResponse trait:
-
成功:
return $this->ok($data);
-
失败:
return $this->fail(message, code)
🔍 列表查询规范
必须支持:
- keyword 模糊搜索
- 精确筛选(status 等)
- 时间范围(created_at)
统一使用:
- applyKeyword
- applyExact
- applyDateRange
📄 分页规范
-
参数:
- page
- page_size(默认 15,最大 100)
-
返回必须包含:
- list
- pagination
🧾 数据校验规范
-
所有写操作必须使用:
$request->validate()
-
唯一性:
Rule::unique(...)
-
数组字段:
role_ids.* exists:roles,id
🔄 CRUD 规范
标准接口:
- index(列表)
- show(详情)
- store(创建)
- update(更新)
- destroy(删除)
扩展接口:
- resetPassword
- assignMenus
⚠️ 安全规则(必须)
- 禁止删除当前登录用户
- 所有 ID 必须 whereNumber
- 不存在数据必须返回 fail
🧠 数据处理规范
- 不信任前端输入
- 必须类型转换(int / string)
- 数组必须去重、过滤
🔗 关联关系
- 使用 with() 预加载
- 多对多使用 sync()
🚫 禁止行为
- 在 Controller 写复杂业务逻辑
- 直接返回未处理的模型数据
- 不做校验直接写入数据库
🚀 生成规则(高优先级)
当生成后台模块时,必须:
- 注册 routes(content + api)
- 创建 Content Controller(__invoke)
- 创建 API Controller(CRUD)
- 添加权限控制(list / view / create / edit / delete)
- 使用统一响应结构(ok / fail)
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.
- 3d ago First seen · 226 lines · 844 tokens per session scan A fd1f4454c6d8
10-backend is a cursor rule published in the GitHub repository neoshopcn/neo-admin (12 stars, last pushed 2mo ago), licensed MIT. It adds 844 tokens to every session, about $0.0042 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.
Other cursor rules, from other repositories
ts
Cursor rule "ts" from un-pany/v3-admin-vite, covering ts 开发规范, 类型, 命名, 代码组织 and 错误处理.
owl-admin
🎈 Owl Admin : 基于 laravel 和 amis 开发的后台框架, 友好的组件使用体验, 可轻松实现复杂页面, 内置代码生成器, 让开发者快速搭建后台管理系统.
laravel
Core Laravel architecture and coding conventions.
core-standards
Project context, AI behavior, and unified coding standards for PHP/Laravel projects.
php
Rules applied when working in PHP files (incl. Laravel, Symfony, WordPress).
laravel
Laravel: Eloquent, Form Requests, policies.