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 skills add cosbort/agent-skills --skill java-spring-best-practicesgit clone --depth 1 https://github.com/cosbort/agent-skillsWrote 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/skills/cosbort/agent-skills/java-spring-best-practices)<a href="https://agentmods.dev/skills/cosbort/agent-skills/java-spring-best-practices"><img src="https://agentmods.dev/badge/skills/cosbort/agent-skills/java-spring-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/skills/cosbort/agent-skills/java-spring-best-practices"><img src="https://agentmods.dev/badge/skills/cosbort/agent-skills/java-spring-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.00104 | $0.02897 |
| Opus 5.5 | $0.00042 | $0.01159 |
| Sonnet 5.5 | $0.00021 | $0.00579 |
| Haiku 4.5 | $0.00010 | $0.00290 |
Grade A, and why
java-spring-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 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.
How it starts
The opening of the file, as written. The whole thing — 410 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Java Spring Boot Best Practices v2.0
Production-ready Spring Boot guide. Updated for Spring Boot 3.5.x / 4.0.x, Java 17+ (optimized for 21+).
What's New in v2.0
- Java Records as DTOs (immutable by default)
- Virtual Threads for high-concurrency I/O (
spring.threads.virtual.enabled=true) - ProblemDetail (RFC 7807) for standardized error responses
- RestClient replaces RestTemplate (fluent, synchronous)
- Structured Logging built into Spring Boot 3.4+
- Testcontainers as primary integration testing strategy (replaces H2)
- Observability with Micrometer Observation API
- Docker Compose integration for dev environments
- Sealed classes for exception hierarchies
- GraalVM Native Image / CDS awareness
Quick Start Checklist
- ✅ Java 17+ (21+ for Virtual Threads)
- ✅
spring-boot-starter-parentfor dependency management - ✅ Constructor injection with
@RequiredArgsConstructor - ✅ Java Records for DTOs (not mutable
@Dataclasses) - ✅ Controllers = routing only; Services = business logic
- ✅ ProblemDetail (RFC 7807) +
@RestControllerAdvice - ✅
@Valid+ Bean Validation on record components - ✅ SLF4J
{}placeholders + structured logging - ✅ YAML profiles (dev/prod/test)
- ✅ Unit tests (Mockito) + Integration tests (Testcontainers)
- ✅
spring.threads.virtual.enabled=true
Core Architecture
controller/ → HTTP routing only (thin)
↓
service/ → Business logic, caching, validation
↓
repository/ → Spring Data JPA
↓
entity/ → JPA domain models
Each layer depends only on layers below. Controllers never access repositories directly. See architecture.md for layer-based vs feature-based patterns.
Dependency Injection (Constructor Only)
@Service
@RequiredArgsConstructor
public class ProductService {
private final ProductRepository repository;
private final ProductMapper mapper;
}
Java Records as DTOs
Records replace @Data Lombok classes: immutable, concise, thread-safe.
What ships with it
13 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- README.md 3.5 KB
- references/architecture.md 5.3 KB
- references/config-reference.md 8.1 KB
- references/exception-handling.md 11 KB
- references/performance-guide.md 12 KB
- references/streams-guide.md 8.1 KB
- references/testing-guide.md 13 KB
- scripts/GlobalExceptionHandler.java 3.5 KB
- scripts/logback-config.xml 3.1 KB
- scripts/pom-template.xml 8.1 KB
- scripts/ProductController.java 2.6 KB
- scripts/ProductService.java 3.6 KB
- scripts/ProductServiceTest.java 8.7 KB
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.
- 1mo ago First seen · 410 lines · 104 tokens per session scan A c90d42bc2991
java-spring-best-practices is a skill published in the GitHub repository cosbort/agent-skills (5 stars, last pushed 2mo ago), licensed MIT. It adds 104 tokens to every session and 2,897 once invoked, about $0.0004 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-31.
Other skills, from other repositories
spring-boot-idioms
Spring Boot 3.x framework patterns: constructor-based DI, Spring Data JPA, REST controllers with RFC 7807 error handling, Actuator observability, and slice testing. Use when building or maintaining Spring Boot microservices. Pair with java-idioms.
spring-boot-in-action
Write and review Spring Boot applications using practices from "Spring Boot in Action" by Craig Walls. Covers auto-configuration, starter dependencies, externalizing configuration with properties and profiles, Spring Security, testing with MockMvc and @SpringBootTest, Spring Actuator for production observability, and…
java-spring-boot
Java and Spring Boot development patterns. Spring Boot 3.x, Spring Security, JPA/Hibernate, reactive programming, and production patterns. Use when building Java backend services, REST APIs, or enterprise applications.
springboot-patterns
Spring Boot architecture patterns, REST API design, layered services, data access, caching, async processing, and logging. Use for Java Spring Boot backend work.
java-coding-standards
Java coding standards for Spring Boot services: naming, immutability, Optional usage, streams, exceptions, generics, and project layout.
java-spring-development
Java Spring Boot development guidelines with best practices for building robust, secure, and maintainable enterprise applications.