sdlc-kit / rules
Cursor rule1 starsChanged 10 days agoMITView on GitHub
Database standards for MySQL models, Alembic migrations, repositories and Elasticsearch code.
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 4,183 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository22 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .cursor/rules/00-ticket-workflow.mdcCursor rule
- .cursor/rules/10-general-standards.mdcCursor rule
- .cursor/rules/20-backend-standards.mdcCursor rule
- .cursor/rules/30-frontend-standards.mdcCursor rule
- .cursor/rules/50-testing-standards.mdcCursor rule
- backend-implementSkill
- chatSkill
- codebase-exploreSkill
- db-migrationSkill
- frontend-implementSkill
- gitlab-mrSkill
- implementation-planSkill
- jira-createSkill
- mr-feedbackSkill
- mr-reviewSkill
- quick-fixSkill
- run-checksSkill
- self-reviewSkill
- ticket-intakeSkill
- ticket-qaSkill
- write-testsSkill
The file
We split this 40-database-standards.mdc into the rules it gives an agent
7 rules. About 0 are common, 5 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
Every foreign key has an index.
- Distinctive: line 17
Every schema change = one Alembic migration.
- Distinctive: line 18
Never edit a migration that already exists on main.
- Distinctive: line 26
Never run migrations against staging or production.
- Distinctive: line 30
NEVER change mappings, index settings, analyzers or aliases, and never reindex.
- Distinctive: line 31
If the ticket needs it: write the proposal under "Human actions required" in PLAN.md and stop for approval.
- Very specific: line 33
Always set size and pagination.
≈ “Common” is an estimate: at least 1 in 5 of the 6,668 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
--- description: Database standards for MySQL models, Alembic migrations, repositories and Elasticsearch code. globs: backend/app/models/**,backend/alembic/**,backend/app/repositories/**,backend/app/search/** paths: backend/app/models/**,backend/alembic/**,backend/app/repositories/**,backend/app/search/** alwaysApply: false --- # Database standards (MySQL + Alembic + Elasticsearch) ## MySQL schema - Tables: plural `snake_case` (`order_items`). Columns: `snake_case`. Foreign keys: `<entity>_id`. - Names: index `ix_<table>_<cols>`, unique `uq_<table>_<cols>`, FK `fk_<table>_<col>_<ref>`. - Types: `VARCHAR(n)` with explicit n; `DECIMAL(p,s)` for money; `DATETIME` stored as UTC; `BOOLEAN`; utf8mb4. - New tables get `id`, `created_at`, `updated_at`. - Every foreign key has an index. Columns used in new `WHERE`/`ORDER BY` get an index (note it in the plan). ## Migrations (Alembic) - Every schema change = one Alembic migration. Never change tables by hand. - Never edit a migration that already exists on `main`. Create a new one instead. - `downgrade()` must exactly reverse `upgrade()`, and must be tested. - Adding a NOT NULL column to an existing table: use `server_default`, or 3 steps (add nullable → backfill → set NOT NULL). Write which one in the plan. - Destructive changes (drop/rename column or table, type narrowing) only if the ticket says so, and never in place: expand/contract. Add the new column, write both, backfill, switch reads; drop the old one in its own later ticket or sub-task, once no code uses it. Mark them as a risk in PLAN.md. - Large tables: note the lock/downtime risk in PLAN.md "Risks". Data updates inside a migration run in batches. - Never run migrations against staging or production. ## Elasticsearch (only if the project has `app/search/`) - MySQL is the source of truth. ES is a copy for search. - NEVER change mappings, index settings, analyzers or aliases, and never reindex. Humans only. If the ticket needs it: write the proposal under "Human actions required" in PLAN.md and stop for approval. - Queries live only in `app/search/`. Use filter context for exact matches. - Always set `size` and pagination. Never request unbounded results. - Handle ES being down using the project's existing pattern (log + fallback or 503).
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
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.

