java-springboot-jpa-cursorrules-prompt-file

java-springboot-jpa-cursorrules-prompt-file is a cursor rule for Cursor from ItamarZand88/awesome-agent-conventions. It costs 1,052 tokens per session, scanned A, a copy of java-springboot-jpa-cursorrules-prompt-file, MIT.

A set of Cursor instructions for Java 17 projects using Spring Boot, a Java web framework, and JPA, a database-access library. It guides the coding agent on project structure and coding practices.

In plain words
What is it for?
Use it when building or maintaining Spring Boot applications with Maven, PostgreSQL, Thymeleaf, and JPA.
Why use it?
It gives the agent consistent rules for handling web requests, services, repositories, and database work. This reduces the need to repeat project conventions in each task.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc). Also seen: mentions Cursor.

Good fit Use it when building or maintaining Spring Boot applications with Maven, PostgreSQL, Thymeleaf, and JPA.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/itamarzand88/awesome-agent-conventions/java-springboot-jpa-cursorrules-prompt-file
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.

Clone the repo
git clone --depth 1 https://github.com/ItamarZand88/awesome-agent-conventions

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 java-springboot-jpa-cursorrules-prompt-file

README.md
[![agentmods](https://agentmods.dev/badge/rules/itamarzand88/awesome-agent-conventions/java-springboot-jpa-cursorrules-prompt-file/github.svg)](https://agentmods.dev/rules/itamarzand88/awesome-agent-conventions/java-springboot-jpa-cursorrules-prompt-file)
Your own site
<a href="https://agentmods.dev/rules/itamarzand88/awesome-agent-conventions/java-springboot-jpa-cursorrules-prompt-file"><img src="https://agentmods.dev/badge/rules/itamarzand88/awesome-agent-conventions/java-springboot-jpa-cursorrules-prompt-file/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.

agentmods 80×15 button for java-springboot-jpa-cursorrules-prompt-file

Your own site · 80×15
<a href="https://agentmods.dev/rules/itamarzand88/awesome-agent-conventions/java-springboot-jpa-cursorrules-prompt-file"><img src="https://agentmods.dev/badge/rules/itamarzand88/awesome-agent-conventions/java-springboot-jpa-cursorrules-prompt-file.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,052 This file is loaded in full into every session.
When invoked 1,052 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 94% copy Near-identical to another mod 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.1 $0.01052 $0.01052
Opus 5.5 $0.00421 $0.00421
Sonnet 5.5 $0.00210 $0.00210
Haiku 4.5 $0.00105 $0.00105

Measured 1mo ago against content hash 1f9800a7cc4e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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 1mo 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.

Origin

This is a copy

94% identical to java-springboot-jpa-cursorrules-prompt-file — 1 line differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

conventions/agent-rules/examples/awesome-cursorrules-java-springboot/java-springboot-jpa-cursorrules-prompt-file.mdc · 94 lines

How it starts

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


description: "Cursor rules for Java development with Springboot and JPA integration." globs: */ alwaysApply: false

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:

  1. All request and response handling must be done only in RestController.
  2. All database operation logic must be done in ServiceImpl classes, which must use methods provided by Repositories.
  3. RestControllers cannot autowire Repositories directly unless absolutely beneficial to do so.
  4. ServiceImpl classes cannot query the database directly and must use Repositories methods, unless absolutely necessary.
  5. Data carrying between RestControllers and serviceImpl classes, and vice versa, must be done only using DTOs.
  6. Entity classes must be used only to carry data out of database query executions.

Entities

  1. Must annotate entity classes with @Entity.
  2. Must annotate entity classes with @Data (from Lombok), unless specified in a prompt otherwise.
  3. Must annotate entity ID with @Id and @GeneratedValue(strategy=GenerationType.IDENTITY).
  4. Must use FetchType.LAZY for relationships, unless specified in a prompt otherwise.
  5. Annotate entity properties properly according to best practices, e.g., @Size, @NotEmpty, @Email, etc.

Repository (DAO):

  1. Must annotate repository classes with @Repository.
  2. Repository classes must be of type interface.
  3. Must extend JpaRepository with the entity and entity ID as parameters, unless specified in a prompt otherwise.
  4. Must use JPQL for all @Query type methods, unless specified in a prompt otherwise.
  5. Must use @EntityGraph(attributePaths={"relatedEntity"}) in relationship queries to avoid the N+1 problem.
  6. Must use a DTO as The data container for multi-join queries with @Query.

Service:

  1. Service classes must be of type interface.
  2. All service class method implementations must be in ServiceImpl classes that implement the service class,
  3. All ServiceImpl classes must be annotated with @Service.
  4. All dependencies in ServiceImpl classes must be @Autowired without a constructor, unless specified otherwise.
  5. Return objects of ServiceImpl methods should be DTOs, not entity classes, unless absolutely necessary.
  6. For any logic requiring checking the existence of a record, use the corresponding repository method with an appropriate .orElseThrow lambda method.
  7. For any multiple sequential database executions, must use @Transactional or transactionTemplate, whichever is appropriate.

Data Transfer object (DTo):

  1. Must be of type record, unless specified in a prompt otherwise.
  2. Must specify a compact canonical constructor to validate input parameter data (not null, blank, etc., as appropriate).

RestController:

  1. Must annotate controller classes with @RestController.
  2. Must specify class-level API routes with @RequestMapping, e.g. ("/api/user").
  3. 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'
  4. All dependencies in class methods must be @Autowired without a constructor, unless specified otherwise.
  5. Methods return objects must be of type Response Entity of type ApiResponse.
  6. All class method logic must be implemented in a try..catch block(s).
  7. Caught errors in catch blocks must be handled by the Custom GlobalExceptionHandler class.

Read the full file on GitHub · 94 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. 1mo ago First seen · 94 lines · 1,052 tokens per session scan A 1f9800a7cc4e

Subscribe to this mod's changes

java-springboot-jpa-cursorrules-prompt-file is a cursor rule published in the GitHub repository ItamarZand88/awesome-agent-conventions (33 stars, last pushed 2mo ago), licensed MIT. It adds 1,052 tokens to every session, about $0.0042 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 94% identical to java-springboot-jpa-cursorrules-prompt-file, differing in 1 line, and is treated as a copy.