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.
npx skills add AratKruglik/claude-sdlc --skill sqlalchemy-patternsgit clone --depth 1 https://github.com/AratKruglik/claude-sdlcWrote 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.
[](https://agentmods.dev/skills/aratkruglik/claude-sdlc/sqlalchemy-patterns)<a href="https://agentmods.dev/skills/aratkruglik/claude-sdlc/sqlalchemy-patterns"><img src="https://agentmods.dev/badge/skills/aratkruglik/claude-sdlc/sqlalchemy-patterns/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.
<a href="https://agentmods.dev/skills/aratkruglik/claude-sdlc/sqlalchemy-patterns"><img src="https://agentmods.dev/badge/skills/aratkruglik/claude-sdlc/sqlalchemy-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00226 | $0.01680 |
| Opus 5.5 | $0.00090 | $0.00672 |
| Sonnet 5.5 | $0.00045 | $0.00336 |
| Haiku 4.5 | $0.00023 | $0.00168 |
Grade A, and why
sqlalchemy-patterns 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 15d 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.
How it starts
The opening of the file, as written. The whole thing — 196 lines — stays where its author put it; the contents beside it link to each section on GitHub.
SQLAlchemy Patterns for FastAPI (async delta)
Load python-foundation:sqlalchemy-patterns via the Skill tool FIRST. It contains the shared SQLAlchemy 2.0 core: detection, Mapped/mapped_column model definition, column type guidance, select() querying, relationship structure, lazy-strategy overview, and migration metadata rules. This skill covers only the async/FastAPI delta.
Async session setup
# app/db/session.py
from collections.abc import AsyncGenerator
from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker, create_async_engine
from app.core.config import settings
engine = create_async_engine(
settings.DATABASE_URL,
echo=False,
pool_pre_ping=True,
pool_size=10,
max_overflow=20,
)
AsyncSessionLocal = async_sessionmaker(
engine,
class_=AsyncSession,
expire_on_commit=False,
)
async def get_db() -> AsyncGenerator[AsyncSession, None]:
async with AsyncSessionLocal() as session:
yield session
Use expire_on_commit=False so that model attributes remain accessible after a commit without triggering lazy loads — important in async contexts where implicit IO is not allowed.
Use pool_pre_ping=True to detect stale connections before use.
get_db() only opens and closes the session; closing discards anything uncommitted, so an exception rolls the request back. Commit explicitly — await db.commit() — once per request, at the end of the endpoint or service function that owns the unit of work. Do not commit after the yield: with the default scope="request" that code runs after the response has been sent, so a failed commit still returns 2xx. On FastAPI ≥ 0.121, Depends(get_db, scope="function") runs the exit code before the response and makes commit-on-exit safe.
Async querying
Every execution is awaited; statement construction follows the foundation skill.
from sqlalchemy import select
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy.orm import selectinload
from app.users.models import User
async def get_user_by_id(db: AsyncSession, user_id: int) -> User | None:
result = await db.execute(select(User).where(User.id == user_id))
return result.scalar_one_or_none()
async def get_user_with_orders(db: AsyncSession, user_id: int) -> User | None:
result = await db.execute(
select(User)
.options(selectinload(User.orders))
.where(User.id == user_id)
)
return result.scalar_one_or_none()
async def create_user(db: AsyncSession, email: str, hashed_password: str, display_name: str) -> User:
user = User(email=email, hashed_password=hashed_password, display_name=display_name)
db.add(user)
await db.flush() # assigns id without committing; the endpoint commits
return user
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.
- 15d ago Changed · -5 lines ef1e9f7d6438
- 2mo ago Changed · +2 lines 089d485aafdc
- 3mo ago First seen · 199 lines · 226 tokens per session scan A ba17c02db2ff
sqlalchemy-patterns is a skill published in the GitHub repository AratKruglik/claude-sdlc (57 stars, last pushed today), licensed MIT. It adds 226 tokens to every session and 1,680 once invoked, about $0.0009 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-08-30.
sqlalchemy-patterns compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| sqlalchemy-patternsAratKruglik/claude-sdlc | Skill | 57 | today | MIT | A | 226 | Claude Code |
| event-store-designwshobson/agents | Skill | 43k | 2d ago | MIT | A | 33 | Claude Code |
| platform-custom-field-generateforcedotcom/sf-skills | Skill | 1.2k | 4d ago | Apache-2.0 | A | 139 | Claude Code |
| durable-objectsfcakyon/claude-codex-settings | Skill | 1.2k | today | Apache-2.0 | A | 22 | Claude Code |
| field-service-sobject-create-configureforcedotcom/sf-skills | Skill | 1.2k | 4d ago | Apache-2.0 | A | 74 | Claude Code |
| nornicdb-grpcorneryd/NornicDB | Skill | 937 | today | MIT | A | 98 | Claude Code, Codex |
| firebaseericrisco/rsc-harness | Skill | 695 | today | MIT | A | 77 | Claude Code, Codex |