specx-sqlalchemy-migrations

specx-sqlalchemy-migrations is a skill for Codex from maksimzayats/specx. It costs 63 tokens per session (732 once invoked), scanned A, original, MIT.

A migration setup for SQLAlchemy applications, using Alembic to record and apply database schema changes over time.

In plain words
What is it for?
It helps add models and repositories, configure asynchronous migrations, generate initial revisions, detect schema drift, and test migration behavior.
Why use it?
It replaces fragile database creation at startup with tracked changes that can be checked, reviewed, and applied consistently.

Skill for Codex

Written for Codex: agents/openai.yaml present. Also seen: installed under .agents/ (shared by several agents).

Good fit It helps add models and repositories, configure asynchronous migrations, generate initial revisions, detect schema drift, and test migration behavior.

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

Made for: 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 specx-sqlalchemy-migrations

README.md
[![agentmods](https://agentmods.dev/badge/skills/maksimzayats/specx/specx-sqlalchemy-migrations.svg)](https://agentmods.dev/skills/maksimzayats/specx/specx-sqlalchemy-migrations)
Your own site
<a href="https://agentmods.dev/skills/maksimzayats/specx/specx-sqlalchemy-migrations"><img src="https://agentmods.dev/badge/skills/maksimzayats/specx/specx-sqlalchemy-migrations.svg" alt="Measured on agentmods" height="20"></a>
Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 732 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.00063 $0.00732
Opus 5 $0.00032 $0.00366
Sonnet 5 $0.00013 $0.00146
Haiku 4.5 $0.00006 $0.00073

Measured 8d ago against content hash 75fac4082cbc, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

specx-sqlalchemy-migrations 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 8d 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.

.agents/skills/specx-sqlalchemy-migrations/SKILL.md · 66 lines

How it starts

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

specx SQLAlchemy Migrations

Use this skill whenever a specx project has SQLAlchemy models or persistence adapters. Read references/alembic.md before editing migration files.

Workflow

  1. Add alembic>=1.18.5 as a runtime dependency when SQLAlchemy adapters exist, together with SQLAlchemy's asyncio extra and the selected driver.
  2. Add alembic.ini, migrations/env.py, migrations/script.py.mako, and migrations/versions/.
  3. Use Alembic's async pattern for async SQLAlchemy engines.
  4. Put app-wide SQLAlchemy settings/session factory under top-level infrastructure/sqlalchemy/.
  5. Keep scope-owned ORM models and repositories under core/<scope>/infrastructure/sqlalchemy/.
  6. Add a project-local SQLAlchemy declarative base under src/<package>/foundation/sqlalchemy_model.py; do not use shared packaged metadata for generated services.
  7. Put reusable model discovery under top-level infrastructure/sqlalchemy/model_discovery.py. Use that same function from migrations/env.py and its guardrail test before assigning target_metadata; do not duplicate discovery or maintain hard-coded model module names.
  8. Set target_metadata to the project-local BaseSQLAlchemyModel.metadata.
  9. Generate or hand-review an initial migration for current models.
  10. Add make migrate and make makemigrations.
  11. Add tests that run alembic upgrade head against an isolated database, check for pending autogenerate changes, and prove every core SQLAlchemy model file is included by the exact discovery function Alembic uses. Use the production database family when dialect behavior matters.

Guardrails

  • Do not call Base.metadata.create_all, metadata.create_all, or drop_all from src/.
  • Do not run migrations from FastAPI startup by default. Run migrations as an operational command before app startup.
  • Do not put app-wide engine/session factory code inside one core scope.
  • Do not let delivery controllers import ORM models, repositories, sessions, or migration helpers.
  • Do not let Alembic drift checks depend on incomplete metadata. Model discovery must include every core/*/infrastructure/sqlalchemy/models/*.py file.
  • Do not trust autogenerated migrations without review.
  • Do not edit, delete, or reorder a revision that may already have been applied; add a new corrective revision.
  • Do not pass SQLite's autocommit connect argument on Python 3.11. For a savepoint-based SQLite test harness spanning Python versions, use SQLAlchemy's connect and begin event-hook recipe.

Read the full file on GitHub · 66 lines

Files

What ships with it

2 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. 8d ago First seen · 66 lines · 63 tokens per session scan A 75fac4082cbc

Subscribe to this mod's changes

specx-sqlalchemy-migrations is a skill published in the GitHub repository maksimzayats/specx (201 stars, last pushed 1mo ago), licensed MIT. It adds 63 tokens to every session and 732 once invoked, about $0.0003 per session on Opus 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.