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.
git clone --depth 1 https://github.com/holtwood/awesome-cursorrules-zhWrote 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.
[](https://agentmods.dev/rules/holtwood/awesome-cursorrules-zh/springboot-jpa-best-practices)<a href="https://agentmods.dev/rules/holtwood/awesome-cursorrules-zh/springboot-jpa-best-practices"><img src="https://agentmods.dev/badge/rules/holtwood/awesome-cursorrules-zh/springboot-jpa-best-practices/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.
<a href="https://agentmods.dev/rules/holtwood/awesome-cursorrules-zh/springboot-jpa-best-practices"><img src="https://agentmods.dev/badge/rules/holtwood/awesome-cursorrules-zh/springboot-jpa-best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.00525 |
| Opus 5 | $0.00000 | $0.00262 |
| Sonnet 5 | $0.00000 | $0.00105 |
| Haiku 4.5 | $0.00000 | $0.00052 |
Grade A, and why
springboot-jpa-best-practices 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 10d 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.
What it actually says
- 所有请求与响应必须仅在 RestController 层处理
- 所有数据库操作逻辑仅在 ServiceImpl 层实现,ServiceImpl 只能调用 Repository 提供的方法
- RestController 不应直接注入 Repository,除非有特殊理由
- ServiceImpl 不得直接操作数据库,只能通过 Repository 间接访问
- RestController 与 ServiceImpl 之间仅用 DTO 传递数据,Entity 只作为数据库数据载体
- Entity 类需加 @Entity 注解,主键加 @Id 和 @GeneratedValue(strategy=GenerationType.IDENTITY)
- Entity 关系建议默认使用 FetchType.LAZY,属性应加 @Size、@NotEmpty、@Email 等校验注解
- Repository 必须为接口,继承 JpaRepository<Entity, ID>,加 @Repository 注解
- 多表关联查询使用 DTO 作为数据容器,@Query 建议用 JPQL,避免 N+1 问题时用 @EntityGraph
- Service 层为接口,具体实现类加 @Service 注解,依赖用 @Autowired 注入
- ServiceImpl 方法返回 DTO,不直接返回 Entity
- 多步数据库操作需加 @Transactional 或使用 transactionTemplate
- DTO 推荐使用 Java 17 record,构造器中校验参数合法性
- Controller 类加 @RestController 注解,类级路由用 @RequestMapping
- 方法级用 @PostMapping/@GetMapping 等,依赖用 @Autowired
- Controller 方法返回 ResponseEntity,所有逻辑用 try...catch 包裹
- 异常统一由 GlobalExceptionHandler 处理
- 全局响应类 ApiResponse 包含 result、message、data 字段
- 遵循 SOLID、DRY、KISS、YAGNI 原则,遵守 OWASP 安全最佳实践
- 代码风格统一,推荐使用 Lombok 简化代码
- 技术栈建议:Spring Boot 3、Spring Web、Spring Data JPA、Thymeleaf、Lombok、PostgreSQL
- 项目结构清晰分层,逻辑拆解细致,便于维护与扩展
- 参考官方文档与 OWASP 指南,定期审计安全与性能
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.
- 10d ago First seen · 28 lines · 0 tokens per session scan A 8097f9c3e2f8
springboot-jpa-best-practices is a cursor rule published in the GitHub repository holtwood/awesome-cursorrules-zh (233 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 525 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.
Other cursor rules, from other repositories
spring-boot
Spring Boot: annotations, dependency injection, JPA patterns.
java-backend
Java Backend Execution Agent (Spring Boot / Quarkus).
py-fast-api
Cursor rules for Python FastAPI backend development and best practices.
deno
Deno: permissions, deno.json, std library, Deploy.
nestjs
NestJS: decorators, modules, guards, interceptors, DTOs.
service-class-conventions
Defines the structure and implementation of service classes, enforcing the use of interfaces, ServiceImpl classes, DTOs for data transfer, and transactional management.