data-access

Enforce service-layer transactions and repository patterns for safe database access.

Updated Mar 20, 2026
One-click install
npx skills add https://github.com/hendrax5/ironman --skill data-access-hendrax5
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: data-access
Source: https://github.com/hendrax5/ironman/tree/main/skills/data-access
Command: npx skills add https://github.com/hendrax5/ironman --skill data-access-hendrax5

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill establishes clear data access rules to prevent inconsistent transactions, leaked business logic in repositories, query inefficiencies, and unsafe migrations, making database operations predictable and maintainable.

Core Features & Use Cases

  • Transaction Boundary: Prescribes that transactions live in the service layer to safely coordinate multi-entity operations.
  • Repository Pattern Template: Provides a minimal repository structure that isolates database operations and accepts a transaction client.
  • Query Optimization Rules: Enforces explicit selects, mandatory pagination, indexing guidance, and strategies to avoid N+1 queries.
  • Migration & Soft Delete Strategy: Defines reversible migrations, safe rename patterns, and soft-delete conventions for business data.
  • Use Case: Implementing an order creation flow that creates an order, inserts items, and decrements stock atomically across repositories.

Quick Start

Create a service-layer transaction that composes repository calls to create an order, insert order items, and decrement product stock within a single atomic operation.

Frequently Asked Questions about data-access

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

FAQPage Schema
How do I manage transaction boundaries in a service layer using Prisma?

Transaction boundaries should live in the service layer to safely coordinate multi-entity operations, passing a transaction client to repository methods for safe database access.

What's the best way to isolate database operations using the repository pattern?

The repository pattern isolates database operations in a minimal structure that accepts a transaction client, ensuring service-layer transactions coordinate multi-entity operations safely.

How do I avoid N+1 queries and enforce pagination in ORM-based repositories?

Query optimization rules enforce explicit selects, mandatory pagination, indexing guidance, and N+1 avoidance strategies to make database operations predictable and maintainable.

Does this approach support reversible migrations and soft-delete conventions?

Yes, the data access strategy defines reversible migrations, safe rename patterns, and soft-delete conventions for business data to ensure safe database operations.

How do I create an order flow that updates stock and inserts items atomically?

Create a service-layer transaction that composes repository calls to create an order, insert order items, and decrement product stock within a single atomic operation.

Can I use this repository pattern with raw SQL instead of an ORM?

Yes, this applies to backend services using ORMs or raw SQL where multi-entity operations, migrations, and query optimization are required for safe database access.