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/TashanGKD/cognitive-osWrote 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/tashangkd/cognitive-os/fragment-before-direct-edit)<a href="https://agentmods.dev/rules/tashangkd/cognitive-os/fragment-before-direct-edit"><img src="https://agentmods.dev/badge/rules/tashangkd/cognitive-os/fragment-before-direct-edit.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.00071 | $0.00561 |
| Opus 5 | $0.00036 | $0.00280 |
| Sonnet 5 | $0.00014 | $0.00112 |
| Haiku 4.5 | $0.00007 | $0.00056 |
Grade A, and why
fragment-before-direct-edit 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 8d 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.
This is a copy
100% identical to fragment-before-direct-edit — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
What it actually says
碎片优先规则(Fragment Before Direct Edit)
核心原则
直接修改L1文档 vs 先记录为L2碎片再整合,这两种路径有本质区别:
| 直接修改 | 先记录碎片再整合 |
|---|---|
| 快,但跳过了关卡A(可能引入重复) | 稍慢,但经过检查 |
| 没有留下「这个想法的来龙去脉」 | 碎片记录了原始想法的背景 |
| 难以追溯「为什么加了这段」 | 碎片整合索引可追溯 |
| 适合:修改已有内容的表述 | 适合:加入全新的洞见或观点 |
触发条件
当用户说类似以下表述,且尚未明确说「直接改」时:
- 「我想在[文档]里加上X」
- 「[文档]的某章应该包含...」
- 「我觉得[文档]漏了一个点」
- 「[文档]需要补充...」
AI 应该做的事
在直接修改之前,先询问一次:
「这个新观点是加入[文档],还是先作为碎片记录后再整合?
直接修改:更快,适合修改已有表述、纠正错误 先记碎片:更严谨,适合加入全新洞见(会自动检查是否重复、标注关联)
[直接修改] [先记录为碎片]」
→ 用户选「直接修改」→ 触发 cognitive-update-knowledge Skill
→ 用户选「先记录为碎片」→ 触发 cognitive-capture-fragment Skill,之后自动问是否立即整合
例外情况(不需要询问,直接执行修改)
- 用户明确说「直接改」「不用记碎片了」
- 修改类型是纠正错别字/改格式/更新日期等非内容修改
- 用户正在执行某个 Skill 的中间步骤(已经走在整合流程里)
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.
- 8d ago First seen · 53 lines · 71 tokens per session scan A 210b5bb7ea14
fragment-before-direct-edit is a cursor rule published in the GitHub repository TashanGKD/cognitive-os (8 stars, last pushed 5mo ago), licensed MIT. It adds 71 tokens to every session and 561 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to fragment-before-direct-edit, differing in 0 lines, and is treated as a copy.
Other cursor rules, from other repositories
cognitive-l3-auto-log
An automatic logging rule for important changes to a cognitive-structure system. It appends dated entries to a system log after related skills run or key documents and records are changed.
cognitive-principle-check
A consistency check for adding new material to L1 cognitive-structure documents. It compares the new text with confirmed L1.5 principles, which are the system’s underlying rules.
profile-collector
A Chinese-language assistant for building and maintaining a structured researcher's profile. The profile records identity, skills, current needs, thinking style, motivation, personality, and an overall interpretation.
fragment-before-direct-edit
A rule for recording a new idea as a smaller knowledge fragment before adding it to a main knowledge document. It distinguishes new insights from corrections, formatting changes, and other direct edits.
memory-bank
You are an expert software engineer with a unique characteristic: your memory resets completely between sessions. This isn't a limitation - it's what drives you to maintain perfect documentation. At the beginning of each dialogue, you rely ENTIRELY on your Memory Bank to understand the project and continue work…
memory
Persistent memory graph — load graphindex.md at session start, follow task routing table, update after significant changes.