agentleFS
a365ngaya365ngay/CogniRouter/skills/senior-java-spring/SKILL.md

senior-java-spring

Skill2 starsChanged 5 days agoMITView on GitHub

Use when designing, implementing, debugging, reviewing, or refactoring Java or Kotlin services with Spring Boot, Spring MVC/WebFlux, Spring Data JPA, transactions, validation, Spring Security, configuration, messaging, Maven/Gradle builds, tests, or observability.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Keep controllers thin; put business rules in services.

    line 20
  2. Very specific:

    Place @Transactional on service methods with deliberate propagation and read-only flags.

    line 22
  3. Very specific:

    Use constructor injection, immutable configuration properties (@ConfigurationProperties with validation), and explicit timeouts/retries for …

    line 25
  4. Distinctive:

    Add Micrometer metrics, structured logs with correlation IDs, and health indicators consistent with the project for changed operational …

    line 26
  5. Very specific:

    Run the build with unit tests and relevant slice tests (@WebMvcTest, @DataJpaTest) or integration tests with Testcontainers.

    line 30

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “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

Senior Java Spring

Role

Build Spring services with clear layering, correct transaction and persistence behavior, secure endpoints, validated input, and tests at the right level.

Before Editing

  1. Inspect Java/Kotlin and Spring Boot versions, build tool (Maven/Gradle), module layout, controller/service/repository conventions, DTO mapping (MapStruct or manual), exception handling (@ControllerAdvice), security config, profiles, and test setup (JUnit 5, Mockito, Testcontainers).
  2. Trace the request or message from entry point through validation, security, service logic, transactions, repositories, external calls, and response mapping.
  3. Reuse existing patterns; do not introduce a new framework layer, mapper, or reactive stack for one change.

Implementation Rules

  • Keep controllers thin; put business rules in services; expose DTOs, never JPA entities, across the API boundary.
  • Validate input with Bean Validation (@Valid, constraints) and map failures to the project's error contract.
  • Place @Transactional on service methods with deliberate propagation and read-only flags. Remember self-invocation bypasses proxies; avoid long transactions around remote calls.
  • Watch JPA pitfalls: N+1 queries (use fetch joins or entity graphs), lazy loading outside transactions, equals/hashCode on entities, and unbounded findAll. Paginate lists.
  • Enforce authorization in Spring Security with method or request rules tied to the resource, not only UI hiding. Never log secrets or personal data.
  • Use constructor injection, immutable configuration properties (@ConfigurationProperties with validation), and explicit timeouts/retries for outbound HTTP and messaging.
  • Add Micrometer metrics, structured logs with correlation IDs, and health indicators consistent with the project for changed operational paths.

Testing and Verification

Run the build with unit tests and relevant slice tests (@WebMvcTest, @DataJpaTest) or integration tests with Testcontainers. Check generated SQL for changed queries and run static analysis the project already uses.

Review Checklist

  • Are transaction boundaries and propagation correct, including rollback on the intended exceptions?
  • Are queries bounded, indexed, and free of N+1 behavior?
  • Is input validated and authorization enforced before side effects?
  • Are entities kept inside the persistence layer and errors mapped consistently?

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.