apps / rules
Cursor rule621 starsChanged 13 months agoApache-2.0View on GitHub
Always implement high quality production ready code that performs the requested task, using the requested tools, libraries, external systems, infrastructure etc. Do NOT implement mocks, simulations or otherwise fake or cheat in an attempt to complete the request. Do not update or delete unrelated code (this includes insertions, deletions, and additions). If you find yourself doing something very unusual or inconsistent with the existing codebase, patterns and practices then stop and explain the situation to the user and confirm the…
We split this run-always.mdc into the rules it gives an agent
37 rules. About 0 are common, 34 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈34
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
If you find yourself doing something very unusual or inconsistent with the existing codebase, patterns and practices then stop and explain …
- Distinctive: line 12
When working on a specific task:
- Distinctive: line 16
Do not get sidetracked by peripheral issues (linter errors, type errors, etc.) unless they directly block the main task
- Distinctive: line 17
If encountering peripheral issues, note them but continue with the main task
- Distinctive: line 20
Verify the core functionality works first
- Distinctive: line 21
Only address type/lint errors if they prevent testing the core functionality
- Distinctive: line 24
Ask Before Expanding Scope
- Distinctive: line 25
If you find related issues that should be fixed, list them for the user
- Distinctive: line 26
Do not start fixing additional issues without explicit user request
- Distinctive: line 27
When in doubt, ask the user if they want to address additional issues
- Distinctive: line 30
If you notice yourself starting to work on unrelated issues, stop
- Distinctive: line 37
When working with code that contains console logs prefixed with identifiers (e.g., 'NAME', 'DEBUG', etc.), these logs should be preserved …
- Distinctive: line 39
DO NOT remove console.log statements that:
- Distinctive: line 44
DO remove console.log statements that:
- Distinctive: line 49
When encountering linter errors for console statements:
- Distinctive: line 51
Document why the console log is being preserved
- Distinctive: line 52
Consider adding a comment to explain the purpose
- Distinctive: line 65
When asked to analyze, search, or investigate code, do NOT make any code changes unless explicitly requested.
- Distinctive: line 66
Use search tools to find relevant code
- Distinctive: line 69
Wait for the user to request specific changes
- Distinctive: line 71
If the user wants changes, they will explicitly ask for them with words like "update", "change", "fix", "modify", etc.
- Very specific: line 76
When creating new migration files in packages/discovery-provider/ddl/migrations/, follow these guidelines:
- Very specific: line 79
Use the format: {number}_{descriptive_name}.sql
- Very specific: line 84
Check the packages/discovery-provider/ddl/migrations/ directory
- Distinctive: line 85
Look for the highest numbered migration file
- Distinctive: line 89
Always wrap migrations in a transaction (begin/commit)
- Distinctive: line 90
Use clear, descriptive names that indicate what the migration does
- Distinctive: line 91
Add comments if the migration's purpose isn't immediately clear from the name
- Distinctive: line 94
If multiple migrations are being added in the same PR:
- Distinctive: line 97
Never use the same number with different suffixes (e.g., 0129a, 0129b)
- Distinctive: line 110
When making code changes:
- Distinctive: line 112
DO NOT modify type definitions unless:
- Distinctive: line 124
If a type change is necessary:
- Distinctive: line 127
Document the type change impact
- Distinctive: line 129
When fixing type errors:
- Distinctive: line 131
Do not modify unrelated types
- Distinctive: line 132
Consider using type assertions as a temporary solution
≈ “Common” is an estimate: at least 1 in 5 of the 6,350 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: false
---
Always implement high quality production ready code that performs the requested task, using the requested tools, libraries, external systems, infrastructure etc. Do NOT implement mocks, simulations or otherwise fake or cheat in an attempt to complete the request. Do not update or delete unrelated code (this includes insertions, deletions, and additions).
If you find yourself doing something very unusual or inconsistent with the existing codebase, patterns and practices then stop and explain the situation to the user and confirm the course of action before proceeding, else, proceed as normal.
# Stay On Task
When working on a specific task:
1. Maintain Focus
- Stay focused on the core task/issue described by the user
- Do not get sidetracked by peripheral issues (linter errors, type errors, etc.) unless they directly block the main task
- If encountering peripheral issues, note them but continue with the main task
2. Prioritize Functionality
- Verify the core functionality works first
- Only address type/lint errors if they prevent testing the core functionality
- Save non-blocking improvements for later
3. Ask Before Expanding Scope
- If you find related issues that should be fixed, list them for the user
- Do not start fixing additional issues without explicit user request
- When in doubt, ask the user if they want to address additional issues
4. Document Distractions
- If you notice yourself starting to work on unrelated issues, stop
- Explain to the user what additional issues you found
- Let the user decide if and when to address them
# Preserve Debug Console Logs
When working with code that contains console logs prefixed with identifiers (e.g., 'NAME', 'DEBUG', etc.), these logs should be preserved as they serve specific debugging purposes. Follow these guidelines:
1. DO NOT remove console.log statements that:
- Have a prefix like 'NAME', 'DEBUG', etc.
- Are explicitly added for debugging/tracing purposes
- Are part of active development or debugging
2. DO remove console.log statements that:
- Are generic without identifiers
- Were accidentally left from previous development
- Are no longer needed for debugging
3. When encountering linter errors for console statements:
- Ignore linter errors for identified debug logs
- Document why the console log is being preserved
- Consider adding a comment to explain the purpose
Example of preserved console log:
```typescript
// Debug log for tracking metadata flow
console.log('NAME upload track form', { initialMetadata })
```
This rule helps maintain important debugging tools while keeping the codebase clean of unnecessary logging.
# Analyze Only
When asked to analyze, search, or investigate code, do NOT make any code changes unless explicitly requested. Instead:
1. Use search tools to find relevant code
2. Explain the current flow/architecture
3. Identify potential issues or gaps
4. Wait for the user to request specific changes
If the user wants changes, they will explicitly ask for them with words like "update", "change", "fix", "modify", etc.
# Migration File Naming Convention
When creating new migration files in `packages/discovery-provider/ddl/migrations/`, follow these guidelines:
1. File Naming Pattern
- Use the format: `{number}_{descriptive_name}.sql`
- The number should be the next sequential number after the highest existing migration
- Example: If the latest is `0128_patch_user_handle.sql`, the next should be `0129_...`
2. Finding the Latest Number
- Check the `packages/discovery-provider/ddl/migrations/` directory
- Look for the highest numbered migration file
- Increment that number by 1 for your new migration
3. Migration Content
- Always wrap migrations in a transaction (begin/commit)
- Use clear, descriptive names that indicate what the migration does
- Add comments if the migration's purpose isn't immediately clear from the name
4. Multiple Migrations
- If multiple migrations are being added in the same PR:
- Coordinate with other developers to avoid number conflicts
- Each migration should have its own sequential number
- Never use the same number with different suffixes (e.g., 0129a, 0129b)
Example:
```sql
-- File: 0129_add_new_column.sql
begin;
ALTER TABLE my_table ADD COLUMN new_column varchar;
commit;
```
# Preserve Type Definitions
When making code changes:
1. DO NOT modify type definitions unless:
- Explicitly requested by the user
- Required to fix a type error that blocks the main task
- Part of a type-focused refactoring task
2. Especially preserve:
- Interface and type definitions
- Type imports
- Type parameters
- Type assertions
- Type annotations
3. If a type change is necessary:
- Explain why the change is needed
- Get explicit approval from the user
- Document the type change impact
4. When fixing type errors:
- Focus on the specific type causing the error
- Do not modify unrelated types
- Consider using type assertions as a temporary solution
Example of what NOT to do:
```typescript
// Don't change this:
type Props = {
uid: UID, // Don't change to string or any other type
// ... other props
}
```
This rule helps maintain type safety and prevents unintended type changes that could introduce bugs or break existing 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 3,978 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 repository3 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .cursor/rules/audius-style-guide.mdcCursor rule
- .cursor/rules/challenges.mdcCursor rule
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.

