agentleFS
joaoguimaraesprojoaoguimaraespro/personal-finance/.cursor/rules/common-coding-style.mdc

personal-finance / rules

Cursor rule1 starsChanged todayMITView on GitHub

Language-independent coding style: simplicity, immutability, small files, explicit errors, validation at boundaries

The file

We split this common-coding-style.mdc into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    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:

    Prefer immutable data: return a new value instead of changing the input in place, unless the language idiom or a measured performance need …

    line 15
  2. Distinctive:

    Start from the data model, then the domain logic, then the interface.

    line 17
  3. Distinctive:

    No magic numbers: name thresholds, delays and limits, or read them from configuration.

    line 24

≈ “Common” is an estimate: at least 1 in 5 of the 6,809 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
common-coding-style.mdc
---
description: "Language-independent coding style: simplicity, immutability, small files, explicit errors, validation at boundaries"
globs: 
alwaysApply: true
---
<!-- Generated by armature from core/rules/common/coding-style.md. Edit the source rule, not this file. -->
# Coding style (all languages)

Language rules in `.claude/rules/<language>/` win where they differ.

## Principles
- Explicit over implicit. Correctness first, then performance, then elegance.
- KISS: the simplest solution that works. YAGNI: no abstraction before the need is real. DRY: extract repetition
  once it is real (three times), not speculatively.
- Prefer immutable data: return a new value instead of changing the input in place, unless the language idiom or a
  measured performance need says otherwise.
- Start from the data model, then the domain logic, then the interface.

## Size and structure
- Organise by feature or domain, not by technical type.
- Functions do one thing; around 50 lines is a signal to split. Source files of 200-400 lines are typical; 800 is a
  soft ceiling (tests, generated and vendored files may exceed it for a stated reason).
- Nesting deeper than 4 levels: use early returns.
- No magic numbers: name thresholds, delays and limits, or read them from configuration.

## Errors and input
- Handle errors explicitly at the level that can act on them. Never swallow an error silently.
- Validate all external input (user input, API responses, files, messages) at the system boundary with a schema
  where one exists. Fail fast with a clear message.
- User-facing messages are plain and leak nothing internal; logs carry the detail (never secrets or personal data).

## Naming
- Names say what the thing holds or does, without a comment. Booleans read as claims (`isActive`, `has_access`).
- Casing follows the language rule. Files and folders that are not code: lowercase `kebab-case`. Tool entry points
  keep their exact names (`AGENTS.md`, `CLAUDE.md`, `README.md`, `LICENSE`, `SKILL.md`).

## Before calling it done
- [ ] Readable, well named, no dead code or debug output
- [ ] Errors handled, input validated at the boundary
- [ ] No hardcoded secrets or environment-specific values
- [ ] Tests cover the change and the project gate passes

<!-- Adapted from affaan-m/ECC rules/common/coding-style.md and patterns.md (MIT) at d2ef268; merged with the owner's engineering rules (NEXUS ME.md) and Ordo's naming-convention.md (generic parts). -->

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.