/db:database-management-strategyfrom db
Defines database setup, migration, and seeding strategies across local, CI, staging, and production environments for PostgreSQL, MongoDB, Redis, BigQuery, and Cosmos DB.
Ships in db. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
This document outlines the required strategy for managing databases across all project environments, incorporating Context7-verified best practices for PostgreSQL, MongoDB, Redis, BigQuery, and Cosmos DB.
| Environment | Tool / Service | Lifecycle / Purpose | Data Source | Persistence |
|---|---|---|---|---|
| Local (Dev) | docker-compose | Long-running, per-developer | Migrations + Developer Seeds | Yes (Named Volume) |
| CI/CD (Tests) | kubectl run | Ephemeral, per-PR/commit | Migrations + Test Seeds | No (Clean for every run) |
| Staging | Managed Cloud DB (e.g., RDS) | Long-running, shared by team | Sanitized/Anonymized Production Dump | Yes (Persistent) |
| Production | Managed Cloud DB (High-Availability) | Long-running, critical user data | Live User Data | Yes (HA + Backups) |
docker compose up/down cycles/data/dbEXPLAIN ANALYZE for query optimizationpg_stat_user_indexes for index usage$indexStats_PARTITIONTIME for efficient partition pruningINFORMATION_SCHEMA.TABLE_STORAGEALTER TABLE or schema modifications-- B-tree for equality and range
CREATE INDEX idx_users_email ON users(email);
-- Partial index for filtered queries
CREATE INDEX idx_orders_pending ON orders(order_date)
WHERE status = 'pending';
-- Covering index with INCLUDE
CREATE INDEX idx_orders_customer ON orders(customer_id)
INCLUDE (order_date, amount);
// Check for index inconsistencies in sharded collections
db.collection.aggregate([
{$indexStats: {}},
{$group: {_id: null, indexDoc: {$push: "$$ROOT"}, allShards: {$addToSet: "$shard"}}}
]);
# Client-side caching with placeholder
SET foo "caching-in-progress"
GET foo
# Replace with actual value after computation
CREATE TABLE my_table (
id INT64,
event_timestamp TIMESTAMP,
category STRING
)
PARTITION BY DATE(event_timestamp)
CLUSTER BY category;
{
"partitionKey": {
"paths": ["/userId"],
"kind": "Hash"
}
}
All database operations must follow these strategies. Deviations require architectural review and documentation in CLAUDE.md.
What SKILL.md sets; muted values are Claude Code's defaults
2 skills in this plugin
npx claudepluginhub lagowski/claudeautopm --plugin dbOther plugins' skills for the same job