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 skills/cosbort/agent-skills/java-spring-best-practicesnpx 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.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.00104 | $0.02897 |
| Opus 5 | $0.00052 | $0.01448 |
| Sonnet 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 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.
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.
- 4d 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 (6 stars, last pushed 1mo ago), licensed MIT. It adds 104 tokens to every session and 2,897 once invoked, about $0.0005 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-08-31.
Other skills, from other repositories
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.
effective-java
Generate and review Java code using patterns and best practices from Joshua Bloch's "Effective Java" (3rd Edition). Use this skill whenever the user asks about Java best practices, API design, object creation patterns, generics, enums, lambdas, streams, concurrency, serialization, method design, exception handling, or…
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…
memorix-sessions
Use when resuming work, preparing handoff context, binding an HTTP control-plane project, or deciding whether sessionstart is useful.
memorix-troubleshooting
Use when Memorix MCP, setup, project binding, HTTP control plane, hooks, skills, or agent integration is missing, stale, or failing.
self-assessment
Interactive skill assessment with personalized learning path generation.