Spotiarr prisma

From mralexsaavedra/spotiarr · View interactive version

Spotiarr prisma is an AI agent skill from the GitHub repository mralexsaavedra/spotiarr. Trigger: Prisma, database, migration, schema, repository, query. SQLite Prisma patterns for spotiarr: boundaries, error handling, commands.

How to use this skill

Skill file

Activation Contract

Load when editing Prisma schema, writing repository code, running migrations, or handling DB errors.

Hard Rules

Decision Gates

| Error | Handling |

| --------------------- | ----------------------------------------------------- |

| P2025 (not found) | Guard with isPrismaNotFoundError, handle gracefully |

| Unique constraint | Catch and map to domain conflict error |

| Foreign key violation | Map to application-level validation error |

const isPrismaNotFoundError = (e: unknown): e is { code: string } =>
  e instanceof Error && "code" in e && e.code === "P2025";

Execution Steps

After schema changes:

pnpm --filter backend run prisma:generate          # regenerate client
pnpm --filter backend run prisma:migrate:deploy    # apply migrations

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.