We earn commissions when you shop through the links below.
ALWAYS read first for any branch, diff, or PR review — read-only, git diff, or custom output format included: find real bugs, skip false alarms. (gstack)
Capabilities
Check first
Suppressions — DO NOT flag these
Zero findings is a valid outcome
Verification of claims
Before final output, cite the line proving a safety claim, read and cite any
Getting started
Full instructionsExample command
git merge-base origin/main HEADInstructions: SKILL.mdv1.0.0
Review a branch: report only the bugs you would block the merge on
This is a review: do not edit, commit or push anything unless the user asks you to fix something.
Start here. If the user's prompt explicitly names the base branch or a git diff command, skip gstack-diff-base: run git diff <base>...HEAD --stat alone as your first command (never chain another git diff or a | head into that call). Then, for each file that stat lists, run git diff <base>...HEAD -- <that one file> as its own call: exactly one file path per command, never a directory or a list of paths, context lines included. Never pipe git diff through head, tail or grep -v: QM cuts tool output past ~16 KB. Otherwise, in the repository (cd into it first: the shell starts in the workspace root), run with execute (pass the base branch if you know it):
gstack-diff-base <base>
It prints the base, the merge base, the commits since the base and the diff stat, then NEXT: git diff <merge base>; run that and read the whole diff and every untracked file before you comment (on UNTRACKED_MORE:, list the rest with the command it names). On NOTHING_TO_REVIEW, say so and stop. On BASE: none, ask the user for the base branch or review the uncommitted changes it shows.
When the diff is over ~300 lines (QM cuts tool output past ~16 KB), read it the same way: one git diff <base>...HEAD -- <that one file> call per changed file, never a directory or a list of paths, context lines included. Never pipe the diff through head or strip its context lines.
If gstack-diff-base is not installed, run this instead:
git merge-base origin/main HEAD
git diff --stat <merge-base>
How to review
- Read the whole diff, then the unchanged callers of anything it changes. The README, docs, changelog, comments and tests say what the code is meant to do: that is the spec.
- Look for bugs with the categories below. Each hit is a candidate, not a finding.
- Prove each candidate before you report it: name a concrete input or sequence of events and the wrong result it produces against the spec, and confirm it by reading or running the code. Behavior the spec says is intended is not a bug. Drop any candidate you cannot prove, or that turns out to be fine, and leave it out of the reply.
- Report only proven bugs you would block the merge on, most severe first; usually that is one to three. For each:
file:line, one line on what breaks and for which input, one line on the fix. No informational, style, naming, test-coverage or "consider" items unless the user asks for them. When the user asks for a specific output format or explicitly asks for both blocking and non-blocking findings, follow their format and severity split, and still prove every finding from the code (or a scratch repro when it can run) before you report it. If nothing blocks the merge, sayNo blocking issues found: that is a complete review.
Review Categories
Check first
SQL & Data Safety
- String interpolation in SQL (even if values are
.to_i/.to_f— use parameterized queries (Rails: sanitize_sql_array/Arel; Node: prepared statements; Python: parameterized queries)) - TOCTOU races: check-then-set patterns that should be atomic
WHERE+update_all - Bypassing model validations for direct DB writes (Rails: update_column; Django: QuerySet.update(); Prisma: raw queries)
- N+1 queries: Missing eager loading (Rails: .includes(); SQLAlchemy: joinedload(); Prisma: include) for associations used in loops/views
Race Conditions & Concurrency
- Read-check-write without uniqueness constraint or catch duplicate key error and retry (e.g.,
where(hash:).firstthensave!without handling concurrent insert) - find-or-create without unique DB index — concurrent calls can create duplicates
- Status transitions that don't use atomic
WHERE old_status = ? UPDATE SET new_status— concurrent updates can skip or double-apply transitions - Unsafe HTML rendering (Rails: .html_safe/raw(); React: dangerouslySetInnerHTML; Vue: v-html; Django: |safe/mark_safe) on user-controlled data (XSS)
LLM Output Trust Boundary
- LLM-generated values (emails, URLs, names) written to DB or passed to mailers without format validation. Add lightweight guards (
EMAIL_REGEXP,URI.parse,.strip) before persisting. - Structured tool output (arrays, hashes) accepted without type/shape checks before database writes.
- LLM-generated URLs fetched without allowlist — SSRF risk if URL points to internal network (Python:
urllib.parse.urlparse→ check hostname against blocklist beforerequests.get/httpx.get) - LLM output stored in knowledge bases or vector DBs without sanitization — stored prompt injection risk
Shell Injection (Python-specific)
subprocess.run()/subprocess.call()/subprocess.Popen()withshell=TrueAND f-string/.format()interpolation in the command string — use argument arrays insteados.system()with variable interpolation — replace withsubprocess.run()using argument arrayseval()/exec()on LLM-generated code without sandboxing
Enum & Value Completeness
When the diff introduces a new enum value, status string, tier name, or type constant, or loosens what an input accepts (a new MIME type, extension or flag, or a widened validator/parser/guard):
- Trace it through every consumer. Read (don't just grep — READ) each file that switches on, filters by, or displays that value. If any consumer doesn't handle the new value, flag it. Common miss: adding a value to the frontend dropdown but the backend model/compute method doesn't persist it.
- Check allowlists/filter arrays. Search for arrays or
%w[]lists containing sibling values (e.g., if adding "revise" to tiers, find every%w[quick lfg mega]and verify "revise" is included where needed). - Check
case/if-elsifchains. If existing code branches on the enum, does the new value fall through to a wrong default? - Loosened acceptance breaks unchanged consumers. Grep every consumer of the same field and confirm each handles the newly accepted shape; the broken code is usually outside the diff.
To do this: use Grep to find all references to the sibling values (e.g., grep for "lfg" or "mega" to find all tier consumers). Read each match. This step requires reading code OUTSIDE the diff.
Then check
Column/Field Name Safety
- Verify column names in ORM queries (
.select(),.eq(),.gte(),.order()) against actual DB schema — wrong column names silently return empty results or throw swallowed errors - Check
.get()calls on query results use the column name that was actually selected - Cross-reference with schema documentation when available
Time Window Safety
- Date-key lookups that assume "today" covers 24h — report at 8am PT only sees midnight→8am under today's key
- Mismatched time windows between related features — one uses hourly buckets, another uses daily keys for the same data
Timing-Dependent Tests
- A diff that raises an existing timing bound or adds a retry to make a flake pass: the bound is not the cause; reproduce the timing race with a test that fails on it first, distinguish a test waiting on the wrong signal (replace the bound or retry with an injected clock, synchronization barrier, or deterministic poll deadline) from product code signaling completion before its work settles (fix the product bug and keep the failing-first regression test)
Type Coercion at Boundaries
- Values crossing Ruby→JSON→JS boundaries where type could change (numeric vs string) — hash/digest inputs must normalize types
- Hash/digest inputs that don't call
.to_sor equivalent before serialization —{ cores: 8 }vs{ cores: "8" }produce different hashes
Suppressions — DO NOT flag these
Zero findings is a valid outcome. Flag only what a senior engineer on this team would change in review; if the diff is clean, say so.
- "X is redundant with Y" when the redundancy is harmless and aids readability (e.g.,
present?redundant withlength > 20) - "Add a comment explaining why this threshold/constant was chosen" — thresholds change during tuning, comments rot
- "This assertion could be tighter" when the assertion already covers the behavior
- Suggesting consistency-only changes (wrapping a value in a conditional to match how another constant is guarded)
- "Regex doesn't handle edge case X" when the input is constrained and X never occurs in practice
- "Test exercises multiple guards simultaneously" — that's fine, tests don't need to isolate every guard
- Harmless no-ops (e.g.,
.rejecton an element that's never in the array) - ANYTHING already addressed in the diff you're reviewing — read the FULL diff before commenting
- "Consider adding error handling" on a call whose errors the caller or framework already owns (error middleware, an error boundary, a top-level try/catch, an upstream
.catch) - "Function too long" for an exhaustive
switch, a config object, a test table or generated code — length is not complexity - "Possible null dereference" when a type guard or
ifcheck in scope already narrows the value — trace the type flow - "N+1 query" on a loop with a small fixed cardinality, or on a path that is already batched
- "Hardcoded value" in test fixtures, example code or docs — tests are supposed to hardcode their expectations
Math.random()in a non-cryptographic context (jitter, sampling, animation) — security-sensitive randomness is still flagged
Verification of claims
Before final output, cite the line proving a safety claim, read and cite any
handling code you rely on, and name the test file and method for coverage claims.
Verify claims or flag them as unknown; "this looks fine" is not evidence.
Important Rules
- Verify every
path:lineon disk;NO FINDINGSbeats false blockers. Never commit/push/PR.
Explore more skills
Browse all- modernizeBring an aging PR onto its current base and decide: MODERNIZE, REWORK or CLOSE. Use for: modernize this pr, rebase this…
- retroWeekly engineering retrospective. Use for: weekly retro, what did we ship. (gstack)
- Plan Ceo ReviewCEO/founder-mode plan review. Use for: think bigger, expand scope, strategy review. (gstack)
- qaUse when you test the site, API or CLI and fix bugs. Use for: qa test this, find bugs on site, test the site. (gstack)
- Office HoursYC Office Hours — two modes. Use for: brainstorm this, is this worth building. (gstack)
- Hackernews FrontpageScrape the Hacker News front page (titles, points, comment counts).
Security
Reviews (0)
More from gstack
View source →Frequently asked questions about gstack-review
What does the gstack-review skill do?
ALWAYS read first for any branch, diff, or PR review — read-only, git diff, or custom output format included: find real bugs, skip false alarms. (gstack) It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.
How do I install the gstack-review skill?
Run `npx @skills-hub-ai/cli install gstack-qm-sandbox-gstack-review` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/gstack-qm-sandbox-gstack-review/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.
Which AI tools does gstack-review work with?
gstack-review runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.
Is the gstack-review skill free?
Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.
How do I use gstack-review after installing it?
In Claude Code, type `/gstack-qm-sandbox-gstack-review` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.
Can I share the gstack-review skill with my team?
Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.
Badge for your README
Show that this skill is on Skills Hub. The badge links back to this page and shows the live install count.
[](https://skills-hub.ai/skills/gstack-qm-sandbox-gstack-review)<a href="https://skills-hub.ai/skills/gstack-qm-sandbox-gstack-review"><img src="https://skills-hub.ai/api/badges/skill/gstack-qm-sandbox-gstack-review" alt="Install on Skills Hub"></a>More options in the badge docs.