sql-business-logic-review

sql-business-logic-review is a skill for Claude Code from yeaight7/agent-powerups. It costs 45 tokens per session (677 once invoked), scanned A, original, Apache-2.0.

A review process for SQL whose results affect reports, metrics, financial logic, product logic, or other business outputs. It checks business meaning in addition to whether the SQL runs successfully.

In plain words
What is it for?
Use it to review SQL changes involving joins, filters, aggregations, grain, date logic, incremental processing, or stakeholder-facing numbers.
Why use it?
SQL can produce plausible results while counting the wrong rows, changing the population, duplicating records, or mishandling dates and nulls. This review helps find those silent meaning changes.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the data-engineering plugin — 8 skills, 4 commands, 3 agents shipped together

Good fit Use it to review SQL changes involving joins, filters, aggregations, grain, date logic, incremental processing, or stakeholder-facing numbers.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/yeaight7/agent-powerups/sql-business-logic-review
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 yeaight7/agent-powerups --skill sql-business-logic-review
Clone the repo
git clone --depth 1 https://github.com/yeaight7/agent-powerups

Made for: Claude Code.

Or install data-engineering, the plugin that ships this one along with the rest of its 8 skills, 4 commands, 3 agents.

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 sql-business-logic-review

README.md
[![agentmods](https://agentmods.dev/badge/skills/yeaight7/agent-powerups/sql-business-logic-review/github.svg)](https://agentmods.dev/skills/yeaight7/agent-powerups/sql-business-logic-review)
Your own site
<a href="https://agentmods.dev/skills/yeaight7/agent-powerups/sql-business-logic-review"><img src="https://agentmods.dev/badge/skills/yeaight7/agent-powerups/sql-business-logic-review/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 sql-business-logic-review

Your own site · 80×15
<a href="https://agentmods.dev/skills/yeaight7/agent-powerups/sql-business-logic-review"><img src="https://agentmods.dev/badge/skills/yeaight7/agent-powerups/sql-business-logic-review.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 677 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.00045 $0.00677
Opus 5.5 $0.00018 $0.00271
Sonnet 5.5 $0.00009 $0.00135
Haiku 4.5 $0.00005 $0.00068

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

Security

Grade A, and why

sql-business-logic-review 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 1mo 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.

plugins/data-engineering/skills/sql-business-logic-review/SKILL.md · 81 lines

How it starts

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

Purpose

Review SQL as business logic, not just syntax. Detect silent semantic changes and flag places where technically valid SQL can still produce wrong business results.

When to Use

  • Reviewing SQL changes that feed reports, metrics, or financial/product logic
  • A query was modified and downstream numbers shifted, or might have
  • Output looks plausible but the definition of what is being counted may have changed

Inputs

  • The SQL under review (diff preferred, full query otherwise)
  • The intended grain and business definition, before and after the change

Workflow

  1. Establish the intended grain before and after the query or change.

  2. Scan for the standard risk patterns:

    • grain mismatches
    • duplicate rows introduced by joins
    • incorrect join keys
    • left vs inner join behavior changes
    • filters that alter population definitions
    • null handling that changes meaning
    • default values that hide data quality issues
    • aggregation mistakes
    • window functions with unsafe partitions or ordering
    • date logic and timezone assumptions
    • incremental logic that can double count, miss rows, or drift
    • metric definitions that no longer match prior intent
  3. Ask the review questions:

    1. What is the intended grain before and after this query?
    2. Could this query duplicate or drop rows?
    3. Has the business definition changed even if the SQL still runs?
    4. Are there edge cases around nulls, late-arriving data, or time windows?
    5. What result could look plausible while still being wrong?
  4. Propose concrete validation checks, for example:

    -- grain check: the expected key must be unique
    SELECT <key_columns>, COUNT(*)
    FROM (<query under review>)
    GROUP BY <key_columns>
    HAVING COUNT(*) > 1;
    
    -- before/after comparison on a stable slice
    SELECT COUNT(*), SUM(<metric_column>) FROM (<old query>);
    SELECT COUNT(*), SUM(<metric_column>) FROM (<new query>);
    

Output

Read the full file on GitHub · 81 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. 1mo ago First seen · 81 lines · 45 tokens per session scan A db9058868e26

Subscribe to this mod's changes

sql-business-logic-review is a skill published in the GitHub repository yeaight7/agent-powerups (6 stars, last pushed 19d ago), licensed Apache-2.0. It adds 45 tokens to every session and 677 once invoked, about $0.0002 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-09-14.