$npx -y skills add Amplicode/spring-skills --skill spring-data-jdbcRules and guidelines for working with Spring Data JDBC in the project. ALWAYS use this skill when adding, removing, or modifying Spring Data JDBC entities (@Table from org.springframework.data.relational.core.mapping), aggregates, AggregateReference links, embedded objects, @Mapp
| 1 | # Detection guard |
| 2 | |
| 3 | 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. |
| 4 | |
| 5 | # Harness compatibility |
| 6 | |
| 7 | 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: |
| 8 | |
| 9 | - **`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. |
| 10 | - **"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. |
| 11 | |
| 12 | 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"). |
| 13 | |
| 14 | --- |
| 15 | |
| 16 | # Preflight: Spring MCP |
| 17 | |
| 18 | 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. |
| 19 | |
| 20 | - **If at least one Amplicode tool is available** — MCP is connected. Proceed with the skill below. |
| 21 | - **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. |
| 22 | - 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. |
| 23 | |
| 24 | --- |
| 25 | |
| 26 | # MCP availability and fallbacks |
| 27 | |
| 28 | 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: |
| 29 | |
| 30 | 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`. |
| 31 | |
| 32 | - 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`. |
| 33 | - Instead of `list_entity_reposit |