/beagle-python:sqlalchemy-code-reviewfrom beagle-python
Reviews SQLAlchemy 2.0 code for session management, relationship patterns, N+1 queries, and Alembic migrations. Provides a structured checklist for code review.
Ships in beagle-python. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
| 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 |
with, async with)relationship() uses appropriate lazy strategyjoinedload/selectinload to avoid N+1select() syntax, not legacy query()downgrade()op.execute() not ORM modelsRun 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.
| 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. |
| Step | Action | Pass condition |
|---|---|---|
| 2a | Identify the loop or repeated call site (ORM attribute access, execute in a loop). | file:line for the loop or hot path. |
| 2b | If claiming N+1: name the relationship or query pattern emitted per iteration. | Relationship or per-iteration SQL pattern with file:line, or rephrase as a question if unclear. |
| Step | Action | Pass condition |
|---|---|---|
| 3a | Open the revision file (e.g. under versions/, or the project’s Alembic layout). | Repo-relative path + file:line for revision / upgrade / downgrade. |
| 3b | If claiming broken downgrade() or risky data migration: point at the op.* / op.execute() involved. | Snippet or line range in that file for each claimed op, or withdraw. |
select() syntax?What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub existential-birds/beagle --plugin beagle-python7 skills in this plugin
/fastapi-code-reviewReviews FastAPI code for routing patterns, dependency injection, validation, and async handlers. Use when reviewing FastAPI apps, checking APIRouter setup, Depends() usage, or response models./postgres-code-reviewReviews PostgreSQL code for indexing strategies, JSONB operations, connection pooling, and transaction safety. Use when reviewing SQL queries, database schemas, JSONB usage, or connection management./pytest-code-reviewReviews pytest test code for async patterns, fixtures, parametrize, and mocking. Use when reviewing test_*.py files, checking async test functions, fixture usage, or mock patterns.Other plugins' skills for the same job