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/lambda-curry/medusa2-starterWrote 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/lambda-curry/medusa2-starter/typescript-patterns)<a href="https://agentmods.dev/rules/lambda-curry/medusa2-starter/typescript-patterns"><img src="https://agentmods.dev/badge/rules/lambda-curry/medusa2-starter/typescript-patterns/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/lambda-curry/medusa2-starter/typescript-patterns"><img src="https://agentmods.dev/badge/rules/lambda-curry/medusa2-starter/typescript-patterns.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.02969 | $0.02969 |
| Opus 5.5 | $0.01188 | $0.01188 |
| Sonnet 5.5 | $0.00594 | $0.00594 |
| Haiku 4.5 | $0.00297 | $0.00297 |
Grade A, and why
typescript-patterns 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 15d 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 — 512 lines — stays where its author put it; the contents beside it link to each section on GitHub.
TypeScript Development Patterns
You are an expert in TypeScript, modern JavaScript, and type-safe development practices.
Core TypeScript Principles
- Use strict TypeScript configuration
- Prefer type inference over explicit typing when clear
- Use union types and discriminated unions effectively
- Implement proper type guards and validation
- Leverage generic types for reusability
- Use
as constfor immutable data structures - Prefer interfaces over type aliases for object shapes
Type Definitions
Interface Design
// Use interfaces for object shapes
interface User {
readonly id: string
name: string
email: string
createdAt: Date
updatedAt: Date
}
// Use generic interfaces for reusability
interface ApiResponse<T> {
data: T
success: boolean
message?: string
}
// Extend interfaces for specialization
interface AdminUser extends User {
role: "admin" | "super_admin"
permissions: Permission[]
}
Union Types and Discriminated Unions
// Use discriminated unions for type safety
type PaymentStatus =
| { status: "pending"; pendingReason: string }
| { status: "completed"; completedAt: Date }
| { status: "failed"; error: string }
// Type guards for discriminated unions
function isCompletedPayment(
payment: PaymentStatus
): payment is Extract<PaymentStatus, { status: "completed" }> {
return payment.status === "completed"
}
Generic Types
// Generic utility types
type Optional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>
type RequiredFields<T, K extends keyof T> = T & Required<Pick<T, K>>
// Generic function types
type AsyncFunction<T extends any[], R> = (...args: T) => Promise<R>
// Generic class types
class Repository<T extends { id: string }> {
async findById(id: string): Promise<T | null> {
// Implementation
}
async create(data: Omit<T, "id">): Promise<T> {
// Implementation
}
}
Advanced Type Patterns
Conditional Types
// Conditional types for API responses
type ApiResult<T> = T extends string
? { message: T }
: T extends Error
? { error: T }
: { data: T }
// Mapped types for form validation
type ValidationErrors<T> = {
[K in keyof T]?: string[]
}
// Template literal types
type EventName<T extends string> = `${T}:created` | `${T}:updated` | `${T}:deleted`
type UserEvents = EventName<"user"> // "user:created" | "user:updated" | "user:deleted"
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.
- 15d ago First seen · 512 lines · 2,969 tokens per session scan A 4decfee034c1
typescript-patterns is a cursor rule published in the GitHub repository lambda-curry/medusa2-starter (164 stars, last pushed 17d ago), licensed MIT. It adds 2,969 tokens to every session, about $0.0119 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-11-15.
typescript-patterns compared with cursor rules from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| typescript-patternslambda-curry/medusa2-starter | Cursor rule | 164 | 17d ago | MIT | A | 2,969 | Cursor |
| vue-typescript-patternssoaring-xiongkulu/easyaiot | Cursor rule | 767 | 3d ago | MIT | A | 381 | Cursor |
| nextjs-typescript-app-cursorrules-prompt-filePatrickJS/awesome-cursorrules | Cursor rule | 41k | 6mo ago | CC0-1.0 | A | 66 | Cursor |
| tsun-pany/v3-admin-vite | Cursor rule | 7.1k | 4mo ago | MIT | A | 287 | Cursor |
| typescript-securityfmflurry/settings-opencode | Cursor rule | 170 | 24d ago | MIT | A | 0 | Cursor |
| naming-conventions-ruleholtwood/awesome-cursorrules-zh | Cursor rule | 244 | 1mo ago | MIT | A | 64 | Cursor |
| typescriptjeffgreendesign/textrawl | Cursor rule | 6 | 2d ago | MIT | A | 0 | Cursor |