monorepo-template / quality
Cursor rule18 starsChanged 59 days agoApache-2.0View on GitHub
Code style - OXC decides; thin handlers; unknown only at I/O boundaries; oxlint suppression form; strict tsconfig flags.
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 repository60 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/skills/vercel-react-best-practices/AGENTS.mdAGENTS.md
- hooks/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- hooks/CLAUDE.mdCLAUDE.md
- .cursor/rules/backend/hono-gateway.mdcCursor rule
- .cursor/rules/backend/ports.mdcCursor rule
- .cursor/rules/backend/service-bindings.mdcCursor rule
- .cursor/rules/backend/workers-cache.mdcCursor rule
- .cursor/rules/backend/workers-config.mdcCursor rule
- .cursor/rules/contracts/contracts.mdcCursor rule
- .cursor/rules/core/agent-instructions.mdcCursor rule
- .cursor/rules/core/boundaries.mdcCursor rule
- .cursor/rules/core/guardrails.mdcCursor rule
- .cursor/rules/core/turborepo.mdcCursor rule
- .cursor/rules/core/worktrees.mdcCursor rule
- .cursor/rules/frontend/react.mdcCursor rule
- .cursor/rules/frontend/tailwind.mdcCursor rule
- .cursor/rules/frontend/tanstack-query.mdcCursor rule
- .cursor/rules/frontend/tanstack-router.mdcCursor rule
- .cursor/rules/frontend/vite-config.mdcCursor rule
- .cursor/rules/ops/cd.mdcCursor rule
- .cursor/rules/ops/changesets.mdcCursor rule
- .cursor/rules/ops/ci.mdcCursor rule
- .cursor/rules/ops/previews.mdcCursor rule
- .cursor/rules/ops/quality-report.mdcCursor rule
- .cursor/rules/ops/release.mdcCursor rule
- .cursor/rules/quality/comments.mdcCursor rule
- .cursor/rules/quality/knip.mdcCursor rule
- .cursor/rules/quality/lint-config.mdcCursor rule
- .cursor/rules/quality/markdown-style.mdcCursor rule
- .cursor/rules/quality/naming.mdcCursor rule
- .cursor/rules/quality/simplicity.mdcCursor rule
- .cursor/rules/quality/testing.mdcCursor rule
- .cursor/rules/quality/typescript-config.mdcCursor rule
- .cursor/rules/tests/front-react.mdcCursor rule
- .cursor/rules/tests/hono-workers.mdcCursor rule
- cfSkill
- changesetSkill
- front-vitestSkill
- git-commitSkill
- honoSkill
- monorepo-agent-setupSkill
- playwright-cliSkill
- pnpmSkill
- react-doctorSkill
- reviewSkill
- review-stackSkill
- run-appSkill
- security-auditSkill
- skills-updateSkill
- tanstack-configSkill
- tanstack-devtoolsSkill
- tanstack-querySkill
- tanstack-routerSkill
- turborepoSkill
- ui-ux-design-best-practicesSkill
- vercel-react-best-practicesSkill
- workers-best-practicesSkill
- skills-updateSkill
The file
We split this code-style.mdc into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
Never annotate a literal wider than it is (const handlers: Record<string, Handler> = { start } drops the known key): keep inference or use …
≈ “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: "Code style - OXC decides; thin handlers; unknown only at I/O boundaries; oxlint suppression form; strict tsconfig flags."
alwaysApply: false
globs: apps/**/*.{ts,tsx},packages/**/*.ts
---
# Code Style
OXC decides style ([lint-config.mdc](lint-config.mdc)): match the surrounding file, let `oxfmt` decide layout, and fix every warning - any warning fails CI.
- Handlers (routes, tools) stay thin: validate at the boundary, delegate I/O to a client or service module, then map the response. No business logic inline in a handler.
- Derive types from their source of truth instead of hand-writing shapes ([contracts.mdc](../contracts/contracts.mdc)).
- `unknown` belongs only at an I/O boundary: a Zod parser, a type predicate's subject, an error / `cause` handler. Parse there and pass the domain type onward; never thread `unknown` / `object` / `Record<string, unknown>` through signatures or re-narrow with ad-hoc `typeof` chains.
- Never annotate a literal wider than it is (`const handlers: Record<string, Handler> = { start }` drops the known key): keep inference or use `satisfies`.
- Inline suppressions use the `oxlint-*` form only, with a reason (`// oxlint-disable-next-line <rule> -- <reason>`); `eslint-disable*` comments are ignored and fail CI as unused directives. An unsafe assertion that must stay carries `// oxlint-disable-next-line typescript/no-unsafe-type-assertion -- <invariant that makes it true>`.
## Strict compiler flags
`strict.json` in `@repo/typescript-config` rejects ordinary-looking code; write to these from the start:
| Flag | Forces |
|------|--------|
| `exactOptionalPropertyTypes` | An optional prop may be absent, never explicitly `undefined`: `{ x: undefined }` is not assignable to `{ x?: string }` - omit the key |
| `noUncheckedIndexedAccess` | Array and index-signature reads yield `T \| undefined`: narrow before use |
| `noPropertyAccessFromIndexSignature` | Index-signature keys use bracket notation, not dot |
| `verbatimModuleSyntax` | Type-only imports say `import type`, or they survive into JS |
| `erasableSyntaxOnly` | No runtime TS constructs - no `enum`, namespaces, or parameter properties (hence `as const` value sets) |
| `noImplicitOverride` | Subclass overrides are marked `override` |
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.

