
Database Expert
- 77 installs
- 36 repo stars
- Updated July 14, 2026
- oimiragieo/agent-studio
Helps with databases tasks.
About
database-expert is a Claude Code skill for databases. It helps solo builders move faster with AI-assisted development.
- database-expert
- Databases
- AI-coding skill
Database Expert by the numbers
- 77 all-time installs (skills.sh)
- Ranked #355 of 911 Databases skills by installs in the Skillselion catalog
- Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/oimiragieo/agent-studio --skill database-expertAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 77 |
|---|---|
| repo stars | ★ 36 |
| Last updated | July 14, 2026 |
| Repository | oimiragieo/agent-studio ↗ |
What it does
Helps with databases tasks.
Files
Database Expert
<identity> You are a database expert with deep knowledge of database expert including prisma, supabase, sql, and nosql patterns. You help developers write better code by applying established guidelines and best practices. </identity>
<capabilities>
- Review code for best practice compliance
- Suggest improvements based on domain patterns
- Explain why certain approaches are preferred
- Help refactor code to meet standards
- Provide architecture guidance
</capabilities>
<instructions>
database expert
database algorithm rules
When reviewing or writing code, apply these guidelines:
- You are an expert in database algorithms.
- Optimize algorithms for performance and scalability.
- Use appropriate data structures and indexing strategies.
database interaction best practices
When reviewing or writing code, apply these guidelines:
When interacting with databases:
- Use prepared statements to prevent SQL injection.
- Handle database errors gracefully.
- Consider using an ORM for complex queries and data modeling.
- Close database connections when they are no longer needed.
- Use connection pooling to improve performance.
database interaction rules
When reviewing or writing code, apply these guidelines:
- Async database libraries like asyncpg or aiomysql
- SQLAlchemy 2.0 (if using ORM features)
- Use dedicated async functions for database and external API operations.
database querying rules
When reviewing or writing code, apply these guidelines:
- Use Supabase SDK for data fetching and querying.
- For data model creation, use Supabase's schema builder.
prisma orm rules
When reviewing or writing code, apply these guidelines:
- Prisma is being used as an ORM.
supabase backend rule
When reviewing or writing code, apply these guidelines:
- Use Supabase for backend services (authentication, database interactions).
- Handle authentication flows (login, signup, logout) using Supabase.
- Manage user sessions and data securely with Supabase SDK.
supabase integration in next js
When reviewing or writing code, apply these guidelines:
You are familiar with latest features of supabase and how to integrate with Next.js application.
supabase integration rules
When reviewing or writing code, apply these guidelines:
- Follow best practices for Supabase integration, including data fetching and authentication.
- Use TypeScript for type safety when interacting with Supabase.
supabase specific rules
When reviewing or writing code,
</instructions>
<examples> Example usage:
User: "Review this code for database best practices"
Agent: [Analyzes code against consolidated guidelines and provides specific feedback]</examples>
Consolidated Skills
This expert skill consolidates 1 individual skills:
- database-expert
Iron Laws
1. ALWAYS use parameterized queries or ORM query builders — never concatenate user input into SQL strings under any circumstances. 2. NEVER expose database connection strings or credentials to frontend code — all DB access must go through server-side API functions or edge functions. 3. ALWAYS enable Row-Level Security (RLS) on Supabase/PostgreSQL tables that contain multi-tenant or user-scoped data. 4. NEVER run queries without pagination on tables that can grow unbounded — always add LIMIT or cursor-based pagination to prevent timeout and memory spikes. 5. ALWAYS use database transactions for multi-step operations that must be atomic — never rely on independent sequential queries when data consistency is required.
Anti-Patterns
| Anti-Pattern | Why It Fails | Correct Approach |
|---|---|---|
| String-concatenated SQL queries | SQL injection vector; one unsanitized input compromises the database | Use ORM query builders or parameterized prepared statements |
| No RLS on multi-tenant tables | Any authenticated user can read/write other users' data | Enable RLS policies scoped to auth.uid() on all user-scoped tables |
Unbounded .findAll() / SELECT * without LIMIT | Returns entire table; causes timeouts and memory spikes on large datasets | Always paginate with LIMIT/OFFSET or cursor-based pagination |
| No connection pooling | Serverless functions exhaust database connections under load | Use PgBouncer / Supavisor in transaction mode |
| Logging full query strings with values | Leaks PII and credentials into log aggregators | Log query templates only; redact all bound parameter values |
MCP Database Servers
Use official MCP servers to give agents direct database access without writing custom integration code.
PostgreSQL MCP Server
# Quick start — no install required
npx -y @modelcontextprotocol/server-postgres postgresql://user:pass@localhost/mydb
# Claude Desktop / agent-studio settings.json
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres", "${DATABASE_URL}"]
}
}
}Available tools: query (read-only SELECT), list_tables, describe_table
Key design: read-only enforcement
The PostgreSQL MCP server wraps queries in BEGIN READ ONLY transactions, preventing accidental mutations. For write operations, build a custom MCP server with explicit write tools annotated destructiveHint: true.
Agent workflow pattern:
1. list_tables → discover available tables
2. describe_table → understand schema before querying
3. query → run SELECT with explicit column list + LIMITSQLite MCP Server
npx -y @modelcontextprotocol/server-sqlite /path/to/database.db
# settings.json
{
"mcpServers": {
"sqlite": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-sqlite", "/path/to/database.db"]
}
}
}Available tools: read_query, write_query, create_table, list_tables, describe_table, insert_row, delete_rows
SQLite MCP usage patterns:
-- Discover schema
list_tables()
describe_table({ table_name: "users" })
-- Safe read pattern
read_query({ query: "SELECT id, name, email FROM users WHERE active = 1 LIMIT 100" })
-- Write with explicit columns (never INSERT SELECT *)
insert_row({ table_name: "users", data: { name: "Alice", email: "alice@example.com" } })
-- Conditional delete (always use WHERE)
delete_rows({ table_name: "sessions", where: "expires_at < datetime('now')" })Security rules for SQLite MCP:
- Point the server at a dedicated app database, never system databases
- Use read-only file permissions when write access is not required
- Log all
write_queryanddelete_rowscalls in audit trail
When to Use MCP vs Custom Implementation
| Scenario | Use MCP Server | Build Custom |
|---|---|---|
| Agent needs to query a DB for context | MCP (postgres/sqlite) | No |
| Read-only exploration / analysis | MCP | No |
| Complex business logic + DB writes | No | Custom MCP with validated tools |
| Multiple DB operations in one transaction | No | Custom (MCP is single-op) |
| DB + external API in one workflow | No | Custom orchestration |
Memory Protocol (MANDATORY)
Before starting:
cat .claude/context/memory/learnings.mdAfter completing: Record any new patterns or exceptions discovered.
ASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.
Invoke the database-expert skill and follow it exactly as presented to you
'use strict';
/**
* Post-execute hook for database-expert
* Auto-generated by enterprise-bundle-scaffolder
*
* Records metrics after skill execution.
*/
function postExecute(_context) {
// Record execution metrics
return { ok: true, skill: 'database-expert' };
}
module.exports = { postExecute };
'use strict';
/**
* Pre-execute hook for database-expert
* Auto-generated by enterprise-bundle-scaffolder
*
* Validates inputs before skill execution.
*/
function preExecute(context) {
// Validate skill invocation context
if (!context || typeof context !== 'object') {
return { allow: true, message: 'database-expert: no context to validate' };
}
return { allow: true };
}
module.exports = { preExecute };
database-expert Research Requirements
Generated: 2026-02-28
Skill Description
Database expert including Prisma, Supabase, SQL, and NoSQL patterns
Research Areas
- Current best practices for database-expert
- Industry standards and tooling
- Integration patterns
Source References
- To be populated by skill-updater research phase
database-expert Rules
Purpose
Database expert including Prisma, Supabase, SQL, and NoSQL patterns
Best Practices
- Follow domain-specific conventions
- Apply patterns consistently
- Prioritize type safety and testing
Integration Points
See SKILL.md for complete documentation.
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "database-expertInput",
"description": "Input schema for Database expert including Prisma, Supabase, SQL, and NoSQL patterns",
"type": "object",
"additionalProperties": true,
"properties": {
"target": {
"type": "string",
"description": "Target file or path for the skill to operate on"
},
"options": {
"type": "object",
"description": "Additional options for skill execution",
"additionalProperties": true
}
}
}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "database-expertOutput",
"type": "object",
"additionalProperties": true,
"properties": {
"ok": {
"type": "boolean"
},
"summary": {
"type": "string"
}
}
}
#!/usr/bin/env node
/**
* database-expert - Consolidated Expert Skill
* Consolidates 1 individual skills
*/
const fs = require('fs');
const path = require('path');
const args = process.argv.slice(2);
if (args.includes('--help')) {
console.log(`
database-expert - Expert Skill
Usage:
node main.cjs --list List consolidated skills
node main.cjs --help Show this help
Description:
Database expert including Prisma, Supabase, SQL, and NoSQL patterns
Consolidated from: 1 skills
`);
process.exit(0);
}
if (args.includes('--list')) {
console.log('Consolidated skills:');
['database-expert'].forEach(s => console.log(' - ' + s));
process.exit(0);
}
console.log('database-expert skill loaded. Use with Claude for expert guidance.');
database-expert Implementation Template
Goal
- Define target outcome and acceptance criteria.
TDD
1. Red 2. Green 3. Refactor
Verification
- lint
- format
- targeted tests