Agent skill

SQL Plan Audit

by mizchi in mizchi/skills

Run EXPLAIN QUERY PLAN against every query in a sqlc-style catalog and diff the plans against a baseline.

No licenceAuto-check passedDatabases

Install SQL Plan Audit

skills CLI
$ npx skills add mizchi/skills --skill sql-plan-audit -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install mizchi/skills sql-plan-audit --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/mizchi/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/sql-plan-audit .claude/skills/sql-plan-audit && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
sql-plan-audit
GitHub stars
356
Token cost
~1.4k tokens
SKILL.md length
636 words
Files
3 (incl. scripts)
Skills in repo
69
Repo updated
First seen
Licence
None found

At a glance

Run EXPLAIN QUERY PLAN against every query in a sqlc-style catalog and diff the plans against a baseline.

  • Works in 5 steps: Identify the schema file and the query… → Run the runner → Commit the output. The text format is… → …
  • Tasks that involve Query optimization
  • SKILL.md covers Why, When to invoke, Workflow and What success and failure look…, plus 7 more sections
  • Runs JavaScript scripts from its folder; calls node

What it does

SQL Plan Audit is an agent skill from mizchi/skills. Run EXPLAIN QUERY PLAN against every query in a sqlc-style catalog and diff the plans against a baseline. Detects new full-table SCANs and TEMP B-TREE sort scans introduced by PRs. SQLite/D1-only today; engine extension noted below.

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including scripts (for example `README.md`).

It sits in Databases, covering Query optimization and SQL. It works with SQL and SQLite. The repository describes itself as: Agent skills by mizchi, distributed via APM.

When your agent uses it

  • Tasks that involve Query optimization
  • Tasks that involve SQL

Example prompts

  • “/sql-plan-audit”

Requirements

  • Node.js

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Identify the schema file and the query catalog file. Typical layout
  2. Run the runner
  3. Commit the output. The text format is line-stable across runs; diffs surface plan changes.
  4. To enforce in CI, regenerate to JSON and diff against a committed baseline
  5. When intentional regressions land (e.g. an index was retired on purpose), regenerate the baseline in the same PR.

What it can do on your machine

Read from SKILL.md and the folder at commit 62f5808. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (JavaScript), which the agent can run.

    Shell commands in SKILL.md call:

    • node

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

SQL Plan Audit loads about 1.4k tokens when it runs. Until then it costs about 62 tokens; SKILL.md has 636 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~62
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

Without a licence we can't republish the file, so here is its outline and opening line. It has 636 words (~1,438 tokens).

“Use this when a project has a sqlc-style query catalog (or any file with -- name: X :type markers) and wants to keep query plans visible in code review.”

— opening of SKILL.md by mizchi
name
sql-plan-audit
version
0.1.0

Read the full SKILL.md on GitHub

Files

SKILL.md and 2 other files (scripts) in sql-plan-audit of mizchi/skills.

  • SKILL.md
  • README.md
  • scripts/explain-runner.mjs

Open the folder on GitHubat commit 62f5808

Compare with similar skills

SQL Plan Audit next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

SQL Plan Audit compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
SQL Plan Audit this skillmizchi/skills356—~1.4kAutomated safety check: PassNone
SQL Insightzebbern/claude-code-guide4.7k—~2.1kAutomated safety check: PassMIT
SQL Expertaiskillstore/marketplace430—~3.4kAutomated safety check: PassNone
SQL ToolkitLeoYeAI/openclaw-master-skills2.2k—~3kAutomated safety check: PassMIT
SQL Database Support for pRESTprest/prest4.6k—~1.6kAutomated safety check: PassMIT
Cursor BYOK Database Schemaleookun/cursor-byok3.2k—~1.3kAutomated safety check: PassMIT

Similar skills

  • SQL Insight

    zebbern/claude-code-guide

    Translate natural language to SQL, optimize query performance, and interpret EXPLAIN plans for SQLite and PostgreSQL.

    4.7k GitHub stars~2.1k tokensUpdated today
    DatabasesAuto-check passed
  • SQL Expert

    aiskillstore/marketplace

    Expert SQL query writing, optimization, and database schema design with support for PostgreSQL, MySQL, SQLite, and SQL Server.

    430 GitHub stars~3.4k tokensUpdated today
    DatabasesAuto-check passed
  • SQL Toolkit

    LeoYeAI/openclaw-master-skills

    Query, design, migrate, and optimize SQL databases. An agent skill from LeoYeAI/openclaw-master-skills.

    2.2k GitHub stars~3k tokensUpdated 2 mo ago
    DatabasesAuto-check passed
  • Guides classifying, gap-analyzing and scaffolding support for a new SQL database in pREST, from Postgres-compatible variants to entirely new dialects.

    4.6k GitHub stars~1.6k tokensUpdated today
    DatabasesAuto-check passed
  • Cursor BYOK Database Schema

    leookun/cursor-byok

    Guides SQLite schema changes in the Cursor BYOK server, keeping SQLx migrations, the Rust store, API contracts and fixtures aligned.

    3.2k GitHub stars~1.3k tokensUpdated today
    DatabasesAuto-check passed
  • SQL Optimization Patterns

    ynulihao/AgentSkillOS

    Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries.

    617 GitHub starsUsed in 11 repos~3.3k tokens
    DatabasesAuto-check passed

