ops-database skill
✓ VerifiedDesign database schemas, create migrations, and optimize queries using standardized naming conventions and indexing strategies.
- GitHub stars
- 5
- Files
- 2
- Last commit
- Nov 11, 2026
- License
- MIT
- Allowed tools
- —
What does the ops-database skill do?
ops-database is an agent skill. Design database schemas, create migrations, and optimize queries using standardized naming conventions and indexing strategies.
Summary generated from the skill's SKILL.md.
About the ops-database skill
Designing database schemas and managing migrations becomes more structured when developers use standardized naming conventions and indexing strategies. This skill provides a framework for creating PostgreSQL tables, defining relationships like one-to-many or many-to-many, and implementing automated updated_at triggers. It is intended for use when an agent needs to generate SQL code that follows specific snake_case rules for tables and columns.
An agent should load this skill when a user requests new table structures, migration scripts, or query optimizations. It produces valid SQL commands, including primary key definitions using UUIDs and various index types such as B-tree, GIN, or GiST. By focusing on stack-neutral conventions, it ensures that naming patterns for foreign keys and indexes remain consistent across different projects. Users can also utilize the provided commands to analyze query performance using EXPLAIN ANALYZE or identify missing indexes through system catalog queries.
What an agent can do with it
- 1Generate standardized PostgreSQL tablesCreate new database tables that follow specific snake_case naming conventions and include automatic timestamp triggers.
- 2Optimize query performanceAnalyze existing SQL queries to find performance bottlenecks or identify where indexes are missing.
Written from the skill's SKILL.md. Every use case is checked against a quote from it.
How to install the ops-database 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 ops-database skill in Claude Code
~/.claude/skills/ops-database/SKILL.md
$ npx degit christopherlouet/claude-base/.claude/skills/ops-database ~/.claude/skills/ops-databaseInstall the ops-database skill in Claude Code (project)
.claude/skills/ops-database/SKILL.md
$ npx degit christopherlouet/claude-base/.claude/skills/ops-database .claude/skills/ops-databaseInstall the ops-database skill in Codex
~/.agents/skills/ops-database/SKILL.md
$ npx degit christopherlouet/claude-base/.claude/skills/ops-database ~/.agents/skills/ops-databaseInstall the ops-database skill in Gemini CLI
~/.gemini/skills/ops-database/SKILL.md
$ npx degit christopherlouet/claude-base/.claude/skills/ops-database ~/.gemini/skills/ops-databaseInstall the ops-database skill in Claude.ai
npx degit christopherlouet/claude-base/.claude/skills/ops-database ops-database && zip -r ops-database.zip ops-database # claude.ai → Customize → Skills → + → Create skill → Upload a skill → ops-database.zip
Automated checks
Ran Nov 16, 2026Full report →Passed our automated checks. That is not a security audit: read the scripts before you let an agent run them. How checks work
- Source repository linked and reachablechristopherlouet/claude-base/.claude/skills/ops-database is public and reachablegithub.com/christopherlouet/claude-base/tree/HEAD/.claude/sk ↗Pass
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit 2026-11-11github.com/christopherlouet/claude-base/commits ↗Pass
- No download-and-run or credential theft in scriptsNo scripts in the skill folderPass
- No hidden instructions in SKILL.mdNo override phrases, safeguard switches, credential requests or hidden charactersgithub.com/christopherlouet/claude-base/blob/HEAD/.claude/sk ↗Pass
- Pre-approved tools are scopedNo pre-approved tools; the agent asks before using onegithub.com/christopherlouet/claude-base/blob/HEAD/.claude/sk ↗Pass
- SKILL.md follows the Agent Skills formatValid name and description; says when to use it; 94 linesgithub.com/christopherlouet/claude-base/blob/HEAD/.claude/sk ↗Pass
SKILL.md
View on GitHubDatabase Design
Conventions
| Element | Convention | Example |
|---|---|---|
| Tables | snake_case plural | users, order_items |
| Columns | snake_case | created_at, user_id |
| Primary key | id | id UUID |
| Foreign key | table_id | user_id |
| Index | idx_table_columns | idx_users_email |
PostgreSQL Schema
CREATE TABLE users (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
email TEXT UNIQUE NOT NULL,
name TEXT NOT NULL,
created_at TIMESTAMPTZ DEFAULT NOW(),
updated_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE INDEX idx_users_email ON users(email);
-- Trigger updated_at
CREATE OR REPLACE FUNCTION update_updated_at()
RETURNS TRIGGER AS $$
BEGIN
NEW.updated_at = NOW();
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
CREATE TRIGGER users_updated_at
BEFORE UPDATE ON users
FOR EACH ROW
EXECUTE FUNCTION update_updated_at();
Relations
-- One-to-Many
CREATE TABLE posts (
id UUID PRIMARY KEY,
user_id UUID REFERENCES users(id) ON DELETE CASCADE,
title TEXT NOT NULL
);
-- Many-to-Many
CREATE TABLE user_roles (
user_id UUID REFERENCES users(id),
role_id UUID REFERENCES roles(id),
PRIMARY KEY (user_id, role_id)
);
Indexes
| Type | Usage |
|---|---|
| B-tree | Equality, range (default) |
| GIN | JSONB, arrays, full-text |
| GiST | Geospatial |
Optimization
-- Analyze a query
EXPLAIN ANALYZE SELECT * FROM users WHERE email = 'test@example.com';
-- Missing indexes
SELECT * FROM pg_stat_user_indexes WHERE idx_scan = 0;
See also
MongoDB publishes their own official agent skills at mongodb/agent-skills (102★, last commit 2026-05-04). The repo covers schema design heuristics, indexing strategies, query patterns, and operational safeguards specific to MongoDB.
For PostgreSQL, the dev-supabase skill already points to supabase/agent-skills which includes a supabase-postgres-best-practices skill (30 rules across 8 categories) — useful for any Postgres project, not just Supabase-managed.
When working on a project using one of these databases, install the relevant vendor skill alongside this one. This skill captures the stack-neutral conventions (naming, soft-delete patterns, updated_at triggers, partitioning strategy); the vendor skills capture the canonical operational patterns specific to MongoDB or Postgres.
Vendor-neutrality: MongoDB Inc. is independent. Supabase is independent. Both pass the vendor-neutrality filter.
Install command and full list of validated vendor skills: docs/recipes/recommended-vendor-skills.md. Audit pilot trace: specs/marketplace-audit/ops-skills-pilot-2026-05-06.md.
Files in this skill
2ops-database skill questions
How do I install the ops-database skill in Claude Code?
Run npx degit christopherlouet/claude-base/.claude/skills/ops-database ~/.claude/skills/ops-database. 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 ops-database 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 can I check for missing indexes in PostgreSQL?
You can identify missing indexes by querying the pg_stat_user_indexes view where idx_scan is 0.