rule-hot-reload-system

rule-hot-reload-system is a cursor rule for Cursor from Mr-chen-05/rules-2.1-optimized. It costs 3,865 tokens per session, scanned A, original, MIT.

A rules-management system that watches rule and configuration files and reloads changes while the system is running. Hot reloading means applying changes without restarting the system.

In plain words
What is it for?
Use it to detect added, changed, removed, or renamed rule files and reload all rules, one rule, or a selected priority level.
Why use it?
It reduces the need to stop and restart a system whenever rules or their settings change.

Cursor rule for Cursor

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

Good fit Use it to detect added, changed, removed, or renamed rule files and…

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/mr-chen-05/rules-2.1-optimized/rule-hot-reload-system
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/Mr-chen-05/rules-2.1-optimized

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 rule-hot-reload-system

README.md
[![agentmods](https://agentmods.dev/badge/rules/mr-chen-05/rules-2.1-optimized/rule-hot-reload-system.svg)](https://agentmods.dev/rules/mr-chen-05/rules-2.1-optimized/rule-hot-reload-system)
Your own site
<a href="https://agentmods.dev/rules/mr-chen-05/rules-2.1-optimized/rule-hot-reload-system"><img src="https://agentmods.dev/badge/rules/mr-chen-05/rules-2.1-optimized/rule-hot-reload-system.svg" alt="Measured on agentmods" height="20"></a>
Per session 3,865 This file is loaded in full into every session.
When invoked 3,865 The same file — it is already loaded in full.
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.03865 $0.03865
Opus 5 $0.01932 $0.01932
Sonnet 5 $0.00773 $0.00773
Haiku 4.5 $0.00386 $0.00386

Measured 7d ago against content hash 7f4dbcb30bf4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

rule-hot-reload-system 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 7d 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.

global-rules/rule-hot-reload-system.mdc · 661 lines

How it starts

The opening of the file, as written. The whole thing — 661 lines — stays where its author put it; the contents beside it link to each section on GitHub.

🔄 规则热更新系统

动态演进: 规则无缝更新,系统持续运行,零停机时间,极致用户体验。

一、更新触发机制

1.1 文件监控

监控范围: 目标目录: - .rules/ (所有规则文件) - global-rules/ (全局规则源) - project-rules/ (项目规则源)

监控文件类型: - *.mdc (规则定义文件) - main.md (规则索引文件) - *.yaml (配置文件)

监控事件: 文件修改: - 内容变化检测 - 修改时间更新 - 文件大小变化

文件操作: - 新增文件 - 删除文件 - 重命名文件 - 移动文件

元数据变化: - 权限修改 - 属性变化 - frontmatter更新

监控实现: 技术方案: - 文件系统监控API - 定期轮询检查 - 哈希值对比 - 修改时间戳

监控频率: - 实时监控: 文件系统事件 - 定期检查: 每30秒 - 完整扫描: 每5分钟

1.2 触发条件

自动触发: 文件内容变化: - 规则逻辑修改 - 优先级调整 - 配置参数变更 - 元数据更新

结构变化: - 新增规则文件 - 删除规则文件 - 目录结构调整

立即生效条件: - P0级规则变更 - 安全规则更新 - 紧急修复补丁

手动触发: 用户命令: - /reload-rules: 重新加载所有规则 - /reload-rule [filename]: 重新加载指定规则 - /reload-priority [level]: 重新加载指定优先级规则

管理操作: - 规则发布命令 - 配置更新命令 - 系统维护命令

延迟触发: 批量更新: - 检测到连续修改 - 延迟5秒统一更新 - 避免频繁重载

计划更新: - 指定时间触发 - 低峰期更新 - 维护窗口执行

1.3 变更检测

哈希对比: 文件指纹: - 计算文件MD5/SHA256 - 与缓存哈希对比 - 检测内容变化

增量检测: - 仅检查修改文件 - 跳过未变化文件 - 优化检测性能

内容分析: 结构化diff: - frontmatter变化 - 规则内容变化 - 优先级变更 - 依赖关系变化

影响评估: - 变更范围 - 影响模块 - 兼容性 - 风险等级

版本追踪: 版本号比对: - 读取version字段 - 对比当前版本 - 识别升级/降级 - 兼容性检查

二、更新流程

2.1 变更检测阶段

文件扫描: 步骤1 - 收集变更: - 列出所有变化文件 - 记录变更类型 - 提取变更内容

步骤2 - 计算哈希: - 为每个文件计算哈希 - 与缓存对比 - 确认实际变更

步骤3 - 识别影响: - 分析变更范围 - 识别依赖关系 - 评估影响面

2.2 验证检查阶段

语法验证: frontmatter检查: - YAML格式正确 - 必需字段存在 - 字段类型正确 - 值范围合法

内容验证: - Markdown格式 - 代码块语法 - 链接有效性 - 引用正确性

优先级验证: 冲突检查: - 检测重复优先级 - 验证范围合法性 - 确认层级正确

范围验证: - P0: 1100-1200 - P1: 1000-1099 - P2: 900-999 - P3: 800-899 - P4: 700-799 - P5: 600-699 - P6: 500-599 - P7: 300-499

依赖检查: 引用验证: - 检查文件引用 - 验证规则引用 - 确认依赖存在

循环检测: - 检测循环依赖 - 识别死锁风险 - 建议修复方案

Read the full file on GitHub · 661 lines

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. 7d ago First seen · 661 lines · 3,865 tokens per session scan A 7f4dbcb30bf4

Subscribe to this mod's changes

rule-hot-reload-system is a cursor rule published in the GitHub repository Mr-chen-05/rules-2.1-optimized (172 stars, last pushed 10mo ago), licensed MIT. It adds 3,865 tokens to every session, about $0.0193 per session on Opus 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-08-30.