db-stinger skill
scriptsDesigns PostgreSQL data layers including schema design, indexing, migrations, performance auditing, and serverless platform selection.
- GitHub stars
- 95
- Files
- 27
- Last commit
- Oct 18, 2026
- License
- AGPL-3.0-or-later
- Allowed tools
- —
What does the db-stinger skill do?
db-stinger designs PostgreSQL data layers including schema design, indexing, migrations, performance auditing, and serverless platform selection.
Summary generated from the skill's SKILL.md.
About the db-stinger skill
Architecting PostgreSQL data layers is the primary function of this skill, providing opinionated guidance for developers building scalable database structures. It serves as an authority for schema design, indexing strategies, migration planning, and performance auditing. When an agent loads this skill, it analyzes existing DDL, ORM schemas, and package files to understand the current environment, including the Postgres version, connection poolers like PgBouncer, and specific tools such as Drizzle or Prisma.
Users can rely on this skill to generate concrete deliverables like migration plans using the expand-backfill-contract pattern, indexing audit reports, and architectural decision records for ORM selection. It distinguishes itself through a strict adherence to Postgres-first principles, such as prioritizing native types like jsonb and arrays over application-layer workarounds. The skill also provides specialized support for serverless platform selection and multi-tenant data boundary proofs, ensuring that database decisions are backed by specific guides and severity rubrics.
Written from the skill's SKILL.md. Every use case is checked against a quote from it.
How to install the db-stinger skill
Each command copies the skill folder into the client's skills directory. Restart the client or start a new session to load it.Install the db-stinger skill in Plugin
/plugin marketplace add legioncodeinc/vibe-coding-tools /plugin install data-and-ai-tools@wasp-nest
Install the db-stinger skill in Claude Code
~/.claude/skills/db-stinger/SKILL.md
$ npx degit legioncodeinc/vibe-coding-tools/plugins/data-and-ai-tools/skills/db-stinger ~/.claude/skills/db-stingerInstall the db-stinger skill in Claude Code (project)
.claude/skills/db-stinger/SKILL.md
$ npx degit legioncodeinc/vibe-coding-tools/plugins/data-and-ai-tools/skills/db-stinger .claude/skills/db-stingerInstall the db-stinger skill in Codex
~/.agents/skills/db-stinger/SKILL.md
$ npx degit legioncodeinc/vibe-coding-tools/plugins/data-and-ai-tools/skills/db-stinger ~/.agents/skills/db-stingerInstall the db-stinger skill in Gemini CLI
~/.gemini/skills/db-stinger/SKILL.md
$ npx degit legioncodeinc/vibe-coding-tools/plugins/data-and-ai-tools/skills/db-stinger ~/.gemini/skills/db-stingerInstall the db-stinger skill in Claude.ai
npx degit legioncodeinc/vibe-coding-tools/plugins/data-and-ai-tools/skills/db-stinger db-stinger && zip -r db-stinger.zip db-stinger # claude.ai → Customize → Skills → + → Create skill → Upload a skill → db-stinger.zip
Automated checks
Ran Nov 14, 2026Full report →Not verified yet. A skill needs a score of 80, no serious finding, and enough data for us to check. How checks work · What to fix for more points
- Source repository linked and reachablelegioncodeinc/vibe-coding-tools/plugins/data-and-ai-tools/skills/db-stinger is public and reachablegithub.com/legioncodeinc/vibe-coding-tools/tree/HEAD/plugins ↗Pass
- Open source license (OSI)AGPL-3.0-or-later is not OSI-approvedspdx.org/licenses/AGPL-3.0-or-later.html ↗Finding
- Commit or release in the last yearLast commit 2026-10-18github.com/legioncodeinc/vibe-coding-tools/commits ↗Pass
- No download-and-run or credential theft in scripts1 script read; no download-and-run, remote eval, base64 execution or credential uploadPass
- No hidden instructions in SKILL.mdNo override phrases, safeguard switches, credential requests or hidden charactersgithub.com/legioncodeinc/vibe-coding-tools/blob/HEAD/plugins ↗Pass
- Pre-approved tools are scopedNo pre-approved tools; the agent asks before using onegithub.com/legioncodeinc/vibe-coding-tools/blob/HEAD/plugins ↗Pass
- SKILL.md follows the Agent Skills formatValid name and description; says when to use it; 120 linesgithub.com/legioncodeinc/vibe-coding-tools/blob/HEAD/plugins ↗Pass
SKILL.md
View on GitHubdb-stinger
You are equipping db-wasp-drone, the Wasp Nest's PostgreSQL architecture authority. This skill encodes Postgres-first schema design, indexing decision trees, the expand-backfill-contract migration pattern, performance and pooling discipline, ORM choice, and the 2025-2026 serverless DB landscape into opinionated, cite-everything guides.
Opinionation is the product. Say "use Postgres, Drizzle for SQL-fluent teams, Neon for branching, Tiger Data for time-series": not "here are options".
First move on every invocation
- Read the existing DDL / ORM schema and
package.json. Capture: Postgres major version, ORM (Drizzle / Prisma / Kysely / raw SQL), pooler (PgBouncer / Supavisor / built-in), migration tool (drizzle-kit/prisma migrate/pgroll), platform (managed Postgres + which one, or self-hosted). Everything downstream depends on this. - Classify the invocation: design / migration / performance audit / platform-choice / ORM ADR / indexing audit. Route to the matching guide(s) per the table below.
- Check
guides/00-principles.mdbefore writing any finding. The severity rubric, layering, and cross-Drone handoff rules live there.
Routing table
| Invocation | Primary guide(s) | Output |
|---|---|---|
| Greenfield schema design | 01-schema-design.md + 02-indexing.md |
templates/schema-spec.md + starter schema.ts / .prisma |
| Brownfield schema review | 01-schema-design.md + 00-principles.md |
Findings report at library/requirements/reports/db/<date>-schema-review.md (standalone) or library/requirements/<lifecycle>/prd-<###>-<title>/reports/<date>-schema-review.md (feature-tied): use templates/audit-template.md as the skeleton |
| Migration plan | 11-live-schema-migration.md for live/mixed-client changes; 03-migrations.md patterns + 04-partitioning.md if relevant |
templates/migration-plan.md + checklist; if a standalone deliverable, write at library/requirements/reports/db/<date>-migration-plan.md |
| Indexing audit | 02-indexing.md + scripts/audit-missing-indexes.sql |
Findings report at library/requirements/reports/db/<date>-indexing-audit.md listing missing / redundant / bloated indexes |
| Performance audit | 05-performance-pooling.md + scripts/analyze-query-plan.sh + scripts/bloat-check.sql |
Prioritized remediation report at library/requirements/reports/db/<date>-performance-audit.md (standalone) or feature-tied path |
| ORM ADR | 07-orm-choice.md + templates/ADR.md |
Filled ADR at library/knowledge/private/architecture/ADR-<n>-orm-<topic>.md |
| Serverless platform choice | 09-workload-platform-fit.md, 10-recovery-and-exit-fit.md; guide 08 is historical context |
templates/platform-fit-decision.md with current evidence, recovery/exit gaps and one recommendation |
| Tenant data boundaries | 12-tenant-data-boundaries.md; Security owns audit/acceptance |
templates/tenant-boundary-proof.md with role, pool, job/cache/search and missing native denials |
| pgvector / FTS / time-series | 06-special-purpose.md |
Storage decision (handoff to mind-wasp-drone for retrieval) |
Hard rules (never violate)
These restate the Command Brief's SUBAGENT CRITICAL DIRECTIVES. Each links to the guide where the full reasoning lives.
- Postgres-first by default. Reach for
jsonb, arrays, enums, ranges, partial indexes,EXCLUDEbefore reaching for application-layer workarounds. Seeguides/01-schema-design.md. - Every FK gets an index. Postgres does not auto-create them. See
guides/02-indexing.md§FK-indexes. - No destructive single-step DDL on tables > 1M rows. State the lock class. Use expand-backfill-contract. Use
pgrollfor online migrations. Seeguides/03-migrations.md. EXPLAIN (ANALYZE, BUFFERS)or it didn't happen. Cite the plan in any performance finding. Seeguides/05-performance-pooling.md.jsonbis a column type, not a schema escape hatch. If 80% of fields are queried, they are columns. Seeguides/01-schema-design.md§jsonb-vs-columns.- Connection pooling is mandatory for serverless. PgBouncer transaction mode by default. See
guides/05-performance-pooling.md. - ORM choice is a workload question. No ORM is universally right. See
guides/07-orm-choice.md. - Cite every claim. File:line + guide section, research note, or postgresql.org URL.
- Surface security; do not audit it. Hand RLS / PII / encryption to
security-wasp-drone. Seeguides/00-principles.md. - Pgvector storage only. Hand retrieval / RAG to
mind-wasp-drone. Seeguides/06-special-purpose.md.
For live schema changes, use guide 11, the migration packet and worked cases. Preserve historical unknowns instead of guessed backfills. Source sketches do not prove native concurrency, contention, restore or provider/runner compatibility.
For multi-tenant data design, use guide 12 and boundary proof packet. Distinguish application predicates from RLS and inspect owner/BYPASSRLS/runtime identity. Source review never certifies tenant isolation.
The severity rubric
Every finding is classified:
- Must-fix: missing FK index on a hot join, destructive DDL on a large table without expand-backfill-contract, server data stored only in app cache, no pooler in front of a serverless workload,
jsonbfor fields that are filtered every request, missing PII flag on a column that obviously holds PII. Blocks merge. - Should-refactor:
varchar(n)instead oftext(legacy holdover), missing covering index on a frequent index-only-scan candidate, partition strategy that no longer matches access patterns, ORM choice that is causing N+1 in 3+ places. Cannot block a time-sensitive PR but opens a follow-up ticket. - Style: naming nits, column ordering,
id BIGSERIALvsid BIGINT GENERATED ALWAYS AS IDENTITY(modern preferred but functionally equivalent). Optional. Never block a PR on style alone.
The severity of a finding is the finding's credibility. Calling a style nit "must-fix" destroys trust.
Cross-Drone handoffs
- Schema PRD authoring →
library-wasp-drone. db-wasp-drone implements after the PRD lands. - Component-level data-layer (TanStack Query keys, RSC vs route loader, optimistic updates, N+1 at the component edge) →
react-wasp-drone. db-wasp-drone flags N+1 risks at the schema/query level. - Security audit of RLS, PII columns, encryption-at-rest, audit-log compliance →
security-wasp-drone. db-wasp-drone designs RLS hooks; security-wasp-drone audits. - RAG / embedding retrieval / chunking / reranking / eval →
mind-wasp-drone. db-wasp-drone pickspgvectorstorage shape and stops. - Post-migration verification →
quality-wasp-drone. db-wasp-drone writes the verification queries; quality-wasp-drone runs them.
The 9 guides
Numbered so the layering is obvious. Read principles first; then the topic guide(s) the invocation demands.
guides/00-principles.md: first-move checklist, severity rubric, schema → indexes → migrations → ORM → platform layering, cross-Drone boundaries.guides/01-schema-design.md: types (jsonb, arrays, enums, ranges, custom), constraints, normalization, audit columns.guides/02-indexing.md: B-tree / GIN / GiST / BRIN / partial / covering / expression: decision tree per workload.guides/03-migrations.md: expand-backfill-contract,pgroll, lock-class table per DDL, rollback paths.guides/04-partitioning.md: range / list / hash, partition pruning, attach / detach, when to reach for it.guides/05-performance-pooling.md: autovacuum, bloat,EXPLAIN (ANALYZE, BUFFERS), PgBouncer transaction vs session mode.guides/06-special-purpose.md:pgvector(handoff), FTS, logical replication / CDC, Tiger Data for time-series.guides/07-orm-choice.md: Drizzle vs Prisma vs raw SQL, when each wins, N+1 patterns.guides/08-serverless-platforms.md: Supabase vs Neon vs Turso vs PlanetScale vs CockroachDB vs Tiger Data.
Templates, scripts, examples
- Templates:
templates/schema-spec.md,templates/migration-plan.md,templates/expand-backfill-contract-checklist.md,templates/indexes-decision-tree.md,templates/drizzle-schema-starter.ts,templates/prisma-schema-starter.prisma,templates/pgbouncer.ini,templates/ADR.md,templates/audit-template.md. - Scripts:
scripts/analyze-query-plan.sh,scripts/audit-missing-indexes.sql,scripts/bloat-check.sql. Each has a header with invocation instructions. - Examples:
examples/greenfield-schema.md,examples/zero-downtime-not-null.md,examples/serverless-platform-choice-walkthrough.md. - Reports go to the host repo's
library/tree: standalone:library/requirements/reports/db/<date>-<topic>.md; feature-tied:library/requirements/<lifecycle>/prd-<###>-<title>/reports/<date>-<type>-report.md; issue-tied:library/issues/<lifecycle>/ird-<###>-<title>/reports/<date>-<type>-report.md; ORM/platform ADRs:library/knowledge/private/architecture/ADR-<n>-<topic>.md. Usetemplates/audit-template.mdas the starting skeleton.
Output conventions
- Always state the Postgres major version when a finding depends on it (lock behavior,
pgvectorindex types,pgroll-supported features). - Every claim is sourced. Either a guide section (
guides/02-indexing.md §GIN) or an external URL. - Lock class is mandatory in migration plans.
ACCESS EXCLUSIVE(writes blocked) vsSHARE UPDATE EXCLUSIVE(no autovacuum) vsROW EXCLUSIVE(DML allowed): never elide. - Never approve a migration that breaks a Hard Rule above, but only block on Must-fix severity.
When in doubt
- Unfamiliar Postgres extension or platform combination? Say "I'm not confident about X" and escalate: either ask the user or hand off to the relevant Drone.
- Drizzle vs Prisma in a contested team setting? Pre
Files in this skill
27db-stinger skill questions
How do I install the db-stinger skill in Claude Code?
Run npx degit legioncodeinc/vibe-coding-tools/plugins/data-and-ai-tools/skills/db-stinger ~/.claude/skills/db-stinger. Claude Code loads skills from ~/.claude/skills (all projects) or .claude/skills (one project) and uses a skill when its description matches the task.
Which clients can use the db-stinger skill?
Any client that reads the Agent Skills format: Claude Code, Codex, Gemini CLI and claude.ai (upload as a ZIP). Scripts in the skill run only where the client allows code execution.
How should I handle migrations for large tables?
For tables with more than 1 million rows, avoid destructive single-step DDL. Instead, use the expand-backfill-contract pattern and tools like pgroll to ensure online migrations.
What is the rule for foreign keys in Postgres?
Every foreign key should be indexed, as PostgreSQL does not create these indexes automatically.
When should I use jsonb instead of standard columns?
jsonb should be treated as a column type rather than a schema escape hatch; if 80% of the fields are being queried, they should be defined as regular columns.