backend-java-ruoyi-conventions

backend-java-ruoyi-conventions is a cursor rule for Cursor from Siborne/YiSmart-Cloud. It costs 0 tokens per session (538 once invoked), scanned A, original, MIT.

A set of Java backend rules for YiSmartCloud, a RuoYi-based application. RuoYi is a Java framework with a common structure for controllers, business services, database access, and administration features.

In plain words
What is it for?
Use it when creating or reviewing Java backend modules, especially nursing-related features. It covers package locations, controller and service patterns, MyBatis-Plus database access, custom SQL in XML, validation, transactions, and date fields.
Why use it?
It tells developers where code belongs and how the layers should work together. This reduces misplaced files, controllers that bypass business logic, inconsistent database queries, and transaction or date-handling errors.

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/siborne/yismart-cloud/backend-java-ruoyi-conventions
Clone the repo
git clone --depth 1 https://github.com/Siborne/YiSmart-Cloud

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 backend-java-ruoyi-conventions

README.md
[![agentmods](https://agentmods.dev/badge/rules/siborne/yismart-cloud/backend-java-ruoyi-conventions.svg)](https://agentmods.dev/rules/siborne/yismart-cloud/backend-java-ruoyi-conventions)
Your own site
<a href="https://agentmods.dev/rules/siborne/yismart-cloud/backend-java-ruoyi-conventions"><img src="https://agentmods.dev/badge/rules/siborne/yismart-cloud/backend-java-ruoyi-conventions.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 538 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.00538
Opus 5 $0.00000 $0.00269
Sonnet 5 $0.00000 $0.00108
Haiku 4.5 $0.00000 $0.00054

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

Security

Grade A, and why

backend-java-ruoyi-conventions 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 4d 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/backend-java-ruoyi-conventions.mdc · 18 lines

What it actually says

后端 Java(RuoYi)开发约定(YiSmartCloud)

  • 模块落点:颐养/护理业务代码(serve 包下的 controller、service、domain、vo、mapper 与 resources/mapper/serve)默认放在 YiSmartCloud-nursing-platform;启动入口在 YiSmartCloud-admin。非系统级需求不要把业务 Controller 塞进 YiSmartCloud-systemYiSmartCloud-adminweb.controller
  • 根包名固定为 org.FlyingSparrow.YiSmartCloud,与现有模块一致。
  • 严格遵守分层:controller -> service -> mapper,控制层不直接操作 mapper。
  • Controller 保持 RuoYi 注解组合:@RestController@RequestMapping@PreAuthorize@Log@Api/@ApiOperation
  • CRUD 接口保持既有模式:列表 startPage()+getDataTable,新增/修改/删除返回 toAjax(...),详情返回 success(...)
  • MyBatis-Plus 与 Service:业务模块普遍使用 IService / ServiceImpl<Mapper, Entity> 搭配 BaseMapper;简单单表 CRUD 可用 MP 能力,JOIN、树形、统计、扩展列须在 Mapper 中声明方法并由 XML 实现(见 mapper 规则),避免与通用 select* 字段冲突。
  • Service 层承担业务校验与默认值填充,参数非法时抛 ServiceException,不要把校验散落到 Controller。
  • 事务写操作使用 @Transactional(rollbackFor = Exception.class),时间字段使用 DateUtils.getNowDate() 保持一致。
  • 日期类型BaseEntity 审计字段与部分代码使用 java.util.Date,业务实体字段也可能使用 java.time.LocalDateTime新增字段优先与同模块、同聚合内已有实体保持一致;跨层 JSON 注意序列化配置,避免混用导致反序列化失败。
  • 涉及 XML 自定义 SQL(尤其 JOIN 扩展字段)时,优先调用 Mapper 自定义方法,避免误用 MP 通用方法导致字段冲突。
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. 4d ago First seen · 18 lines · 0 tokens per session scan A c59142bba279

Subscribe to this mod's changes

backend-java-ruoyi-conventions is a cursor rule published in the GitHub repository Siborne/YiSmart-Cloud (4 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 538 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-31.