zaezd / rules
Cursor rule1 starsChanged 3 months agoMITView on GitHub
TypeScript style, language policy, hygiene, shared domain vocabulary
- Reads credentials
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 1,533 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 repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/architecture.mdcCursor rule
- .cursor/rules/bdd-specs.mdcCursor rule
- .cursor/rules/composer-core.mdcCursor rule
- .cursor/rules/data-sources.mdcCursor rule
- .cursor/rules/implementation-order.mdcCursor rule
- .cursor/rules/mcp-layer.mdcCursor rule
- .cursor/rules/testing.mdcCursor rule
- .cursor/rules/web-ui.mdcCursor rule
- .cursor/rules/workflow.mdcCursor rule
The file
We split this code-style.mdc into the rules it gives an agent
6 rules. About 0 are common, 3 are distinctive, and 3 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.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 24
Use const objects with as const instead of enum.
- Very specific: line 30
Prefer type aliases for data, discriminated unions over optional-field soup, and readonly arrays for anything crossing a module boundary.
- Distinctive: line 39
Never substitute a default, a guess or a web-search answer for data a source did not return.
- Very specific: line 50
No secrets. .env.example documents every variable.
- Distinctive: line 51
No unused dependencies. Add a package in the same change that starts using it.
- Distinctive: line 52
Every file ends with a newline.
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 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: "TypeScript style, language policy, hygiene, shared domain vocabulary" alwaysApply: true --- # Code style ## Language - **Code, comments, identifiers, docstrings, commit messages: English.** - **Agent rule files and briefs** (`.cursor/rules/*.mdc`, `.claude/rules/*.md`, `AGENTS.md`, `CLAUDE.md`): English, unless the project owner asks otherwise; then switch every tree at once so the Rules Sync diff stays reviewable. - **User-facing product copy** (the trip board, the user guide): Russian, following the microcopy rules in `specs/05-interfeys.md`. - **Chat replies to the user: Russian.** ## TypeScript - Node >= 22.6, ESM only (`"type": "module"`). Relative imports carry the `.ts` extension; the toolchain runs TypeScript through Node's native type stripping, so only erasable syntax is allowed: no `enum`, no `namespace`, no parameter properties, no decorators. Use `const` objects with `as const` instead of `enum`. - `strict` is on, together with `noUncheckedIndexedAccess`, `exactOptionalPropertyTypes` and `verbatimModuleSyntax`. Type-only imports use `import type`. - **`any` is forbidden** and the linter enforces it. External payloads enter as `unknown` and are narrowed by an explicit parser in `src/sources/`. Everything downstream of that parser is a domain type. - Prefer `type` aliases for data, discriminated unions over optional-field soup, and readonly arrays for anything crossing a module boundary. - Named exports only; one clear responsibility per module. A file above roughly 300 lines is a signal to split, and a single file holding two thousand lines is an explicit reviewer complaint in `specs/08-repozitoriy.md`. ## Errors and absence - A missing field is `undefined` and stays visible as missing all the way to the UI. Never substitute a default, a guess or a web-search answer for data a source did not return. This is the product's core promise, not a style preference. - Throw typed errors carrying the source name and the arguments that failed (`class SourceError extends Error`), not bare strings. - Optional enrichment never throws outward: it resolves to `undefined` after its timeout and the caller renders the absence. ## Hygiene - No `TODO`, no commented-out code, no stub that returns a plausible value. The repository is read by an AI reviewer that scores exactly this. - No secrets. `.env.example` documents every variable; real values live in `.env`, ignored. - No unused dependencies. Add a package in the same change that starts using it. - Every file ends with a newline. - `console.log` is off outside `scripts/`; use `console.warn` and `console.error` for operational messages. ## Naming - Types and classes `PascalCase`; functions, variables and files `camelCase` for modules with a single export, `kebab-case` for multi-word file names (`build-trip.ts`). - Domain vocabulary is fixed and shared with the specs and the documentation: `TripRequest`, `TripResult`, `TripPackage`, `EventCard`, `CoverageNote`, `SkippedNote`, `Leg`, `HotelOffer`, `CheckoutLink`. Do not invent a synonym in a new module. - Tool names are identical in code, README, user guide and architecture diagram: `find_event_trips`, `get_trip_details`, `create_trip_checkout`. A mismatch between the diagram and the code was flagged by both reviewers of the plan; do not reintroduce it. ## Commands ```bash npm run typecheck # tsc --noEmit npm run lint # eslint . npm run lint:fix npm run verify # the full gate ``` ## References @architecture.mdc @testing.mdc
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.

