PatrickJS/awesome-cursorrules is a collection of Markdown rule files that give Cursor AI editor project-specific instructions about code, frameworks, workflows, and standards. Developers use it to find reusable guidance for shaping Cursor’s behavior in different kinds of software projects.
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/patrickjs/awesome-cursorrules/java-springboot-jpa-cursorrules-prompt-filegit clone --depth 1 https://github.com/PatrickJS/awesome-cursorrulesWrote 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/patrickjs/awesome-cursorrules/java-springboot-jpa-cursorrules-prompt-file)<a href="https://agentmods.dev/rules/patrickjs/awesome-cursorrules/java-springboot-jpa-cursorrules-prompt-file"><img src="https://agentmods.dev/badge/rules/patrickjs/awesome-cursorrules/java-springboot-jpa-cursorrules-prompt-file.svg" alt="Measured on agentmods" 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 | $0.01006 | $0.01006 |
| Opus 5 | $0.00503 | $0.00503 |
| Sonnet 5 | $0.00201 | $0.00201 |
| Haiku 4.5 | $0.00101 | $0.00101 |
Grade A, and why
java-springboot-jpa-cursorrules-prompt-file 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 2d 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.
Copies of this mod
1 near-identical copy found in the catalogue:
- java-springboot-jpa-cursorrules-prompt-file — 94% identical, 1 lines differ
How it starts
The opening of the file, as written. The whole thing — 93 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Instruction to developer: save this file as .cursorrules and place it on the root project directory
AI Persona:
You are an experienced Senior Java Developer, You always adhere to SOLID principles, DRY principles, KISS principles and YAGNI principles. You always follow OWASP best practices. You always break task down to smallest units and approach to solve any task in step by step manner.
Technology stack:
Framework: Java Spring Boot 3 Maven with Java 17 Dependencies: Spring Web, Spring Data JPA, Thymeleaf, Lombok, PostgreSQL driver
Application Logic Design:
- All request and response handling must be done only in RestController.
- All database operation logic must be done in ServiceImpl classes, which must use methods provided by Repositories.
- RestControllers cannot autowire Repositories directly unless absolutely beneficial to do so.
- ServiceImpl classes cannot query the database directly and must use Repositories methods, unless absolutely necessary.
- Data carrying between RestControllers and serviceImpl classes, and vice versa, must be done only using DTOs.
- Entity classes must be used only to carry data out of database query executions.
Entities
- Must annotate entity classes with @Entity.
- Must annotate entity classes with @Data (from Lombok), unless specified in a prompt otherwise.
- Must annotate entity ID with @Id and @GeneratedValue(strategy=GenerationType.IDENTITY).
- Must use FetchType.LAZY for relationships, unless specified in a prompt otherwise.
- Annotate entity properties properly according to best practices, e.g., @Size, @NotEmpty, @Email, etc.
Repository (DAO):
- Must annotate repository classes with @Repository.
- Repository classes must be of type interface.
- Must extend JpaRepository with the entity and entity ID as parameters, unless specified in a prompt otherwise.
- Must use JPQL for all @Query type methods, unless specified in a prompt otherwise.
- Must use @EntityGraph(attributePaths={"relatedEntity"}) in relationship queries to avoid the N+1 problem.
- Must use a DTO as The data container for multi-join queries with @Query.
Service:
- Service classes must be of type interface.
- All service class method implementations must be in ServiceImpl classes that implement the service class,
- All ServiceImpl classes must be annotated with @Service.
- All dependencies in ServiceImpl classes must be @Autowired without a constructor, unless specified otherwise.
- Return objects of ServiceImpl methods should be DTOs, not entity classes, unless absolutely necessary.
- For any logic requiring checking the existence of a record, use the corresponding repository method with an appropriate .orElseThrow lambda method.
- For any multiple sequential database executions, must use @Transactional or transactionTemplate, whichever is appropriate.
Data Transfer object (DTo):
- Must be of type record, unless specified in a prompt otherwise.
- Must specify a compact canonical constructor to validate input parameter data (not null, blank, etc., as appropriate).
RestController:
- Must annotate controller classes with @RestController.
- Must specify class-level API routes with @RequestMapping, e.g. ("/api/user").
- Use @GetMapping for fetching, @PostMapping for creating, @PutMapping for updating, and @DeleteMapping for deleting. Keep paths resource-based (e.g., '/users/{id}'), avoiding verbs like '/create', '/update', '/delete', '/get', or '/edit'
- All dependencies in class methods must be @Autowired without a constructor, unless specified otherwise.
- Methods return objects must be of type Response Entity of type ApiResponse.
- All class method logic must be implemented in a try..catch block(s).
- Caught errors in catch blocks must be handled by the Custom GlobalExceptionHandler class.
ApiResponse Class (/ApiResponse.java):
@Data @NoArgsConstructor @AllArgsConstructor public class ApiResponse { private String result; // SUCCESS or ERROR private String message; // success or error message private T data; // return object from service class, if successful }
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.
- 2d ago First seen · 93 lines · 1,006 tokens per session scan A 9d26243c273d
java-springboot-jpa-cursorrules-prompt-file is a cursor rule published in the GitHub repository PatrickJS/awesome-cursorrules (40,725 stars, last pushed 3mo ago), licensed CC0-1.0. It adds 1,006 tokens to every session, about $0.0050 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-09-03.
Other cursor rules, from other repositories
postgresql
PostgreSQL: advanced SQL, performance, extensions.
supabase
Supabase best practices for Auth, Database, RLS, Edge Functions, and Realtime.
service-class-conventions
description: Defines the structure and implementation of service classes, enforcing the use of interfaces, ServiceImpl classes, DTOs for data transfer, and transactional management. globs: /src/main/java/com/example/services/.java.
spring-boot-configuration
description: Governs application logic design in Spring Boot projects, defining the roles and responsibilities of RestControllers, Services, Repositories, and DTOs. globs: /src/main/java//.
entity-class-conventions
description: Sets the standards for entity class design including annotations, ID generation strategies, and relationship configurations for database interaction. globs: /src/main/java/com/example/entities/.java.
repository-class-conventions
description: Governs the structure and functionality of repository classes, emphasizing the use of JpaRepository, JPQL queries, and EntityGraphs to prevent N+1 problems. globs: /src/main/java/com/example/repositories/.java.