sdlc-kit / rules
Cursor rule1 starsChanged 10 days agoMITView on GitHub
General coding standards for all code in this repository (size limits, naming, structure).
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 4,183 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 repository22 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .cursor/rules/00-ticket-workflow.mdcCursor rule
- .cursor/rules/20-backend-standards.mdcCursor rule
- .cursor/rules/30-frontend-standards.mdcCursor rule
- .cursor/rules/40-database-standards.mdcCursor rule
- .cursor/rules/50-testing-standards.mdcCursor rule
- backend-implementSkill
- chatSkill
- codebase-exploreSkill
- db-migrationSkill
- frontend-implementSkill
- gitlab-mrSkill
- implementation-planSkill
- jira-createSkill
- mr-feedbackSkill
- mr-reviewSkill
- quick-fixSkill
- run-checksSkill
- self-reviewSkill
- ticket-intakeSkill
- ticket-qaSkill
- write-testsSkill
The file
We split this 10-general-standards.mdc into the rules it gives an agent
9 rules. About 0 are common, 3 are distinctive, and 6 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.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
Before editing a file: wc -l <file>.
- Very specific: line 18
Keep the public import path working if other code imports it (re-export in __init__.py / index.ts).
- Very specific: line 23
Search before writing a helper: rg -n "def <name>|function <name>|const <name>".
- Distinctive: line 24
Follow the existing pattern in the closest similar feature.
- Very specific: line 30
No unclear abbreviations. Allowed: id, url, api, db, ui.
- Distinctive: line 33
No magic numbers/strings: use named constants or enums.
- Very specific: line 34
No commented-out code, no print, no console.log, no debugger.
- Very specific: line 36
Never swallow errors. No bare except:.
- Distinctive: line 39
No new dependency unless PLAN.md lists it and the human approved the plan.
≈ “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.
Files
---
description: General coding standards for all code in this repository (size limits, naming, structure).
alwaysApply: true
---
# General coding standards
## Size limits (hard, checked by scripts)
| Unit | Limit |
|-----------------------|-------------------------------|
| Any source/test file | ≤ 200 lines (aim for ≤ 150) |
| Function / method | ≤ 40 lines |
| React component file | ≤ 150 lines |
| Parameters | ≤ 4 (else pass an object/model) |
| Nesting depth | ≤ 3 (use early returns) |
Before editing a file: `wc -l <file>`. If your change would exceed the limit, split first:
- Split by responsibility, not by line number (e.g. `orders_service.py` → `services/orders/create.py`, `cancel.py`).
- Keep the public import path working if other code imports it (re-export in `__init__.py` / `index.ts`).
- Exempt: `frontend/src/components/ui/*` (shadcn generated), lock files, files in `.agent/size-allowlist.txt`.
## Structure
- One responsibility per file. The file name says what it does.
- Search before writing a helper: `rg -n "def <name>|function <name>|const <name>"`. Reuse, don't duplicate.
- Follow the existing pattern in the closest similar feature. Consistency beats your preference.
## Naming
- Python: `snake_case` files/functions/vars, `PascalCase` classes, `UPPER_SNAKE` constants.
- TypeScript: `PascalCase.tsx` for components, `useThing.ts` for hooks, `camelCase.ts` for other modules.
- Booleans start with `is/has/can/should`. Functions start with a verb (`get_order`, `cancelOrder`).
- No unclear abbreviations. Allowed: `id`, `url`, `api`, `db`, `ui`.
## Code hygiene
- No magic numbers/strings: use named constants or enums.
- No commented-out code, no `print`, no `console.log`, no `debugger`.
- `TODO` only with a ticket key: `# TODO(PROJ-123): ...`.
- Never swallow errors. No bare `except:`; catch specific exceptions; no empty `catch {}`.
- Config and secrets come from settings/env. Never hardcode URLs, credentials, tokens.
- Comments explain WHY, not WHAT. Public functions get a one-line docstring/JSDoc.
- No new dependency unless PLAN.md lists it and the human approved the plan.
- Imports: absolute, no wildcard (`*`), no circular imports.
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.

