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/jimmypocock/cursor-rules/typescriptgit clone --depth 1 https://github.com/jimmypocock/cursor-rulesWhat 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.00004 | $0.00753 |
| Opus 5 | $0.00002 | $0.00377 |
| Sonnet 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 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 — 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.
- yesterday 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. 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
90-devops-deployment
Docker, CI/CD, AWS, Vercel, and VPS deployment rules.
00-global-architect
Global default behavior for the entire repository.
55-data-model-versioning
Dataset versioning, model checkpoint management, and training reproducibility rules.
85-error-observability
Error handling, logging, and observability rules.
30-database-postgres
PostgreSQL and persistence rules.
35-api-contracts
API versioning, contracts, and schema evolution rules.