code-style

code-style is a cursor rule for Cursor from louisbrulenaudet/monorepo-template. It costs 0 tokens per session (543 once invoked), scanned A, original, Apache-2.0.

A repository-specific guide for formatting, linting, and structuring TypeScript code. It explains how route and tool handlers should delegate work and how to fix, rather than hide, lint errors.

In plain words
What is it for?
Use it when writing handlers, changing lint or format rules, or deciding where validation and input/output code belongs.
Why use it?
It prevents personal formatting choices, misplaced business logic, and ignored warnings from causing inconsistent code or failed CI checks.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when writing handlers, changing lint or format rules, or deciding where validation and input/output code belongs.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/louisbrulenaudet/monorepo-template/code-style
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/louisbrulenaudet/monorepo-template

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for code-style

README.md
[![agentmods](https://agentmods.dev/badge/rules/louisbrulenaudet/monorepo-template/code-style/github.svg)](https://agentmods.dev/rules/louisbrulenaudet/monorepo-template/code-style)
Your own site
<a href="https://agentmods.dev/rules/louisbrulenaudet/monorepo-template/code-style"><img src="https://agentmods.dev/badge/rules/louisbrulenaudet/monorepo-template/code-style/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for code-style

Your own site · 80×15
<a href="https://agentmods.dev/rules/louisbrulenaudet/monorepo-template/code-style"><img src="https://agentmods.dev/badge/rules/louisbrulenaudet/monorepo-template/code-style.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 543 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00543
Opus 5.5 $0.00000 $0.00217
Sonnet 5.5 $0.00000 $0.00109
Haiku 4.5 $0.00000 $0.00054

Measured 23d ago against content hash f9752aec0028, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

code-style scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 23d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/quality/code-style.mdc · 29 lines

How it starts

The opening of the file, as written. The whole thing — 29 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Code Style

OXC decides style (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).
  • 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

Read the full file on GitHub · 29 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 23d ago Changed · +8 lines f9752aec0028
  2. 25d ago Changed · +1 lines d84d1606891a
  3. 27d ago Changed · +3 lines 27a9f276dfc3
  4. 1mo ago First seen · 17 lines · 0 tokens per session scan A ad3150189557

Subscribe to this mod's changes

code-style is a cursor rule published in the GitHub repository louisbrulenaudet/monorepo-template (19 stars, last pushed today), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 543 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.