repository-adapters

Bridge database repository patterns to domain interfaces through adapters.

1|1|Updated May 3, 2026
One-click install
npx skills add https://github.com/matt-riley/agent-skills --skill repository-adapters
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: repository-adapters
Source: https://github.com/matt-riley/agent-skills/tree/main/skills/repository-adapters
Command: npx skills add https://github.com/matt-riley/agent-skills --skill repository-adapters

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Aligns repository-layer changes with domain boundaries by providing a structured approach to designing adapters, mapping DB errors, and coordinating across dialects.

Core Features & Use Cases

  • Domain-first design: defines a stable repository interface and adapter boundary that callers rely on.
  • Error mapping: ensures DB-level errors are translated into domain errors at the adapter boundary.
  • Safe workflows: guides generators and tests through change-safe patterns when supporting multiple DB dialects.

Quick Start

Identify the domain interface and implement or adjust the corresponding DB adapter following the described guardrails.

Frequently Asked Questions about repository-adapters

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I map database errors to domain errors at the repository boundary?

To map database errors to domain errors, implement an adapter at the repository edge that translates DB-level exceptions into domain-specific errors before they cross the boundary. This preserves domain integrity by isolating persistence concerns from the domain layer.

What is a repository adapter and when do I need one?

A repository adapter is a structural bridge connecting database repository patterns to stable domain interfaces. You need one when updating repository methods or coordinating multiple SQL dialects to ensure the domain boundary remains protected from infrastructure changes.

How do I support multiple SQL dialects in a single repository pattern?

Supporting multiple SQL dialects requires guiding generated query layers and tests through change-safe patterns at the adapter boundary. The adapter coordinates dialect-specific queries while exposing a stable repository interface to the domain layer.

How do I update repository methods without breaking the domain interface?

To update repository methods safely, review the domain interface, adjust the adapter implementation, and validate generated query layers and tests. This ensures correct error handling and safe workflows while maintaining the established domain boundary contract.

Does the repository pattern work with domain-driven design boundaries?

The repository pattern works with domain-driven design by defining a stable adapter boundary that callers rely on. It aligns repository-layer changes with domain boundaries, ensuring DB errors are translated and infrastructure concerns do not leak into the domain.