RULE

RULE is a cursor rule for Cursor from FuRongJun-1999/dsh-memory. It costs 7,898 tokens per session, scanned A, original, MIT.

A set of work rules injected into a coding-agent session. The rules cover how the agent searches memory, handles files and commands, verifies work, and records completed tasks.

In plain words
What is it for?
It is intended to guide agent behavior during coding sessions, including checking stored guidance first and documenting important task results.
Why use it?
The provided information describes operating procedures rather than a standalone coding capability, so its exact use beyond enforcing those procedures is not clear.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc). Also seen: mentions subagents.

Good fit It is intended to guide agent behavior during coding sessions, including checking stored guidance first and documenting important task results.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/furongjun-1999/dsh-memory/rule
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/FuRongJun-1999/dsh-memory

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

README.md
[![agentmods](https://agentmods.dev/badge/rules/furongjun-1999/dsh-memory/rule/github.svg)](https://agentmods.dev/rules/furongjun-1999/dsh-memory/rule)
Your own site
<a href="https://agentmods.dev/rules/furongjun-1999/dsh-memory/rule"><img src="https://agentmods.dev/badge/rules/furongjun-1999/dsh-memory/rule/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for RULE

Your own site · 80×15
<a href="https://agentmods.dev/rules/furongjun-1999/dsh-memory/rule"><img src="https://agentmods.dev/badge/rules/furongjun-1999/dsh-memory/rule.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 7,898 This file is loaded in full into every session.
When invoked 7,898 The same file — it is already loaded in full.
Security scan A 1 finding. 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.07898 $0.07898
Opus 5.5 $0.03159 $0.03159
Sonnet 5.5 $0.01580 $0.01580
Haiku 4.5 $0.00790 $0.00790

Measured 9d ago against content hash ecb128383e4d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

RULE scanned grade A with 1 finding 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 9d 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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

- **动作**:构造 argv 列表→subprocess.run(capture_output=True, text=True, encoding='utf-8', errors='replace')→env 带 PYTHONUTF8=1→shell=False;边界判据=本次调用是否产出非UTF-8字节流(纯MSYS工具与不起进程的内置工具豁免;原生Windows程序不豁免,须python包装或显式解码);仓内引用与文档路径一律写
.codebuddy/rules/lingshu-discipline/RULE.mdc · 212 lines

How it starts

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

工作纪律(工作纪律_认知图条目_v1.1)· 18 条

本文件由 scripts/render_discipline.py 从真源 docs/工作纪律_认知图条目_v1.1.json 渲染生成,请勿手改;改真源后重跑渲染。 真源指纹(SHA256 前16位):9486668b0dadac39

概述

工作纪律集: 4条方法论(理论先行/全面处理/白箱方法/根因) + 3条执行(验证/双副本/兜底) + 1条思考(中文思考/协作模式分级) + 1条保密(敏感信息隔离) + 3条图像线(选源护栏/历史查询优先/算法权威唯一) + 1条协作(访谈澄清:先问清再动手) + 1条合规(内容政策合规:公开产物过内容政策+隐私双清单) + 2条执行调度与运行环境(命令执行统一走python/UTF-8: 显式encoding+PYTHONUTF8=1, 规避GBK, 全仓文本与路径一律UTF-8(无BOM, 中文可进路径), 不做控制台兼容(取用走python), 公开面路径写相对路径(守 check_local_paths); 任务派发统一走蜂巢(zcode端的工作流工具为等效蜂巢工具——使用者2026-10-04裁定; 蜂巢功能完全完善之前可优先使用zcode工作流): 任何执行性任务经蜂巢spawn/submit执行并留痕, agent本体只做编排, L1出口=产物落点为只读判定(不改仓库/外部状态)可直跑须留痕) + 1条记忆闭环(任务收尾归档:每次任务执行完只将核心修改(内容/原因/位置/验证结论)按CCG六要素(功能名/生效条件/子功能/执行/验证方式/不适用条件)成文存入灵枢记忆, 不写中间过程; text 类缺要素即被写入闸门拒并当场返回缺失清单) + 1条信息获取(工作区索引优先: 查工作区文件先读 WORKSPACE_INDEX.md(仓根, 由 scripts/workspace_index.py 从 git 追踪面管线生成), 尚无则先跑 --write 生成再读, 不以重复全盘浏览代替; 索引是会陈化的手工件, 故须管线生成+机械守卫, 否则退化为误导源)

执行公约

约定 内容
0.1 会话起始先查记忆 动手前先调认知图入口——工具名随端:MCP 端 = server「mdcg」的 cg;DSH 端 = 内建基元 lingshu_cg(即下文所有 cg(...),同一服务勿因名字不同而猜测)。op 是必填参数(route/read/write/verify/review…),任何调用都显式传、勿省略。先 cg(op=route, intent=<任务意图>);命中纪律/知识则按其 execution.how 执行。禁止跳过此步直接改代码或跑命令。
0.2 命中即声明 命中纪律须在回复中输出该条 response.direct 原文(「按工作纪律第 N 条:…」)。这是「已执行」的唯一可观测证据;未声明即视为未执行。
0.3 产出即证据 「动作」栏要求的产出(判定单/检索结果/验证结论/归档节点 id)必须实际给出,缺失即未执行。
0.4 违规即归档 发现自己违反任一条 → 第 4 条归因 + 第 16 条写入灵枢记忆。隐瞒违规本身是更严重的违规。
0.5 例外不外溢 某条的「不适用」只豁免该条,不豁免其它条。

纪律路由表

1. 理论先行

  • 触发:重要项目|长期任务
  • 动作:识别项目级别→检索理论文档与既有实践→输出理论要点→再进入设计
  • 不适用:情感交互|闲聊
  • 声明:按工作纪律第1条: 理论先行——先查相关理论与既有实践再动手。

2. 全面处理

  • 触发:有相关记忆|有认知图|有对应权限
  • 动作:读任务要求→读工作记忆→查相关任务→(有成果:复用 | 无:设计+调研)
  • 不适用:情感交互|闲聊
  • 声明:按工作纪律第2条: 全面处理——先读任务/工作记忆, 有相关成果就在其上开发, 没有则先设计调研。

3. 白箱方法

  • 触发:trained_on_4docs_intro
  • 动作:识别任务条件→找知识/规则(并行递归)→精准执行; 正确→记录; 错误→找条件
  • 不适用:需要快速执行的短期事项|情感交互|闲聊
  • 声明:按工作纪律第3条: 白箱方法——用认知图【识别条件→找知识规则→精准执行】, 正确记录/错误找条件/不猜测/未验证不写入。

Read the full file on GitHub · 212 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. 9d ago Changed · +123 tokens per session ecb128383e4d
  2. 10d ago Changed · +158 tokens per session 5210ef40152c
  3. 11d ago Changed · +195 tokens per session d202360e6e29
  4. 12d ago Changed · +2 tokens per session a5d99fb8ebac
  5. 16d ago Changed · +117 tokens per session 0f2bdd6bedcc
  6. 17d ago Changed · +539 tokens per session deb9f71ada01
  7. 22d ago First seen · 212 lines · 6,764 tokens per session scan A ca732f79e2f5

Subscribe to this mod's changes

RULE is a cursor rule published in the GitHub repository FuRongJun-1999/dsh-memory (396 stars, last pushed today), licensed MIT. It adds 7,898 tokens to every session, about $0.0316 per session on Opus 5.5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-24.