Standardize database access and repository patterns using Kotlin and SQL transactions.
Install
mkdir -p .claude/skills/repository && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/15048" && unzip -o skill.zip -d .claude/skills/repository && rm skill.zipInstalls to .claude/skills/repository
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Repository-mønster med Kotlin object og Connection/TransactionalSession extension-funksjoner, DBUtils-transaksjoner og ResultSet-mappingKey capabilities
- →Implement repository pattern with Kotlin objects
- →Use `Connection` and `TransactionalSession` extension functions
- →Manage database transactions via `DBUtils.asyncTransaction` or `DBUtils.transaction`
- →Centralize `ResultSet` to domain mapping in `RepositoryMappers.kt`
- →Handle database errors using `useAndHandleErrors`
- →Configure `PostgresDataSource` with HikariCP and Vault integration
How it works
The skill defines patterns for database access using Kotlin objects, extension functions, and `DBUtils` for transactions, centralizing data source configuration and result set mapping.
Inputs & outputs
When to use repository
- →Implementing repository-pattern data access
- →Configuring transactional database operations
- →Setting up SQL migration workflows
About repository
Provides patterns for object-based repositories, using extension functions for connections and transactions. Includes configuration for secure migration and data source handling.
Repository-mønster med Kotlin object og Connection/TransactionalSession extension-funksjoner, DBUtils-transaksjoner og ResultSet-mapping
When not to use it
- →When skipping Flyway migrations for schema changes
- →When using bare JDBC connections directly in service code
Limitations
- →All database access must go through `DBUtils.asyncTransaction {}` or `DBUtils.transaction {}`
- →ResultSet mapping logic must be centralized in `RepositoryMappers.kt`
- →Bare JDBC connections are not to be used directly in service code
How it compares
This skill enforces a structured, transactional, and type-safe approach to database access in Kotlin, preventing common pitfalls like scattered ResultSet mapping or unmanaged connections, unlike direct JDBC usage.
Compared to similar skills
repository side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| repository (this skill) | 0 | 6mo | No flags | Intermediate |
| drizzle-orm | 32 | 5mo | No flags | Intermediate |
| database-migration | 3 | 5mo | No flags | Advanced |
| backend-dev | 1 | 9mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by navikt
View all by navikt →You might also like
drizzle-orm
EpicenterHQ
Drizzle ORM patterns for type branding and custom types. Use when working with Drizzle column definitions, branded types, or custom type conversions.
database-migration
wshobson
Execute database migrations across ORMs and platforms with zero-downtime strategies, data transformation, and rollback procedures. Use when migrating databases, changing schemas, performing data transformations, or implementing zero-downtime deployment strategies.
backend-dev
marmelab
Coding practices for backend development in Atomic CRM. Use when deciding whether backend logic is needed, or when creating/modifying database migrations, views, triggers, RLS policies, edge functions, or custom dataProvider methods that call Supabase APIs.
prisma-database
slashwhy
Prisma schema conventions, migrations, seeding, and query patterns. Use when modifying database schema, creating migrations, or writing complex queries.
efcore-migrations
thecaaz
**WORKFLOW SKILL** — EF Core migrations workflow for backend model changes: generate, review, and apply EF Core migrations using the repository's README guidance. Agents MUST NOT hand-edit migration code — migrations must be generated with the `dotnet ef migrations add` tool.
ck:databases
lengo0951
Design schemas, write queries for MongoDB and PostgreSQL. Use for database design, SQL/NoSQL queries, aggregation pipelines, indexes, migrations, replication, performance optimization, psql CLI.