Install
$ agentstack add skill-yeaight7-agent-powerups-sql-business-logic-review ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
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
- Establish the intended grain before and after the query or change.
- 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
- Ask the review questions:
- What is the intended grain before and after this query?
- Could this query duplicate or drop rows?
- Has the business definition changed even if the SQL still runs?
- Are there edge cases around nulls, late-arriving data, or time windows?
- What result could look plausible while still being wrong?
- Propose concrete validation checks, for example:
```sql -- grain check: the expected key must be unique SELECT , COUNT() FROM () GROUP BY HAVING COUNT() > 1;
-- before/after comparison on a stable slice SELECT COUNT(), SUM() FROM (); SELECT COUNT(), SUM() FROM (); ```
Output
- summary of business-logic risks
- likely semantic changes
- highest-risk joins, filters, or aggregations
- concrete validation checks to run
- what needs human confirmation
Verification
- [ ] Intended grain stated for before and after
- [ ] Every flagged risk tied to a specific join, filter, or aggregation
- [ ] At least one runnable validation check proposed per high-risk finding
- [ ] Human-confirmation items listed separately
Failure Modes
- Syntax-only review — the query parses and runs, so it gets approved; business meaning was never checked.
- Style distraction — prioritize correctness over style; do not get distracted by minor formatting issues.
- Plausible-results trap — numbers in the right ballpark pass review while the population definition silently changed.
- Editing instead of reporting — do not edit code unless explicitly asked.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: yeaight7
- Source: yeaight7/agent-powerups
- License: Apache-2.0
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.