spotiarr-prisma

Enforce Prisma boundaries, singleton client, and Zod validation for SQLite backend operations.

41|6|Updated Nov 27, 2025
One-click install
npx skills add https://github.com/mralexsaavedra/spotiarr --skill spotiarr-prisma
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spotiarr-prisma
Source: https://github.com/mralexsaavedra/spotiarr/tree/main/skills/spotiarr-prisma
Command: npx skills add https://github.com/mralexsaavedra/spotiarr --skill spotiarr-prisma

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It reduces fragile and insecure database work by enforcing consistent Prisma structure, validation, error mapping, and migration workflows for spotiarr’s backend.

Core Features & Use Cases

  • Prisma placement boundaries: Keeps Prisma client usage confined to infrastructure code so domain and presentation layers remain clean.
  • Singleton PrismaClient pattern: Ensures a single Prisma client instance is created and imported from the designated setup module.
  • Validation-first database flow: Requires Zod parsing before repository calls to prevent invalid payloads reaching Prisma.
  • Typed DTO → repository → Prisma: Standardizes how requests become typed inputs and how repositories interact with the database.
  • Prisma error mapping: Translates raw Prisma errors into application-level errors so UI/HTTP layers handle safe, meaningful outcomes.
  • Transaction discipline: Uses tight-scope transactions for atomic multi-write operations.

Quick Start

After you change apps/backend/prisma/schema.prisma, run the backend Prisma generate and migration deploy commands to update the client and apply schema changes.

Frequently Asked Questions about spotiarr-prisma

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

FAQPage Schema
How do I map Prisma P2025 errors to application-level errors in a repository pattern?

To map Prisma errors, catch P2025 not-found exceptions and constraint violations within your repository layer, translating them into safe application-level errors before they reach the UI or HTTP presentation layers.

How do I validate data before passing it to Prisma database operations?

Validate Prisma database inputs by parsing payloads with Zod schemas before executing repository calls, ensuring only typed DTOs reach your PrismaClient singleton for safe data access.

What is the best way to structure Prisma client usage in a layered backend architecture?

Structure Prisma client usage by enforcing placement boundaries, confining the PrismaClient singleton to infrastructure code so your domain and presentation layers remain clean and decoupled.

How do I run SQLite migrations safely when updating a Prisma schema?

Run SQLite Prisma migrations safely by executing Prisma generate and migration deploy commands after modifying schema.prisma, ensuring schema evolution updates the client and applies changes atomically.

When should I use tight-scope transactions for multi-write Prisma operations?

Use tight-scope Prisma transactions for multi-write operations to guarantee atomicity, ensuring that complex repository query implementations either commit all changes or roll back entirely on failure.