agentleFS
synaptiaisynaptiai/prompt-decorators/.cursor/rules/060-coding-patterns.mdc

prompt-decorators / rules

Cursor rule44 starsChanged 20 months agoApache-2.0View on GitHub

FOLLOW coding patterns WHEN writing code TO maintain codebase quality

The file

Show its rules and text

We split this 060-coding-patterns.mdc into the rules it gives an agent

13 rules. About 0 are common, 13 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈13

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When writing new code or modifying existing code

    line 11
  2. Distinctive:

    When implementing features or fixing bugs

    line 12
  3. Distinctive:

    When refactoring or optimizing code

    line 13
  4. Distinctive:

    Prefer simple solutions over complex ones

    line 16
  5. Distinctive:

    Avoid code duplication by checking for similar functionality elsewhere in the codebase

    line 17
  6. Distinctive:

    Ensure code complies with pre-commit requirements

    line 18
  7. Distinctive:

    Only make changes that are explicitly requested or well understood

    line 19
  8. Distinctive:

    Remove old implementations when introducing new ones to avoid duplicate logic

    line 21
  9. Distinctive:

    Keep codebase clean and organized

    line 22
  10. Distinctive:

    Avoid writing scripts in files, especially for one-time operations

    line 23
  11. Distinctive:

    Use mocking data only for tests, never for dev or prod environments

    line 25
  12. Distinctive:

    Never add stubbing or fake data patterns affecting dev or prod environments

    line 26
  13. Distinctive:

    Never overwrite env files without explicit confirmation

    line 27

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

Keep what fits and drop the rest. Your version, ready for your agents.
Files
060-coding-patterns.mdc
---
description: FOLLOW coding patterns WHEN writing code TO maintain codebase quality
globs: **/*.py
---

# Coding Pattern Preferences

<version>1.0.0</version>

## Context
- When writing new code or modifying existing code
- When implementing features or fixing bugs
- When refactoring or optimizing code

## Requirements
- Prefer simple solutions over complex ones
- Avoid code duplication by checking for similar functionality elsewhere in the codebase
- Ensure code complies with pre-commit requirements
- Only make changes that are explicitly requested or well understood
- Exhaust all options within existing implementation before introducing new patterns
- Remove old implementations when introducing new ones to avoid duplicate logic
- Keep codebase clean and organized
- Avoid writing scripts in files, especially for one-time operations
- Refactor files exceeding 200-300 lines of code
- Use mocking data only for tests, never for dev or prod environments
- Never add stubbing or fake data patterns affecting dev or prod environments
- Never overwrite env files without explicit confirmation

## Examples

<example>
# Good: Simple solution with no duplication
def calculate_total(items):
    """Calculate total price of items using existing utility function."""
    from utils.pricing import apply_discount

    base_total = sum(item.price for item in items)
    return apply_discount(base_total)  # Reusing existing functionality
</example>

<example type="invalid">
# Bad: Duplicating existing functionality
def calculate_total(items):
    """Calculate total with duplicated discount logic."""
    base_total = sum(item.price for item in items)

    # Reimplementing discount logic that already exists in utils.pricing
    if base_total > 100:
        return base_total * 0.9
    else:
        return base_total
</example>

Download now (ZIP)

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.