Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/heyAyushh/staccnpx agentmods add rules/heyayushh/stacc/typescriptWrote 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/heyayushh/stacc/typescript)<a href="https://agentmods.dev/rules/heyayushh/stacc/typescript"><img src="https://agentmods.dev/badge/rules/heyayushh/stacc/typescript.svg" alt="Measured on agentmods" 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.00000 | $0.02196 |
| Opus 5 | $0.00000 | $0.01098 |
| Sonnet 5 | $0.00000 | $0.00439 |
| Haiku 4.5 | $0.00000 | $0.00220 |
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 4d 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 — 313 lines — stays where its author put it; the contents beside it link to each section on GitHub.
TypeScript Best Practices (for JS/JSX Type-Checking)
This guide outlines essential TypeScript best practices for teams working with JavaScript or JSX files that are type-checked by TypeScript (e.g., via tsconfig.json with allowJs and/or JSDoc annotations). While many examples use native TypeScript syntax for clarity and conciseness, the underlying principles and type-safety benefits apply directly to your .js/.jsx codebase.
1. Enable Strict Mode in tsconfig.json
This is the single most impactful change you can make. strict: true enables a suite of crucial checks that catch the vast majority of common type-related bugs at compile time.
Action: Ensure your tsconfig.json includes:
// tsconfig.json
{
"compilerOptions": {
"strict": true, // Enables all strict type-checking options
"noImplicitAny": true, // Catches untyped variables/parameters
"strictNullChecks": true, // Prevents `null`/`undefined` access without checks
"strictPropertyInitialization": true, // Ensures class properties are initialized
"allowJs": true, // Crucial for type-checking .js/.jsx files
"checkJs": true, // Enables type-checking in .js/.jsx files
// ... other options
},
"include": ["**/*.js", "**/*.jsx"] // Ensure your JS/JSX files are included
}
2. Define Clear Type Contracts
Use interfaces and type aliases to describe the shape of your data, especially for API payloads, component props, and complex objects. For .js/.jsx files, leverage JSDoc to apply these types.
✅ GOOD: Interfaces for Object Shapes & Classes
Interfaces are ideal for defining the shape of objects and for implementing explicit contracts when working with classes. Define these in .d.ts or .ts files, then reference them in JSDoc.
// types.d.ts or types.ts
interface UserProfile {
id: string;
name: string;
email: string;
age?: number; // Optional property
}
interface Point {
readonly x: number;
readonly y: number;
}
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.
- 4d ago First seen · 313 lines · 0 tokens per session scan A 25aba04f0c46
typescript is a cursor rule published in the GitHub repository heyAyushh/stacc (3 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,196 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-09-03.
Other cursor rules, from other repositories
vue-typescript-patterns
A set of coding rules for Vue 3 projects using TypeScript, a language that adds type checking to JavaScript. It covers component structure, file locations, TypeScript usage, and Pinia, a library for shared application state.
nextjs-typescript-app-cursorrules-prompt-file
Cursor rules for Next.js development with TypeScript integration.
ts
A set of TypeScript coding rules covering types, naming, file organization, error handling, and strict type checking. TypeScript is JavaScript with checks that help catch many mistakes before the program runs.
platform-pattern-2-filesystem-operations
Cursor rule "platform-pattern-2-filesystem-operations" from PaulJPhilp/EffectPatterns, covering platform pattern 2: filesystem operations and example.
handle-unexpected-errors-by-inspecting-the-cause
Cursor rule "handle-unexpected-errors-by-inspecting-the-cause" from PaulJPhilp/EffectPatterns, covering handle unexpected errors by inspecting the cause and example.
modeling-tagged-unions-with-datacase
Cursor rule "modeling-tagged-unions-with-datacase" from PaulJPhilp/EffectPatterns, covering modeling tagged unions with data.case and example.