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/jimmypocock/cursor-rulesWrote 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/jimmypocock/cursor-rules/typescript)<a href="https://agentmods.dev/rules/jimmypocock/cursor-rules/typescript"><img src="https://agentmods.dev/badge/rules/jimmypocock/cursor-rules/typescript/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/jimmypocock/cursor-rules/typescript"><img src="https://agentmods.dev/badge/rules/jimmypocock/cursor-rules/typescript.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.00004 | $0.00753 |
| Opus 5.5 | $0.00002 | $0.00301 |
| Sonnet 5.5 | $0.00001 | $0.00151 |
| Haiku 4.5 | $0.00000 | $0.00075 |
Grade A, and why
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 1mo 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 — 96 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Description: TypeScript Development Standards Globs: **/.ts, **/.tsx, **/.mts, **/.cts
TypeScript Development Standards
@base.mdc
Core TypeScript Principles
- Leverage TypeScript's static typing to catch errors at compile time
- Avoid using
anytype unless absolutely necessary - Use type inference where it improves readability
- Define explicit return types for functions
- Create reusable type definitions for common patterns
- Take advantage of TypeScript's advanced type features when appropriate
Type Definitions
Naming
- Use PascalCase for interface and type names (e.g.,
UserProfile) - Prefix interfaces for React component props with component name (e.g.,
ButtonProps) - Use descriptive names that convey purpose (e.g.,
ApiResponserather than justResponse) - Avoid prefixing interfaces with 'I' (prefer
UseroverIUser)
Structure
- Use interfaces for object shapes primarily
- Use type aliases for unions, intersections, or complex types
- Prefer interfaces for public APIs to support declaration merging
- Keep type definitions close to where they are used
- Export types that are used across multiple files
Type Safety
- Enable strict type checking in
tsconfig.json - Use
unknowninstead ofanywhen type is unclear - Use union types to represent values that could be of different types
- Utilize generics for flexible, reusable code
- Add appropriate type guards when narrowing types
- Use
readonlymodifiers for immutable properties - Use
as constfor literal values when appropriate
Best Practices
Modern TypeScript Features
- Use optional chaining (
?.) to safely access nested properties - Use nullish coalescing (
??) to provide default values - Use template literal types for string manipulations
- Apply mapped types to transform existing types
- Use conditional types for type-level programming
- Leverage utility types (e.g.,
Partial<T>,Required<T>,Pick<T>,Omit<T>) - Use const assertions for readonly arrays and tuples
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.
- 1mo ago First seen · 96 lines · 4 tokens per session scan A cfb9beef8e13
typescript is a cursor rule published in the GitHub repository jimmypocock/cursor-rules (8 stars, last pushed 1y ago), licensed MIT. It adds 4 tokens to every session and 753 once invoked, about $0.0000 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-31.
Other cursor rules, from other repositories
20-frontend-nextjs
Next.js frontend rules.
typescript
Rules applied when working in TypeScript or JavaScript files.
10-backend-fastapi
FastAPI backend rules.
angular
Angular: signals, standalone components, RxJS patterns.
typescript
Strict TypeScript: generics, discriminated unions, no any.
bun
Bun runtime: Bun.serve, Bun.file, bundler, test runner.