sqlalchemy-code-review

sqlalchemy-code-review is a skill for Claude Code from existential-birds/beagle. It costs 49 tokens per session (930 once invoked), scanned A, original, Apache-2.0.

A checklist for reviewing SQLAlchemy database code. SQLAlchemy is a Python library that maps application objects to database records and builds database queries.

In plain words
What is it for?
Use it to review sessions, relationships, query performance, bulk operations, asynchronous database access, and Alembic migrations.
Why use it?
It helps find unclosed sessions, inefficient repeated queries, incorrect relationship loading, and unsafe or irreversible database migrations.

Skill for Claude Code

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

Part of the beagle-python plugin — 6 skills shipped together

Good fit Use it to review sessions, relationships, query performance, bulk operations, asynchronous database access, and Alembic migrations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/existential-birds/beagle/sqlalchemy-code-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 existential-birds/beagle --skill sqlalchemy-code-review
Clone the repo
git clone --depth 1 https://github.com/existential-birds/beagle

Made for: Claude Code.

Or install beagle-python, the plugin that ships this one along with the rest of its 6 skills.

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 sqlalchemy-code-review

README.md
[![agentmods](https://agentmods.dev/badge/skills/existential-birds/beagle/sqlalchemy-code-review/github.svg)](https://agentmods.dev/skills/existential-birds/beagle/sqlalchemy-code-review)
Your own site
<a href="https://agentmods.dev/skills/existential-birds/beagle/sqlalchemy-code-review"><img src="https://agentmods.dev/badge/skills/existential-birds/beagle/sqlalchemy-code-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 sqlalchemy-code-review

Your own site · 80×15
<a href="https://agentmods.dev/skills/existential-birds/beagle/sqlalchemy-code-review"><img src="https://agentmods.dev/badge/skills/existential-birds/beagle/sqlalchemy-code-review.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 930 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.00049 $0.00930
Opus 5.5 $0.00020 $0.00372
Sonnet 5.5 $0.00010 $0.00186
Haiku 4.5 $0.00005 $0.00093

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

Security

Grade A, and why

sqlalchemy-code-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/beagle-python/skills/sqlalchemy-code-review/SKILL.md · 70 lines

How it starts

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

SQLAlchemy Code Review

Quick Reference

Issue Type Reference
Session lifecycle, context managers, async sessions references/sessions.md
relationship(), lazy loading, N+1, joinedload references/relationships.md
select() vs query(), ORM overhead, bulk ops references/queries.md
Alembic patterns, reversible migrations, data migrations references/migrations.md

Review Checklist

  • Sessions use context managers (with, async with)
  • No session sharing across requests or threads
  • Sessions closed/cleaned up properly
  • relationship() uses appropriate lazy strategy
  • Explicit joinedload/selectinload to avoid N+1
  • No lazy loading in loops (N+1 queries)
  • Using SQLAlchemy 2.0 select() syntax, not legacy query()
  • Bulk operations use bulk_insert/bulk_update, not ORM loops
  • Async sessions use proper async context managers
  • Migrations are reversible with downgrade()
  • Data migrations use op.execute() not ORM models
  • Migration dependencies properly ordered

Gates (SQLAlchemy-specific)

Run once per SQLAlchemy-related finding, after you can anchor file:line (see review-verification-protocol) and before the finding ships. If a step’s pass condition is not met, do not assert the finding as written—gather evidence, withdraw, downgrade severity, or rephrase as a question.

Gate 1 — Session scope and lifecycle

Step Action Pass condition
1a Open the module where the session is created or injected (not from memory). file:line for Session, sessionmaker, async_session, or the factory/Depends() that yields a session.
1b If claiming leak, cross-request sharing, or missing cleanup: trace the session’s scope (context manager, try/finally, middleware). Scoped region cited with a file:line range, or withdraw if scope is correct after the read.

Read the full file on GitHub · 70 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 70 lines · 49 tokens per session scan A 2b2c5a226d7c

Subscribe to this mod's changes

sqlalchemy-code-review is a skill published in the GitHub repository existential-birds/beagle (82 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 49 tokens to every session and 930 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-16.

Related

Other skills, from other repositories

triage-contributor-pr

Triage open pull requests from external contributors to prisma/orm and produce a per-PR verdict with evidence. Use when a maintainer asks to triage, evaluate, assess, or review the queue of incoming contributor PRs, to decide whether a fork PR is safe to run CI on, to check whether a PR is in scope for its version…

prisma/orm · 131 tokens

review-implement-phase

Implements triaged review actions, commits focused fixes, and posts Done plus resolves threads. Use when the user wants only the implementation phase of the review-framework workflow.

prisma/orm · 38 tokens

no-bare-casts

Writing as in TypeScript or TSX production code, modifying a file that contains a bare as cast, silencing a type error with a cast, encountering as unknown as, or reviewing a cast site.

prisma/orm · 52 tokens

review-prs

Review a GitHub pull request in the googleapis/mcp-toolbox repo against the team's reviewer checklist: PR title/description conventions, linked issue, logic errors and unhandled edge cases, breaking changes, test coverage, docs updates, security (input handling), and new dependencies. Use whenever a maintainer asks…

googleapis/mcp-toolbox · 162 tokens

migration-review

Review database migration files when a change adds or modifies paths under migrations/. Use it before merge to collect forward, rollback, locking, and data-safety evidence.

rohitg00/ai-engineering-from-scratch · 35 tokens

ring:using-lib-systemplane

Using lib-systemplane, the hot-reload runtime-config plane (Postgres LISTEN/NOTIFY or MongoDB change streams), in two modes. Sweep Mode detects DIY config reload (SIGHUP, fsnotify, viper, pgx LISTEN), manual tenant-scoping, hand-built admin CRUD, and v4 residue. Reference Mode catalogs client lifecycle and…

LerianStudio/ring · 106 tokens