agentleFS
zotoiozotoio/CRUX-Compress/.cursor/rules/example/coding-standards-demo.crux.mdc

CRUX-Compress / example

Cursor rule8 starsChanged 2 months agoMITView on GitHub

Team coding standards and best practices

The file

Files
coding-standards-demo.crux.mdc
---
generated: 2026-01-28 10:45
sourceChecksum: 264908382
beforeTokens: 3234
afterTokens: 875
reducedBy: 73%
confidence: 95%
alwaysApply: false
crux: true
description: Team coding standards and best practices
---

> [!IMPORTANT]
> Generated file - do not edit!

# Team Coding Standards and Best Practices

```crux
⟦CRUX:coding-standards-demo.md
Ρ{team coding standards+best practices}
Κ{
  fn=function; cls=class; var=variable;
  JS=JavaScript; TS=TypeScript; Py=Python
}

R.philosophy{
  readable≻clever; code→humans first;
  ∀code→read many×>write 1×
}

R.boyscout{
  leave code≥found; touch file→cleanup minor;
  ¬scope-creep; big refactor→separate ticket
}

R.naming{
  vars+fns=descriptive+self-doc; ¬single-letter[except short loops];
  JS/TS{var+fn=camelCase; cls=PascalCase; const=SCREAMING_SNAKE};
  Py{var+fn=snake_case; cls=PascalCase};
  bool→prefix[is|has|can|should];
  files{JS/TS=kebab-case; Py=snake_case};
  dir=lowercase+hyphens; 1file→1responsibility
}

R.structure{
  fn.len≤20..30ln; 1fn→1thing;
  nesting≤3levels→use early return|extract fn;
  comments→"why"¬"what"
}

R.docs{
  ∀public[API|cls|fn]→doc comments;
  include=[desc,params+types,return,examples?,exceptions?]
}

R.errors{
  ¬swallow!→log|handle|rethrow;
  custom err types→precise handling+debug;
  err.msg∋[op failed,expected,actual,IDs,ctx]
}

R.test{
  ∀new code→tests; cov≥80%⊕meaningful;
  name="should [behavior] when [condition]";
  pattern=AAA[Arrange→Act→Assert];
  mock=[external APIs,DB,filesystem,time]; ¬mock=[unit tested,utils,data structs]
}

R.git{
  commit=conventional{type(scope):desc};
  types=[feat,fix,docs,style,refactor,test,chore];
  branch=[feature/,fix/,refactor/,docs/]+desc; +ticket#?;
  PR{title clear,desc what+why,ref issues,small+complete,tests,CI pass}
}

R.security{
  ¬commit[API keys,secrets,passwords,creds,private keys,PII]!;
  use env vars+secret mgmt;
  ∀input→validate[type,format,range]+sanitize;
  DB→parameterized queries; output→encode[XSS];
  auth→check before op; use established libs; rate limit; secure sessions
}

R.perf{
  DB{¬N+1→eager load; +indexes; paginate; profile slow};
  cache{expensive ops+external API; TTL→volatility; invalidation; warming};
  frontend{lazy load; optimize images; min bundle; code split}
}

R.deps{
  before add→check[maintained?,bundle size?,vulns?,existing alt?];
  doc major deps in README;
  prod→pin exact ver; libs→ver ranges;
  update regularly; monitor vulns
}

R.review{
  author{self-review first; PR small+focused; ctx in desc; feedback→constructive};
  reviewer{respectful; explain reasoning; required≠suggestions; approve when good enough}
}

R.logging{
  log=[startup,shutdown,auth events,biz-critical ops,errors+ctx,perf metrics];
  ¬log=[sensitive data,high-freq spam,redundant];
  levels{ERROR=failed+attention; WARN=unexpected+recoverable;
    INFO=normal biz; DEBUG=detailed; TRACE=very detailed}
}

Ω{
  standards=living doc→update as team grows;
  goal=better code together¬bureaucracy;
  ?doubt→ask colleague
}
⟧
```

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.