long-doc-governance

long-doc-governance is a skill for Claude Code, Codex from BackToCimaCoppi/Praxis. It costs 115 tokens per session (1,367 once invoked), scanned A, original, Apache-2.0.

A set of rules for managing long documents by checking their length and splitting them when substantial changes would make them too large.

In plain words
What is it for?
Use it when a document is too long, when a major change is being made to an already-large document, or when a length check reports a critical warning.
Why use it?
It helps keep design, testing, interface, and other project documents usable as they grow.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions AGENTS.md.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is bash .claude/hooks/pre-commit-check.sh.

Good fit Use it when a document is too long, when a major change is being made to an already-large document, or when a length check reports a critical warning.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/BackToCimaCoppi/Praxis
agentmods
npx agentmods add skills/backtocimacoppi/praxis/long-doc-governance

Made for: Claude Code, Codex.

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 long-doc-governance

README.md
[![agentmods](https://agentmods.dev/badge/skills/backtocimacoppi/praxis/long-doc-governance/github.svg)](https://agentmods.dev/skills/backtocimacoppi/praxis/long-doc-governance)
Your own site
<a href="https://agentmods.dev/skills/backtocimacoppi/praxis/long-doc-governance"><img src="https://agentmods.dev/badge/skills/backtocimacoppi/praxis/long-doc-governance/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 long-doc-governance

Your own site · 80×15
<a href="https://agentmods.dev/skills/backtocimacoppi/praxis/long-doc-governance"><img src="https://agentmods.dev/badge/skills/backtocimacoppi/praxis/long-doc-governance.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 115 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,367 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.00115 $0.01367
Opus 5 $0.00057 $0.00683
Sonnet 5 $0.00023 $0.00273
Haiku 4.5 $0.00012 $0.00137

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

Security

Grade A, and why

long-doc-governance 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 9d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/doc-length-check.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/long-doc-governance/SKILL.md · 124 lines

How it starts

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

长文档治理

1. 何时触发

三种入口(任一成立即触发本 skill):

  1. 增量触发:本轮任务要对某文档做"实质修改",且该文档行数 ≥ 强制阈值(见下方阈值表)
  2. 主动调用:用户说"帮我拆 XXX"、"这个文档太长了"
  3. 检测报告post-change-check 输出了 [CRITICAL] 行且本轮有实质修改

不触发:归档目录(默认匹配路径含「归档」的目录,项目可在配置里改)下的文档;CLAUDE.md / AGENTS.md / SKILL.md 不受管控。


2. 实质修改 vs 微改

实质修改(触发治理)

  • 新增章节或 H2/H3 标题
  • 新增接口、字段、业务规则
  • 改设计描述或状态流转
  • 重写段落(语义增量 > 20 行)

微改(豁免)

  • 错别字、纯排版调整
  • 链接修复、版本号 bump
  • 纯措辞润色(< 20 行改动)

自检方式git diff --stat 看增删行数;语义增量 > 20 行 或 新增 H2/H3 → 实质修改。

反例(不能当微改):重写一段 50 行的设计描述;把一个功能从一处搬到另一处;新增接口参数说明。


3. 阈值表

只对 docs/ 下业务文档生效;CLAUDE.md / AGENTS.md / SKILL.md 不扫描。

类型 覆盖范围 警告阈值 强制阈值
接口协议 / 测试 / Schema *接口**数据库**schema*04-测试/ 等路径模式(由项目自定义) 600 行 1000 行
设计文档 / 总控 01-需求/02-页面设计/03-技术设计/00-任务总控/(非归档)、施工蓝图 / goal 章程、任务总控、技术方案 800 行 1500 行

扫描命令:bash <本 skill 目录>/scripts/doc-length-check.sh --format human --scope <file>(脚本随本 skill 附带,默认阈值在同目录 doc-length-config.default.json,项目可用 .claude/doc-length-config.json 覆盖)


4. 拆分预算评估

拆分前先估算工作量:

预估时间 ≈ 目标文档行数 / 200 × 5 分钟

预估时间 > 主任务工作量 × 1.5停下来问用户三选一,不要自作主张:

<文件名> 共 X 行,拆分预估约 Y 分钟,主任务约 Z 分钟。建议: A. 先拆再做(一次付清) B. 单独排一个拆分任务,本次先改完 C. 本次例外,在任务级设计文档(轻量设计方案/任务总控)写明原因」


5. 拆分操作流程

步骤一:分析结构

grep -n "^## " <file>    # 列出所有 H2 标题与行号
wc -l <file>             # 总行数

识别业务边界(按功能模块,不按行数)。

步骤二:规划子文件

目标:每个子文件 < 警告阈值 × 70%。

拆分模板:

原文件: 03-01-前后端接口协议.md
↓
03-01-前后端接口协议/
  ├── 00-总览与公共约定.md   ← 鉴权、错误码、分页、命名约定
  ├── 01-用户模块.md
  ├── 02-订单模块.md
  └── 03-第三方集成.md

步骤三:执行拆分

  • 原文件改名并移入新目录,保留索引(00-总览 列各子文件链接)
  • 子文件路径遵守层级编号规则(NN-名称.md

步骤四:修复引用

# 全仓搜旧路径引用(.md / .java / .ts 均查)
grep -rn "旧文件名" . --include="*.md" --include="*.java" --include="*.ts"

逐个修复为新路径,确保 anchor 锚点仍然存在。

步骤五:验证

# 若项目存在文档层级检查门禁脚本(如 .claude/hooks/pre-commit-check.sh)则运行;没有则人工核对
bash .claude/hooks/pre-commit-check.sh

确认层级编号检查通过。

Read the full file on GitHub · 124 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 First seen · 124 lines · 115 tokens per session scan A 2444b659d803

Subscribe to this mod's changes

long-doc-governance is a skill published in the GitHub repository BackToCimaCoppi/Praxis (6 stars, last pushed 15d ago), licensed Apache-2.0. It adds 115 tokens to every session and 1,367 once invoked, about $0.0006 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-31.

Related

Other skills, from other repositories

notion-importer

A workflow for importing Notion, a workspace for documents and notes, into a project's local documentation vault through a connection to Notion.

Enakoneschniy/claude-dev-stack · 96 tokens

release-sync

Syncs latest release content to NotebookLM and HQ Knowledge Base after version tagging. Reads CHANGELOG, CLAUDE.md, and hook README, updates notebook sources, and ingests release digest. Optionally generates podcast from updated knowledge base. Use after tagging a new version to propagate release knowledge.

yonatangross/orchestkit · 62 tokens

neurolink-guide

Guide for using the NeuroLink SDK and CLI. Invoke when users ask how to use neurolink, integrate AI providers, add MCP tools, configure RAG, set up memory, deploy servers, or work with multimodal content. Covers SDK, CLI, providers, tools, and enterprise features.

juspay/neurolink · 65 tokens

github-commenting

How to post clean, rich, deduplicated GitHub PR review comments — suggestion blocks, multi-line anchors, markers, formatting rules. Load before posting or fixing any PR comment.

juspay/neurolink · 41 tokens

upload-artifact

Upload a file as a ClosedLoop document (PRD, implementation plan, feature, or template). Reads file content and uploads via MCP without consuming conversation context. Also supports creating new versions of existing documents. Triggers on: "upload artifact", "upload PRD", "upload implementation plan", "upload…

closedloop-ai/claude-plugins · 103 tokens

extract-plan-md

Sync plan.md with plan.json content. MUST be used after ANY edit to plan.json to keep plan.md in sync. Triggers: After editing plan.json with Edit tool (REQUIRED - always sync after edits) User asks to "sync plan.md", "update plan.md", "extract the md from a plan" Converting plan.json to markdown or viewing plan as…

closedloop-ai/claude-plugins · 99 tokens