todo-mcp / rules
Cursor rule2 starsChanged 18 months agoMITView on GitHub
@src/db/schema.ts @src/db/postgres.ts
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 1,533 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 repository6 other files it gives its agents.
- .cursor/rules/development-workflow.mdcCursor rule
- .cursor/rules/mcp-development.mdcCursor rule
- .cursor/rules/pr-automation.mdcCursor rule
- .cursor/rules/README.mdCursor rule
- .cursor/rules/release-management.mdcCursor rule
- .cursor/rules/testing-standards.mdcCursor rule
The file
Show its rules and text
We split this database-patterns.mdc into the rules it gives an agent
14 rules. About 0 are common, 12 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
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
- Distinctive: line 13
Update Zod validation schemas accordingly
- Distinctive: line 14
Ensure type safety between database and validation
- Distinctive: line 23
Verify migration works with test database
- Distinctive: line 24
Check that rollback is possible if needed
- Very specific: line 27
Use the todoDb interface from src/db/index.ts
- Distinctive: line 28
All database operations should be type-safe with Drizzle
- Distinctive: line 29
Use transactions for operations that modify multiple tables
- Very specific: line 33
Use generatedAlwaysAsIdentity() for primary keys
- Distinctive: line 35
Use appropriate varchar lengths based on UI constraints
- Distinctive: line 39
Keep migrations focused and atomic
- Distinctive: line 40
Test migrations with real data scenarios
- Distinctive: line 42
Document complex migrations with comments
- Distinctive: line 45
Use environment variables for database URLs
- Distinctive: line 48
Always close connections in tests
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 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: globs: alwaysApply: true --- # Database Development Patterns ## Schema Changes When modifying `src/db/schema.ts`: 1. **Update Schema First**: - Modify tables in `schema.ts` - Update Zod validation schemas accordingly - Ensure type safety between database and validation 2. **Generate Migration**: ```bash npm run db:generate ``` 3. **Test Migration**: - Apply to development database: `npm run db:migrate` - Verify migration works with test database - Check that rollback is possible if needed ## Database Operations - Use the `todoDb` interface from `src/db/index.ts` - All database operations should be type-safe with Drizzle - Use transactions for operations that modify multiple tables - Handle database errors gracefully with proper error types ## Schema Patterns - Use `generatedAlwaysAsIdentity()` for primary keys - Include `createdAt` timestamp with `defaultNow()` - Use appropriate varchar lengths based on UI constraints - Foreign keys should have proper references with cascade rules ## Migration Best Practices - Keep migrations focused and atomic - Test migrations with real data scenarios - Include both up and down migrations when possible - Document complex migrations with comments ## Connection Management - Use environment variables for database URLs - Separate test and development databases - Connection pooling is handled by the postgres library - Always close connections in tests @src/db/schema.ts @src/db/postgres.ts
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.

