agentleFS
piominpiomin/claude-ai-spring-boot/skills/conventions/SKILL.md

conventions

Skill1.4k starsChanged 6 days agoApache-2.0View on GitHub

Spring Boot project conventions and mandatory rules. Auto-loads when working with Spring Boot, Java, or Maven projects. Enforces No-Lombok, constructor injection, RestClient, Flyway for relational databases, Problem Details errors, and other standards; adds OpenAPI contract rules when the API is built for a UI.

15 other projects use a version of this.

Adopted by

Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data

Week of Sep 13: 0 new projectsWeek of Sep 20: 0 new projectsWeek of Sep 27: 0 new projectsWeek of Oct 4: 0 new projectsWeek of Oct 11: 0 new projectsWeek of Oct 18: 0 new projectsWeek of Oct 25: 0 new projectsWeek of Nov 1: 0 new projects
Sep 2026Oct 2026Nov 2026
New projects taking a version of this file each week, over the 8 weeks our latest run read: only 0 in all, so this is a hint, not a trend.

Most recently taken up by

Who's talking about piomin/claude-ai-spring-boot

The biggest 5 of 17 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 17

Talked about on GitHub (17 times).

On GitHub · 17

12 more on GitHub

Used with

Projects with it also use review and release.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • SentrySkill

    review

    Fixture review skill.

    Also in 3 projects that use this

  • MicrosoftSkill

    release

    Use ONLY when the user explicitly asks to cut/publish a Huabu desktop release or tag a version. Performs an outward action — bumps the version in apps/desktop/package.json, commits + annotated-tags vX.Y.Z, and pushes the branch + tag. That tag push auto-builds the macOS/Windows installers and publishes a GitHub Release. Provides `status`, `bump`, `tag-push`, and a one-command `run` (bump → tag-push).

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 12 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Update README.md on each new version

    line 33
  2. Distinctive:

    Use latest Spring Boot 4.x and Java 21+

    line 37
  3. Very specific:

    Never edit an applied migration.

    line 79
  4. Distinctive:

    Every entity change ships with its migration in the same commit

    line 80

“Common” is measured: kept by at least 6 in 10 of the 12 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Spring Boot Project Conventions

These conventions apply to ALL code generated or reviewed in the project. Follow them strictly.

Mandatory Rules

  • No Lombok — write explicit constructors, getters, setters; use LoggerFactory.getLogger() for loggers
  • Constructor injection — no @Autowired on fields
  • RestClient over RestTemplate/WebClient for blocking HTTP calls
  • RestTestClient with @AutoConfigureRestTestClient for integration tests
  • Testcontainers with @ServiceConnection (not @DynamicPropertySource)
  • Jakarta Persistence (not javax.persistence)
  • Java records for DTOs: <Resource>Response, <Resource>CreateRequest, <Resource>UpdateRequest; controllers never expose entities
  • Maven for dependency management
  • Group ID: pl.piomin.services
  • Artifact name = parent directory name
  • Semantic versioning from 1.0.0 — PATCH by default, MINOR for a backward-compatible feature, MAJOR for a breaking API change; every OpenAPI contract change bumps the version
  • Docker Compose for local dependencies
  • CI pipeline — generate CI/CD config; detect existing CI setup (.github/workflows/, .circleci/, .gitlab-ci.yml) and match it, or default to a sensible choice
  • Tests — always write both positive and negative test cases
  • Update README.md on each new version

Code Quality Standards

  • Use latest Spring Boot 4.x and Java 21+
  • @Transactional(readOnly = true) at service class level, @Transactional on mutating methods
  • @Valid @RequestBody on all POST/PUT endpoints
  • @RestControllerAdvice for global exception handling
  • Return ResponseEntity with proper status codes (201 Created, 204 No Content)
  • @ConfigurationProperties for type-safe config (no raw @Value for groups)
  • @HttpExchange interfaces for declarative HTTP clients
  • Virtual threads enabled by default (spring.threads.virtual.enabled: true)
  • Problem Details enabled (spring.mvc.problemdetails.enabled: true); every error, including the catch-all 500, is RFC 9457 Problem Details, and the catch-all never returns the exception message
  • List endpoints return PagedModel; never Page/PageImpl
  • Optimistic locking with @Version; a lost update returns 409
  • Graceful shutdown configured (server.shutdown: graceful)
  • Actuator probes: permit /actuator/health/** (not only /actuator/health), so the liveness/readiness probes work behind security

REST API Built for a UI (OpenAPI Contract)

Decide first whether these rules apply. They are required only when the API is built for a UI (or another client) that is generated from its OpenAPI contract; they cost extra code and tests that a plain API does not need.

SituationAction
The user says the API backs a web UI or generated clients; the project's CLAUDE.md names a UI (e.g. a crud-ui-blueprint UI); the repo has contract/openapi.json or docs/API-CONTRACT.mdLoad the spring-boot skill, references/ui-contract.md, and follow it
Service-to-service API, internal API, or no client is generated from the contractOptional - the general rules above are enough; use a rule from ui-contract.md only when the user asks for it
UnsureAsk once whether a UI or generated client will consume the API

references/ui-contract.md is the single source of these rules: /api base path without CORS, operationIds, the springdoc 3 contract exported to contract/openapi.json and checked in CI, the fixed FieldError codes, PUT with a required version, filters, Reference {id, label} relations, Keycloak realm layout, public health/info, and the README "Connect a UI" section. Where it differs from the defaults above (e.g. /api instead of /api/v1), it wins; a contract document in the project (docs/API-CONTRACT.md) wins over both.

Relational Database Schema (Flyway)

Decide first whether Flyway applies:

SituationAction
JDBC/JPA with a Flyway-supported relational database (PostgreSQL, MySQL, MariaDB, Oracle, SQL Server, DB2, H2, ...)Use Flyway
Project already uses LiquibaseKeep Liquibase, do not add Flyway
No persistence, NoSQL only (MongoDB, Redis, Cassandra, Elasticsearch), or a database Flyway does not supportSkip Flyway - no dependency, no db/migration, no spring.flyway.*

When Flyway applies:

  • Flyway owns the schema (src/main/resources/db/migration); Hibernate only validates it (spring.jpa.hibernate.ddl-auto: validate). Never use update/create outside tests
  • Dependencies: spring-boot-starter-flyway plus the database module (e.g. flyway-database-postgresql)
  • application.yml: ddl-auto: validate, open-in-view: false, and the database in the readiness probe (management.endpoint.health.group.readiness.include: readinessState,db). Flyway defaults need no spring.flyway.* keys
  • IDs are standard identity columns mapped with GenerationType.IDENTITY: GENERATED BY DEFAULT AS IDENTITY (PostgreSQL, Oracle, DB2, H2), AUTO_INCREMENT (MySQL/MariaDB), IDENTITY (SQL Server); not SERIAL/BIGSERIAL
  • Never edit an applied migration; every change is one new file V<n>__<description>.sql
  • Every entity change ships with its migration in the same commit
  • A new NOT NULL column gets a DEFAULT or a backfill, so existing rows keep working
  • Name constraints and indexes explicitly (pk_, uk_, ck_, fk_, ix_); index every foreign key column; a unique constraint the API reports as a 409 conflict is referenced by name from the exception handler
  • Column DEFAULTs match entity defaults; validation rules get a matching DB CHECK
  • Integration tests use Testcontainers with the production database and assert that all migrations were applied

Details and examples: spring-boot skill, references/data.md (Database Migrations).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.