Agent skill

Sqlx Query Validator

by macro-inc in macro-inc/macro

Inspect Rust changes for SQLx queries. An agent skill from macro-inc/macro.

AGPL-3.0Auto-check: notesBusiness, Finance & HR

Install Sqlx Query Validator

skills CLI
$ npx skills add macro-inc/macro --skill sqlx-query-validator -a claude-code

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

GitHub CLI
$ gh skill install macro-inc/macro sqlx-query-validator --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/macro-inc/macro.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.pi/skills/sqlx-query-validator .claude/skills/sqlx-query-validator && 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
sqlx-query-validator
GitHub stars
4.6k
Token cost
~1.1k tokens
SKILL.md length
536 words
Files
1
Skills in repo
19
Repo updated
First seen
Licence
AGPL-3.0

At a glance

Inspect Rust changes for SQLx queries. An agent skill from macro-inc/macro.

  • Works in 3 steps: From the repository root, identify… → Inspect changed .rs files for SQLx… → If no SQLx queries were changed, say so…
  • Business, Finance & HR work in your project
  • SKILL.md covers Scope Changed Rust Code, Require SQLx Macros, Refresh SQLx Offline Cache and Performance Review Checklist, plus 2 more sections
  • Calls just

What it does

Sqlx Query Validator is an agent skill from macro-inc/macro. Inspect Rust changes for SQLx queries. Use after modifying Rust code that adds or changes SQLx queries to ensure compile-time SQLx macros are used, run just preparedb for offline query cache, and review queries for performance and security issues.

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Business, Finance & HR. It works with Rust and SQL. The repository describes itself as: Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory. The licence is AGPL-3.0.

When your agent uses it

  • Business, Finance & HR work in your project

Example prompts

  • “/sqlx-query-validator”

Requirements

  • Pre-approved tools (allowed-tools): Bash, Read, Edit, Glob, Grep

Workflow steps

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

  1. From the repository root, identify changed Rust files using the repository's VCS
  2. Inspect changed .rs files for SQLx usage, including
  3. If no SQLx queries were changed, say so in the final response and do not run just prepare_db unless the user explicitly asked for it.

What it can do on your machine

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

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash
    • Read
    • Edit
    • Glob
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • just

    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

Sqlx Query Validator loads about 1.1k tokens when it runs. Until then it costs about 68 tokens; SKILL.md has 536 words of instructions outside code blocks.

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

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: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Bash, Read, Edit, Glob, Grep

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); files beside SKILL.md are not scanned.

SKILL.md

The full file from macro-inc/macro at commit 49418e7, republished under its AGPL-3.0 licence (© macro-inc). 536 words, ~1,105 tokens.

