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/chihebnabil/lovable-boilerplate/typescriptgit clone --depth 1 https://github.com/chihebnabil/lovable-boilerplateWhat 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.00000 | $0.01023 |
| Opus 5 | $0.00000 | $0.00511 |
| Sonnet 5 | $0.00000 | $0.00205 |
| Haiku 4.5 | $0.00000 | $0.00102 |
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 2d 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 — 186 lines — stays where its author put it; the contents beside it link to each section on GitHub.
TypeScript & Utilities Rules
Shared Type Definitions
Core Application Types
// lib/types.ts - Always define shared types here
export interface User {
id: string
email: string
name: string
avatar?: string
role: UserRole
createdAt: string
updatedAt: string
}
export interface ApiResponse<T> {
data: T
message: string
success: boolean
meta?: {
total: number
page: number
limit: number
}
}
export type UserRole = 'admin' | 'user' | 'guest'
export type Theme = 'light' | 'dark' | 'system'
export type LoadingState = 'idle' | 'loading' | 'success' | 'error'
Form Type Patterns
// Derive form types from Zod schemas
export type UserFormData = z.infer<typeof userSchema>
export type CreateUserData = z.infer<typeof createUserSchema>
export type UpdateUserData = z.infer<typeof updateUserSchema>
// Component prop types
export interface UserCardProps {
user: User
onEdit: (id: string) => void
onDelete: (id: string) => void
className?: string
}
Utility Functions
Keep Existing cn Function
// lib/utils.ts - NEVER modify this function
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
Common Utility Patterns
// Date formatting
export function formatDate(date: Date | string, format?: string): string {
return new Intl.DateTimeFormat('en-US', {
year: 'numeric',
month: 'short',
day: 'numeric',
...format
}).format(new Date(date))
}
// Debounce utility
export function debounce<T extends (...args: any[]) => any>(
func: T,
wait: number
): (...args: Parameters<T>) => void {
let timeout: NodeJS.Timeout
return (...args: Parameters<T>) => {
clearTimeout(timeout)
timeout = setTimeout(() => func(...args), wait)
}
}
// Sleep utility for demos/testing
export const sleep = (ms: number) => new Promise(resolve => setTimeout(resolve, ms))
Constants Organization
API and Route Constants
// lib/constants.ts
export const API_ENDPOINTS = {
USERS: '/api/users',
PRODUCTS: '/api/products',
AUTH: '/api/auth',
} as const
export const QUERY_KEYS = {
USERS: 'users',
PRODUCTS: 'products',
USER_PROFILE: 'user-profile',
} as const
export const ROUTES = {
HOME: '/',
DASHBOARD: '/dashboard',
USERS: '/users',
PROFILE: '/profile',
} as const
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.
- 2d ago First seen · 186 lines · 0 tokens per session scan A 8f5d365ec288
typescript is a cursor rule published in the GitHub repository chihebnabil/lovable-boilerplate (65 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,023 tokens. 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.
Other cursor rules, from other repositories
standard-back-end-typescript-clean-code-practices
This standard establishes clean code practices in TypeScript for back-end development to enhance maintainability and ensure consistent patterns across services. It covers logging best practices, error... .
standard-typescript-good-practices
Generic practices that can be applied for all TS code in our app .
typescript-strict
Strict TypeScript boundaries — no any, Zod validation, explicit return types.
mcp
Guidelines for implementing and interacting with the Task Master MCP Server.
new_features
Guidelines for integrating new features into the Task Master CLI.
tests
Guidelines for implementing and maintaining tests for Task Master CLI.