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.
git clone --depth 1 https://github.com/iloveitaly/llm-ide-rulesWrote 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/rules/iloveitaly/llm-ide-rules/alembic-migrations)<a href="https://agentmods.dev/rules/iloveitaly/llm-ide-rules/alembic-migrations"><img src="https://agentmods.dev/badge/rules/iloveitaly/llm-ide-rules/alembic-migrations/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/rules/iloveitaly/llm-ide-rules/alembic-migrations"><img src="https://agentmods.dev/badge/rules/iloveitaly/llm-ide-rules/alembic-migrations.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.00000 | $0.00426 |
| Opus 5.5 | $0.00000 | $0.00170 |
| Sonnet 5.5 | $0.00000 | $0.00085 |
| Haiku 4.5 | $0.00000 | $0.00043 |
Grade A, and why
alembic-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 21d 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.
What it actually says
Alembic Migrations
- Migrations must stay compatible with offline SQL generation.
- Pass the session connection into helpers rather than opening a new connection.
- Prefer Alembic's enum integration over hand-written enum migrations when it works.
- Migration logic should not use model classes.
Default Content for New Non-Nullable Columns
To add a non-nullable column and set a specific value for all existing rows without a persistent server default:
# 1. Add the column as nullable (no default needed):
op.add_column(
"distribution",
sa.Column(
"default_campaign_ending_date", sa.DateTime(timezone=True), nullable=True
),
)
# 2. Update existing rows with your desired value (e.g., a specific datetime)
op.execute(
"UPDATE distribution SET default_campaign_ending_date = %s", [datetime.utcnow()]
)
# 3. Alter the column to non-nullable:
op.alter_column("distribution", "default_campaign_ending_date", nullable=False)
Record Backfill Operations
For migrations that include data mutation, and not only schema modifications, use this pattern to setup a session:
from alembic import op
from sqlmodel import Session
from activemodel.session_manager import global_session
from app import log
def run_migration_helper():
pass
def upgrade() -> None:
session = Session(bind=op.get_bind())
with global_session(session):
run_migration_helper()
flip_point_coordinates()
backfill_screening_host_data()
# flush before running any other operations, otherwise not all changes will persist to the transaction
session.flush()
However, if you don't need the business logic attached to the models, you can execute a query using op.execute:
op.execute(
TheModel.__table__.update().values({"a_field": "a_value"}) # type: ignore
)
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.
- 21d ago Changed · +5 lines dbe4389e253a
- 1mo ago Changed · -1 lines 565aab94ef94
- 1mo ago First seen · 63 lines · 0 tokens per session scan A 1a44cf2a6d0d
alembic-migrations is a cursor rule published in the GitHub repository iloveitaly/llm-ide-rules (13 stars, last pushed 4d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 426 tokens. 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.
Other cursor rules, from other repositories
ai-kb
Use shared AI KB rules and context.
creating-cursor-rules
Meta-rule for creating effective Cursor IDE rules with best practices, patterns, and examples.
roslyn-mcp-docs-agents
Docs sync AGENTS/README, agent conventions, PowerShell, secrets.
roslyn-mcp-decompile
Assembly resolve, ILSpy decompile, NuGet/BCL fallback.
pn-tool-risk-policy
MCP tool risk tiers, HITL gates, and when to use approvalcheckpoint and gatelogappend. Use for safety reviews and workflow audits.
codesynapse-cli
Use this rule to answer codebase architecture questions, trace dependencies, find callers/callees, calculate blast radius, and explore the code graph. Triggers on: "how does X work", "what handles Y", "where is Z defined", "explain the mechanism", "who calls", "blast radius", "shortest path", "trace request flow"…