/dev10x-db:bqfrom dev10x-db
Read-only BigQuery access via MCP tools wrapping the bq CLI. Explores datasets, tables, and columns, runs SELECT queries with dry-run estimation and safety checks against writes.
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.
Read when SKILL.md points to them.
Announce: "Using dev10x-db:bq to read BigQuery through the read-only tools."
This skill follows references/task-orchestration.md patterns.
REQUIRED: Create a task at invocation. Execute at startup:
TaskCreate(subject="Run read-only BigQuery query", activeForm="Querying BigQuery")Mark completed when done: TaskUpdate(taskId, status="completed")
bq CLI from the Google Cloud SDK, on PATH.gcloud auth login (and
gcloud auth application-default login where your setup needs it).databases.yaml, no DSN and no keyring entry.
The tools use whatever account gcloud holds.Never guess a column name. Walk down from the project before writing a query:
mcp__plugin_dev10x_db__bq_datasets(project_id="<project>")mcp__plugin_dev10x_db__bq_tables(dataset="<project>.<dataset>")mcp__plugin_dev10x_db__bq_schema(table="<project>.<dataset>.<table>")mcp__plugin_dev10x_db__bq_query(sql="SELECT …", dry_run=true).
The job payload is bq's raw dry-run output; read the bytes it
would process from there.
REQUIRED: never pass maximum_bytes_billed above the 10 GiB
default on your own.
When the estimate exceeds it, stop, report the estimate, and let the
user decide whether to narrow the query or raise the cap.mcp__plugin_dev10x_db__bq_query(sql="SELECT …").
Read truncated; when it is true, add a LIMIT, a filter, or raise
max_rows (1-10000).
A page of exactly max_rows rows also reads as truncated.
When bq prints something other than a row list, rows is empty and
raw carries the output; read raw before calling the result empty.Address every table in SQL as `project.dataset.table`.
Pass project_id to bill a project other than the gcloud default, and
location when the dataset lives outside the default location.
The lexer checks refuse before bq runs, and the dry-run check refuses
before the query runs, so a refusal executes nothing:
MERGE, EXPORT DATA,
LOAD DATA, CALL and EXECUTE IMMEDIATE are blocked, and so is
EXTERNAL_QUERY, whose SQL hides in a string literal.
Leave out the trailing ;, do not start the SQL with - (bq would
read it as a flag), and use plain \n line breaks: any ;, a
leading -, and \r, \f or \v are refused.
BigQuery keywords such as MERGE or CALL are refused even inside a
string literal or comment, and so is a run of four or more identical
quotes; rephrase the literal (for example CONCAT('ca', 'll')).
The rules are the same ones the DX004 hook applies to bq query
(dev10x.core.domain.rules.read_only_sql).bq_query call first dry-runs the same SQL with the same
project, location and flags; a dry run executes nothing.
The query runs only when BigQuery reports
statistics.query.statementType SELECT and no child jobs.
These dry-run results refuse with blocked: true: any other
statement type (SCRIPT, DML, DDL, EXPORT_DATA), child jobs,
a missing or malformed statistics or status field, and an
errorResult.
A dry run that fails or times out also stops the query, and its
error starts with The bq dry run failed.
This layer adds to the lexer above and never replaces it.
Each query costs one extra API round-trip.~/.bigqueryrc, BIGQUERYRC and FLAGS_* are not read, so they
cannot add --destination_table or --replace.maximum_bytes_billed defaults to 10 GiB and is capped at 1 TiB.
A query over the cap fails in BigQuery without billing.bq after 120 seconds.
[Verify] whether the BigQuery job keeps running server-side; the
byte cap still bounds what it can bill.REQUIRED: no fallback to raw bq.
This covers every error from these tools: a refused statement, bq
missing from PATH, expired gcloud credentials, the timeout and the
byte cap.
Do not retry through Bash bq, a script or another tool.
Report the error; for credentials, tell the user to run
gcloud auth login.
Print the statement in a fenced sql block whose first line names
the target:
-- Run against: <project>.<dataset> (BigQuery)
One statement per block, with an exact WHERE clause and the row
count you expect — the format of dev10x-db:sql-handoff.
Its databases.yaml lookup and db-psql read-back do not apply to
BigQuery.
Ask the user to run it in the BigQuery console or their own bq, and
end the turn.
After the user says it ran, read the effect back with a bq_query
SELECT on the same WHERE clause before building on it.
Keep the task open until that read-back is done.
bq to denyOnce this skill is in use, raw bq no longer needs an allow rule.
dev10x:plugin-doctor reports Bash(bq:*), Bash(bq query:*) and
similar allows (strategy raw-bq-allow).
Move them from permissions.allow to permissions.deny in your own
user settings; the plugin does not edit that file for you.
dev10x-db:sql-handoff — the handoff block format reused above.dev10x-db:db-psql — the Postgres sibling of this skill.What 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
/dbdev10x-db:dbSafe database query planning for Claude Code. When querying any database, ensures schema-first construction and read-only safety so queries are accurate and never modify production data. TRIGGER when: code needs database queries, schema discovery, or SQL construction. DO NOT TRIGGER when: no database interaction needed, or user is writing application code that happens to mention SQL in comments.
/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-handoffOther plugins' skills for the same job