_code-rules-TypeScript

A writing rule that removes boilerplate and keeps responses focused on the essential information.

In plain words
What is it for?
Writing concise answers, presenting multi-step instructions, marking uncertainty or destructive actions, and checking references before mentioning files or settings.
Why use it?
It reduces filler, repeated summaries, unnecessary choices, and other wording that makes answers harder to scan.

Cursor rule for Cursor

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.

agentmods
npx agentmods add rules/brainy-builds/ts-inspect-cli/_code-rules-typescript
Clone the repo
git clone --depth 1 https://github.com/Brainy-Builds/ts-inspect-cli

Made for: Cursor.

Per session 24,603 This file is loaded in full into every session.
When invoked 24,603 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.24603 $0.24603
Opus 5 $0.12301 $0.12301
Sonnet 5 $0.04921 $0.04921
Haiku 4.5 $0.02460 $0.02460

Measured yesterday against content hash 403fb6b11543, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

_code-rules-TypeScript 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 yesterday.

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/_code-rules-TypeScript.mdc · 2,505 lines

How it starts

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

NodeJS / BunJS + TypeScript Code Rules


Principles

These rules enforce five core architectural principles. Every section in this document serves at least one of them.

Principle What it means
DRY (Do Not Repeat Yourself) Each piece of knowledge - a constant, a type shape, a guard, a computation - has exactly one authoritative location. Duplication forces parallel edits and risks silent divergence.
SoC (Separation of Concerns) Each module and function owns exactly one concern. Mixing I-O, validation, and transformation in one place makes any of the three harder to change independently.
Modularity Units are small, named, independently testable, and connected by stable typed interfaces. Adding or replacing a module must not require editing unrelated code.
Readability Code communicates intent to the next reader without guesswork. Names, structure, and formatting carry the meaning; comments fill only the gaps that code cannot convey.
Iterability A change to one concern does not cascade unpredictably into unrelated code. This is the natural result of applying DRY, SoC, and Modularity together.

Code Readability

Consistent Conventions

  • Indentation: Use 1 tab (\t) per indent level. Nested blocks increase indent by one level (1 tab (\t)).

  • String literals: Use double quotes ("...") for normal string literals. Use template literals (`${expression}` or multi-line `...`) only when you need interpolation or a multi-line string body. Do not use single-quoted ('...') string literals.

  • Hyphens / dashes: Always use only a plain hyphen-minus (-) wherever you need a dash. Never use an en dash () or em dash ().

  • Semicolons: Terminate statements with semicolons (;). Apply semicolons consistently in TypeScript source (imports, exports, declarations, assignments, return statements, and similar statement forms).

Read the full file on GitHub · 2,505 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. yesterday First seen · 2,505 lines · 24,603 tokens per session scan A 403fb6b11543

Subscribe to this mod's changes

_code-rules-TypeScript is a cursor rule published in the GitHub repository Brainy-Builds/ts-inspect-cli (2 stars, last pushed 12d ago), licensed MIT. It adds 24,603 tokens to every session, about $0.1230 per session on Opus 5. 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-08-31.