No slash command · from dev10x-db
Safe database query planning for Claude Code. Ensures schema-first SQL construction and read-only safety so queries are accurate and never modify production data.
Ships in dev10x-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 skill follows references/task-orchestration.md patterns.
Create a task at invocation, mark completed when done:
REQUIRED: Create a task at invocation. Execute at startup:
TaskCreate(subject="Plan database query", activeForm="Planning query")Mark completed when done: TaskUpdate(taskId, status="completed")
Schema-first query construction for safe, accurate database queries.
Before writing any SQL:
information_schema querydev10x-db:db-psql for PostgreSQL)Generic skills discover database context by searching these resources (in order, first match wins per resource type):
~/.config/Dev10x/db-*-schema.md — global schema docs
(preferred, see references/config-resolution.md)Handled by dev10x-db:db-psql — see its SKILL.md for the full
search order. Key locations:
$DB_CONFIG environment variable (explicit override)skills/db-psql/databases.yaml)~/.config/Dev10x/databases.yaml — XDG; preferred global location~/.claude/memory/Dev10x/databases.yaml — deprecated fallbackskills/*/databases.yaml)~/.claude/skills/*/databases.yaml)~/.claude/plugins/marketplaces/*/skills/*/databases.yaml)*:db pattern (e.g.,
tt:db, acme:db) — project-specific aliases, common queries,
and DSN configurationAlways load available context before constructing queries.
SELECT * on production tables without a WHERE clause| Anti-Pattern | What to Do Instead |
|---|---|
| Guess table/column names | Load schema files first, or query information_schema.tables / information_schema.columns |
| Retry with random name variations | Stop and look up the correct name in schema docs |
SELECT * on large tables | Use specific columns and LIMIT |
| Inline DSN strings in prompts | Use the engine-specific skill's wrapper script |
| Skip schema check for "simple" queries | Always verify — even common tables have gotchas |
Schema files should follow this template. Place them at
~/.config/Dev10x/db-<name>-schema.md (preferred global
path per references/config-resolution.md):
# <Project> Database Schema — <database-name>
## <Domain Group>
| Table | Key Columns | Notes |
|-------|-------------|-------|
| `table_name` | id, name, status, foreign_key_id | Brief purpose |
## Common Gotchas
- Table `actual_name` (NOT `guessed_name`)
- Money fields store JSON: `field::jsonb->>'amount'`
## Common Queries
### Find X by Y
\```sql
SELECT ... FROM ... WHERE ...
\```
This skill provides query planning guidance. Actual query execution is handled by engine-specific skills:
dev10x-db:db-psql — PostgreSQL via psql wrapperdev10x-db:sql-handoff — hands write statements to the user and
verifies them with a SELECT afterwardsWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub dev10x-guru/dev10x-claude --plugin dev10x-db4 skills in this plugin
/bqdev10x-db:bqRead-only BigQuery access through MCP tools that wrap the bq CLI — so an agent can explore datasets and run a SELECT against project.dataset.table without a blanket `Bash(bq query:*)` allow that would also approve DELETE, MERGE or a --destination_table write. TRIGGER when: reading BigQuery data, listing BigQuery datasets or tables, or checking a BigQuery table's columns. DO NOT TRIGGER when: querying Postgres (use dev10x-db:db-psql), or the statement writes (print it for the user, see dev10x-db:sql-handoff).
/db-psqldev10x-db:db-psqlSafe read-only psql wrapper for Claude Code. Provides db.sh with SQL validation hook so database queries are safe and auditable. Configure databases in databases.yaml with env var or keyring backends. TRIGGER when: executing SQL against configured databases. DO NOT TRIGGER when: planning queries (use dev10x-db:db), or working with non-database tasks.
/sql-handoffdev10x-db:sql-handoffUse when a write (UPDATE, INSERT, DELETE, DDL) must reach a database the agent can only read through dev10x-db:db-psql — so the supervisor gets one paste-safe statement aimed at the right database, and the agent proves the effect before building on it. TRIGGER when: the agent needs the user to run non-SELECT SQL by hand, or the db-psql hook just blocked a write. DO NOT TRIGGER when: the SQL is a SELECT (run it via dev10x-db:db-psql), or the change belongs in a migration file in the codebase.
Other plugins' skills for the same job