ai-instructions: Instructions file for GitHub Copilot

.github/instructions/spring-boot-repository.instructions.md

ai-instructions spring-boot-repository.instructions.md is an instructions file for GitHub Copilot from lsampaioweb/ai-instructions. It costs 890 tokens per session, scanned A, original, MIT.

A set of Spring Boot rules for repository code, the part of an application that reads and writes stored data. It favors JDBC and separates repository interfaces from their implementations.

In plain words
What is it for?
Use it to define repository methods, SQL configuration names, JDBC-based persistence, and database operations such as finding, saving, updating, and deleting records.
Why use it?
It makes database access consistent and helps prevent unsafe or unclear SQL usage.

Instructions file for GitHub Copilot

Written for GitHub Copilot: a Copilot instructions file.

This is lsampaioweb/ai-instructions's own configuration. It tells GitHub Copilot how to work on ai-instructions itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything ai-instructions configures →

Reuse

Borrowing it

Nothing to install: this file belongs to lsampaioweb/ai-instructions. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/lsampaioweb/ai-instructions/main/.github/instructions/spring-boot-repository.instructions.md
Clone the repo
git clone --depth 1 https://github.com/lsampaioweb/ai-instructions

Made for: GitHub Copilot.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ai-instructions spring-boot-repository.instructions.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/lsampaioweb/ai-instructions/spring-boot-repository.svg)](https://agentmods.dev/instructions/lsampaioweb/ai-instructions/spring-boot-repository)
Your own site
<a href="https://agentmods.dev/instructions/lsampaioweb/ai-instructions/spring-boot-repository"><img src="https://agentmods.dev/badge/instructions/lsampaioweb/ai-instructions/spring-boot-repository.svg" alt="Measured on agentmods" height="20"></a>
Per session 890 This file is loaded in full into every session.
When invoked 890 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00890 $0.00890
Opus 5 $0.00445 $0.00445
Sonnet 5 $0.00178 $0.00178
Haiku 4.5 $0.00089 $0.00089

Measured 4d ago against content hash 57c0da8a52ed, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

ai-instructions spring-boot-repository.instructions.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/instructions/spring-boot-repository.instructions.md · 49 lines

How it starts

The opening of the file, as written. The whole thing — 49 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Spring Boot Repository Engine

Naming Conventions

  • Name repository interfaces with the *Repository suffix (e.g., HolidayRepository).
  • Name repository implementations with the *RepositoryImpl suffix (e.g., HolidayRepositoryImpl).
  • Name SQL configuration property records with the *SqlConfigurationProperties suffix (e.g., HolidaySqlConfigurationProperties).
  • Use resource entity names in repository identifiers (never DataRepository or PersistenceRepository).
  • Name SQL property keys with the pattern sql.<resource>.<operation> (e.g., sql.holidays.find-by-id).
  • Name SQL column name constant classes with the *SqlColumns suffix (e.g., UserSqlColumns, AccountSqlColumns).

Rules

  • Defer the global ORM ban to spring-boot-architecture.instructions.md.
  • Defer ORM dependency bans to spring-boot-pom.instructions.md.
  • Use findById, findAll, findBy*, save, update, and deleteById as standard method name prefixes.
  • Keep method names consistent with operation semantics across all repositories.
  • Keep JDBC or JdbcClient as the default for relational persistence modules.
  • Use interface + implementation separation (XyzRepository interface + XyzRepositoryImpl) for modules with multiple persistence adapters or higher domain complexity.
  • Use a single @Repository class without a separate interface for focused modules with a single persistence adapter.
  • Allow non-relational repository implementations only when the module is explicitly scoped to an approved non-relational store.
  • Declare SQL column name constants in a *SqlColumns utility class within the feature package.
  • Use *SqlColumns constants as all named parameter keys in SQL method calls.
  • Declare SQL result-set column-label constants in the repository implementation and reuse them for all ResultSet reads.
  • Return Optional<T> from all single-resource lookup methods (e.g., findById).
  • Keep business orchestration out of repository methods.
  • Parameterize all SQL executed by repositories.
  • Build SQL parameter containers to be null-tolerant by omitting null entries or binding typed null values explicitly.
  • Accept pagination parameters (offset, limit, sort column) as explicit method parameters for paginated queries.
  • Keep SQL statements straightforward and readable; prefer simple joins, predicates, and direct projections over expression-heavy control-flow in SQL.
  • Implement sortable pagination in SQL only when the user explicitly requires database-side sorting or the expected data volume makes application-side sorting unsuitable.
  • When the user prefers simpler SQL and data volume constraints do not require database-side sorting, perform sorting in Java after retrieval using an allowlisted set of sortable fields.
  • Externalize SQL statements into @PropertySource-backed XML property files, one file per feature.
  • Declare @PropertySource on the @Configuration class that owns the JdbcClient bean.
  • Access SQL statements through a @ConfigurationProperties record named XyzSqlConfigurationProperties within the feature package.
  • Register XyzSqlConfigurationProperties using one explicit pattern: either @Component + @ConfigurationProperties on the record, or @EnableConfigurationProperties on the owning @Configuration class.
  • Annotate *SqlConfigurationProperties records with @Validated and annotate each SQL field with @NotBlank.
  • Validate generated-key fallback results explicitly and throw a deterministic data-retrieval exception when no key is returned.
  • Use Locale.ROOT for case normalization in machine-parsed string comparisons (e.g., SQL error-message feature detection).
  • Catch SQL exceptions at the repository boundary and wrap them in a feature-scoped exception; services must not re-wrap the same SQL failure.
  • Fall back from INSERT/UPDATE ... RETURNING only when exception evidence indicates the database does not support RETURNING.
  • Rethrow unrelated SQL grammar errors.

Read the full file on GitHub · 49 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 49 lines · 890 tokens per session scan A 57c0da8a52ed

Subscribe to this mod's changes

ai-instructions spring-boot-repository.instructions.md is an instructions file published in the GitHub repository lsampaioweb/ai-instructions (1 stars, last pushed 15d ago), licensed MIT. It adds 890 tokens to every session, about $0.0044 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other instructions, from other repositories