simple-data-patterns

Create, read, update, and delete domain entities with Pydantic models and async repositories.

Updated Apr 11, 2026
One-click install
npx skills add https://github.com/bennybennison/agent-toolkit --skill simple-data-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: simple-data-patterns
Source: https://github.com/bennybennison/agent-toolkit/tree/main/skills/simple-data-patterns
Command: npx skills add https://github.com/bennybennison/agent-toolkit --skill simple-data-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Applications often need straightforward persistence for domain entities without the overhead of raw data stores or complex medallion architectures. This skill provides a clear pattern using Pydantic models and dataclasses to map directly to storage with standard CRUD operations.

Core Features & Use Cases

  • Direct Pydantic schemas for API boundaries.
  • Dataclass domain entities for pure business data.
  • Repository pattern with async CRUD methods.
  • SQL migration templates for easy table creation.
  • Sync patterns for upserting external API data. Use cases include internal settings storage, prototyping product catalogs, or caching API responses where data can be re‑pulled.

Quick Start

Ask the simple-data-patterns skill to add a new product with SKU 1001 and title "Sample Widget".

Frequently Asked Questions about simple-data-patterns

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

FAQPage Schema
How do I implement async CRUD persistence for dataclass domain entities?

Async CRUD persistence for dataclass domain entities is implemented using the repository pattern with asynchronous methods mapped to a SQL backend. This approach separates pure business data from Pydantic API boundary schemas for straightforward storage operations.

What's the best way to map Pydantic models to a SQL storage layer without complex architectures?

Mapping Pydantic models to a SQL storage layer without complex architectures is achieved by using direct Pydantic schemas for API boundaries and dataclass domain entities for business data. The repository pattern handles standard CRUD operations without medallion architectures.

When do I need the repository pattern for simple data models instead of raw data stores?

The repository pattern for simple data models is needed when applications require straightforward CRUD persistence without the overhead of raw data stores. It suits internal settings storage, prototyping product catalogs, or caching API responses where data can be re-pulled.

Does this CRUD pattern support upserting external API data into SQL backends?

Yes, this CRUD pattern supports upserting external API data into SQL backends using sync patterns designed for external data synchronization. It maps Pydantic schemas and dataclass entities directly to storage, allowing cached API responses to be updated efficiently.

Can I use Pydantic schemas for API boundaries while keeping domain logic in dataclasses?

Yes, you can use Pydantic schemas for API boundaries while keeping domain logic in dataclasses. This pattern separates pure business data in dataclass domain entities from API validation schemas, mapping both directly to an async SQL storage layer.

Are SQL migration templates included for creating tables in the repository pattern?

Yes, SQL migration templates are included for creating tables in the repository pattern. These templates provide easy table creation for storing dataclass domain entities mapped through Pydantic schemas in straightforward CRUD applications.