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/holtwood/awesome-cursorrules-zhWrote 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/holtwood/awesome-cursorrules-zh/typescript-with-mobx)<a href="https://agentmods.dev/rules/holtwood/awesome-cursorrules-zh/typescript-with-mobx"><img src="https://agentmods.dev/badge/rules/holtwood/awesome-cursorrules-zh/typescript-with-mobx.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.00712 |
| Opus 5 | $0.00000 | $0.00356 |
| Sonnet 5 | $0.00000 | $0.00142 |
| Haiku 4.5 | $0.00000 | $0.00071 |
Grade A, and why
typescript-with-mobx 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 3d 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.
What it actually says
- 对 MobX 使用 TypeScript 确保类型安全:
- 安装必要的类型定义:
- 对于 MobX 核心库和
mobx-react-lite,通常它们自带 TypeScript 类型定义。如果遇到类型错误,可能需要手动安装@types/mobx和@types/mobx-react-lite(如果它们不是内置的)。
- 对于 MobX 核心库和
- 使用装饰器(Decorators):
- MobX 推荐使用装饰器 (
@observable,@action,@computed) 来定义可观察状态、动作和计算值。在 TypeScript 中使用装饰器需要启用相应的编译器选项。 - 在
tsconfig.json中启用:{ "compilerOptions": { "experimentalDecorators": true, "emitDecoratorMetadata": true } } - 示例:
import { makeObservable, observable, action, computed } from 'mobx'; class UserStore { @observable name: string = 'John Doe'; @observable age: number = 30; constructor() { makeObservable(this); } @action setAge(newAge: number) { this.age = newAge; } @computed get isAdult() { return this.age >= 18; } }
- MobX 推荐使用装饰器 (
makeObservable或makeAutoObservable:- 对于 TypeScript 项目,推荐在类的
constructor中调用makeObservable(this)或makeAutoObservable(this)来明确地将类属性标记为可观察的。这比使用装饰器更现代,并且在某些环境中可能不需要额外的 Babel 配置。 - 示例(使用
makeObservable):import { makeObservable, observable, action, computed } from 'mobx'; class UserStore { name: string = 'John Doe'; age: number = 30; constructor() { makeObservable(this, { name: observable, age: observable, setAge: action, isAdult: computed, }); } setAge(newAge: number) { this.age = newAge; } get isAdult() { return this.age >= 18; } }
- 对于 TypeScript 项目,推荐在类的
- 类型推断与显式类型:
- TypeScript 能够很好地推断 MobX store 的类型,但在复杂场景下,显式地为属性、参数和返回值添加类型注解可以提高代码的可读性和健壮性。
- 接口和类型别名:
- 定义清晰的接口(
interface)或类型别名(type)来描述 MobX store 的状态结构和 action 的参数,有助于保持代码的一致性和可维护性。
- 定义清晰的接口(
- 与 React 组件结合:
- 在 React 函数式组件中使用
mobx-react-lite的observerHOC 或useObserverHook 时,确保组件 props 和 MobX store 访问的类型正确。
- 在 React 函数式组件中使用
- 安装必要的类型定义:
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.
- 3d ago First seen · 76 lines · 0 tokens per session scan A 9efc078248d0
typescript-with-mobx is a cursor rule published in the GitHub repository holtwood/awesome-cursorrules-zh (232 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 712 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
component-development
Modern React + TypeScript component patterns — hooks, typed props, performance optimization, forms, and testing.
ai-agent-specialist
Cursor rules for TypeScript, React, Node.js, clean architecture, testing, and WHY-oriented engineering guidance.
20-frontend-nextjs
Next.js frontend rules.
nextjs-tailwind-typescript-apps-cursorrules-prompt
Cursor rules for Next.js development with Tailwind CSS and TypeScript integration.
react-typescript
Rules for writing frontend code at PostHog (mostly React + Typescript with Kea).
coding-guidelines
React Native Expo SDK 54 project with TypeScript, Expo Router v6, Redux Toolkit, and modern development practices.