sqlalchemy-models

sqlalchemy-models is a skill for Claude Code, Codex from tedivm/robs_awesome_python_template. It costs 44 tokens per session (1,557 once invoked), scanned A, original, MIT.

Guidance for defining SQLAlchemy models, writing database queries, and creating Alembic migrations. SQLAlchemy maps Python objects to database tables, while Alembic records controlled database-structure changes.

In plain words
What is it for?
Use it when adding or changing tables, writing queries, checking database-layer conventions, or creating migrations that work with SQLite and PostgreSQL.
Why use it?
It keeps database code consistent and prevents unsafe manual schema changes. It also sets conventions for modern asynchronous SQLAlchemy projects.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it when adding or changing tables, writing queries, checking database-layer conventions, or creating migrations that work with SQLite and PostgreSQL.

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

Made for: Claude Code, Codex.

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-models

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/tedivm/robs_awesome_python_template/sqlalchemy-models"><img src="https://agentmods.dev/badge/skills/tedivm/robs_awesome_python_template/sqlalchemy-models.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,557 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00044 $0.01557
Opus 5.5 $0.00018 $0.00623
Sonnet 5.5 $0.00009 $0.00311
Haiku 4.5 $0.00004 $0.00156

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

Security

Grade A, and why

sqlalchemy-models 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.

{{cookiecutter.__package_slug}}/.agents/skills/sqlalchemy-models/SKILL.md · 186 lines

How it starts

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

SQLAlchemy Models and Migrations

context7: If the mcp_context7 tool is available, load the full sqlalchemy and alembic documentation before debugging, creating or modifying models or queries, or writing migrations:

mcp_context7_resolve-library-id: "sqlalchemy"
mcp_context7_get-library-docs: <resolved-id>
mcp_context7_resolve-library-id: "alembic"
mcp_context7_get-library-docs: <resolved-id>

Guidelines and patterns for database models, queries, and Alembic migrations in this codebase.


Core Requirements

  • Always use async SQLAlchemy APIs (never synchronous).
  • Always use SQLAlchemy 2.0 syntax.
  • Represent database tables with the declarative class system (Base subclass).
  • Use Alembic for all schema changes — never alter the schema manually.
  • Migrations must be compatible with both SQLite and PostgreSQL.

Model Definition

Models live in {{cookiecutter.__package_slug}}/models/. Import and extend the shared Base from {{cookiecutter.__package_slug}}.models.base.

from uuid import UUID, uuid4

from sqlalchemy.orm import Mapped, mapped_column

from {{cookiecutter.__package_slug}}.models.base import Base


class User(Base):
    __tablename__ = "users"

    id: Mapped[UUID] = mapped_column(primary_key=True, default=uuid4)
    email: Mapped[str] = mapped_column(unique=True)
    name: Mapped[str]
    is_active: Mapped[bool] = mapped_column(default=True)

Typing Conventions

Pattern Meaning
Mapped[str] NOT NULL column
Mapped[str | None] NULLable column
mapped_column(default=...) Server-side / Python-side default
mapped_column(primary_key=True) Primary key
mapped_column(unique=True) Unique constraint
mapped_column(index=True) Index

Read the full file on GitHub · 186 lines

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 · 186 lines · 44 tokens per session scan A 4bb09766dae8

Subscribe to this mod's changes

sqlalchemy-models is a skill published in the GitHub repository tedivm/robs_awesome_python_template (312 stars, last pushed 5mo ago), licensed MIT. It adds 44 tokens to every session and 1,557 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-08-30.

Related

Other skills, from other repositories

alembic-migration

Create, review, and apply database schema changes with Alembic. Use whenever a SQLAlchemy model is added or changed, a column/index/constraint needs to change, or a data backfill is required — anything that alters the PostgreSQL schema.

vstorm-co/full-stack-ai-agent-template · 56 tokens

python

Enforces FastAPI, Dependency Injection, and general Python coding standards using uv inside the server directory.

aps08/fullstack-clean-architecture · 22 tokens

SQLAlchemy ORM Expert

Comprehensive SQLAlchemy skill for customer support tech enablement, covering ORM patterns, session management, query optimization, async operations, and PostgreSQL integration.

manutej/luxor-claude-marketplace · 34 tokens

fastapi

FastAPI best practices and conventions. Use when working with FastAPI APIs, Pydantic models, dependencies, streaming responses including Server-Sent Events (SSE), and serving frontend apps. Keeps FastAPI code clean and up to date with the latest features and patterns.

idiscoord13-sketch/agent-jail-mcp · 57 tokens

background-tasks

Async task execution authority — Celery workers and beat scheduler, APScheduler in-process cron, bare Redis LPUSH/BRPOP queues, dead-letter queues, idempotency patterns, task monitoring, and Docker Compose worker definitions for Python pipelines.

LuuOW/meridian-mcp · 51 tokens

datamodel-code-generator

Use this skill when the user wants Python data models, Pydantic models, dataclasses, TypedDicts, msgspec structs, or type-safe Python classes generated from OpenAPI, AsyncAPI, JSON Schema, GraphQL, JSON/YAML/CSV sample data, MCP tool schemas, Protocol Buffers, XML Schema, Apache Avro, or existing Python model objects.…

koxudaxi/datamodel-code-generator · 147 tokens