Skill / SKILL.md

Query Writing

macro-inc/macro

Use when you are about to write or change SQL, before the first line and again before you commit it. Applies to any new or changed sqlx `query!`, `query_as!`, or `query_scalar!`, QueryBuilder or other assembled SQL, a Soup or GraphQL filter that becomes SQL, a SQL function, view, or trigger, and code that calls an existing query in a loop, from a new page or job, or with a wider scope (a team instead of a user, a list instead of one id). Covers how to write the query so it stays bounded and index-backed, and the required EXPLAIN (ANALYZE, BUFFERS) on a production-size local database before the commit. Reviewing a finished diff is query-review; macro and cache checks are sqlx-query-validator.
2 views 6,575 repository stars 0 commentsUpdated Nov 28, 2026
Overview

Use when you are about to write or change SQL, before the first line and again before you commit it. Applies to any new or changed sqlx `query!`, `query_as!`, or `query_scalar!`, QueryBuilder or other assembled SQL, a Soup or GraphQL filter that becomes SQL, a SQL function, view, or trigger, and code that calls an existing query in a loop, from a new page or job, or with a wider scope (a team instead of a user, a list instead of one id). Covers how to write the query so it stays bounded and index-backed, and the required EXPLAIN (ANALYZE, BUFFERS) on a production-size local database before the commit. Reviewing a finished diff is query-review; macro and cache checks are sqlx-query-validator.

Installation & variants

Download the repository, including the skill’s supporting files.

git clone -- 'https://github.com/macro-inc/macro' skill-source

Use the complete skill-source/.agents/skills/query-writing directory with your client’s skill installer.

  • .agents/skills/query-writing

    main · SKILL.md

    Open installation source

    Source directory recorded from the imported repository path

Source directory .agents/skills/query-writing

Source instructions
Read source instructions

Open to load source instructions

Original SKILL.md

Open to load the original file

Included files
Source & validation
Source status
Awaiting source check
Format validation
Format valid
Checked at
Pending source check
Content SHA-256
a4854ea9d13640f7ee1b8500fc4439f6dcdc77360462c62c15637f3ab907b600
Discussion
Comments Be the First to Comment

Please log in to comment

    No comments yet

Related skills