Skip to content

Guide · Agent skill

How to use the JPA and Hibernate patterns agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

The jpa-patterns skill gives an AI agent a checklist of JPA and Hibernate practices for Spring Boot projects, written in Spanish with Java examples. It is for Java developers who model tables, write repositories, or tune slow data access. After this guide you will know what the skill changes in the agent's behaviour, how to install it, and how to ask for help in a way that triggers it.

Patrones JPA y Hibernateaffaan-m/ECC · MIT

Quick start

  1. 1Download the ZIP. Download the jpa-patterns ZIP from this page.
  2. 2Unzip the skill. Unzip it into ~/.claude/skills/ for all projects, or into your project's .claude/skills/ folder for one project.
  3. 3Or upload it in the apps. In the Claude apps, go to Settings → Capabilities → Skills and upload the ZIP.
  4. 4Describe your JPA problem. Ask in plain language about entities, queries, transactions, pagination or pool settings, naming Spring Boot and JPA or Hibernate.
  5. 5Review the agent's output. Check suggested mappings, queries and settings against your schema and load before using them.
  6. 6Verify SQL with logging. Enable Hibernate SQL and bind logging to confirm the queries the agent's changes produce.

What the jpa-patterns skill makes the agent do

An agent skill is a folder with a SKILL.md file that the agent reads when a request matches the skill's description. The jpa-patterns skill covers JPA/Hibernate entity design, relationships, query optimisation, transactions, auditing, indexing, pagination and connection pooling in Spring Boot.

Once the skill is active, the agent follows the patterns in that file when you ask about these topics. The source lists examples such as avoiding N+1 queries with join fetch, using DTO projections for read paths, and relying on Flyway or Liquibase instead of Hibernate auto DDL.

Install the jpa-patterns skill from a ZIP

Download the ZIP for the skill from this page and unzip it. The skill is a single file, SKILL.md, inside a folder named for the skill.

To make it available to Claude Code for all your projects, unzip it into ~/.claude/skills/. To make it available only inside one project, unzip it into that project's .claude/skills/ folder.

In the Claude apps you can instead upload the ZIP under Settings → Capabilities → Skills.

  • Personal install: ~/.claude/skills/
  • Project install: .claude/skills/ inside your project

Trigger the skill with natural requests

You do not need a special command. The skill's description matches requests about modelling tables, relationships, slow queries, transactions, auditing, pagination or connection pool settings. Describe your problem in plain language and name your stack (Spring Boot, JPA or Hibernate) so the match is clear.

  • Review this @OneToMany mapping for N+1 query problems in my Spring Boot service.
  • Design the JPA entities and indexes for a markets table with a unique slug and a status column.
  • Set up cursor-style pagination for my orders repository using Spring Data JPA.
  • Check my HikariCP settings for a Spring Boot app that runs on PostgreSQL.
  • Set up Flyway migrations instead of relying on Hibernate auto DDL.

Examples of what the agent produces

The skill includes concrete patterns the agent can adapt. For example, it shows an entity with @Table indexes, @EntityListeners(AuditingEntityListener.class) and @Enumerated(EnumType.STRING), and a repository query that uses left join fetch to load a collection in one query.

For reads, the skill recommends projection interfaces so you select only the columns you need. For pagination it shows PageRequest.of with a sort, and mentions cursor-style paging using id > :lastId in JPQL with ordering.

  • Mark service methods @Transactional and use readOnly = true for read paths.
  • Avoid EAGER fetching on collections.
  • Use hibernate.jdbc.batch_size with saveAll for batch writes.
@Query("select m from MarketEntity m left join fetch m.positions where m.id = :id") Optional<MarketEntity> findWithPositions(@Param("id") Long id);

Configure HikariCP and check the SQL

The skill lists recommended HikariCP properties as a starting point. Treat them as defaults to review against your own load, not as tuned values.

To verify query efficiency, the skill suggests enabling SQL logging at DEBUG and bind-parameter logging at TRACE for Hibernate.

  • Note: the skill's PostgreSQL LOB property applies only if your project handles LOBs on PostgreSQL.
spring.datasource.hikari.maximum-pool-size=20 spring.datasource.hikari.minimum-idle=5 spring.datasource.hikari.connection-timeout=30000 spring.datasource.hikari.validation-timeout=5000 logging.level.org.hibernate.SQL=DEBUG logging.level.org.hibernate.orm.jdbc.bind=TRACE

What the skill needs and safety notes

The skill assumes a Java and Spring Boot project that uses JPA or Hibernate, with examples built around Spring Data JPA and HikariCP as the connection pool. PostgreSQL is referenced for LOB handling, Flyway or Liquibase is recommended for migrations, and Testcontainers is recommended for data-access tests.

The skill runs no scripts and uses no network access. The examples are generic, so check any generated change against your schema and expected load before applying it, especially database changes. The skill does not verify the code it suggests.

  • Not suitable for Node.js, Python or plain JDBC projects.
  • Do not apply generated migrations or mapping changes to production without review.

What people use it for

  • Finding N+1 query problems in an existing @OneToMany mapping and fixing them with join fetch or projections.
  • Designing entities, unique slugs and composite indexes for a new Spring Boot table.
  • Setting up paginated or cursor-style list endpoints with Spring Data JPA.
  • Reviewing HikariCP pool size and timeout settings for a PostgreSQL-backed service.
  • Planning Flyway or Liquibase migrations to replace Hibernate auto DDL.

Frequently asked questions

Is the jpa-patterns skill free to use?

The skill is published under the MIT licence, as stated on this page. Check the licence file in the source repository for the full terms before redistributing it.

What do I need to use the jpa-patterns skill?

You need a Java and Spring Boot project that uses JPA or Hibernate. The examples assume Spring Data JPA and HikariCP, and the skill recommends Flyway or Liquibase and Testcontainers.

How do I install the jpa-patterns skill?

Download the ZIP from this page and unzip it into ~/.claude/skills/ for all projects or into a project's .claude/skills/ folder. In the Claude apps you can upload the ZIP under Settings → Capabilities → Skills.

Does the skill run scripts or access the network?

According to the listing, the skill runs no scripts and uses no network access. It consists of a SKILL.md file with guidance and examples.

Does it work with Node.js, Python or plain JDBC?

No. The patterns are for JPA and Hibernate, so they do not apply to Node.js, Python or plain JDBC codebases.

Why does the agent recommend Flyway instead of Hibernate auto DDL?

The skill states that you should use Flyway or Liquibase and never depend on Hibernate auto DDL in production. It also recommends idempotent, additive migrations.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Use this skill if you are a Java developer working on a Spring Boot service with JPA or Hibernate and want a consistent checklist for entities, fetching, transactions and pool settings. Pick something else if your project does not use JPA or Hibernate, or if you need verified, production-ready database changes, since the examples are generic and not tested by the skill.

Download the skill