Download SKILL.mdSave it as .claude/skills/sqlx-query-validator/SKILL.md (or your agent's skills folder).
name
sqlx-query-validator
description
Inspect Rust changes for SQLx queries. Use after modifying Rust code that adds or changes SQLx queries to ensure compile-time SQLx macros are used, run `just prepare_db` for offline query cache, and review queries for performance and security issues.
allowed-tools
Bash, Read, Edit, Glob, Grep

SQLx Query Validator

Use this skill after substantial Rust changes that add, remove, or modify SQLx queries.

This is a focused review pass, not something to run after every edit. Batch related Rust changes first, then validate the changed queries before handing the task back to the user.

Scope Changed Rust Code

  1. From the repository root, identify changed Rust files using the repository's VCS:

    • If a .jj directory exists at the repository root, use Jujutsu:

      bash
      jj diff --name-only
    • Otherwise, use Git:

      bash
      git diff --name-only
  2. Inspect changed .rs files for SQLx usage, including:

    • sqlx::query
    • sqlx::query_as
    • sqlx::query_scalar
    • sqlx::query_file
    • imported variants such as query(...), query_as(...), query_scalar(...), or query_file(...)
    • macro variants such as sqlx::query!, sqlx::query_as!, sqlx::query_scalar!, and sqlx::query_file!
  3. If no SQLx queries were changed, say so in the final response and do not run just prepare_db unless the user explicitly asked for it.

Require SQLx Macros

Prefer compile-time checked SQLx macros for changed queries:

  • sqlx::query!
  • sqlx::query_as!
  • sqlx::query_scalar!
  • sqlx::query_file!

Flag changed code that calls SQLx query functions directly, such as:

rust
sqlx::query("SELECT ...")
sqlx::query_as::<_, MyType>("SELECT ...")
sqlx::query_scalar("SELECT ...")

Replace direct function calls with the equivalent macro whenever the SQL text is static enough for SQLx to check at compile time.

Only allow direct SQLx query functions when the SQL must be dynamically assembled and cannot reasonably be expressed with a macro. In that case:

  • Keep dynamic fragments constrained to trusted allowlists, not raw user input.
  • Bind all values with .bind(...); never interpolate user-controlled values into SQL strings.
  • Add or preserve a clear comment explaining why a macro cannot be used.

Refresh SQLx Offline Cache

When SQLx queries were changed, run this from the repository root:

bash
just prepare_db

If it fails, inspect the error. Fix in-scope query/cache issues and rerun just prepare_db. If it still fails for environmental reasons, stop and report the failure clearly.

Show full SKILL.md (242 more words)Show less

Performance Review Checklist

For each changed query, inspect the SQL and surrounding code for likely performance problems:

  • Avoid unbounded result sets; prefer explicit LIMIT, pagination, or keyset pagination where applicable.
  • Ensure filters and joins are likely backed by appropriate indexes for high-cardinality or frequently queried columns.
  • Avoid SELECT * in production queries; select only needed columns.
  • Avoid N+1 query patterns in loops; prefer batching or joins.
  • Watch for leading-wildcard LIKE / ILIKE searches, broad JSON scans, or functions on indexed columns that may prevent index use.
  • Check joins for accidental cross joins or missing join predicates.
  • Prefer stable ordering for paginated queries.

Security Review Checklist

For each changed query, inspect for security issues:

  • No string interpolation, format!, concatenation, or raw user input in SQL text.
  • User-controlled values must be passed as SQLx bind parameters.
  • Dynamic identifiers, order-by fields, directions, table names, and column names must come from trusted allowlists.
  • Avoid leaking sensitive data by selecting or returning columns that are not needed.
  • Verify tenant, organization, user, or access-control predicates are present where the surrounding domain requires them.
  • Be cautious with destructive statements (DELETE, UPDATE, INSERT ... ON CONFLICT) and ensure predicates are correctly scoped.

Final Response

Briefly summarize:

  • Which changed SQLx queries were reviewed.
  • Whether all changed queries use SQLx macros, or why any direct function call remains justified.
  • Whether just prepare_db passed, failed, or was skipped because no SQLx queries changed.
  • Any performance or security concerns found and fixed, or that none were found.

© macro-inc, AGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .pi/skills/sqlx-query-validator of macro-inc/macro.

Open the folder on GitHubat commit 49418e7

Compare with similar skills

Sqlx Query Validator 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.

Sqlx Query Validator compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Sqlx Query Validator this skillmacro-inc/macro4.6k—~1.1kAutomated safety check: NotesAGPL-3.0
SeekDB Code Reviewoceanbase/seekdb3.1k—~2.1kAutomated safety check: PassApache-2.0
Resolve PR Reviewshencangsheng/easydb_app590—~2.4kAutomated safety check: PassMIT
Coding Agentmastra-ai/mastra29k—~2.3kAutomated safety check: PassCustom licence
Rust No Unwrapshencangsheng/easydb_app590—~802Automated safety check: PassMIT
Webapp Buildersidequery/sidemantic129—~5.5kAutomated safety check: PassAGPL-3.0

Similar skills

  • SeekDB Code Review

    oceanbase/seekdb

    Reviews seekdb pull requests and diffs for real defects in correctness, resources, concurrency, security and tests, reporting only Blocker or Major findings.

    3.1k GitHub stars~2.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Resolve PR Review

    shencangsheng/easydb_app

    Resolve pull request code review comments end-to-end. An agent skill from shencangsheng/easydb_app.

    590 GitHub stars~2.4k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Coding Agent

    mastra-ai/mastra

    Authoring playbook for building agents that write, edit, review, or refactor code.

    29k GitHub stars~2.3k tokensUpdated today
    DevelopmentAuto-check passed
  • Rust No Unwrap

    shencangsheng/easydb_app

    Enforces strict avoidance of unwrap() in Rust code. An agent skill from shencangsheng/easydb_app.

    590 GitHub stars~802 tokensUpdated 1 mo ago
    Documents & OfficeAuto-check passed
  • Webapp Builder

    sidequery/sidemantic

    Build interactive analytics webapps, demos, dashboards, or embedded app surfaces from Sidemantic semantic models using copyable component primitives and deterministic query inspection.

    129 GitHub stars~5.5k tokensUpdated yesterday
    DatabasesAuto-check passed
  • Surf

    BlockRunAI/ClawRouter

    Use this skill — NOT browser or webfetch — for ALL Surf crypto-data calls.

    6.6k GitHub stars~4k tokensUpdated 2 days ago
    Business, Finance & HRAuto-check passed

More from macro-inc/macro

All 19 skills in this repo
  • Mintlify API

    macro-inc/macro

    Interact with the Mintlify REST API to manage deployments, trigger builds, and query documentation site metadata programmatically.

    4.6k GitHub starsUsed in 2 repos~333 tokens
    Auto-check passed
  • Add Tour

    macro-inc/macro

    Add or change an in-app feature tour (a view's guided flyover) in the web app.

    4.6k GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • Define Feature Flag

    macro-inc/macro

    Define a frontend feature flag with defineFlag and wire its readers.

    4.6k GitHub stars~780 tokensUpdated today
    Auto-check passed
  • Run App

    macro-inc/macro

    Run the Macro app on Cursor Cloud and pick up edits. An agent skill from macro-inc/macro.

    4.6k GitHub stars~712 tokensUpdated today
    Auto-check passed
  • Add SDK Endpoint

    macro-inc/macro

    Wrap a new backend endpoint in the TypeScript SDK (packages/sdk), or record it as skipped.

    4.6k GitHub stars~1k tokensUpdated today
    Auto-check: notes
  • Enforce hexagonal architecture in the Rust backend. An agent skill from macro-inc/macro.

    4.6k GitHub stars~3k tokensUpdated today
    Auto-check passed

Works with

Questions about Sqlx Query Validator

What does Sqlx Query Validator do?

Inspect Rust changes for SQLx queries. An agent skill from macro-inc/macro. Sqlx Query Validator is an agent skill from macro-inc/macro. Inspect Rust changes for SQLx queries.

When should I use Sqlx Query Validator?

Sqlx Query Validator fits situations like: business, Finance & HR work in your project.

How do I install Sqlx Query Validator in Claude Code?

Run `npx skills add macro-inc/macro --skill sqlx-query-validator -a claude-code`. Or copy the skill folder (.pi/skills/sqlx-query-validator in macro-inc/macro) into .claude/skills/sqlx-query-validator in your project. Claude Code loads it when a task matches its description.

How do I install Sqlx Query Validator in Codex?

Run `npx skills add macro-inc/macro --skill sqlx-query-validator -a codex`. Or copy the skill folder (.pi/skills/sqlx-query-validator in macro-inc/macro) into .agents/skills/sqlx-query-validator in your project. Codex loads it when a task matches its description.

Can I use Sqlx Query Validator 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 macro-inc/macro --skill sqlx-query-validator -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/sqlx-query-validator, .gemini/skills/sqlx-query-validator, .github/skills/sqlx-query-validator and .opencode/skills/sqlx-query-validator in your project.

What does Sqlx Query Validator need to run?

Going by SKILL.md and its folder, Sqlx Query Validator needs the command-line tools its instructions call (just). Its frontmatter pre-approves these tools: Bash, Read, Edit, Glob, Grep.

Does Sqlx Query Validator 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 Sqlx Query Validator safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Sqlx Query Validator use?

Sqlx Query Validator is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Sqlx Query Validator use?

About 1.1k tokens (SKILL.md is roughly 4.4k 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 Sqlx Query Validator?

Skills that share tags, products or a category with Sqlx Query Validator: SeekDB Code Review (oceanbase/seekdb, 3.1k stars), Resolve PR Review (shencangsheng/easydb_app, 590 stars), Coding Agent (mastra-ai/mastra, 29k stars) and Rust No Unwrap (shencangsheng/easydb_app, 590 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Sqlx Query Validator?

macro-inc (a GitHub organization) maintains it in macro-inc/macro, which has 4,590 GitHub stars. The repository holds 19 skills in this directory. The repository was last updated on October 8, 2026.

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