Agent skill

Specx Sqlalchemy Migrations

by maksimzayats in maksimzayats/specx

Add or repair Alembic migrations for specx SQLAlchemy services.

MITAuto-check passedDatabases

Install Specx Sqlalchemy Migrations

skills CLI
$ npx skills add maksimzayats/specx --skill specx-sqlalchemy-migrations -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install maksimzayats/specx specx-sqlalchemy-migrations --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/maksimzayats/specx.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/specx-sqlalchemy-migrations .claude/skills/specx-sqlalchemy-migrations && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
specx-sqlalchemy-migrations
GitHub stars
202
Token cost
~822 tokens
SKILL.md length
357 words
Files
3 (incl. references)
Skills in repo
12
Repo updated
First seen
Licence
MIT

At a glance

Add or repair Alembic migrations for specx SQLAlchemy services.

  • Works in 11 steps: Add alembic>=1.18.5 as a runtime… → Add alembic.ini, migrations/env.py,… → Use Alembic's async pattern for async… → …
  • Adding SQLAlchemy models
  • SKILL.md covers Workflow, Guardrails, Code Style and References
  • Calls make

What it does

Specx Sqlalchemy Migrations is an agent skill from maksimzayats/specx. Add or repair Alembic migrations for specx SQLAlchemy services. Use when adding SQLAlchemy models or repositories, replacing metadata.createall schema bootstraps, creating async Alembic env.py, adding migration Makefile targets, generating initial revisions, or testing migration drift.

Its SKILL.md is about 820 tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `agents/openai.yaml` and `references/alembic.md`).

It sits in Databases, covering ORMs and data access and Database migrations. It works with SQLAlchemy. The repository describes itself as: ⚙️ Executable architecture guardrails and agent skills for building structured Python services! The licence is MIT.

When your agent uses it

  • Adding SQLAlchemy models
  • Replacing metadata.createall schema bootstraps
  • Creating async Alembic env.py
  • Adding migration Makefile targets

Example prompts

  • “/specx-sqlalchemy-migrations”

Requirements

  • Python 3

Workflow steps

11 steps, taken from the first numbered list in SKILL.md.

  1. Add alembic>=1.18.5 as a runtime dependency when SQLAlchemy adapters
  2. Add alembic.ini, migrations/env.py, migrations/script.py.mako, and
  3. Use Alembic's async pattern for async SQLAlchemy engines.
  4. Put app-wide SQLAlchemy settings/session factory under top-level
  5. Keep scope-owned ORM models and repositories under
  6. Add a project-local SQLAlchemy declarative base under
  7. Put reusable model discovery under top-level
  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,

What it can do on your machine

Read from SKILL.md and the folder at commit 9362406. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • make

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Specx Sqlalchemy Migrations loads about 822 tokens when it runs, and up to ~4.7k if it reads all its reference files. Until then it costs about 79 tokens; SKILL.md has 357 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~79
When it runs · the whole SKILL.md, loaded when a task matches
~822
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from maksimzayats/specx at commit 9362406, republished under its MIT licence (© maksimzayats). 357 words, ~822 tokens.

Download SKILL.mdSave it as .claude/skills/specx-sqlalchemy-migrations/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
specx-sqlalchemy-migrations
description
Add or repair Alembic migrations for specx SQLAlchemy services. Use when adding SQLAlchemy models or repositories, replacing metadata.create_all schema bootstraps, creating async Alembic env.py, adding migration Makefile targets, generating initial revisions, or testing migration drift.

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.
Show full SKILL.md (165 more words)Show less

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.

Code Style

Use blank lines as logical separators in all code. Keep related statements together, but separate independent setup, action, assertion, response, branch, and transformation groups so long blocks stay readable.

References

  • references/alembic.md - async Alembic layout, env.py, Makefile targets, initial migration, and migration tests.

© maksimzayats, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in skills/specx-sqlalchemy-migrations of maksimzayats/specx.

  • SKILL.md
  • agents/openai.yaml
  • references/alembic.md

Open the folder on GitHubat commit 9362406

Compare with similar skills

Specx Sqlalchemy Migrations next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Specx Sqlalchemy Migrations compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Specx Sqlalchemy Migrations this skillmaksimzayats/specx202—~822Automated safety check: PassMIT
Change Database Schemamartin-ueding/geo-activity-playground100—~225Automated safety check: PassCustom licence
Sqlalchemykid-sid/claude-spellbook190—~3.5kAutomated safety check: PassMIT
Python Database Patternsaiskillstore/marketplace4301 repos~1.2kAutomated safety check: NotesNone
DB Connectionaiskillstore/marketplace430—~3.5kAutomated safety check: NotesNone
DB Migrationskurealnum/dotfiles290—~820Automated safety check: PassNone

