doc-sync

Rewrites stale documentation to match code changes diffed against origin/main.

Updated Sep 7, 2026
One-click install
npx skills add https://github.com/cgfixit/CG-agent-harness --skill doc-sync-cgfixit
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: doc-sync
Source: https://github.com/cgfixit/CG-agent-harness/tree/main/.claude/skills/doc-sync
Command: npx skills add https://github.com/cgfixit/CG-agent-harness --skill doc-sync-cgfixit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Documentation drifts out of sync with code as branches evolve, leaving READMEs, setup guides, and user manuals describing routes, CLI flags, and config keys that no longer exist. This Skill actively fixes that drift instead of just reporting it. ## Core Features & Use Cases - Diff-Based Drift Detection: Fetches origin/main (or the branch upstream) and classifies doc-relevant changes such as new HTTP routes, shim actions, config keys, and CLI flags. - In-Place Doc Rewrites: Updates README.md, AGENTS.md, setup-guide.md, docs/*.md, and mirrored .codex/.claude skill docs following a strict truth order where code and INVARIANTS.md outrank prose. - Verification Pass: Runs invariant guard and route-coverage tests, then re-greps every route, gate name, and flag written into docs against the cited source. - Use Case: Before cutting a release, run this Skill to compare your feature branch against main and rewrite every doc section that references renamed routes, removed config keys, or changed CLI flags. ## Quick Start Ask the AI to sync the docs by diffing this branch against origin/main and fixing any stale prose in the README and docs folder.

Frequently Asked Questions about doc-sync

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix documentation drift after a feature branch diverges from main?▼

Fetch origin/main, diff the merge-base range against HEAD, and classify doc-relevant changes like new routes, config keys, and CLI flags. Then rewrite each affected doc in place, quoting current code values verbatim rather than re-deriving them from memory.

What is the difference between doc-sync and cgagentharness-doc-sync?▼

doc-sync writes the fixes directly into README.md, AGENTS.md, setup-guide.md, and docs/*.md. cgagentharness-doc-sync only flags drift and reports findings without making any edits.

Which documentation files does doc-sync update?▼

It updates README.md, AGENTS.md, setup-guide.md, docs/*.md including USER_MANUAL.md and DEPENDENCIES.md, plus mirrored guidance under .codex/skills and .claude/skills. It only touches docs whose subject matter the diff actually changed.

Does doc-sync push or merge the documentation changes it makes?▼

No, doc-sync only edits files locally. Publishing follows the repository's PR conventions: a draft PR with a [docs] prefix validated by scripts/check-pr-template.sh.

What tools are required to run doc-sync?▼

It requires git for fetching and diffing against origin/main, and ripgrep for verifying routes, gates, and CLI flags against source. It operates in a Cargo project with the standard docs layout.

When should I not use doc-sync for documentation updates?▼

Avoid it when you only want a drift report without edits, since cgagentharness-doc-sync handles that. It also ignores pure refactors, test-only changes, and formatting-only diffs, and leaves dependency version numbers to dep-sync.