Agent skill

Cm Doc Syncer

by kingxiaozhe in kingxiaozhe/cm-workflow

文档同步 Skill,开发完成后自动更新 README、.claude/ 配置、specs CHANGELOG,保持文档与代码一致

MITAuto-check: notesDevelopment

Install Cm Doc Syncer

skills CLI
$ npx skills add kingxiaozhe/cm-workflow --skill cm-doc-syncer -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install kingxiaozhe/cm-workflow cm-doc-syncer --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/kingxiaozhe/cm-workflow.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/cm-doc-syncer .claude/skills/cm-doc-syncer && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
cm-doc-syncer
GitHub stars
104
Token cost
~1.1k tokens
SKILL.md length
310 words
Files
1
Skills in repo
23
Repo updated
First seen
Licence
MIT

At a glance

文档同步 Skill,开发完成后自动更新 README、.claude/ 配置、specs CHANGELOG,保持文档与代码一致

  • Works in 6 steps: 扫描变更 → 更新 README.md → 更新 .claude/CLAUDE.md → …
  • Tasks that involve Changelog and release notes
  • SKILL.md covers 触发条件, 输入, 执行步骤 and 禁止(红线,违反任何一条即任务失败), plus 1 more section
  • Calls git

What it does

Cm Doc Syncer is an agent skill from kingxiaozhe/cm-workflow. 文档同步 Skill,开发完成后自动更新 README、.claude/ 配置、specs CHANGELOG,保持文档与代码一致

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Changelog and release notes and Technical documentation. It works with Git. The repository describes itself as: Codex-native, spec-driven AI Agent workflow with Claude Code compatibility, independent review, QA, fixes, and refactors. The licence is MIT.

When your agent uses it

  • Tasks that involve Changelog and release notes
  • Tasks that involve Technical documentation

Example prompts

  • “/cm-doc-syncer”

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. 扫描变更
  2. 更新 README.md
  3. 更新 .claude/CLAUDE.md
  4. 更新 .claude/rules/
  5. 生成 specs CHANGELOG
  6. 验证文档一致性

What it can do on your machine

Read from SKILL.md and the folder at commit 82d43f0. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Cm Doc Syncer loads about 1.1k tokens when it runs. Until then it costs about 20 tokens; SKILL.md has 310 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~20
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:154
    - **不得触碰文档之外的文件**:代码、配置、`.env*`、CI 一律只读;发现问题只上报「待人工」,不代修

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from kingxiaozhe/cm-workflow at commit 82d43f0, republished under its MIT licence (© kingxiaozhe). 310 words, ~1,089 tokens.

