project-doc-versioning-guard

project-doc-versioning-guard is a cursor rule for Cursor from TashanGKD/tashan-cursor-skills. It costs 1,462 tokens per session, scanned A, original, MIT.

A rule for keeping old versions of existing project Markdown documents before they are changed. It applies to project documents and excludes logs, code, new files, and other files covered by separate rules.

In plain words
What is it for?
Use it when editing existing project specifications, architecture notes, plans, test documents, standards, reports, or API contracts.
Why use it?
It prevents important documentation from being overwritten without a recoverable copy and change record.

Cursor rule for Cursor

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

Good fit Use it when editing existing project specifications, architecture notes, plans, test documents, standards, reports, or API contracts.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/tashangkd/tashan-cursor-skills/project-doc-versioning-guard
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 project-doc-versioning-guard

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

Your own site · 80×15
<a href="https://agentmods.dev/rules/tashangkd/tashan-cursor-skills/project-doc-versioning-guard"><img src="https://agentmods.dev/badge/rules/tashangkd/tashan-cursor-skills/project-doc-versioning-guard.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,462 This file is loaded in full into every session.
When invoked 1,462 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.01462 $0.01462
Opus 5 $0.00731 $0.00731
Sonnet 5 $0.00292 $0.00292
Haiku 4.5 $0.00146 $0.00146

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

Security

Grade A, and why

project-doc-versioning-guard 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 10d 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.

rules/project-doc-versioning-guard.mdc · 105 lines

How it starts

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

项目文档版本留痕规则(project-doc-versioning-guard)

设计对齐:代码用 git 管理版本 / Skill·Rule·Agent 用 skill-rule-修改规范 备份 / 认知结构文档用 cognitive-structure-write-guard 备份。 本规则补全最后一层:项目级产物文档


覆盖范围(必须执行留痕)

需要备份的文档(以下目录中已存在的 .md 文件):

  • 项目群/[任意项目]/ 下的所有文档(产品定义.md / 技术架构.md / 开发计划.md / DEPLOY_ARCH.md / 测试规范.md 等)
  • _内部总控/开发规范/ 下的所有规范文档
  • 测试工程师/ 目录下的规范性文档
  • 任何其他项目级「产物型」.md(报告、审核文档、API 合约等)

排除(不需备份)

  • 追加型日志任务日志.md / PENDING-EXPERIENCES.md / 系统日志.md / CO-BUILD-LOG.md(这些文件本身就是历史记录,只增不减)
  • 认知结构_内部总控/认知结构/L1_* / L1.5_*(由 cognitive-structure-write-guard.mdc 覆盖)
  • Skill/Rule/Agent 文件.cursor/skills/ / .cursor/rules/ / .cursor/agents/(由 skill-rule-修改规范 覆盖)
  • 代码文件.ts / .py / .tsx / .js 等(由 git 管理)
  • 新建文件:目标路径不存在时(无旧版本可备份)

强制执行步骤(4步,顺序不可跳过)

Step 1【读取版本信息】
        Read: [目标文件] 前10行
        → 找版本号(如 v1.1 / v0.5)
        → 若无版本号 → 视为 v1.0,备份为 v1.0,新版改为 v1.1

Step 2【备份到 history/】
        目标路径:[文件所在目录]/history/[文件名无.md]_v[当前版本]_[YYYYMMDD].md
        → 若 history/ 目录不存在 → Shell: mkdir -p [目录]/history/
        → cp [文件] [备份路径]
        → ⚠️ 必须确认备份文件存在后才继续,不可跳过

Step 3【执行修改】
        → 更新文件头部版本号(小修改 +0.1;重大重构 +1.0)
        → 执行原计划的修改内容(StrReplace 或 Write)

Step 4【追加变更记录】
        在文档末尾追加(若已有「## 变更记录」章节则在其内追加,否则新建):

        ---
        ## 变更记录(续)

        ### [新版本号] — [YYYY-MM-DD] — [本次修改一句话摘要]

        **修改内容**:[具体改了什么,为什么改]
        **备份路径**:`history/[文件名]_v[旧版本]_[日期].md`

违反后果

直接 Write/StrReplace 而未备份 → 旧版本永久丢失,无法恢复。


与现有留痕机制的关系

层级 机制 覆盖范围
代码层 Git .ts/.py/.tsx 等代码文件
认知结构层 cognitive-structure-write-guard.mdc L1/L1.5 认知文档
Skill/Rule/Agent 层 skill-rule-修改规范 .cursor/ 目录组件
项目文档层 本规则(project-doc-versioning-guard) 项目群/ 和规范文档

变更记录

v1.0 — 2026-03-23 — 初始创建

根因:系统性审计发现项目文档层(产品定义.md / 技术架构.md / 开发计划.md 等)是留痕机制的唯一空白层。L1 认知文档和 Skill 文件均有强制备份机制,但项目文档毫无保护——一次错误的 Write 调用会导致历史版本永久丢失。

设计决策

  • alwaysApply: false(条件触发):仅在修改项目文档时激活,不增加全局 context 负担
  • 覆盖范围:项目群/ + 开发规范/(新建文件、代码文件、追加型日志排除)
  • 四步强制流程:读取版本 → 备份 → 修改 → 追加变更记录

Read the full file on GitHub · 105 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. 10d ago First seen · 105 lines · 1,462 tokens per session scan A 60838d73606c

Subscribe to this mod's changes

project-doc-versioning-guard is a cursor rule published in the GitHub repository TashanGKD/tashan-cursor-skills (20 stars, last pushed 5mo ago), licensed MIT. It adds 1,462 tokens to every session, about $0.0073 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.