agentleFS
aniketshukla1aniketshukla1/sdlc-kit/.cursor/skills/db-migration/SKILL.md

db-migration

Skill1 starsChanged 12 days agoMITView on GitHub

Phase 4 (data tasks). Changes SQLAlchemy models and creates a verified Alembic migration for MySQL. Use only when PLAN.md "Data changes" says a migration is needed.

24 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use api-endpoint, git-workflow and 6 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • tadoEngSkill

    api-endpoint

    Add or change a backend API endpoint on this product, keeping Pydantic as the single contract authority and regenerating the TypeScript client. Use when asked to add an endpoint, expose data to the frontend, change a request or response shape, or wire a new backend capability into a page.

    Also in 4 projects that use this

  • Microsoft AzureSkill

    git-workflow

    Squad branching model: dev-first workflow with insiders preview channel

    Also in 3 projects that use this

  • Microsoft AzureSkill

    design

    Design rules and conventions for the API Center Portal. Use when editing detail pages, card components, badges, layout, navigation, sidebars, or headers. Covers badge styling, metadata placement, page navigation patterns, and layout alignment.

    Also in 3 projects that use this

  • AnthropicSkill

    debug

    Structured debugging session — reproduce, isolate, diagnose, and fix. Trigger with an error message or stack trace, "this works in staging but not prod", "something broke after the deploy", or when behavior diverges from expected and the cause isn't obvious.

    Also in 3 projects that use this

  • VercelSkill

    agent-browser

    Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.

    Also in 3 projects that use this

  • GoogleSkill

    grill-me

    A relentless interview to sharpen a plan or design.

    Also in 3 projects that use this

  • +1 more from Azure

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 21 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read PLAN.md "Data changes" and the next unticked data task.

    line 10
  2. Very specific:

    Run the checker (it does upgrade → downgrade → upgrade on your LOCAL/test DB): bash .cursor/skills/run-checks/scripts/check_migration.sh …

    line 23
  3. Very specific:

    Verify: output ends with MIGRATION PASS.

    line 25
  4. Very specific:

    Never edit a migration that already exists on main (check_guards.sh fails if you do).

    line 26
  5. Distinctive:

    Never touch Elasticsearch mappings or indices.

    line 31

“Common” is measured: kept by at least 6 in 10 of the 21 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

DB migration (phase 4, data tasks)

Skip this skill if PLAN.md "Data changes → Migration" is no.

Steps

  1. Read PLAN.md "Data changes" and the next unticked data task. Do only that task.
  2. Edit or create the model in backend/app/models/ following the database standards (names, explicit lengths, DECIMAL for money, indexes on foreign keys).
  3. Generate the migration from inside backend/: alembic revision --autogenerate -m "<KEY> <short description>"
  4. Open the new file in backend/alembic/versions/. Autogenerate is often wrong. Check each item:
    • Only the intended changes. Delete unrelated detected diffs.
    • Types, lengths, nullable and defaults are exactly what the plan says.
    • NOT NULL column on an existing table has server_default (or the plan's 3-step approach).
    • Index / unique / FK names follow ix_, uq_, fk_ naming.
    • downgrade() reverses upgrade() in reverse order.
    • A rename or drop follows expand/contract (database standards), never in place.
    • No ORM model imports inside the migration (use op and sa only).
  5. Run the checker (it does upgrade → downgrade → upgrade on your LOCAL/test DB): bash .cursor/skills/run-checks/scripts/check_migration.sh Verify: output ends with MIGRATION PASS.
  6. Never edit a migration that already exists on main (check_guards.sh fails if you do). Create a new one.
  7. alembic heads shows 2 heads after you updated from main (main got a new migration): set down_revision in YOUR oldest new migration to the other head. Don't use alembic merge. Then step 5 again.
  8. Data backfill on staging/production is NOT your job. If needed, it must be under "Human actions required" in PLAN.md. If it isn't, stop and tell the human.
  9. Never touch Elasticsearch mappings or indices.
  10. Tick the task in PLAN.md. Add to PROGRESS.md log: task, migration file name, MIGRATION PASS.

Done when

  • Every item in step 4 checked
  • MIGRATION PASS shown in this chat
  • alembic heads shows exactly one head

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.