agentleFS
AudiusProjectAudiusProject/apps/.cursor/rules/run-always.mdc

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
  1. Distinctive:

    If you find yourself doing something very unusual or inconsistent with the existing codebase, patterns and practices then stop and explain …

    line 8
  2. Distinctive:

    When working on a specific task:

    line 12
  3. Distinctive:

    Do not get sidetracked by peripheral issues (linter errors, type errors, etc.) unless they directly block the main task

    line 16
  4. Distinctive:

    If encountering peripheral issues, note them but continue with the main task

    line 17
  5. Distinctive:

    Verify the core functionality works first

    line 20
  6. Distinctive:

    Only address type/lint errors if they prevent testing the core functionality

    line 21
  7. Distinctive:

    Ask Before Expanding Scope

    line 24
  8. Distinctive:

    If you find related issues that should be fixed, list them for the user

    line 25
  9. Distinctive:

    Do not start fixing additional issues without explicit user request

    line 26
  10. Distinctive:

    When in doubt, ask the user if they want to address additional issues

    line 27
  11. Distinctive:

    If you notice yourself starting to work on unrelated issues, stop

    line 30
  12. Distinctive:

    When working with code that contains console logs prefixed with identifiers (e.g., 'NAME', 'DEBUG', etc.), these logs should be preserved …

    line 37
  13. Distinctive:

    DO NOT remove console.log statements that:

    line 39
  14. Distinctive:

    DO remove console.log statements that:

    line 44
  15. Distinctive:

    When encountering linter errors for console statements:

    line 49
  16. Distinctive:

    Document why the console log is being preserved

    line 51
  17. Distinctive:

    Consider adding a comment to explain the purpose

    line 52
  18. Distinctive:

    When asked to analyze, search, or investigate code, do NOT make any code changes unless explicitly requested.

    line 65
  19. Distinctive:

    Use search tools to find relevant code

    line 66
  20. Distinctive:

    Wait for the user to request specific changes

    line 69
  21. Distinctive:

    If the user wants changes, they will explicitly ask for them with words like "update", "change", "fix", "modify", etc.

    line 71
  22. Very specific:

    When creating new migration files in packages/discovery-provider/ddl/migrations/, follow these guidelines:

    line 76
  23. Very specific:

    Use the format: {number}_{descriptive_name}.sql

    line 79
  24. Very specific:

    Check the packages/discovery-provider/ddl/migrations/ directory

    line 84
  25. Distinctive:

    Look for the highest numbered migration file

    line 85
  26. Distinctive:

    Always wrap migrations in a transaction (begin/commit)

    line 89
  27. Distinctive:

    Use clear, descriptive names that indicate what the migration does

    line 90
  28. Distinctive:

    Add comments if the migration's purpose isn't immediately clear from the name

    line 91
  29. Distinctive:

    If multiple migrations are being added in the same PR:

    line 94
  30. Distinctive:

    Never use the same number with different suffixes (e.g., 0129a, 0129b)

    line 97
  31. Distinctive:

    When making code changes:

    line 110
  32. Distinctive:

    DO NOT modify type definitions unless:

    line 112
  33. Distinctive:

    If a type change is necessary:

    line 124
  34. Distinctive:

    Document the type change impact

    line 127
  35. Distinctive:

    When fixing type errors:

    line 129
  36. Distinctive:

    Do not modify unrelated types

    line 131
  37. Distinctive:

    Consider using type assertions as a temporary solution

    line 132

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
run-always.mdc
---
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.

Download now (ZIP)

  • 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.

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.