spring-boot-patterns

spring-boot-patterns is a cursor rule for Cursor from cagridursun/ai-peer-live-coding-agent. It costs 760 tokens per session, scanned A, original, MIT.

A set of preferred patterns and conventions for building Spring Boot services. Spring Boot is a Java framework for creating web services and applications.

In plain words
What is it for?
Use it when starting a Spring Boot service to choose its layers, Java or Kotlin usage, database setup, API generation, error responses, and build conventions.
Why use it?
It gives development work a consistent structure and recommends established choices for code organization, testing, persistence, and error handling.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when starting a Spring Boot service to choose its layers, Java or Kotlin usage, database setup, API generation, error responses, and build conventions.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/cagridursun/ai-peer-live-coding-agent/spring-boot-patterns
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/cagridursun/ai-peer-live-coding-agent

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 spring-boot-patterns

README.md
[![agentmods](https://agentmods.dev/badge/rules/cagridursun/ai-peer-live-coding-agent/spring-boot-patterns/github.svg)](https://agentmods.dev/rules/cagridursun/ai-peer-live-coding-agent/spring-boot-patterns)
Your own site
<a href="https://agentmods.dev/rules/cagridursun/ai-peer-live-coding-agent/spring-boot-patterns"><img src="https://agentmods.dev/badge/rules/cagridursun/ai-peer-live-coding-agent/spring-boot-patterns/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 spring-boot-patterns

Your own site · 80×15
<a href="https://agentmods.dev/rules/cagridursun/ai-peer-live-coding-agent/spring-boot-patterns"><img src="https://agentmods.dev/badge/rules/cagridursun/ai-peer-live-coding-agent/spring-boot-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 760 This file is loaded in full into every session.
When invoked 760 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 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.1 $0.00760 $0.00760
Opus 5.5 $0.00304 $0.00304
Sonnet 5.5 $0.00152 $0.00152
Haiku 4.5 $0.00076 $0.00076

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

Security

Grade A, and why

spring-boot-patterns 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 2mo 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/spring-boot-patterns.mdc · 56 lines

How it starts

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

Spring Boot — Preferred Patterns & Conventions

Reference Code

When building a new service, look for proven patterns in your own practice projects or open-source Spring Boot examples:

  • [EXAMPLE_PROJECT_PATH/URL] conversational / workflow APIs (state machines, step validation)
  • [EXAMPLE_PROJECT_PATH/URL] CRUD REST APIs (standard controller → service → repository)
  • [EXAMPLE_PROJECT_PATH/URL] OpenAPI-first services (codegen for interfaces and DTOs)

Consult those references for project structure, Maven config, test patterns, and error handling — adapt to the interview scope, not copy wholesale.

Architecture

  • 3-layer max: Controller → Service → Repository
  • Kotlin for entity/model classes only (no Lombok); Java for all other code — optional, use when the problem fits
  • OpenAPI codegen for controller interfaces and DTOs (interfaceOnly=true) — optional
  • JPA + H2 in-memory with create-drop DDL — when persistence is required
  • @RestControllerAdvice for centralized error responses
  • BigDecimal for monetary values
  • ConcurrentHashMap for in-memory rate limiting or caches

Maven / Build

  • Kotlin compiler plugins: spring + jpa (allopen + noarg) — when using Kotlin entities
  • kotlin-maven-noarg dependency required for JPA entity no-arg constructors
  • Kotlin compiles before Java; OpenAPI generated sources in Kotlin sourceDirs
  • Java default-compile phase none, custom java-compile after Kotlin — when mixing Kotlin + Java
  • Set maven.compiler.source, maven.compiler.target, maven.compiler.release explicitly in <properties> for IDE compatibility
  • JaCoCo 0.8.14+ for Java 21+ (older versions may fail on newer class file versions)
  • Exclude generated API packages from JaCoCo coverage reports

Error Handling

  • Custom exceptions: NotFoundException (404), ConflictException (409), ValidationException (400), RateLimitException (429)
  • GlobalExceptionHandler maps to ErrorResponse with code, message, details (list of FieldError)
  • Filter-thrown exceptions: inject HandlerExceptionResolver, call resolveException() to route through @RestControllerAdvice
  • Always structured JSON, never plain text

Read the full file on GitHub · 56 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. 2mo ago First seen · 56 lines · 760 tokens per session scan A 4870840e8950

Subscribe to this mod's changes

spring-boot-patterns is a cursor rule published in the GitHub repository cagridursun/ai-peer-live-coding-agent (14 stars, last pushed 2mo ago), licensed MIT. It adds 760 tokens to every session, about $0.0030 per session on Opus 5.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.