spring-boot-service

spring-boot-service is a cursor rule for Cursor from lsampaioweb/ai-instructions. It costs 0 tokens per session (415 once invoked), scanned A, original, MIT.

A set of rules for Spring Boot service classes, which contain an application’s business decisions and coordination between components.

In plain words
What is it for?
It guides service interfaces and implementations, read-only and write transactions, and orchestration across application features.
Why use it?
It gives developers consistent guidance for naming services, placing business logic, and defining database transaction boundaries.

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/lsampaioweb/ai-instructions/spring-boot-service
Clone the repo
git clone --depth 1 https://github.com/lsampaioweb/ai-instructions

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-service

README.md
[![agentmods](https://agentmods.dev/badge/rules/lsampaioweb/ai-instructions/spring-boot-service.svg)](https://agentmods.dev/rules/lsampaioweb/ai-instructions/spring-boot-service)
Your own site
<a href="https://agentmods.dev/rules/lsampaioweb/ai-instructions/spring-boot-service"><img src="https://agentmods.dev/badge/rules/lsampaioweb/ai-instructions/spring-boot-service.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 415 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.00415
Opus 5 $0.00000 $0.00208
Sonnet 5 $0.00000 $0.00083
Haiku 4.5 $0.00000 $0.00042

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

Security

Grade A, and why

spring-boot-service 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/spring-boot-service.mdc · 29 lines

What it actually says

Spring Boot Service Engine

Naming Conventions

  • Name service interfaces with the *Service suffix (e.g., HolidayService, PaymentService).
  • Name service implementations with the *ServiceImpl suffix (e.g., HolidayServiceImpl, PaymentServiceImpl).
  • Use descriptive, domain-specific names for all service types (never BusinessService, OperationService, or AppService).

Rules

  • For authorization annotations and role enforcement, defer to spring-boot-security.mdc.
  • Place @Service on the implementation class, not on the interface.
  • Implement all cross-feature orchestration and business decision logic in service classes.
  • Use a service interface paired with a *ServiceImpl implementation for business modules that have multiple collaborators or evolving API contracts.
  • Use a single @Service class without a separate interface for simple integration or utility services.
  • Apply @Transactional(readOnly = true) to service methods that only read data.
  • Apply @Transactional to service methods that perform write operations.
  • Apply @Transactional annotations at the method level.
  • Use REQUIRED transaction propagation for service methods that participate in or start a transaction.
  • Use REQUIRES_NEW propagation only when the operation must commit independently of the outer transaction.
  • Return domain model objects or response DTOs from service methods.
  • Catch unwrapped persistence-layer exceptions at the service boundary and rethrow as domain exceptions (e.g., ResourceNotFoundException, DuplicateResourceException).
  • Do not re-wrap feature-scoped exceptions already thrown by the repository for the same SQL failure.
  • When a repository lookup returns empty Optional<T> for a required resource, throw the appropriate domain exception at the service boundary.
  • Route all outbound integration calls through service methods.
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 · 29 lines · 0 tokens per session scan A 92bf933bfcc5

Subscribe to this mod's changes

spring-boot-service is a cursor rule published in the GitHub repository lsampaioweb/ai-instructions (1 stars, last pushed 12d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 415 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.