agentleFS
hi-donwihi-donwi/Donwi-Skills/skills/quarkus-persistence/SKILL.md

quarkus-persistence

Skill0 starsChanged 13 days agoMITView on GitHub

Work with data in Quarkus: JPA entities, PanacheRepository, safe Flyway migrations, PostgreSQL conventions, audit columns, soft delete, and transaction boundaries.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    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. Very specific:

    Before writing one against real data, read references/migrations.md.

    line 44

≈ “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

Quarkus Persistence

Overview

Full rules: .agents/standards/java/database.md. This is the workflow and the patterns.

When to use

  • Creating or changing an entity or table
  • Writing a Flyway migration
  • Writing or optimising a query
  • A slow endpoint suspected of being a data problem
  • Deciding where @Transactional goes

Process

  1. Migration first. The schema is the source of truth and the entity follows it, never the other way round. Forward-only; no edit to a migration that has run anywhere.
  2. The entity mirrors the table. It does not create it. @Enumerated(EnumType.STRING) always — ORDINAL stores the enum's position in the source, so inserting one value in the middle silently changes the meaning of every existing row.
  3. PanacheRepository, not active record. A repository can be mocked, which is what lets a service be tested in milliseconds without a database.
  4. Audit columns come from a @MappedSuperclass, set by @PrePersist/@PreUpdate, not by each caller remembering.
  5. Own the transaction at the service boundary. @Transactional belongs on the service method that represents one unit of work — not on a repository, not on a resource.
  6. Treat N+1 as a bug, not as slowness. It passes every test with ten rows and fails in production with ten thousand. Fetch what the caller will read.
  7. Let the database do set work. Sums, counts, group-bys and paging belong in SQL, not in a loop over an entity list.

A migration that is safe on an empty database can still lock a populated one for minutes. Before writing one against real data, read references/migrations.md.

Verification

  • Migration exists before the entity change
  • New columns are nullable or backfilled
  • @Transactional is on the service, not the resource
  • Collection queries cannot N+1
  • Report aggregations run in SQL, not in Java

Red flags

PitfallConsequence
generation=updateHibernate alters the production schema. Always none.
EnumType.ORDINALInserting an enum value changes the meaning of old data
float/double for moneyRounding errors in financial reports
TIMESTAMP without a zoneAmbiguous when the server's zone changes
Entity returned as JSONInternal columns leak, LazyInitializationException
Editing a merged migrationChecksum failure, startup dies in staging
A transaction wrapping an HTTP callConnection pool exhausted under load
No index on a filter columnSequential scan; fine in a demo, fatal in production

References

  • references/entities-and-repositories.md - the worked migration/entity/repository/audit example
  • references/migrations.md - changes that are safe against a populated table
  • references/transactions-and-queries.md - transaction boundaries, N+1, report queries

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.