Skip to content

feat: add verify-sql agent skill - #46

Merged
mickamy merged 8 commits into
mainfrom
feat/verify-sql-skill
Nov 23, 2026
Merged

mickamy merged 8 commits into
mainfrom
feat/verify-sql-skill

Conversation

@mickamy

@mickamy mickamy commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Add skills/verify-sql, an agent skill that teaches coding agents such as Claude Code to back SQL-related claims ("fixed the N+1", "reduced queries") with a before/after measurement from sql-tap run and sql-tap diff (#41–#45), and to report what was and was not verified.

Changes

feat: add verify-sql agent skill

  • skills/verify-sql/SKILL.md, with a description that triggers on changes to code that talks to a database and before reporting that SQL behavior improved.
  • Setup checks before measuring: sql-tapd's gRPC address, the command connecting through the proxy's -listen port, no other application sharing sql-tapd, and no cached test results (go test -count=1). The agent asks the user instead of guessing when it cannot confirm these.
  • Measure the narrowest command that exercises the change, with the exact same command before and after.
  • What to do for each exit code of run and diff. In particular, the agent must not work around exit 2 or use the loosening flags (-allow-command-mismatch, -allow-increase, -fail-on-slow) unless the user asked, and must never edit a report.
  • Reporting: include the diff Markdown as is, then separate "Verified" from "Not verified". Slow queries and total time are not presented as measured improvements.

docs: document the verify-sql agent skill

  • README: an "Agent skill" section that explains what the skill does and how to install it into .claude/skills/ by downloading SKILL.md from the release tag matching sql-tap -version.

Distribution is a plain file download for now. Packaging the repository as a Claude Code plugin marketplace can come later if needed. See the review comment for the local review and its fixes.

Verification

  • Flags, exit codes and rejection rules in the skill match the README and the current behavior of run / diff.

Copilot AI balanced review requested due to automatic review settings November 23, 2026 05:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@mickamy

mickamy commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator Author

Copilot could not review this PR (insufficient quota), so it was reviewed locally with Claude Code's /code-review. All six findings were valid and are fixed, one commit each:

  • 3336eaa (important): run passes a failing command's exit code through, so a failed go test (exit 1) read like "N+1 or slow queries found, report valid". The skill now tells the agent to check the command's own output first, and to read the code as sql-tap's only if the command succeeded.
  • c3da7e0: run's exit 2 also covers bad arguments, a command that cannot start, and an unwritable -out. The skill now says to read sql-tap's Error: line, and to create the -out directory first.
  • 194ee91: the same applies to diff's exit 2 (missing or unreadable report file, bad arguments). Measure again only when the comparison is invalid.
  • 7a58fa1: if the skill loads after the change is made, "before" could be measured on changed code. The baseline must now come from the commit without the change (HEAD if uncommitted, otherwise the merge base), using a worktree or git stash.
  • d7586c1: the report example now cites the exact measured command, including -count=1.
  • 56bfcb6: the README install step required a source checkout. It now downloads SKILL.md from the release tag that matches sql-tap -version, so the flags and exit codes it describes match the installed binary.

Copilot AI balanced review requested due to automatic review settings November 23, 2026 06:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@mickamy
mickamy merged commit d26d3f1 into main Nov 23, 2026
4 checks passed
@mickamy
mickamy deleted the feat/verify-sql-skill branch November 23, 2026 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants