RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/Copilot instructions/iloveitaly/llm-ide-rules

Copilot instructions

.github/instructions/alembic-migrations.instructions.md
Copilot instructions

Quality

50/100

Scores the file, not the repository.

Length

175 words

6 headings · 3 code blocks

Repository

13

— · pushed 33 days ago

Last changed

3 days ago

First indexed 3 days ago.
iloveitaly/llm-ide-rules/.github/instructions/alembic-migrations.instructions.mdRawGitHub
1---
2applyTo: "migrations/versions/*.py"
3---
4## Alembic Migrations
5 
6 
7### Default Content for New Non-Nullable Columns
8 
9To add a non-nullable column and set a specific value for all existing rows without a persistent server default:
10 
11```python
12# 1. Add the column as nullable (no default needed):
13op.add_column('distribution', sa.Column('default_campaign_ending_date', sa.DateTime(timezone=True), nullable=True))
14# 2. Update existing rows with your desired value (e.g., a specific datetime)
15op.execute("UPDATE distribution SET default_campaign_ending_date = %s", [datetime.utcnow()])
16# 3. Alter the column to non-nullable:
17op.alter_column('distribution', 'default_campaign_ending_date', nullable=False)
18```
19 
20### Record Backfill Operations
21 
22For migrations that include data mutation, and not only schema modifications, use this pattern to setup a session:
23 
24```python
25from alembic import op
26from sqlmodel import Session
27from activemodel.session_manager import global_session
28from app import log
29 
30def run_migration_helper():
31 pass
32 
33def upgrade() -> None:
34 session = Session(bind=op.get_bind())
35 
36 with global_session(session):
37 run_migration_helper()
38 flip_point_coordinates()
39 backfill_screening_host_data()
40 
41 # flush before running any other operations, otherwise not all changes will persist to the transaction
42 session.flush()
43```
44 
45However, if you don't need the business logic attached to the models, you can execute a query using `op.execute`:
46 
47```python
48op.execute(
49 TheModel.__table__.update().values({"a_field": "a_value"}) # type: ignore
50)
51```
52 

Sections

  • Alembic Migrations
  • Default Content for New Non-Nullable Columns
  • 1. Add the column as nullable (no default needed):
  • 2. Update existing rows with your desired value (e.g., a specific datetime)
  • 3. Alter the column to non-nullable:
  • Record Backfill Operations

Stack — with the evidence

python

(1.00)

pytest

(0.70)

ruff

(0.70)

github-actions

(0.60)

