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.
npx agentmods add rules/brainy-builds/ts-inspect-cli/_code-rules-typescript-summarygit clone --depth 1 https://github.com/Brainy-Builds/ts-inspect-cliWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.04354 | $0.04354 |
| Opus 5 | $0.02177 | $0.02177 |
| Sonnet 5 | $0.00871 | $0.00871 |
| Haiku 4.5 | $0.00435 | $0.00435 |
Grade A, and why
_code-rules-TypeScript-summary 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.
How it starts
The opening of the file, as written. The whole thing — 176 lines — stays where its author put it; the contents beside it link to each section on GitHub.
This file is an always-applied concise summary of ./.cursor/rules/_code-rules-TypeScript.mdc.
Every rule below is binding; when a point is ambiguous or an edge case arises,
read the original ./.cursor/rules/_code-rules-TypeScript.mdc for the full
rationale, canonical code examples, and boundary clarifications.
PRINCIPLES
- DRY - one authoritative location for every piece of knowledge.
- SoC - each module and function owns exactly one concern.
- Modularity - small, named, independently testable units connected by stable typed interfaces.
- Readability - names and structure carry meaning; comments fill only gaps code cannot convey.
- Iterability - changes to one concern must not cascade into unrelated code.
FORMATTING
- Indent with 1 tab (\t) per level; never spaces.
- Double quotes ("…") for all string literals; template literals only for interpolation or multiline strings; never single quotes.
- Terminate every statement with a semicolon (;).
- Use only a plain hyphen-minus (-); never an en dash or em dash.
- Maximum 100 physical lines per named function/method (blank lines count; JSDoc above does not). Split responsibilities into smaller named functions when the limit would be exceeded.
TRAILING COMMAS & SEPARATORS
- Multiline array literals, object literals, and call-site argument lists: trailing comma after the last item.
- Formal parameter lists (non-empty): always a trailing comma after the last parameter, even on a single physical line (e.g.
function foo(bar: Baz,)). - Empty parameter lists: no comma inside
(). - Use commas to separate runtime lists (parameters, arguments, destructuring bindings, array/object elements, tuple element types). Generic lists
<T, U>andimport type { Foo, Bar }keep commas wherever TS/ECMAScript syntax requires them. - Use semicolons to separate members inside
interfacebodies and inline object-type shapes. Do not use;between tuple element types.
NAMING CONVENTIONS
camelCase: variables, functions, parameters (leading _ allowed for unused; no trailing _).UPPER_CASE: every hardcoded configuration literal assigned to aconst(timeouts, limits, HTTP methods, status codes, path segments, feature flags, multipliers). Shared styling classes also use UPPER_CASE. Runtime-varying data (request fields, parsed JSON, loop indices, intermediates) stays camelCase unless it is a true compile-time-style constant.PascalCase: classes, interfaces, type aliases.- No
Iprefix on interfaces (UserAccount, not IUserAccount). snake_casebindings only when mirroring an external schema (REST/JSON, DB rows, vendor SDKs). Keep snake_case local and aligned with upstream field names only where renaming would obscure protocol or storage reality.
NO MAGIC NUMBERS
- Never use a bare numeric literal directly in an expression. Assign it to a named
UPPER_CASE constfirst, then reference the binding. - Exception: obvious pure-bookkeeping indices such as
index + 1. - Domain-specific bare numbers (timeouts, HTTP codes, limits, geodetic bounds) must always be named first.
MULTILINE FORMATTING
- Arrays / objects: one element or property per physical line.
- Compound boolean predicates (&&, ||): one operand/sub-condition per physical line everywhere they appear - if, while, do…while, for-condition, ternary condition, const/let boolean bindings, return, throw.
- for-loop headers: one clause per physical line (initializer / condition / update).
- Non-empty function signatures:
async(if any),function, and name on one line followed by(; one parameter per physical line (each ends with a trailing comma); close with): ReturnType {on its own line. Empty parameter lists stay compact:function f(). - Inline object type annotations ({ … }): expand across multiple lines -
{alone, eachmember: Type;on its own line,}alone before=,),:,as, or the following token. Prefer atype/interfaceunder./src/types/**when the shape repeats.
VARIABLES
- Never
var. constby default;letonly when a binding must be reassigned.- Destructuring:
constwhen no binding in the pattern is reassigned;letwhen any binding needs reassignment. You cannot mark one bindingconstand anotherletin the same pattern - split into multiple declarations when only some fields must stay mutable. let/constare block-scoped with a temporal dead zone; prefer them overvarto avoid accidental reads before initialization and leakage across branches.
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.
- yesterday First seen · 176 lines · 4,354 tokens per session scan A 8bafc1948039
_code-rules-TypeScript-summary is a cursor rule published in the GitHub repository Brainy-Builds/ts-inspect-cli (2 stars, last pushed 12d ago), licensed MIT. It adds 4,354 tokens to every session, about $0.0218 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.
Other cursor rules, from other repositories
architecture
Architecture of openapi-to-cli (ocli).
testing
Test conventions for openapi-to-cli (Jest).
code-style
Code style for openapi-to-cli (TypeScript).
workflow
Workflow for openapi-to-cli.
codegraph
CodeGraph MCP usage guide — when to use which tool.
errors
ALWAYS use custom errors from src/errors.ts.