Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
amplicode avatar

Spring Data Jdbc

  • 183 installs
  • 105 repo stars
  • Updated July 27, 2026
  • amplicode/spring-skills

spring-data-jdbc is an agent skill that detects and explains Spring Data JDBC aggregate-root and owned-entity conventions via MCP entity inspection.

About

spring-data-jdbc is an agent skill for solo builders maintaining Spring Data JDBC domains aligned with DDD aggregates. It walks a fixed multi-step ritual: inventory entities, classify aggregate roots versus owned children using MCP tooling, and reconcile @MappedCollection, @Embedded, and AggregateReference patterns against what the database mapping actually expects. The skill treats get_jdbc_entity_details output as authoritative—roots have null aggregateRootFqn, children point to a named root, and referencedBy surfaces incoming links. Install it when you are extending a Java API or modular monolith and need the agent to stop guessing repository boundaries or flattening embeddables into the wrong lifecycle. It suits intermediate-to-advanced backends where JDBC (not JPA) is the persistence choice and Amplicode MCP is available in the workspace.

  • Ordered substeps 1.1 → 1.2 → 1.3 → 1.4 → 1.5 for detecting aggregate conventions without skipping
  • MCP get_jdbc_entity_details as source of truth for root vs owned child vs AggregateReference
  • Distinguishes @Embedded value objects from owned entities with separate tables
  • list_all_domain_entities inventory step for aggregate discovery
  • Cross-aggregate links documented only via AggregateReference, never direct object graphs

Spring Data Jdbc by the numbers

  • 183 all-time installs (skills.sh)
  • Ranked #31 of 89 Java & JVM skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/amplicode/spring-skills --skill spring-data-jdbc

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs183
repo stars105
Last updatedJuly 27, 2026
Repositoryamplicode/spring-skills

What it does

Audit and document Spring Data JDBC DDD aggregate roots, owned children, and AggregateReference links using MCP entity details before refactoring repositories.

Who is it for?

Best when you use Amplicode MCP on Spring Data JDBC codebases and need consistent aggregate documentation before merges.

Skip if: Greenfield projects without JDBC entities, JPA-only stacks, or repos with no MCP Spring domain tools wired up.

When should I use this skill?

Working on Spring Data JDBC domains, aggregate boundaries, @MappedCollection/@Embedded, or when MCP JDBC entity detail tools are in play.

What you get

You get an ordered aggregate inventory and role classification per entity aligned with MCP details, ready for repository and schema changes.

  • Aggregate inventory and root/child classification
  • Documented cross-aggregate AggregateReference map

By the numbers

  • 5 ordered substeps starting at 1.1 through 1.5

Files

SKILL.mdMarkdownGitHub ↗

Detection guard

Before applying any rule from this skill, confirm the target file imports from org.springframework.data.relational.core.mapping / org.springframework.data.annotation. If you see jakarta.persistence.* imports, stop and switch to the spring-data-jpa skill — the two stacks are not interchangeable and patterns from JPA (HibernateProxy, @ManyToOne, @OneToMany, @JoinColumn, FetchType) do not apply here.

Harness compatibility

This skill is designed to work across multiple agent runtimes (Claude Code, Codex, OpenCode). Two harness-specific primitives are referenced by name in this skill; treat them as preferred-but-optional and degrade gracefully:

  • `AskUserQuestion` (Claude Code structured prompt with multiple-choice options). When the runtime supports it, use it for Step 1.4 of every conventions file — the JSON examples in those files map to the tool's expected payload. When the runtime does not support it (Codex, OpenCode, plain CLI), ask exactly the same questions inline in the conversation: render each question as a short paragraph followed by a numbered or bulleted list of options, mark the recommended option with (Recommended), and accept either the option label or its number in the user's reply. The decision tree is identical; only the rendering changes.
  • "Memory" — Claude Code's persistent file-based auto-memory. References like "check memory for previously saved conventions" mean: if you have access to Claude Code's auto-memory, look there first. In Codex/OpenCode (and any runtime without persistent memory), substitute "scan earlier turns of this conversation" — if conventions were resolved in the same session, reuse them; if the session is fresh, just run Step 1 from scratch.

Do not refuse a task because one of these primitives is missing. Substitute the inline equivalent and announce the substitution once at the start of the task ("AskUserQuestion not available in this runtime — asking inline" / "no persistent memory in this runtime — detecting conventions from scratch").

---

Preflight: Spring MCP

This skill is part of the Spring Agent Toolkit and is designed to work with the Spring MCP server (provided by the Amplicode IntelliJ plugin). Before doing anything else, check your tool list for any Spring MCP tool — they are exposed under the amplicode MCP server (e.g. get_jdbc_entity_details, list_all_domain_entities, list_entity_repositories); harnesses that flatten MCP tools into the tool list use the mcp__amplicode__ prefix on the same names.

  • If at least one Amplicode tool is available — MCP is connected. Proceed with the skill below.
  • If none are available — stop and invoke the `amplicode-install` skill (bundled with the Spring Agent Toolkit). It installs the Amplicode plugin and walks the user through the «Настроить Spring Agent» welcome-screen button + MCP-client restart. After it completes, the MCP tools become available — resume this skill.
  • If amplicode-install is not registered in your skill list or the user declines to install (e.g. they are running in a harness without MCP support such as a CI sandbox), continue with the file-read fallbacks described in the next section so the task is not blocked.

---

MCP availability and fallbacks

