sqlike

sqlike is a skill for Claude Code, Codex from orifisher2/sqlike. It costs 81 tokens per session (2,024 once invoked), scanned A, original, Apache-2.0.

A deterministic checker for SQL, the language used to read and change data in databases. It checks validity, common problems, suggested rewrites, indexes, and whether two queries produce equivalent results.

In plain words
What is it for?
Use it to analyze new or edited SQL, review queries, and compare an original query with a refactored or optimized version across supported database dialects.
Why use it?
It catches SQL mistakes and can verify rewrites instead of relying only on manual review or an agent’s judgment.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Use it to analyze new or edited SQL, review queries, and compare an original query with a refactored or optimized version across supported database dialects.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/orifisher2/sqlike/sqlike
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add orifisher2/sqlike --skill sqlike
Clone the repo
git clone --depth 1 https://github.com/orifisher2/sqlike

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sqlike

README.md
[![agentmods](https://agentmods.dev/badge/skills/orifisher2/sqlike/sqlike/github.svg)](https://agentmods.dev/skills/orifisher2/sqlike/sqlike)
Your own site
<a href="https://agentmods.dev/skills/orifisher2/sqlike/sqlike"><img src="https://agentmods.dev/badge/skills/orifisher2/sqlike/sqlike/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sqlike

Your own site · 80×15
<a href="https://agentmods.dev/skills/orifisher2/sqlike/sqlike"><img src="https://agentmods.dev/badge/skills/orifisher2/sqlike/sqlike.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 81 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,024 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00081 $0.02024
Opus 5.5 $0.00032 $0.00810
Sonnet 5.5 $0.00016 $0.00405
Haiku 4.5 $0.00008 $0.00202

Measured 15d ago against content hash e8f53abeccc8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

sqlike scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 15d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/sqlike/SKILL.md · 115 lines

How it starts

The opening of the file, as written. The whole thing — 115 lines — stays where its author put it; the contents beside it link to each section on GitHub.

sqlike

sqlike is a deterministic SQL analyzer (no LLM in its analysis path — its verdicts are reproducible and authoritative). Prefer it over eyeballing SQL yourself: it catches validity errors, anti-patterns, and non-equivalent rewrites that are easy to miss by reading.

When to reach for it

  • You produced or edited SQL → run analyze before presenting it. Fix what it flags.
  • You reviewed someone's SQL → run analyze to back your review with specifics.
  • You rewrote, refactored, or optimized a query → run diff on the before/after to prove the rewrite is result-preserving. An LLM cannot reliably self-grade equivalence; sqlike can.

How to call it

Via the MCP server (@sqlike/mcp), two tools:

  • analyze(sql, schema?, dialect?) — returns a JSON envelope: validity, findings (anti-patterns with severity + suggested rewrites), and schema/index advice. Pass schema (CREATE TABLE / CREATE INDEX DDL) for column- and type-aware checks. dialect is postgres (default), mysql, mariadb, sqlite, mssql, or duckdb.
  • diff(sql_a, sql_b, schema?, dialect?) — returns a JSON verdict: overall is one of Equivalent, EquivalentWithNotes, Differs, Undecided, plus a confidence and a per-property report (columns, rows, cardinality, order).

Or via the CLI (@sqlike/cli): sqlike check query.sql and sqlike diff before.sql after.sql.

When the SQL is generated, not written

The tool reads SQL text, not ORM calls or builder chains. If the code you wrote produces SQL indirectly, get the statement out first and analyze that.

  • Dump the statement from the ORM. SQLAlchemy: str(stmt) or stmt.compile(dialect=postgresql.dialect()). Django: str(queryset.query) for a quick look, but it prints string parameters unquoted (WHERE name = Oscar parses as a column, not a value); for the SQL actually sent use connection.queries with DEBUG=True. ActiveRecord: relation.to_sql. knex: .toString() (or .toSQL() for sql plus bindings). Drizzle: .toSQL() returns { sql, params }. jOOQ: query.getSQL() (getSQL(ParamType.INLINED) to inline values). Diesel: diesel::debug_query::<Pg, _>(&query).to_string(), then drop the trailing -- binds: comment. Prisma exposes SQL only through logging: new PrismaClient({ log: ['query'] }) and read the query field of each event.
  • Keep the bind placeholders. $1, ? and :name parse and are reported back under parameters. Python's %s and %(name)s do not parse and will hit the consent gate; replace each with a $N placeholder before analyzing, never with a real value.
  • Analyze the assembled statement, not the fragments. For string-built or conditional SQL, produce each statement the code can actually emit (or at least the widest one) and analyze each. A WHERE fragment on its own is not a query.
  • Templated SQL is compiled first. dbt, sqlc and similar: analyze the compiled output, not the Jinja or the annotated source.
  • An ORM refactor is a rewrite. Changing a filter chain, replacing a join with a subquery, or swapping an ORM call for raw SQL changes the SQL. Dump the statement before and after and run diff on the pair, with the schema.
  • Pass the schema the ORM knows. Migrations or model definitions give the DDL. Without it, column and type checks are skipped.

Read the full file on GitHub · 115 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 15d ago Changed e8f53abeccc8
  2. 1mo ago Changed · +62 lines 3d16910af22a
  3. 1mo ago First seen · 53 lines · 81 tokens per session scan A 33d3f5a7d338

Subscribe to this mod's changes

sqlike is a skill published in the GitHub repository orifisher2/sqlike (7 stars, last pushed yesterday), licensed Apache-2.0. It adds 81 tokens to every session and 2,024 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

quarry

Query PostgreSQL, MySQL, Redis and Neptune with Quarry (qy), compare data across environments, maintain reusable queries, and manage connections or the database workbench. Use for database evidence or explicit Quarry tasks, not general database design discussions.

yiminspace/quarry · 51 tokens

Drizzle ORM Testing

Testing patterns for Drizzle ORM covering migration testing, query builder testing, transaction testing, and database integration testing with PostgreSQL, SQLite, and MySQL.

PramodDutta/qaskills · 36 tokens

postgresdb

Use when PostgreSQL engine behaviour decides the answer — schema and type design, index choice, reading EXPLAIN on a slow query, zero-downtime DDL and backfills, or ops (roles, RLS, pooling, vacuum, partitioning, PITR). PG16, ORM-agnostic. NOT portable query logic (that is sql), NOT a managed provider's platform…

ericrisco/rsc-harness · 91 tokens

neon

Use when you have picked Neon (serverless Postgres) and need to connect correctly from a serverless or edge runtime, wire database branching into dev, preview and CI, or stop being burned by scale-to-zero cold starts and pooler limits — including choosing HTTP versus WebSocket connections and pooled versus direct…

ericrisco/rsc-harness · 93 tokens

planetscale

Use when operating PlanetScale (Vitess serverless MySQL) — branches and the pscale CLI, schema changes through deploy requests (Online DDL cutover, 30-min revert window), tables without foreign keys, or the edge HTTP driver. NOT MySQL engine work like EXPLAIN or index choice (that is mysql), NOT generic migration…

ericrisco/rsc-harness · 87 tokens

ring:mapping-service-resources

Mapping a Go service's Service -> Module -> Resource hierarchy for dispatch-layer registration: detects modules and per-module PostgreSQL/MongoDB/RabbitMQ resources, database names, and shared databases, generates MongoDB index migration pairs (.up.json/.down.json), detects existing Postgres migrations, emits an HTML…

LerianStudio/ring · 97 tokens