agentleFS
michaelalbermichaelalber/ai-toolkit/skills/doc-sync/SKILL.md

doc-sync

Skill2 starsChanged 4 months agoMITView on GitHub

Documentation staleness detection, XML doc comment generation, and README synchronization -- keeps documentation accurate and in sync with code changes. Use when auditing documentation coverage, generating XML doc comments, or systematically syncing READMEs after code changes. Do NOT use for a single, already-identified fix like "there's a typo, fix it" -- just make the edit directly.

23 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use refactor, code-review and 1 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • GitHubSkill

    refactor

    Surgical code refactoring to improve maintainability without changing behavior. Covers extracting functions, renaming variables, breaking down god functions, improving type safety, eliminating code smells, and applying design patterns. Less drastic than repo-rebuilder; use for gradual improvements.

    Also in 3 projects that use this

  • GoogleSkill

    code-review

    Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.

    Also in 4 projects that use this

  • MicrosoftSkill

    handoff

    Compact the current conversation into a handoff document for another agent to pick up.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 18 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    READ BEFORE WRITING — read the full implementation before documenting.

    line 25
  2. Very specific:

    NO HALLUCINATED APIs — confirm every member exists (Grep/Glob) before documenting.

    line 26
  3. Distinctive:

    Exit criteria: every in-scope item classified.

    line 63

“Common” is measured: kept by at least 6 in 10 of the 18 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Doc Sync

"The only thing worse than no documentation is wrong documentation — someone will trust it and make a bad decision." -- adapted from Steve McConnell, "Code Complete"

Core Philosophy

Documentation decays the moment code changes. This skill detects when documentation has drifted from code, generates accurate XML doc comments from implementation analysis, and keeps READMEs synchronized with the project's actual state. The goal is not comprehensive documentation — it is accurate documentation. A perfectly documented codebase that was accurate six months ago is a liability; a minimally documented one verified this morning is an asset. Freshness and accuracy always beat completeness. Documentation is a derived artifact of code: when they diverge, the code is always right and the docs must change to match.

Non-Negotiable Constraints:

  1. CODE IS TRUTH — when docs and code disagree, update the docs to match; never the reverse.
  2. READ BEFORE WRITING — read the full implementation before documenting; never generate from the signature alone.
  3. NO HALLUCINATED APIs — confirm every member exists (Grep/Glob) before documenting; verify every <see cref>/<paramref> resolves.
  4. DETECT BEFORE GENERATING — audit for staleness first; assume all existing docs are stale until verified.
  5. PRESERVE VOICE — match the project's existing documentation style exactly; document the why, not the what.

Full principle table, discipline rules, anti-patterns, and error recovery live in references/conventions.md.

Workflow

STALENESS DETECTION
    SCAN      Identify scope: target dir/namespace, file types (.cs/.md/.xml), doc types.
    COMPARE   Per documented file: code vs. doc modification dates (git log); signatures vs. doc
              content; new public members without docs; removed members still in docs.
    CLASSIFY  CURRENT | STALE (code changed after doc) | MISSING (public API, no doc) |
              ORPHANED (doc references gone code) | DRIFT (doc ≠ current signatures).
    PRIORITIZE  ORPHANED → DRIFT → STALE → MISSING-on-public → CURRENT.
    (Heuristics: references/staleness-detection.md.)

XML DOC GENERATION
    READ      Full implementation; exact signature; throwing paths; edge cases; existing docs.
    GENERATE  <summary> WHAT+WHY not HOW · <param> each param + constraints · <returns> each
              non-void · <exception> each throw + condition · <remarks> edge/threading/perf ·
              <example> only when non-obvious · <see cref> related members.
    VERIFY    Every <param name> matches a real param; every <exception cref> is actually thrown;
              every <see cref> resolves; no <returns> on void; examples compile; summary ≠ name.
    (C# tag patterns: references/xml-doc-patterns.md.)

README SYNC
    INVENTORY  What the README covers (description, setup, config, usage, API, deps, contributing).
    DIFF       Each section vs. current state: setup vs. build files; deps vs. manifests; examples
               vs. current signatures; description vs. current capabilities.
    UPDATE     Read the current code/config; update to match; preserve existing style/format; don't
               add sections without an obvious gap; note anything you cannot verify.
    VALIDATE   All paths exist; commands valid; dep versions match manifests; API refs current.

Exit criteria: every in-scope item classified; updated docs match the implementation; every reference verified to resolve; unverifiable items flagged with a note; README sections validated against manifests and build files.

State Block

<doc-sync-state>
phase: SCAN | COMPARE | CLASSIFY | GENERATE | VALIDATE
scope: [directory, namespace, or file]
files_scanned: [count]
gaps_found: [count]
stale_docs: [count]
items_updated: [count]
items_validated: [count]
last_verified: [description of last action]
</doc-sync-state>

Output Template

  • Staleness report, XML doc coverage report — references/output-templates.md.
  • C# XML tag patterns, when to use each tag, quality examples — references/xml-doc-patterns.md.
  • Staleness heuristics (git-blame compare, signature drift, coverage, broken examples) — references/staleness-detection.md.
  • Principle table, discipline rules, anti-patterns, error recovery — references/conventions.md.

Integration with Other Skills

SkillRelationship
architecture-journalWhen an audit reveals undocumented architecture decisions, record them as ADRs there — documentation gaps often indicate decision gaps. Typical flow: doc-sync audit → discover an undocumented API redesign → architecture-journal records the decision → return to doc-sync to update XML docs + README.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.