

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
1234567# Database and SQL Rules89These rules apply when working on database models, schemas, and migrations.1011## Technology1213- **Database**: PostgreSQL 1614- **ORM**: SQLAlchemy 2.x15- **Migrations**: Alembic16- **RLS**: Row Level Security (MANDATORY)1718## Row Level Security (RLS)1920**CRITICAL**: RLS is mandatory for ALL tables containing user data.2122### RLS Context Helpers2324Every database operation MUST use the appropriate context helper:2526| Helper | Use Case |27|-----------------------|------------------------------|28| `with_user_context` | User-scoped operations |29| `with_admin_context` | Admin-scoped operations |30| `with_system_context` | Background/webhook operations|3132### Zero Tolerance3334- No direct session/ORM calls without RLS context wrappers35- No bypassing RLS policies for convenience36- No using superuser credentials in application code3738### RLS Validation3940After any schema change, validate RLS:41- User isolation: User A cannot see User B's data42- Admin access: Admin can see data within policy scope43- System context: Background tasks use system context4445## Migration Workflow4647```bash48# 1. Create migration49alembic revision --autogenerate -m "description"5051# 2. REVIEW the generated migration (do not blindly apply)52# 3. Add RLS policies if new table created53# 4. Test locally54alembic upgrade head5556# 5. Commit57git add alembic/versions/58git commit -m "feat(db): description [{{TICKET_PREFIX}}-XXX]"59```6061### Migration Rules6263- Never use `DROP TABLE` without a backup strategy64- Never skip Alembic (no manual DDL in production)65- Always add proper indexes for query patterns66- Add RLS policies for every new table with user data67- Schema changes REQUIRE System Architect approval6869## SQLAlchemy Model Standards7071- Use SQLAlchemy 2.x `Mapped` type annotations72- Define relationships explicitly73- Include `created_at` and `updated_at` timestamps on all tables74- Use UUIDs for primary keys7576## Key References7778- `docs/database/DATA_DICTIONARY.md` -- Schema reference (SINGLE SOURCE OF TRUTH)79- `docs/database/RLS_DATABASE_MIGRATION_SOP.md` -- Migration SOP (MANDATORY reading)80- `docs/database/RLS_IMPLEMENTATION_GUIDE.md` -- RLS implementation details81- `patterns_library/database/rls-migration.md` -- RLS migration pattern82- `patterns_library/database/prisma-transaction.md` -- Transaction pattern83
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?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| bybren-llc/safe-agentic-workflow.cursor/rules/00-core-principles.mdc · 399 | Cursor rules | no sections | 48/100 | today | |
| bybren-llc/safe-agentic-workflow.cursor/rules/01-git-workflow.mdc · 399 | Cursor rules | lint-formatstyletypesgit+2 | 85/100 | today | |
| bybren-llc/safe-agentic-workflow.cursor/rules/02-pattern-discovery.mdc · 399 | Cursor rules | stylearchgitdo-not+2 | 73/100 | today | |
| bybren-llc/safe-agentic-workflow.cursor/rules/03-safe-ai-dlc.mdc · 399 | Cursor rules | styledo-not | 59/100 | today | |
| bybren-llc/safe-agentic-workflow.cursor/rules/04-knowledge-vault.mdc · 399 | Cursor rules | stylegitapido-not | 73/100 | today | |
| bybren-llc/safe-agentic-workflow.cursor/rules/10-backend-python.mdc · 399 | Cursor rules | testlint-formatstylegit+4 | 97/100 | today | |
| bybren-llc/safe-agentic-workflow.cursor/rules/11-frontend-react.mdc · 399 | Cursor rules | buildstyletypessecurity+3 | 65/100 | today | |
| bybren-llc/safe-agentic-workflow.cursor/rules/13-testing.mdc · 399 | Cursor rules | teststyletesting-strategyapi+1 | 88/100 | today | |
| bybren-llc/safe-agentic-workflow.cursor/rules/14-spec-creation.mdc · 399 | Cursor rules | teststylegitdo-not | 69/100 | today | |
| bybren-llc/safe-agentic-workflow.cursor/rules/15-deployment.mdc · 399 | Cursor rules | setuptestgitsecurity+2 | 80/100 | today | |
| bybren-llc/safe-agentic-workflow.cursor/rules/16-stripe-payments.mdc · 399 | Cursor rules | testdo-not | 61/100 | today | |
| bybren-llc/safe-agentic-workflow.cursor/rules/20-agent-architect.mdc · 399 | Cursor rules | stylearchgit | 58/100 | today | |
| bybren-llc/safe-agentic-workflow.cursor/rules/21-agent-backend.mdc · 399 | Cursor rules | testlint-formatstyleapi+1 | 85/100 | today | |
| bybren-llc/safe-agentic-workflow.cursor/rules/22-agent-qas.mdc · 399 | Cursor rules | teststylesecurityagent-behaviour | 81/100 | today | |
| bybren-llc/safe-agentic-workflow.cursor/rules/23-agent-security.mdc · 399 | Cursor rules | stylesecurity | 52/100 | today | |
| bybren-llc/safe-agentic-workflow.cursor/rules/30-background-agents.mdc · 399 | Cursor rules | testlint-formatstylegit+1 | 74/100 | today | |
| bybren-llc/safe-agentic-workflow.cursor/rules/31-mcp-integration.mdc · 399 | Cursor rules | stylesecuritydo-notagent-behaviour | 61/100 | today | |
| bybren-llc/safe-agentic-workflow.gemini/GEMINI.md · 399 | GEMINI.md | lint-formatstylearchgit+4 | 66/100 | today | |
| bybren-llc/safe-agentic-workflowAGENTS.md · 399 | AGENTS.md | buildteststylearch+5 | 84/100 | today | |
| bybren-llc/safe-agentic-workflowCLAUDE.md · 399 | CLAUDE.md | buildtestlint-formatarch+6 | 91/100 | today |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 14 days ago | |
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 46 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 14 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 14 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 14 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 14 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 14 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 14 days ago | |
| bybren-llc/safe-agentic-workflow.cursor/rules/10-backend-python.mdc · 399 | Cursor rules | testlint-formatstylegit+4 | 97/100 | today |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/bybren-llc-safe-agentic-workflow-cursor-rules-12-database-sql)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.