mobx-strict-mode

mobx-strict-mode is a cursor rule for Cursor from holtwood/awesome-cursorrules-zh. It costs 0 tokens per session (476 once invoked), scanned A, original, MIT.

Guidance for enabling MobX strict mode, which requires observable state changes to happen inside actions.

In plain words
What is it for?
Use it to enforce action-based state updates and detect invalid changes while developing a MobX application.
Why use it?
It catches accidental direct changes during development and makes the application's data flow easier to trace.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit Use it to enforce action-based state updates and detect invalid changes while developing a MobX application.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/holtwood/awesome-cursorrules-zh/mobx-strict-mode
Install

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.

Clone the repo
git clone --depth 1 https://github.com/holtwood/awesome-cursorrules-zh

Made for: Cursor.

Wrote 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.

agentmods badge for mobx-strict-mode

README.md
[![agentmods](https://agentmods.dev/badge/rules/holtwood/awesome-cursorrules-zh/mobx-strict-mode.svg)](https://agentmods.dev/rules/holtwood/awesome-cursorrules-zh/mobx-strict-mode)
Your own site
<a href="https://agentmods.dev/rules/holtwood/awesome-cursorrules-zh/mobx-strict-mode"><img src="https://agentmods.dev/badge/rules/holtwood/awesome-cursorrules-zh/mobx-strict-mode.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 476 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00476
Opus 5 $0.00000 $0.00238
Sonnet 5 $0.00000 $0.00095
Haiku 4.5 $0.00000 $0.00048

Measured 5d ago against content hash 71f2f00d2aa6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

mobx-strict-mode 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 5d 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.

docs/rules/frontend/react/mobx/mobx-strict-mode.mdc · 33 lines

What it actually says

  • 为 MobX 实现严格模式以获得更好的调试体验
    • 什么是严格模式
      • MobX 的严格模式(Strict Mode)是一种开发辅助功能,它强制所有状态修改都必须通过 action 进行。这意味着你不能在 action 之外直接修改任何可观察状态。
      • 启用严格模式有助于在开发阶段捕获意外的状态修改,从而避免难以调试的 bug。
    • 如何启用
      • 在应用程序的入口文件或 MobX store 的初始化阶段,使用 configure 函数来启用严格模式。
      • 示例:
        import { configure } from 'mobx';
        
        // 仅在开发环境启用严格模式
        if (process.env.NODE_ENV === 'development') {
          configure({
            enforceActions: 'always',
          });
        }
        
      • enforceActions 的可选值:
        • 'never' (默认):允许在任何地方修改状态。
        • 'observed':只允许在 action 中修改被 MobX 观察到的状态。
        • 'always':强制所有状态修改都必须在 action 中进行,这是最严格的模式,推荐在开发环境使用。
    • 优点
      • 早期错误检测:在开发阶段就能发现并修复不规范的状态修改,避免潜在的运行时问题。
      • 清晰的数据流:强制通过 action 修改状态,使得应用程序的数据流更加清晰和可预测。
      • 更好的调试体验:当状态修改不符合规则时,MobX 会抛出错误,帮助开发者快速定位问题。
    • 注意事项
      • 严格模式主要用于开发环境,不建议在生产环境中使用,因为它会增加一些运行时开销。
      • 确保所有状态修改都包裹在 action 中,包括异步操作中的状态更新。
Changes

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.

  1. 5d ago First seen · 33 lines · 0 tokens per session scan A 71f2f00d2aa6

Subscribe to this mod's changes

mobx-strict-mode 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 476 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.