Exposes a lightweight interface to query and manage SQLite databases within the project.

Install

mkdir -p .claude/skills/db-api && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10775" && unzip -o skill.zip -d .claude/skills/db-api && rm skill.zip

Installs to .claude/skills/db-api

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.

The db-api skill exposes the repository's SQLite database to agents via a lightweight CLI (scripts/db.sh) and a small Python wrapper (scripts/skills/db-api.py). Use this skill for safe, read-first operations and limited CRUD tasks when a full service layer is not available.
274 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Beginner

Key capabilities

  • List database tables and row counts
  • View table contents in pretty, raw, or CSV formats
  • Execute SQL queries on the SQLite store
  • Report database status and PRAGMA settings
  • Identify connected processes

How it works

The skill provides a CLI and Python wrapper to interface with a local SQLite database. It uses standard sqlite3 commands to perform read-first operations and administrative tasks.

Inputs & outputs

You give it
SQL query or table name
You get back
Formatted database records or status report

When to use db-api

  • Inspect database tables
  • Query todos
  • Check database status

About this skill

db-api skill

The db-api skill exposes the repository's SQLite database to agents via a lightweight CLI (scripts/db.sh) and a small Python wrapper (scripts/skills/db-api.py). Use this skill for safe, read-first operations and limited CRUD tasks when a full service layer is not available.

Usage

  • scripts/skills/db-api.py list-tables
  • scripts/skills/db-api.py status
  • scripts/skills/db-api.py show-table todos
  • scripts/skills/db-api.py view todos [limit|'all'] [format] # formats: pretty (default), raw, csv
  • scripts/skills/db-api.py view todos all pretty
  • scripts/skills/db-api.py view todos 10 csv
  • scripts/skills/db-api.py query "SELECT count(*) FROM todos;"

Output formats and status fields

  • view: supports three output formats:
    • pretty: sqlite3 -header -column (human-friendly table with column headers)
    • raw: pipe-delimited values without headers (good for scripting)
    • csv: header + CSV output
  • status: prints the following fields to aid agents and operators:
    • DB_PATH, size, last_modified, last_access
    • tables: list of table names
    • table_row_counts: per-table counts
    • table_count: total number of tables
    • PRAGMA values: journal_mode, foreign_keys, busy_timeout
    • connected_processes: lsof output if available

Troubleshooting

  • Ensure sqlite3 is installed and scripts/lib/sql.sh DB_PATH points to the expected DB file (default: run/v-daemon.db).
  • If WAL cannot be enabled, move the DB to a WAL-capable filesystem (avoid certain CIFS mounts).
  • PRAGMA settings like foreign_keys must be applied per-connection; scripts/lib/sql.sh sets sensible defaults per run.
  • Check run/system.log and logs/sql-agent.log for initialization and errors.

Notes

  • Do not run untrusted SQL via the query endpoint; treat it as an administrative capability.
  • For complex or high-frequency DB work, implement a dedicated service layer rather than giving agents direct SQL access.
  • See docs/db-api.md and docs/db-api-spec.md for full reference and examples.

When not to use it

  • When a dedicated service layer is available
  • When performing high-frequency database operations

Prerequisites

sqlite3scripts/lib/sql.sh

Limitations

  • Do not run untrusted SQL via the query endpoint
  • WAL mode requires a compatible filesystem

How it compares

It provides a standardized interface for agents to interact with the database instead of requiring manual CLI commands or direct file access.

Compared to similar skills

db-api side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
db-api (this skill)06moNo flagsBeginner
find-hypertable-candidates14moNo flagsIntermediate
h3-pg12moNo flagsAdvanced
sqlmesh03moReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

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.

18

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.

15

sqlmesh

droher

Use when working with SQLMesh — writing or editing MODEL blocks, Python @model decorators, Python @macros, audits, unit tests, external_models.yaml, or seeds; running `sqlmesh plan/apply/audit/render/evaluate/test`; debugging plans, snapshots, virtual environments, or state issues; configuring `conf

00

database

asnk633

Database development and operations workflow covering SQL, NoSQL, database design, migrations, optimization, and data engineering.

00

inspect-database

Juan961

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.

00

sql-queries

anthropics

Write correct, performant SQL across all major data warehouse dialects (Snowflake, BigQuery, Databricks, PostgreSQL, etc.). Use when writing queries, optimizing slow SQL, translating between dialects, or building complex analytical queries with CTEs, window functions, or aggregations.

1888

Search skills

Search the agent skills registry