Glob targeting

  • migrations/versions/*.py

Format

Copilot instructions

Two layers: one always-on repo file, plus optional glob-scoped instruction files. Lives under .github/ rather than the repo root, which is the tell that it is aimed at the GitHub platform surface as much as the editor.

What the corpus says about it

Repository

Owner
iloveitaly
Language
—
License
—
Archived
no

All configs in this repo

Also in iloveitaly/llm-ide-rules

Diff this repo’s formats

One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
iloveitaly/llm-ide-rules.cursor/rules/python.mdc · 13Cursor rulespythonpytest+2setupstyletypesdo-not88/1003 days ago
iloveitaly/llm-ide-rules.cursor/rules/alembic-migrations.mdc · 13Cursor rulespythonpytest+2no sections50/1003 days ago
iloveitaly/llm-ide-rules.cursor/rules/fastapi.mdc · 13Cursor rulespythonpytest+2no sections24/1003 days ago
iloveitaly/llm-ide-rules.cursor/rules/general.mdc · 13Cursor rulespythonpytest+2teststyledo-notagent-behaviour+192/1003 days ago
iloveitaly/llm-ide-rules.cursor/rules/justfiles.mdc · 13Cursor rulespythonpytest+2do-not31/1003 days ago
iloveitaly/llm-ide-rules.cursor/rules/pytest-integration-tests.mdc · 13Cursor rulespythonpytest+2teststyletesting-strategy73/1003 days ago
iloveitaly/llm-ide-rules.cursor/rules/pytest-tests.mdc · 13Cursor rulespythonpytest+2testarchtesting-strategyapi+161/1003 days ago
iloveitaly/llm-ide-rules.cursor/rules/python-app.mdc · 13Cursor rulespythonpytest+2styledatabasedocs61/1003 days ago
iloveitaly/llm-ide-rules.cursor/rules/python-route-tests.mdc · 13Cursor rulespythonpytest+2api24/1003 days ago
iloveitaly/llm-ide-rules.cursor/rules/react-router.mdc · 13Cursor rulespythonpytest+2testing-strategy57/1003 days ago
iloveitaly/llm-ide-rules.cursor/rules/react.mdc · 13Cursor rulespythonpytest+2styletesting-strategyuido-not60/1003 days ago
iloveitaly/llm-ide-rules.cursor/rules/shell.mdc · 13Cursor rulespythonpytest+2no sections4/1003 days ago
iloveitaly/llm-ide-rules.cursor/rules/typescript.mdc · 13Cursor rulespythonpytest+2styletypessecurity63/1003 days ago
iloveitaly/llm-ide-rules.github/copilot-instructions.md · 13Copilot instructionspythonpytest+2teststyledo-notagent-behaviour+192/1003 days ago
iloveitaly/llm-ide-rules.github/instructions/fastapi.instructions.md · 13Copilot instructionspythonpytest+2no sections16/1003 days ago
iloveitaly/llm-ide-rules.github/instructions/justfiles.instructions.md · 13Copilot instructionspythonpytest+2do-not31/1003 days ago
iloveitaly/llm-ide-rules.github/instructions/pytest-integration-tests.instructions.md · 13Copilot instructionspythonpytest+2teststyletesting-strategy65/1003 days ago
iloveitaly/llm-ide-rules.github/instructions/pytest-tests.instructions.md · 13Copilot instructionspythonpytest+2testarchtesting-strategyapi+153/1003 days ago
iloveitaly/llm-ide-rules.github/instructions/python-app.instructions.md · 13Copilot instructionspythonpytest+2styledatabasedocs61/1003 days ago
iloveitaly/llm-ide-rules.github/instructions/python-route-tests.instructions.md · 13Copilot instructionspythonpytest+2api16/1003 days ago
Diff against .cursor/rules/python.mdc Diff against .cursor/rules/alembic-migrations.mdc Diff against .cursor/rules/fastapi.mdc Diff against .cursor/rules/general.mdc Diff against .cursor/rules/justfiles.mdc Diff against .cursor/rules/pytest-integration-tests.mdc Diff against .cursor/rules/pytest-tests.mdc Diff against .cursor/rules/python-app.mdc Diff against .cursor/rules/python-route-tests.mdc Diff against .cursor/rules/react-router.mdc Diff against .cursor/rules/react.mdc Diff against .cursor/rules/shell.mdc Diff against .cursor/rules/typescript.mdc Diff against .github/copilot-instructions.md Diff against .github/instructions/fastapi.instructions.md Diff against .github/instructions/justfiles.instructions.md Diff against .github/instructions/pytest-integration-tests.instructions.md Diff against .github/instructions/pytest-tests.instructions.md Diff against .github/instructions/python-app.instructions.md Diff against .github/instructions/python-route-tests.instructions.md

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
pytorch/pytorch.github/copilot-instructions.md · 102kCopilot instructionspythonpytorch+4setupbuildteststyle+5100/1003 days ago
hiyouga/LlamaFactory.github/copilot-instructions.md · 74kCopilot instructionspythontransformers+4setupbuildtestlint-format+597/1002 days ago
darkmatter/nixmac.github/copilot-instructions.md · 24Copilot instructionstypescriptrust+14setupbuildtestlint-format+896/1003 days ago
iloveitaly/llm-ide-rules.github/copilot-instructions.md · 13Copilot instructionspythonpytest+2teststyledo-notagent-behaviour+192/1003 days ago
bytedance/deer-flow.github/copilot-instructions.md · 79kCopilot instructionstypescriptpython+15setupbuildtestlint-format+689/1003 days ago
iloveitaly/llm-ide-rules.github/instructions/python.instructions.md · 13Copilot instructionspythonpytest+2setupstyletypesdo-not88/1003 days ago
Significant-Gravitas/AutoGPT.github/copilot-instructions.md · 186kCopilot instructionspythonnode+19setupbuildtestlint-format+1088/1003 days ago
u9401066/nsforge-mcp.github/copilot-instructions.md · 4Copilot instructionspythonpytest+2setuptestlint-formatgit+285/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack