inspect-database
Safe database inspection workflow for diagnosing schemas and identifying architectural risks.
Install
mkdir -p .claude/skills/inspect-database && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/15822" && unzip -o skill.zip -d .claude/skills/inspect-database && rm skill.zipInstalls to .claude/skills/inspect-database
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Workflow para inspeccionar y auditar Supabase/Postgres sin modificar datos, entendiendo esquema, relaciones, migraciones, logs y riesgos. USE FOR: diagnóstico de estructura, inventario de tablas, análisis de dependencias, revisión de seguridad y troubleshooting de consultas.Key capabilities
- →List tables by schema
- →Identify columns, types, PK/FK, indices, and constraints for critical tables
- →Review migration history
- →Correlate errors with endpoints or specific queries
- →Execute security and performance advisors
- →Present prioritized findings with evidence and suggested actions
How it works
The skill defines an inspection question and scope, inventories structural elements, traces changes through migration history, diagnoses operational issues from logs, and reviews security and performance.
Inputs & outputs
When to use inspect-database
- →Audit database schema
- →Inspect relationships
- →Troubleshoot query performance
- →Review database security
About this skill
Inspect Database
Objetivo
Obtener una visión confiable del estado de la base de datos (estructura, relaciones, salud y riesgo) sin aplicar cambios destructivos.
Resultado Esperado
- Mapa de esquema actualizado y entendible.
- Hallazgos priorizados de integridad, seguridad y performance.
- Hipótesis de diagnóstico con evidencia.
- Recomendaciones accionables para el siguiente cambio.
Entradas Mínimas
- Pregunta de inspección principal (qué se quiere entender).
- Alcance (schema, tablas o dominio funcional).
- Entorno consultado.
- Síntoma asociado, si existe (error, lentitud, inconsistencias).
Flujo Paso a Paso
1. Definir pregunta y alcance
- Traducir la necesidad en preguntas concretas:
- ¿Qué tablas participan?
- ¿Qué relaciones/cascadas existen?
- ¿Qué migración introdujo el cambio?
- Limitar alcance para evitar análisis difuso.
Chequeo de salida:
- Hay objetivo de inspección claro y verificable.
2. Inventario estructural
- Listar tablas por schema.
- Para cada tabla crítica, identificar:
- columnas y tipos,
- PK/FK,
- índices,
- constraints.
- Detectar tablas huérfanas o naming inconsistente.
Chequeo de salida:
- Estructura base documentada con foco en entidades críticas.
3. Trazabilidad de cambios
- Revisar historial de migraciones aplicadas.
- Relacionar cambios estructurales con síntomas reportados.
- Señalar discrepancias entre lo esperado y lo realmente aplicado.
Decisiones:
- Si faltan migraciones esperadas, marcar drift de entorno.
- Si hay cambios manuales fuera de migración, elevar riesgo.
Chequeo de salida:
- Se entiende cuándo y cómo evolucionó el esquema.
4. Diagnóstico operativo
- Revisar logs de servicios relevantes (postgres/api/auth/realtime según caso).
- Correlacionar errores con endpoints o consultas específicas.
- Identificar patrones:
- timeouts,
- locks,
- violaciones de constraints,
- picos de errores.
Chequeo de salida:
- Existe evidencia operacional para sostener hipótesis.
5. Revisión de seguridad y performance
- Ejecutar advisors de seguridad/performance.
- Validar si hay:
- RLS ausente o incompleta,
- políticas demasiado permisivas,
- índices faltantes en rutas de consulta frecuentes.
- Priorizar hallazgos por severidad e impacto.
Chequeo de salida:
- Hallazgos categorizados con prioridad y recomendación.
6. Entrega de hallazgos
- Presentar resumen ejecutivo corto.
- Listar findings priorizados:
- severidad,
- evidencia,
- impacto,
- acción sugerida.
- Incluir riesgos residuales y supuestos abiertos.
Chequeo de salida:
- El equipo puede decidir próximos pasos sin investigación adicional inmediata.
Reglas de Calidad
- No ejecutar DDL durante inspección.
- Separar hechos observados de inferencias.
- Citar evidencia mínima por hallazgo.
- Evitar conclusiones sin correlación técnica.
Checklist Rápido
- Objetivo y alcance definidos.
- Esquema inventariado.
- Migraciones y drift revisados.
- Logs y síntomas correlacionados.
- Advisors analizados.
- Hallazgos priorizados y accionables.
Prompt de Ejemplo
- "Usa inspect-database para mapear relaciones y constraints del dominio de simulaciones."
- "Ejecuta inspect-database para investigar por qué fallan inserciones intermitentes en una tabla con RLS."
When not to use it
- →When the goal is to modify data
- →When the goal is to execute DDL during inspection
- →When conclusions are without technical correlation
Limitations
- →The skill does not execute DDL during inspection
- →The skill separates observed facts from inferences
- →The skill avoids conclusions without technical correlation
How it compares
This workflow provides a structured, read-only audit process for database health and risk, unlike manual inspection that might lack a systematic approach or risk unintended modifications.
Compared to similar skills
inspect-database side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| inspect-database (this skill) | 0 | 4mo | No flags | Intermediate |
| supabase-postgres-best-practices | 4 | 6mo | No flags | Intermediate |
| find-hypertable-candidates | 1 | 4mo | No flags | Intermediate |
| h3-pg | 1 | 2mo | No flags | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
supabase-postgres-best-practices
davila7
Postgres performance optimization and best practices from Supabase. Use this skill when writing, reviewing, or optimizing Postgres queries, schema designs, or database configurations.
find-hypertable-candidates
timescale
Use this skill to analyze an existing PostgreSQL database and identify which tables should be converted to Timescale/TimescaleDB hypertables. **Trigger when user asks to:** - Analyze database tables for hypertable conversion potential - Identify time-series or event tables in an existing schema - Evaluate if a table would benefit from Timescale/TimescaleDB - Audit PostgreSQL tables for migration to Timescale/TimescaleDB/TigerData - Score or rank tables for hypertable candidacy **Keywords:** hypertable candidate, table analysis, migration assessment, Timescale, TimescaleDB, time-series detection, insert-heavy tables, event logs, audit tables Provides SQL queries to analyze table statistics, index patterns, and query patterns. Includes scoring criteria (8+ points = good candidate) and pattern recognition for IoT, events, transactions, and sequential data.
h3-pg
postgis
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
backend-dev
marmelab
Coding practices for backend development in Atomic CRM. Use when deciding whether backend logic is needed, or when creating/modifying database migrations, views, triggers, RLS policies, edge functions, or custom dataProvider methods that call Supabase APIs.
supabase-enterprise-rbac
jeremylongshore
Configure Supabase enterprise SSO, role-based access control, and organization management. Use when implementing SSO integration, configuring role-based permissions, or setting up organization-level controls for Supabase. Trigger with phrases like "supabase SSO", "supabase RBAC", "supabase enterprise", "supabase roles", "supabase permissions", "supabase SAML".
hiddenroom-supabase
cuvo1903-ctrl
Hidden Room Supabase backend skill for migrations, generated database types, Edge Functions, RLS policies, auth/profile sync, storage buckets, Stripe integration, cloud_jobs, and database documentation. Use when editing supabase/migrations, supabase/functions, database.types.ts, or Supabase-backed f