database-patterns
Skill by softspark
Gives an AI assistant guidance on database schema design and query tuning, covering indexing, N+1 queries, transactions and EXPLAIN. Written for developers working with PostgreSQL, MySQL or Qdrant.
Install database-patterns
Built from the published package, never by AI.
git clone --depth 1 https://github.com/softspark/ai-toolkit /tmp/ai-toolkit && mkdir -p ~/.claude/skills && cp -r /tmp/ai-toolkit/app/skills/database-patterns ~/.claude/skills/database-patternsRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/softspark/ai-toolkit /tmp/ai-toolkit && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/ai-toolkit/app/skills/database-patterns ~/.gemini/antigravity-cli/skills/database-patternsAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
The database-patterns skill gives an AI assistant reference guidance for database schema design and query tuning. It covers ORM choice for Node.js, Python and PHP, naming conventions, soft delete and audit columns, UUID versus serial keys, index types and composite index order, EXPLAIN ANALYZE, N+1 prevention, safe migration steps, and PgBouncer connection pooling settings. It also includes Qdrant vector database patterns for client setup, collections, upserts, filtered search and payload indexes.
The skill is loaded as reference material when trigger words such as schema, slow query, N+1, EXPLAIN and deadlock appear. It sets rules, such as profiling with EXPLAIN (ANALYZE, BUFFERS) before adding an index, and indexing every foreign key. It lists common gotchas, including lazy loading and long-running transactions that hold row locks. It is aimed at developers working with PostgreSQL, MySQL or Qdrant. It is not user-invocable, and it points to other skills for migrations, profiling and observability.
Written from the project's SKILL.md and checked against it.
What it can do
- ORM selectionMaps scenarios to Prisma, Drizzle, SQLAlchemy 2.0, SQLModel, Doctrine or Eloquent.
- Schema naming conventionsSets rules for plural snake_case tables and idx_ and fk_ prefixed indexes and foreign keys.
- Common schema patternsShows soft delete, audit columns and guidance on UUID versus serial keys.
- Index strategiesExplains when to index, index types such as B-tree, GIN and BRIN, and composite index column order.
- Query optimizationCovers EXPLAIN ANALYZE, common plan issues and N+1 prevention with eager loading.
- Safe migrationsGives patterns for adding NOT NULL columns and a migration checklist.
- Connection poolingShows PgBouncer settings and pool size formulas for different workloads.
- Qdrant vector patternsCovers Qdrant client setup, collection creation, upserts, filtered search and payload indexes.
What you need
- Python qdrant_client library for the Qdrant examples
- A running Qdrant server for the Qdrant examples
Try asking
- Review this schema for missing indexes on foreign key columns.
- Explain why this PostgreSQL EXPLAIN ANALYZE shows a sequential scan.
- Find N+1 queries in this ORM code and fix them with eager loading.
Good to know
- Set to user-invocable false, so it is loaded by trigger words rather than called directly.
- Allowed tools are limited to Read.
- Schema evolution, migration tasks and observability are handled by other skills.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: app/skills/database-patterns/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
Allowed tools: Read
Alternatives to database-patterns
All alternatives →Creates, configures and manages datasets on the Hugging Face Hub, including SQL-based querying and transformation. Built for people who edit dataset content and metadata directly, alongside the HF MCP server.
Diagnoses and repairs gbrain's Postgres access when a command or MCP result shows a GBRAIN_DB_ACCESS marker, or when the operator reports the brain database is down. It runs the hardcoded gbrain db-repair ladder and verifies the result with a re-probe.
Manages clusters, instances, and backups for AlloyDB for PostgreSQL. Built for creating, configuring, and administering AlloyDB databases, not general PostgreSQL or Cloud SQL instances.
Writes, reviews and migrates Supabase logs queries against the ClickHouse logs table served by the logs.all.otel endpoint. Built for developers who write Logs Explorer SQL or convert older BigQuery logs queries.
Diagnoses and fixes slow Paperclip PostgreSQL queries using Cloud and Neon evidence, local benchmarks, regression tests, and a pull request with passing checks. Built for engineers working on Paperclip.
Guides AI assistants through Prisma 8 projects built on @prisma/orm-postgres, @prisma/orm-sqlite, or @prisma/orm-mongo. It covers data contracts, migrations, typed queries and runtime setup for developers on Prisma 8.
Compare with hugging-face-datasets, db-repair or alloydb-basics
database-patterns: common questions
Does this skill cover Qdrant?
Yes. It includes Qdrant vector database patterns with Python client examples for setup, collections, upserts, filtered search and payload indexes.
Which ORMs does it recommend?
It lists Prisma and Drizzle for Node.js, SQLAlchemy 2.0 and SQLModel for Python, and Doctrine or Eloquent for PHP, chosen by scenario.
Can I call this skill directly?
No. The source sets user-invocable to false and allows only the Read tool, so it loads when trigger words such as slow query or EXPLAIN appear.
How do I install database-patterns?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is database-patterns free?
The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.
Is database-patterns safe to use?
It scores 61 of 100. Grades: maintenance A, licence A, quality B. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to database-patterns?
Similar skills: hugging-face-datasets, db-repair, alloydb-basics, clickhouse-logs-queries.
