agentleFS
voyager67voyager67/AgentFieldkit/skills/sql-integrity-check/SKILL.md

sql-integrity-check

Skill0 starsChanged 13 days agoMITView on GitHub

Review SQL queries and data-model changes for correctness, access scope, safe parameterization, and performance. Use when writing joins, filters, migrations, reports, or analytics queries.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check NULL semantics, timezone/date boundaries, numeric precision, collation, case sensitivity, pagination stability, and aggregate …

    line 13
  2. Distinctive:

    Test edge cases: no rows, duplicate keys, missing foreign keys, boundary dates, and values that could alter the query structure.

    line 16
  3. Distinctive:

    Do not execute destructive statements or real-data exports without explicit authorization.

    line 22
  4. Distinctive:

    Do not expose customer rows or secrets in logs or examples.

    line 23
  5. Distinctive:

    Treat a fast query as incorrect if it returns the wrong entities or hides duplicates.

    line 24

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

SQL Integrity Check

Procedure

  1. Identify the database engine, schema constraints, expected row grain, key relationships, indexes, and caller permissions.
  2. For every query, state the intended output grain. Verify joins cannot silently multiply rows and filters preserve intended inclusions/exclusions.
  3. Confirm user-controlled values are bound parameters, not concatenated into SQL. Review dynamic identifiers separately because they often need allowlists.
  4. Check NULL semantics, timezone/date boundaries, numeric precision, collation, case sensitivity, pagination stability, and aggregate behavior.
  5. Inspect query plans or EXPLAIN output on representative non-production data when performance matters. Avoid full table scans or expensive locks without understanding scale.
  6. For migrations, verify constraints, backfill logic, idempotency, and compatibility with old/new application versions.
  7. Test edge cases: no rows, duplicate keys, missing foreign keys, boundary dates, and values that could alter the query structure.

Deliverable

Explain expected row grain, correctness risks, access-control assumptions, relevant plan/index observations, and tests performed.

Boundaries

  • Do not execute destructive statements or real-data exports without explicit authorization.
  • Do not expose customer rows or secrets in logs or examples.
  • Treat a fast query as incorrect if it returns the wrong entities or hides duplicates.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.