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.
git clone --depth 1 https://github.com/TheSethRose/DevRulesWrote 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.
[](https://agentmods.dev/rules/thesethrose/devrules/typescript5)<a href="https://agentmods.dev/rules/thesethrose/devrules/typescript5"><img src="https://agentmods.dev/badge/rules/thesethrose/devrules/typescript5/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.
<a href="https://agentmods.dev/rules/thesethrose/devrules/typescript5"><img src="https://agentmods.dev/badge/rules/thesethrose/devrules/typescript5.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00932 | $0.00932 |
| Opus 5.5 | $0.00373 | $0.00373 |
| Sonnet 5.5 | $0.00186 | $0.00186 |
| Haiku 4.5 | $0.00093 | $0.00093 |
Grade A, and why
TypeScript5 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 3mo 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.
How it starts
The opening of the file, as written. The whole thing — 62 lines — stays where its author put it; the contents beside it link to each section on GitHub.
TypeScript Best Practices
tsconfig.json Configuration
- Enable
strictmode (or individual strict flags likestrictNullChecks,noImplicitAny,strictFunctionTypes, etc.). This is the most crucial step for leveraging TypeScript's safety features. - Configure
targetandmoduleappropriately for your runtime environment (e.g.,ES2022or higher for modern Node/browsers, appropriate module system likeNodeNextorESNext). - Set up
baseUrlandpathsfor non-relative module resolution if needed, especially in larger projects or monorepos. - Understand compiler options related to JSX (
jsx,jsxFactory, etc.) if using React/JSX. - Configure declaration file generation (
declaration,declarationMap,outDir) if building a library.
Type System & Definitions
- Avoid
any. Useunknownwhen the type is truly unknown and perform type checking/narrowing before use. - Use explicit types for function parameters, return values, and variable declarations where inference is not sufficient or clear.
- Prefer specific types over overly broad ones (e.g.,
stringoverany,"success" | "error"overstring). - Use
interfacefor defining the shape of objects or implementing classes. - Use
typefor creating aliases for unions, intersections, tuples, primitives, and using utility types. - Leverage built-in Utility Types (
Partial,Required,Readonly,Pick,Omit,Record, etc.) to manipulate existing types effectively. - Use Generics (
<T>) to create reusable components, functions, and types that can work over a variety of types. - Use
readonlymodifiers for properties that should not be reassigned after object creation. - Utilize Discriminated Unions (tagged unions) with literal types to create type-safe state machines or variant types.
Type Narrowing & Guards
- Rely on TypeScript's control flow analysis for automatic type narrowing (e.g., within
ifchecks,switchstatements,instanceofchecks). - Use
typeofchecks for primitives. - Use
instanceofchecks for classes. - Use the
inoperator to check for property existence. - Create custom Type Guard functions (
value is Type) for complex validation logic.
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.
- 3mo ago First seen · 62 lines · 932 tokens per session scan A 304d45225e9d
TypeScript5 is a cursor rule published in the GitHub repository TheSethRose/DevRules (26 stars, last pushed 1y ago), licensed MIT. It adds 932 tokens to every session, about $0.0037 per session on Opus 5.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-30.
TypeScript5 compared with cursor rules from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| TypeScript5TheSethRose/DevRules | Cursor rule | 26 | 1y ago | MIT | A | 932 | Cursor |
| pyspark-etl-best-practices-cursorrules-prompt-filePatrickJS/awesome-cursorrules | Cursor rule | 41k | 6mo ago | CC0-1.0 | A | 3,275 | Cursor |
| kotlin-ktor-development-cursorrules-prompt-filePatrickJS/awesome-cursorrules | Cursor rule | 41k | 6mo ago | CC0-1.0 | A | 2,078 | Cursor |
| kotlin-springboot-best-practices-cursorrules-prompt-filePatrickJS/awesome-cursorrules | Cursor rule | 41k | 6mo ago | CC0-1.0 | A | 1,518 | Cursor |
| nextjs-tanstack-query-cursorrules-prompt-filePatrickJS/awesome-cursorrules | Cursor rule | 41k | 6mo ago | CC0-1.0 | A | 1,847 | Cursor |
| go-backend-scalability-cursorrules-prompt-filePatrickJS/awesome-cursorrules | Cursor rule | 41k | 6mo ago | CC0-1.0 | A | 1,200 | Cursor |
| jest-unit-testing-cursorrules-prompt-filePatrickJS/awesome-cursorrules | Cursor rule | 41k | 6mo ago | CC0-1.0 | A | 935 | Cursor |