forge-doc-policy

forge-doc-policy is a skill for Claude Code from yike-gunshi/forge-skills. It costs 140 tokens per session (1,539 once invoked), scanned A, original, MIT.

A Chinese-language rulebook for managing project documentation under the docs/ directory. It defines approved document locations, required metadata, and how documents are kept current or archived.

In plain words
What is it for?
Use it when deciding where to put documentation, organising a docs/ directory, adding document metadata, or setting up a new project’s documentation structure.
Why use it?
It helps prevent documents from being saved in inconsistent places or losing the information needed to identify their status and source of truth.

Skill for Claude Code

Written for Claude Code: PreToolUse hook event. Also seen: reads .claude/ paths; mentions CLAUDE.md.

Good fit Use it when deciding where to put documentation, organising a docs/ directory, adding document metadata, or setting up a new project’s documentation structure.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/yike-gunshi/forge-skills/forge-doc-policy
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.

Any agent
npx skills add yike-gunshi/forge-skills --skill forge-doc-policy
Clone the repo
git clone --depth 1 https://github.com/yike-gunshi/forge-skills

Made for: Claude Code.

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 forge-doc-policy

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/yike-gunshi/forge-skills/forge-doc-policy"><img src="https://agentmods.dev/badge/skills/yike-gunshi/forge-skills/forge-doc-policy.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 140 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,539 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.00140 $0.01539
Opus 5 $0.00070 $0.00770
Sonnet 5 $0.00028 $0.00308
Haiku 4.5 $0.00014 $0.00154

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

Security

Grade A, and why

forge-doc-policy 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.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/init-project.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/forge-doc-policy/SKILL.md · 104 lines

How it starts

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

/forge-doc-policy:文档落地治理规范

这是一个规范型 skill,不主动产出代码或文档,作为其他 forge-* skill 和 LLM 自觉行为的当前真相源

全程中文。


设计目标

解决三层文档治理痛点:

层级 痛点 本 skill 提供
写时约束 AI 创建文档时落到错位置(forge skill 部分约束 + CLAUDE.md 表不全 + 直接对话完全无约束) doc-paths.md 三层白名单 + LLM 强校验铁律
读时索引 文档分散,找不到最新信息 frontmatter-schema.md(索引自动生成脚本规划中,见 CHANGELOG Roadmap)
生命周期 不带元数据,分不清活/死文档 frontmatter-schema.md 必填字段(批量回填脚本规划中,见 CHANGELOG Roadmap)

文件清单(仅列已实现的文件)

文件 作用
SKILL.md 本文件,元信息和装载说明
doc-paths.md 当前真相源、模块附录、active 工作区、archive 白名单
frontmatter-schema.md frontmatter 字段定义(4 必填 + 2 选填)
claude-md-snippet.md 项目 CLAUDE.md 复制粘贴的引用段
CHANGELOG.md 版本号 + 演进记录 + 规划中的能力(Roadmap)
scripts/init-project.sh 新项目 day 0 一键脚手架(幂等,绝不覆盖)

规划中但未实现的脚本/模板(audit-project.sh、build-index.sh 等)见 CHANGELOG.md 的 Roadmap 节,不出现在本清单,避免被误引导执行。


装载方式(三选一,按场景)

装载 1:项目 CLAUDE.md 引用(当前主装载,Sprint A)

每个项目的 CLAUDE.md(项目根 / ~/claudecode_workspace/CLAUDE.md)加 3 行引用段,详见 claude-md-snippet.md

Why:规则源头在本 skill,所有项目通过引用读取,不复制副本。

装载 2:新项目 day 0(✅ 已就绪)

~/.claude/skills/forge-doc-policy/scripts/init-project.sh

在新项目根跑一次:创建 docs/ 标准骨架 + 拷贝 CLAUDE.md 模板 + 配 .gitignore + 生成 docs/README.md。

装载 3:老项目接入(手动方式)

  • init-project.sh 幂等且绝不覆盖已有文件,老项目也可安全跑一遍补齐缺失骨架
  • frontmatter 缺失、目录偏差人工按 doc-paths.md 白名单核对

LLM 强校验铁律(每次创建 .md / 新目录前必须执行)

本段被 claude-md-snippet.md 引用,写进每个项目 CLAUDE.md。

  1. 自查 — 核对目标路径是否在 doc-paths.md 的层 1 白名单内
  2. 违规处理 — 若不在白名单 / 介于多个目录 / 涉及新分类 → 停下问用户(给 2-3 个候选路径)
  3. 合规处理 — 在白名单内 → 静默写入,不打断用户
  4. 铁律 — 违反 1-3 的写入即视为 bug,用户报告后 AI 必须立即移动文件 + 在 memory 加 feedback

Why 不上 PreToolUse hook:Hook 误伤会让用户频繁被打断,3 次就会自己关掉,反而失效。LLM 自觉 + 违规才问 = 更友好且对 forge skill 已有约束的补强。(决策渊源见 CHANGELOG)


触发关键词

用户说 行为
"文档治理" / "forge-doc-policy" 进入本 skill,按用户具体诉求路由(查白名单 / 装载 / 审计)
"文档放哪" / "这个文档应该放哪" doc-paths.md 给路径建议
"docs 目录乱了" / "想清理文档" doc-paths.md 白名单人工核对
AI 准备创建任意 .md 或新目录 自查 doc-paths.md 三层白名单(LLM 强校验铁律)

Read the full file on GitHub · 104 lines

Files

What ships with it

8 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. 11d ago First seen · 104 lines · 140 tokens per session scan A 866fcb4de34c

Subscribe to this mod's changes

forge-doc-policy is a skill published in the GitHub repository yike-gunshi/forge-skills (13 stars, last pushed 1mo ago), licensed MIT. It adds 140 tokens to every session and 1,539 once invoked, about $0.0007 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.

Related

Other skills, from other repositories