Similar skills

  • Change Database Schema

    martin-ueding/geo-activity-playground

    How to change the SQLAlchemy data model and generate the matching Alembic migration.

    100 GitHub stars~225 tokensUpdated 12 days ago
    DatabasesAuto-check passed
  • Sqlalchemy

    kid-sid/claude-spellbook

    A skill your agent uses when using async SQLAlchemy 2.0 — defining models, writing queries, managing async sessions, loading relationships without N+1, or setting up and debugging Alembic migrations.

    190 GitHub stars~3.5k tokensUpdated 2 mo ago
    DatabasesAuto-check passed
  • Python Database Patterns

    aiskillstore/marketplace

    SQLAlchemy and database patterns for Python. An agent skill from aiskillstore/marketplace.

    430 GitHub starsUsed in 1 repo~1.2k tokens
    DatabasesAuto-check: notes
  • DB Connection

    aiskillstore/marketplace

    A skill your agent uses when setting up database connections, especially for Neon PostgreSQL.

    430 GitHub stars~3.5k tokensUpdated today
    DatabasesAuto-check: notes
  • DB Migrations

    kurealnum/dotfiles

    A skill your agent uses when generating or regenerating Drizzle migration files, changing database schema tables or columns, resolving migration sequence conflicts after rebase, reviewing migration…

    290 GitHub stars~820 tokensUpdated 5 mo ago
    DatabasesAuto-check passed
  • Drizzle

    kurealnum/dotfiles

    Drizzle ORM schema and database guide. An agent skill from kurealnum/dotfiles.

    290 GitHub stars~1.3k tokensUpdated 5 mo ago
    DatabasesAuto-check passed

More from maksimzayats/specx

All 12 skills in this repo
  • Specx Add Core Service

    maksimzayats/specx

    Add or refactor a specx core scope service. An agent skill from maksimzayats/specx.

    202 GitHub stars~688 tokensUpdated 2 mo ago
    Auto-check passed
  • Specx Add Core Use Case

    maksimzayats/specx

    Add or refactor a specx core scope use case. An agent skill from maksimzayats/specx.

    202 GitHub stars~1.1k tokensUpdated 2 mo ago
    Auto-check passed
  • Add delivery controllers for specx services, especially FastAPI HTTP routes.

    202 GitHub stars~704 tokensUpdated 2 mo ago
    Auto-check passed
  • Add technical infrastructure adapters for specx core scopes.

    202 GitHub stars~1k tokensUpdated 2 mo ago
    Auto-check passed
  • Design or review specx core scope boundaries in Python services.

    202 GitHub stars~1.8k tokensUpdated 2 mo ago
    Auto-check passed
  • Specx Diwire Composition

    maksimzayats/specx

    Wire dependency injection for a specx Python service with diwire.

    202 GitHub stars~1.1k tokensUpdated 2 mo ago
    Auto-check passed

Works with

Categories

Questions about Specx Sqlalchemy Migrations

What does Specx Sqlalchemy Migrations do?

Add or repair Alembic migrations for specx SQLAlchemy services. Specx Sqlalchemy Migrations is an agent skill from maksimzayats/specx. Add or repair Alembic migrations for specx SQLAlchemy services.

When should I use Specx Sqlalchemy Migrations?

Specx Sqlalchemy Migrations fits situations like: adding SQLAlchemy models; replacing metadata.createall schema bootstraps; creating async Alembic env.py; adding migration Makefile targets.

How do I install Specx Sqlalchemy Migrations in Claude Code?

Run `npx skills add maksimzayats/specx --skill specx-sqlalchemy-migrations -a claude-code`. Or copy the skill folder (skills/specx-sqlalchemy-migrations in maksimzayats/specx) into .claude/skills/specx-sqlalchemy-migrations in your project. Claude Code loads it when a task matches its description.

How do I install Specx Sqlalchemy Migrations in Codex?

Run `npx skills add maksimzayats/specx --skill specx-sqlalchemy-migrations -a codex`. Or copy the skill folder (skills/specx-sqlalchemy-migrations in maksimzayats/specx) into .agents/skills/specx-sqlalchemy-migrations in your project. Codex loads it when a task matches its description.

Can I use Specx Sqlalchemy Migrations in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add maksimzayats/specx --skill specx-sqlalchemy-migrations -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/specx-sqlalchemy-migrations, .gemini/skills/specx-sqlalchemy-migrations, .github/skills/specx-sqlalchemy-migrations and .opencode/skills/specx-sqlalchemy-migrations in your project.

What does Specx Sqlalchemy Migrations need to run?

Going by SKILL.md and its folder, Specx Sqlalchemy Migrations needs the command-line tools its instructions call (make). Our summary lists: Python 3.

Does Specx Sqlalchemy Migrations access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Specx Sqlalchemy Migrations safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Specx Sqlalchemy Migrations use?

Specx Sqlalchemy Migrations is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Specx Sqlalchemy Migrations use?

About 822 tokens (SKILL.md is roughly 3.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.9k tokens, read only when the agent opens those files.

What are the alternatives to Specx Sqlalchemy Migrations?

Skills that share tags, products or a category with Specx Sqlalchemy Migrations: Change Database Schema (martin-ueding/geo-activity-playground, 100 stars), Sqlalchemy (kid-sid/claude-spellbook, 190 stars), Python Database Patterns (aiskillstore/marketplace, 430 stars) and DB Connection (aiskillstore/marketplace, 430 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Specx Sqlalchemy Migrations?

maksimzayats (a GitHub user) maintains it in maksimzayats/specx, which has 202 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on August 8, 2026.

Source: maksimzayats/specx on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.