This skill prefers the Spring MCP tools (get_jdbc_entity_details, list_all_domain_entities, list_entity_repositories) because they return resolved, project-wide answers in one call. If the Spring MCP server is unreachable (connection error, tool not registered, harness without MCP support) and the user has chosen not to install the plugin via the Preflight above, do not refuse the task — fall back to direct file reads / grep:

This project is Kotlin-first (Kotlin 2.2.20 primary, Java for some modules) — every fallback grep must hit both *.kt and *.java. Do not pass -t java to rg; either omit the type filter or use -t kotlin -t java.

  • Instead of list_all_domain_entities — grep the project for org.springframework.data.relational.core.mapping.Table imports (or @Table annotations whose import resolves there) to enumerate JDBC entities. Works the same in .java and .kt.
  • Instead of list_entity_repositories — grep for the repository-declaration keyword (extends in Java, : in Kotlin; Kotlin may omit the space before the colon, so use \s*). Spell out every base interface explicitly rather than relying on optional prefixes — (List)?(...|...) parses ambiguously to a human reader:
  (extends|:)\s*(ListCrudRepository|CrudRepository|ListPagingAndSortingRepository|PagingAndSortingRepository)\b
  • Instead of get_jdbc_entity_details — see the "Without get_jdbc_entity_details" subsection in references/aggregate-rules-impl.md. The manual procedure there yields the same idField.type / aggregateRootFqn / aggregates / referencedBy information by reading source files (both Java and Kotlin).

State once at the start of the task that you are operating in fallback mode and why (e.g. "Spring MCP not reachable — using file-read fallback"). Do not silently switch.

Working with JDBC Entities

When the task involves creating or modifying a Spring Data JDBC entity:

1. If entity conventions have not been detected yet in this conversation — check memory for previously saved conventions first (or earlier conversation turns in runtimes without persistent memory — see "Harness compatibility"). If found, reuse them. Otherwise read references/entity-conventions.md and follow all substeps there to detect project conventions. 2. Read references/entity-rules-impl.md and follow the rules there when writing or modifying the entity. 3. If the entities involve any relationship between each other or to existing entities — a collection field, a reference field, an FK column, or a relationship described in the user's request ("X belongs to Y", "Y has many X") — also read references/aggregate-rules-impl.md before deciding the shape of any link. The entity rules cover field syntax; the aggregate rules decide which relationship shapes are legal and in which direction the link may be held. Skipping this step is how illegal shapes (raw FK to a member of another aggregate, references to non-roots) get generated.

Tool-vs-source policy — when you are going to edit the entity, read the source file directly. get_jdbc_entity_details is documented as a read-only analysis tool and explicitly says "you plan to modify the entity class afterward — read the file directly instead." Use the MCP tool only for cross-aggregate context that is not visible from one file:

  • The target's role in its aggregate (aggregateRootFqn).
  • Other aggregates pointing here (referencedBy).
  • The id type of a different aggregate you need to link to via AggregateReference<Other, IdType> (when reading Other's source is overkill).

For everything in the file you are editing — id type, current fields, current @MappedCollection / @Embedded declarations — read the file.

Reviewing JDBC Patterns

When the user asks to review JDBC patterns, conventions, or code quality in the project:

1. Detect current conventions by following references/entity-conventions.md (steps 1.1–1.5). 2. Compare the detected conventions against the best practices defined in references/entity-rules-impl.md. For each deviation, output a recommendation in the format:

### JDBC Review

**[Convention or pattern name]**
- Current: <what the project does>
- Recommended: <what the best practice says>
- Reason: <why this matters>

If no deviations are found — state that the project follows best practices.

---

Working with JDBC Repositories

When the task involves adding or modifying a Spring Data JDBC repository:

1. If repository conventions have not been detected yet in this conversation — check memory (or earlier conversation turns — see "Harness compatibility") first. Otherwise read references/repository-conventions.md and follow all substeps there. 2. Read references/repository-rules-impl.md and follow the rules there.

Before creating a new repository, call list_entity_repositories with entityFqn = <target> to confirm no repository already exists for this entity, and call get_jdbc_entity_details for the target — a repository may only be created for an aggregate root (aggregateRootFqn == null). Note that list_entity_repositories has no JDBC filter; filter results manually if you called it without entityFqn.

---

Working with Aggregates

When the task involves aggregate boundaries — adding AggregateReference fields, converting an owned @MappedCollection into a cross-aggregate link, splitting an aggregate, or answering "who references X?" / "what's inside aggregate Y?":

1. If aggregate conventions have not been detected yet in this conversation — check memory (or earlier conversation turns — see "Harness compatibility") first. Otherwise read references/aggregate-conventions.md and follow all substeps there. 2. Read references/aggregate-rules-impl.md and follow the rules there.

The MCP tool get_jdbc_entity_details is the source of truth for aggregate membership. Its response carries aggregateRootFqn (null if this entity is itself a root), aggregates (owned children, recursive — only populated for roots), and referencedBy (other aggregates linking here via AggregateReference). Read these before making any aggregate-boundary decision.

Related skills

How it compares

Use instead of ad-hoc code reading when you need DDD-aligned JDBC rules tied to machine-readable entity metadata.

FAQ

Who is spring-data-jdbc for?

Backend-focused developers and small teams on Spring Data JDBC who want agents to follow DDD aggregate rules with MCP-backed entity facts.

When should I use spring-data-jdbc?

Use in Build when modeling or refactoring aggregates; also in Ship review when validating that new entities are roots, owned children, or embeddables before PR.

Is spring-data-jdbc safe to install?

It is procedural documentation plus MCP read-style inspection; confirm MCP server scopes and review Security Audits on this Prism page before connecting to production domains.

Java & JVMbackendintegrations

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.