{
  "markdown": "# Opinionated Prisma Skills\n\nAn opinionated AI coding skill plugin for building with Prisma ORM on self-hosted PostgreSQL.\n\n## This Plugin Makes Decisions\n\nThis is not a reference guide. It is a set of enforced opinions about how to use Prisma with PostgreSQL. It chooses UUID v7 over v4, strings over database enums, snake_case mapping, and raw SQL only when Prisma changes algorithmic complexity.\n\n**If your project has different needs, fork this plugin rather than using it directly.** The value is in the decisions being made consistently, not in covering every possible approach.\n\n## How It Works\n\nSkills trigger automatically based on what you're doing. When your coding agent sees you working with Prisma schemas, database queries, migrations, or transactions, the relevant skill activates and guides the agent's decisions.\n\nYou don't invoke skills manually. Ask your agent to \"add a users table\" and the schema-design skill kicks in. Ask it to \"add an index to a large table\" and migration-safety takes over with the safe `CONCURRENTLY` pattern. The agent checks for relevant skills before any database task.\n\n## What's Inside\n\n### Skills\n\n- **opinionated-prisma** — Entry point. Establishes UUID v7 prerequisites, checks for existing schema and Docker setup, routes to the appropriate skill for the task at hand.\n\n- **schema-design** — Activates when designing models or adding fields. Enforces snake_case mapping via `@@map`/`@map`, UUID v7 primary keys, `@@index` on every foreign key, string fields over database enums, separate slug fields for URLs, and soft delete via `deletedAt`.\n\n- **indexing** — Activates when adding indexes or diagnosing slow queries. Covers what Prisma handles (B-tree, composite, GIN) and what requires custom migrations (partial indexes, expression indexes, GiST, BRIN). Addresses N+1 join behavior and when to enable `relationJoins`.\n\n- **migration-safety** — Activates when planning or running `prisma migrate`. Enforces the `--create-only` review workflow, three-step required column additions (nullable, backfill, NOT NULL), `CREATE INDEX CONCURRENTLY` for large tables, and `NOT VALID`/`VALIDATE` for constraints.\n\n- **transactions** — Activates when writing transactions or bulk operations. Chooses interactive vs sequential transactions, enforces explicit timeouts, handles bulk create with relations via transaction loops, and bulk upsert via `INSERT ... ON CONFLICT`.\n\n- **raw-sql-boundary** — Activates when deciding whether to use `$queryRaw`. Draws the line: raw SQL only when Prisma cannot express the operation (window functions, CTEs, full-text search, JSONB operators) or when it changes algorithmic complexity (bulk upsert). Not for marginal speed gains.\n\n## Installation\n\nInstallation differs by platform. If you use more than one, install separately for each.\n\n### Claude Code\n\nRegister the marketplace:\n\n```\n/plugin marketplace add esot321c/opinionated-prisma\n```\n\nInstall the plugin:\n\n```\n/plugin install opinionated-prisma@opinionated-prisma\n```\n\n### Codex CLI\n\nOpen the plugin search interface:\n\n```\n/plugins\n```\n\nSearch for `opinionated-prisma` and select Install Plugin.\n\n### Gemini CLI\n\nInstall the extension:\n\n```\ngemini extensions install https://github.com/esot321c/opinionated-prisma\n```\n\nUpdate later:\n\n```\ngemini extensions update opinionated-prisma\n```\n\n### Cursor\n\nIn Cursor Agent chat:\n\n```\n/add-plugin opinionated-prisma\n```\n\nOr search for \"opinionated-prisma\" in the plugin marketplace.\n\n### OpenCode\n\nTell OpenCode:\n\n```\nFetch and follow instructions from https://raw.githubusercontent.com/esot321c/opinionated-prisma/refs/heads/main/.opencode/INSTALL.md\n```\n\n### Manual (Any Platform)\n\nClone into your skills directory:\n\n```bash\ngit clone https://github.com/esot321c/opinionated-prisma.git ~/.claude/skills/opinionated-prisma\n```\n\n### Project-Level\n\nAdd to a specific project:\n\n```bash\ngit clone https://github.com/esot321c/opinionated-prisma.git .claude/skills/opinionated-prisma\n```\n\n## Prerequisites\n\nSelf-hosted PostgreSQL with the `pg_uuidv7` extension. See the `opinionated-prisma` skill for setup instructions including Docker Compose configuration.\n\n## Opinions\n\nThis plugin makes these decisions rather than presenting options:\n\n- UUID v7 via `pg_uuidv7`, not v4/CUID/ULID\n- String fields for status/category, database enums only for type discriminators\n- Slugs for user-facing URLs, UUIDs for internal keys\n- `@@map` and `@map` to snake_case on every model and field\n- `@@index` on every foreign key (Prisma does not auto-create these)\n- Normalize by default, denormalize only with measured justification\n- `$queryRaw` only when Prisma changes algorithmic complexity, not for marginal speed\n- Three-step migration for adding required columns (nullable, backfill, NOT NULL)\n- Interactive transactions when operations depend on each other, sequential when they don't\n\nIf any of these don't fit your project, fork and adjust. PRs to make decisions configurable will not be accepted.\n\n## Updating\n\nPlugin updates are generally automatic depending on your platform. To manually update:\n\n- **Claude Code**: `/plugin update opinionated-prisma`\n- **Gemini CLI**: `gemini extensions update opinionated-prisma`\n- **Manual installs**: `git pull` in the cloned directory\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines. The short version: this plugin is opinionated by design. If you disagree with a decision, fork it. PRs that water down specific guidance into \"it depends\" will be closed.\n\n## License\n\nMIT License — see [LICENSE](LICENSE) for details.\n",
  "bytes": 5555,
  "sha": "e72242f05b0f9b1c8db46e6d076556f473b3ac6082d417a4629bca4565baa15c",
  "repo_slug": "esot321c/opinionated-prisma",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_esot321c_opinionated_prisma_opinionated__5fce9073/readme"
}