fragment-before-direct-edit

fragment-before-direct-edit is a cursor rule for Cursor from TashanGKD/tashan-cursor-skills. It costs 71 tokens per session (561 once invoked), scanned A, original, MIT.

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.

In plain words
What is it for?
Use it when someone proposes adding a new point to a knowledge document and has not explicitly asked for a direct edit.
Why use it?
It preserves the idea's background and allows duplicate or related content to be checked before the main document changes.

Cursor rule for Cursor

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

Good fit Use it when someone proposes adding a new point to a knowledge document and has not explicitly asked for a direct edit.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/tashangkd/tashan-cursor-skills/fragment-before-direct-edit
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/TashanGKD/tashan-cursor-skills

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 fragment-before-direct-edit

README.md
[![agentmods](https://agentmods.dev/badge/rules/tashangkd/tashan-cursor-skills/fragment-before-direct-edit/github.svg)](https://agentmods.dev/rules/tashangkd/tashan-cursor-skills/fragment-before-direct-edit)
Your own site
<a href="https://agentmods.dev/rules/tashangkd/tashan-cursor-skills/fragment-before-direct-edit"><img src="https://agentmods.dev/badge/rules/tashangkd/tashan-cursor-skills/fragment-before-direct-edit/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 fragment-before-direct-edit

Your own site · 80×15
<a href="https://agentmods.dev/rules/tashangkd/tashan-cursor-skills/fragment-before-direct-edit"><img src="https://agentmods.dev/badge/rules/tashangkd/tashan-cursor-skills/fragment-before-direct-edit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 71 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 561 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.00071 $0.00561
Opus 5 $0.00036 $0.00280
Sonnet 5 $0.00014 $0.00112
Haiku 4.5 $0.00007 $0.00056

Measured 11d ago against content hash 210b5bb7ea14, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

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 11d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

rules/fragment-before-direct-edit.mdc · 53 lines

What it actually says

碎片优先规则(Fragment Before Direct Edit)

核心原则

直接修改L1文档 vs 先记录为L2碎片再整合,这两种路径有本质区别:

直接修改 先记录碎片再整合
快,但跳过了关卡A(可能引入重复) 稍慢,但经过检查
没有留下「这个想法的来龙去脉」 碎片记录了原始想法的背景
难以追溯「为什么加了这段」 碎片整合索引可追溯
适合:修改已有内容的表述 适合:加入全新的洞见或观点

触发条件

当用户说类似以下表述,且尚未明确说「直接改」时:

  • 「我想在[文档]里加上X」
  • 「[文档]的某章应该包含...」
  • 「我觉得[文档]漏了一个点」
  • 「[文档]需要补充...」

AI 应该做的事

在直接修改之前,先询问一次:

「这个新观点是加入[文档],还是先作为碎片记录后再整合?

直接修改:更快,适合修改已有表述、纠正错误 先记碎片:更严谨,适合加入全新洞见(会自动检查是否重复、标注关联)

[直接修改] [先记录为碎片]」

→ 用户选「直接修改」→ 触发 cognitive-update-knowledge Skill → 用户选「先记录为碎片」→ 触发 cognitive-capture-fragment Skill,之后自动问是否立即整合


例外情况(不需要询问,直接执行修改)

  • 用户明确说「直接改」「不用记碎片了」
  • 修改类型是纠正错别字/改格式/更新日期等非内容修改
  • 用户正在执行某个 Skill 的中间步骤(已经走在整合流程里)
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. 11d ago First seen · 53 lines · 71 tokens per session scan A 210b5bb7ea14

Subscribe to this mod's changes

fragment-before-direct-edit is a cursor rule published in the GitHub repository TashanGKD/tashan-cursor-skills (20 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. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.