More from mizchi/skills

All 69 skills in this repo
  • Publish Agent Skill

    mizchi/skills

    Package, publish, verify and update an agent skill through a Claude Code plugin marketplace, APM or the npx skills CLI.

    356 GitHub stars~1.7k tokensUpdated 6 days ago
    Auto-check passed
  • AI Index

    mizchi/skills

    Method and tooling for measuring how AI-generated a piece of prose reads, in Japanese or English.

    356 GitHub stars~3.6k tokensUpdated 6 days ago
    Auto-check passed
  • Cloudflare Deploy

    mizchi/skills

    Deploy applications and infrastructure to Cloudflare with the cf CLI and typed cloudflare.config.ts.

    356 GitHub stars~2.9k tokensUpdated 6 days ago
    Auto-check: notes
  • Review Image

    mizchi/skills

    Review screenshots or other images with OpenRouter vision models via bundled Deno scripts.

    356 GitHub stars~1.3k tokensUpdated 6 days ago
    Auto-check passed
  • Post-generation safety checks for sqlc-gen-moonbit + Cloudflare D1.

    356 GitHub stars~995 tokensUpdated 6 days ago
    Auto-check passed
  • Apm Usage

    mizchi/skills

    Reference for APM (Agent Package Manager) — apm.yml syntax, install / uninstall / update commands, target detection, lockfile workflow.

    356 GitHub stars~1.9k tokensUpdated 6 days ago
    Auto-check passed

Works with

Categories

Questions about SQL Plan Audit

What does SQL Plan Audit do?

Run EXPLAIN QUERY PLAN against every query in a sqlc-style catalog and diff the plans against a baseline. SQL Plan Audit is an agent skill from mizchi/skills. Run EXPLAIN QUERY PLAN against every query in a sqlc-style catalog and diff the plans against a baseline.

When should I use SQL Plan Audit?

SQL Plan Audit fits situations like: tasks that involve Query optimization; tasks that involve SQL.

How do I install SQL Plan Audit in Claude Code?

Run `npx skills add mizchi/skills --skill sql-plan-audit -a claude-code`. Or copy the skill folder (sql-plan-audit in mizchi/skills) into .claude/skills/sql-plan-audit in your project. Claude Code loads it when a task matches its description.

How do I install SQL Plan Audit in Codex?

Run `npx skills add mizchi/skills --skill sql-plan-audit -a codex`. Or copy the skill folder (sql-plan-audit in mizchi/skills) into .agents/skills/sql-plan-audit in your project. Codex loads it when a task matches its description.

Can I use SQL Plan Audit in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mizchi/skills --skill sql-plan-audit -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/sql-plan-audit, .gemini/skills/sql-plan-audit, .github/skills/sql-plan-audit and .opencode/skills/sql-plan-audit in your project.

What does SQL Plan Audit need to run?

Going by SKILL.md and its folder, SQL Plan Audit needs JavaScript for the scripts in its folder and the command-line tools its instructions call (node). Our summary lists: Node.js.

Does SQL Plan Audit access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is SQL Plan Audit safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does SQL Plan Audit use?

No licence was found for SQL Plan Audit or its repository. Without one, default copyright applies: ask the author before reusing or redistributing it.

How many tokens does SQL Plan Audit use?

About 1.4k tokens (SKILL.md is roughly 5.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to SQL Plan Audit?

Skills that share tags, products or a category with SQL Plan Audit: SQL Insight (zebbern/claude-code-guide, 4.7k stars), SQL Expert (aiskillstore/marketplace, 430 stars), SQL Toolkit (LeoYeAI/openclaw-master-skills, 2.2k stars) and SQL Database Support for pREST (prest/prest, 4.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains SQL Plan Audit?

mizchi (a GitHub user) maintains it in mizchi/skills, which has 356 GitHub stars. The repository holds 69 skills in this directory. The repository was last updated on October 2, 2026.

Source: mizchi/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.