Download SKILL.mdSave it as .claude/skills/cm-doc-syncer/SKILL.md (or your agent's skills folder).
name
cm-doc-syncer
description
文档同步 Skill,开发完成后自动更新 README、.claude/ 配置、specs CHANGELOG,保持文档与代码一致

cm-doc-syncer — 文档同步器

在所有开发任务完成后,自动同步更新项目文档。确保文档和代码保持一致。

触发条件

由 /cm-ai 在最后任务的独立审查前调用;收口阶段只核验已审文档。

输入

  • specs 文件夹路径
  • 代码项目路径(可多个)
  • LESSONS.md 中积累的架构决策
  • 本 specs 批次全部 feature/task 的原始改动证据、开工快照和最后任务的批准文档写范围

执行步骤

1. 扫描变更

对每个代码项目,先读其 CLAUDE.md「版本控制」字段,按值选变更识别方式(显式分支,不得自行发明):

  • remote / local → git diff {基线}..HEAD 获取已提交候选;基线先取上一份 CHANGELOG 的 base-commit,无则取已确认的 scaffold/初始 commit。无法确认时记录基线缺口,改用下述本批次任务证据,不把全量文件当变更集
  • none 或项目无 .git → 用本批次 handoff/diff 和开工快照定位文件,再核实当前内容;tasks 只确定任务清单,不能仅凭勾选项推断真实改动
  • 字段缺失但有 .git → 按 local 处理

本轮范围是当前 specs 批次的全部 feature/task,恢复后仍按同一批次;不等于最后一个任务。 从有效批准清单、tasks 和各任务已有 handoff/diff 记录汇总变更路径;旧任务只读已绑定记录, 最后任务使用正在定稿的真实 diff。不能只凭 checkbox、时间、文件名或任意旧 Review 认定归属。

将本轮已提交差异与所有任务尚未提交的 staged、unstaged、新建/删除文件合并,按当前代码净变化去重。 早期任务已完成却仍未提交的改动属于本轮,不能因它出现在最后任务的开工快照里就当作用户原改动排除。 对照各任务开工快照和实际 diff 按片段排除用户原有改动;同文件混有他人修改、来源或批次不明时只报告缺口,不猜归属。

汇总仅用于读取;最后任务仍只写事先批准的文档范围,不重新修改旧任务源码、状态或凭证。 没有可信证据时明确“同步范围待确认”,不得按全量文件清单替代变更归属证明或宣称全部同步。

随后(与版本控制方式无关):

  • 识别新增的目录、模块、API、数据模型
  • 从 specs 的 requirements.md 获取功能描述;requirements.md 缺失 → 该 feature 跳过描述提取并在最终输出中上报「specs 不完整」,不得凭 tasks.md 猜功能描述
  • 从 LESSONS.md 获取架构决策和踩坑记录;文件不存在 → 按 0 条处理,不报错不中断
1.5 增量同步业务地图

按 ../codebase-context/references/writeback.md 复用本次变更证据:更新相关章节, 没有地图时创建最小局部地图,项目指定文档优先。不得因目录不存在直接跳过, 不得触发全量 scan;所需文档必须在本任务批准范围内,结果进入同一 handoff 与 Review。

2. 更新 README.md

对每个代码项目的 README 进行精炼更新:

必须覆盖:

  • 项目简介 — 一句话说清楚是什么
  • 架构概览 — 技术栈、目录结构、核心模块关系
  • 快速开始 — 安装、配置环境变量、运行的最少步骤
  • 功能模块 — 各模块简述,本次新增的功能标注
  • API/接口 — 关键接口说明(如有后端)
  • 合约地址 — 部署的合约信息(如有合约)
  • 部署 — 构建命令、部署方式、环境要求

原则:

  • 精炼,开发者能在 2 分钟内理解项目全貌
  • 已有的 README 合理内容保留,只更新/补充变更涉及的部分
  • 如项目没有 README → 新建完整版
  • 不写废话,不放过时信息
3. 更新 .claude/CLAUDE.md

检查变更是否影响项目结构,保持 ≤150 行:

  • 新增了目录 → 更新「目录结构」
  • 新增了常用命令 → 更新「常用命令」
  • 引入了新技术栈 → 更新「技术栈」
  • 新增了 rules 文件 → 更新引用列表
4. 更新 .claude/rules/

检查变更中是否出现了新的模式或约定,按下表判据决定(满足才建,不满足不建,无中间态):

变更特征动作
新增 ≥2 个路由/接口文件(如 src/api/**)创建 rules/backend-api.md
新增 migration 目录或 ORM 配置创建 rules/database.md
新增 contracts/** 或合约框架配置创建 rules/smart-contract.md
仅模型/工具文件、无 ORM约定并入最近的既有 rules,不另建
已有 rules 的 globs 与实际目录不符更新 globs 路径

新建 rules 一律从当前 Skill 向上解析 workflow root,使用 {CM_WORKFLOW_ROOT}/templates/rules/{名称}.md 骨架(frontmatter 含 description + globs),模板不存在则参照项目内既有 rules 的格式。

本步完成后回到步骤 3 回填 CLAUDE.md 的 rules 引用列表(步骤 3 执行时 rules 尚未定稿,引用列表以本步结果为准)。

4.5 LESSONS.md 归档(防膨胀深井)

LESSONS.md 超过 50 条时执行归档:

  • 归档判据(按序适用):① 条目带 feature 标签且标签不属于当前活跃 feature → 归档;② 横切/全局决策(不属于任何单一 feature 的约定,如"统一用 pnpm")→ 豁免,留在主文件;③ 无标签且无法判断归属 → 留在主文件(宁留勿丢)
  • 归档条目移入 {SPECS_DIR}/LESSONS-archive.md(全文保留)
  • 主文件索引按 feature 聚合为一行(- {feature名} {N} 条 → archive),不逐条留行——逐条索引会让主文件列表项总数不降,归档失去防膨胀意义
  • N1/N7 只加载主文件——上下文轮换的成本因此有上界;archive 仍在审计链内随时可查
5. 生成 specs CHANGELOG

在 specs 文件夹下创建 CHANGELOG 文件,文件名日期取执行同步的当日(不是 feature 提交日),如 CHANGELOG-2026-04-12.md;同日重复执行则覆盖更新同名文件:

markdown
# 变更日志 — 2026-04-12

> base-commit: {本次同步时的 HEAD hash;版本控制 none 的项目写 none}   # 下次同步的 diff 基线,步骤 1 读取

## Feature 1: {feature名}

### 新增
- {功能描述}

### 关键文件
- `{path}` — {说明}

### 架构决策
- {从 LESSONS.md 中提取的相关决策}

## Feature 2: {feature名}

...

多次开发产生多个日期文件,形成完整的变更历史。

6. 验证文档一致性

最后检查:

  • CLAUDE.md 中引用的 rules 文件都存在
  • rules 中的 globs 与实际目录匹配
  • README 中的命令与 package.json / Makefile 一致
  • 环境变量文档与 .env.example 一致

发现不一致时按两态处理(修复方向一律以代码/配置为准改文档,不得反向改代码):

  • 只改文档就能一致(如 README 写错命令、CLAUDE.md 引用了不存在的 rules)→ 修复并计数
  • 需要改代码/配置/新建非文档文件才能一致(如 .env.example 缺失、脚本指向不存在的文件)→ 不修,在输出「一致性」行报「发现 N 处待人工」——doc-syncer 无权创建或修改文档之外的任何文件

禁止(红线,违反任何一条即任务失败)

  • 不得虚构:接口、命令、合约地址、环境变量只写代码或 specs 中实际存在的;桩实现/空函数按 specs 口径描述时必须注明「以 specs 为准,实现未完成」
  • 不得删除用户手写内容:README 中无法从代码/specs 再生的段落(徽章、致谢、许可、手写背景说明)一律原样保留,更新只增改与变更相关的部分
  • 不得触碰文档之外的文件:代码、配置、.env*、CI 一律只读;发现问题只上报「待人工」,不代修
  • 归档不得丢条目:归档前后条目总数必须守恒(主文件活跃条数 + archive 条数 = 原总数),执行后自查一次
  • 代码与 specs 不符时不得按 specs 想象功能:以代码实际行为为准描述,差异作为「待人工」写入 CHANGELOG 上报

输出

text
📝 文档同步完成

README: {更新/新建} {N} 个项目
CLAUDE.md: {更新/无变化}
Rules: {新增 N 个 / 更新 N 个 / 无变化}
CHANGELOG: {N} 个 feature
业务地图: {已更新/已建局部地图/无需更新/项目规则豁免/待同步} {路径或原因}
一致性: {PASSED / 有 N 处已修复 / 发现 N 处待人工}   # 三态可并存,如「2 处已修复,1 处待人工」

© kingxiaozhe, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/cm-doc-syncer of kingxiaozhe/cm-workflow.

Open the folder on GitHubat commit 82d43f0

Compare with similar skills

Cm Doc Syncer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Cm Doc Syncer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Cm Doc Syncer this skillkingxiaozhe/cm-workflow104—~1.1kAutomated safety check: NotesMIT
Releasejrswab/axe896—~1.4kAutomated safety check: PassApache-2.0
CommitLennartHennigs/Button2565—~562Automated safety check: PassMIT
Qkeymapper Release NotesZalafina/QKeyMapper756—~1.3kAutomated safety check: PassGPL-3.0
Doc-Code Sync Checkfancyboi999/open-tag203—~1.7kAutomated safety check: PassApache-2.0
CommitLennartHennigs/ESPRotary188—~590Automated safety check: PassMIT

Similar skills

  • Release

    jrswab/axe

    Prepare code for release (version bumps, changelog, README updates) and create an annotated tag to trigger the GoReleaser workflow.

    896 GitHub stars~1.4k tokensUpdated 4 days ago
    DevelopmentAuto-check passed
  • Commit

    LennartHennigs/Button2

    Stage and commit current changes for Button2 — checks for needed CHANGELOG/README/CLAUDE.md updates, creates a branch if on master, writes a commit message, and commits

    565 GitHub stars~562 tokensUpdated 4 mo ago
    DevelopmentAuto-check passed
  • Qkeymapper Release Notes

    Zalafina/QKeyMapper

    为 QKeyMapper 编写 README.md 的中文 release note,并默认联动 qkeymapper-readme-en-sync 定向同步更新英文版 READMEen.md。收集最近正式 release tag 之后的已提交更新,先展示中英双语完整草稿供审阅,批准实施后分阶段原子提交两个 README。用于发布说明、更新日志和中英文版本信息维护。

    756 GitHub stars~1.3k tokensUpdated today
    DevelopmentAuto-check passed
  • Doc-Code Sync Check

    fancyboi999/open-tag

    Reconciles documentation with code at the end of a change or as a periodic audit, following a repo rule that code changes and doc changes land in one commit.

    203 GitHub stars~1.7k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Commit

    LennartHennigs/ESPRotary

    Stage and commit current changes for ESPRotary — checks for needed CHANGELOG/README/CLAUDE.md updates, creates a branch if on master, writes a commit message, and commits

    188 GitHub stars~590 tokensUpdated 2 mo ago
    DevelopmentAuto-check passed
  • Housekeeping

    alexeykrol/claude-code-starter

    Фоновое обслуживание проекта: актуальность README, CHANGELOG, версии, .gitignore, метафайлов.

    194 GitHub stars~759 tokensUpdated yesterday
    DevelopmentAuto-check: notes

More from kingxiaozhe/cm-workflow

All 23 skills in this repo
  • Cm AI

    kingxiaozhe/cm-workflow

    用户明确说“规格已确认,开始实现”或要求按已审批 CM specs 开发时使用。新任务默认由 JS workflow 驱动 N1-N8,完成开发、独立审查、QA 与文档同步;模糊点子、未审规格和单独一句“继续”不能触发编码批准。

    104 GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Cm Check

    kingxiaozhe/cm-workflow

    用户说“检查工作流是否安装正确”“为什么找不到 cm 命令”时使用。默认查询 npm 稳定版,有新版自动升级已管理的 CM 安装,再检查插件、核心 Skills、兼容包装与模板引用;不测试或修改业务代码。

    104 GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Cm Fix

    kingxiaozhe/cm-workflow

    用户说“修复这个可复现 bug”或要求根据失败报告修代码时使用。执行红灯测试、根因定位、最小修复、独立审查和回归;尚未确认的问题先用 cm-test,新功能和架构重设计转交 cm-prd。

    104 GitHub stars~2.5k tokensUpdated today
    Auto-check passed
  • Cm Idea

    kingxiaozhe/cm-workflow

    用户说“我有个点子”“帮我梳理产品”或需要先聊清目标时使用。通过逐题访谈整理为可交给 cm-prd 的 PRD;已有明确需求文档时改用 cm-prd,不写代码、不拆开发任务。

    104 GitHub stars~419 tokensUpdated today
    Auto-check passed
  • Cm Init

    kingxiaozhe/cm-workflow

    用户说“第一次接管这个项目”“分析仓库并生成项目规则”时使用。分析已有代码并生成 Codex AGENTS.md 与 CM/Claude 兼容规则;仅适用于非空存量项目,不创建脚手架、不承接普通代码修改。

    104 GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Cm Miniprogram Engineer

    kingxiaozhe/cm-workflow

    微信小程序开发工程师 Skill,执行小程序开发任务,自动适配项目技术栈(原生小程序/Taro/uni-app 等),支持 Figma/Stitch 设计稿还原与云开发

    104 GitHub stars~1.2k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Cm Doc Syncer

What does Cm Doc Syncer do?

文档同步 Skill,开发完成后自动更新 README、.claude/ 配置、specs CHANGELOG,保持文档与代码一致. Cm Doc Syncer is an agent skill from kingxiaozhe/cm-workflow.

When should I use Cm Doc Syncer?

Cm Doc Syncer fits situations like: tasks that involve Changelog and release notes; tasks that involve Technical documentation.

How do I install Cm Doc Syncer in Claude Code?

Run `npx skills add kingxiaozhe/cm-workflow --skill cm-doc-syncer -a claude-code`. Or copy the skill folder (skills/cm-doc-syncer in kingxiaozhe/cm-workflow) into .claude/skills/cm-doc-syncer in your project. Claude Code loads it when a task matches its description.

How do I install Cm Doc Syncer in Codex?

Run `npx skills add kingxiaozhe/cm-workflow --skill cm-doc-syncer -a codex`. Or copy the skill folder (skills/cm-doc-syncer in kingxiaozhe/cm-workflow) into .agents/skills/cm-doc-syncer in your project. Codex loads it when a task matches its description.

Can I use Cm Doc Syncer in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add kingxiaozhe/cm-workflow --skill cm-doc-syncer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cm-doc-syncer, .gemini/skills/cm-doc-syncer, .github/skills/cm-doc-syncer and .opencode/skills/cm-doc-syncer in your project.

What does Cm Doc Syncer need to run?

Going by SKILL.md and its folder, Cm Doc Syncer needs the command-line tools its instructions call (git).

Does Cm Doc Syncer access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Cm Doc Syncer safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Cm Doc Syncer use?

Cm Doc Syncer is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Cm Doc Syncer use?

About 1.1k tokens (SKILL.md is roughly 4.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Cm Doc Syncer?

Skills that share tags, products or a category with Cm Doc Syncer: Release (jrswab/axe, 896 stars), Commit (LennartHennigs/Button2, 565 stars), Qkeymapper Release Notes (Zalafina/QKeyMapper, 756 stars) and Doc-Code Sync Check (fancyboi999/open-tag, 203 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Cm Doc Syncer?

kingxiaozhe (a GitHub user) maintains it in kingxiaozhe/cm-workflow, which has 104 GitHub stars. The repository holds 23 skills in this directory. The repository was last updated on October 9, 2026.

Source: kingxiaozhe/cm-workflow on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.