plugins/cc10x/skills/diff-driven-docs/SKILL.md
Use when a BUILD phase completes, a commit is staged, or a PR is about to be created, and the diff has not yet been reflected in documentation. Also use when the user says "update docs", "sync docs", "document this", or asks whether documentation is up to date.
npx skillsauth add romiluz13/cc10x diff-driven-docsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Stale documentation is worse than no documentation — it actively misleads contributors, users, and future maintainers. diff-driven-docs treats documentation as a first-class deliverable of every BUILD phase, not an afterthought. Just as test-driven-development enforces that tests must be produced as part of the code-change cycle, diff-driven-docs enforces that doc updates must accompany code changes before the workflow closes. The doc-syncer agent analyzes the actual diff, classifies documentation impact across three layers (business, technical, audit), and writes only the updates that are genuinely needed — skipping trivially low-impact changes fast.
Run this classifier before any doc work. Use it to determine which layers to evaluate and which to skip.
| Diff Characteristic | Business Layer | Technical Layer | Audit Layer | |---------------------|---------------|----------------|-------------| | Internal utility, helper, or type change only | SKIP | CHECK | SKIP | | Test addition with no new pattern | SKIP | SKIP | SKIP | | Style / formatting change | SKIP | SKIP | SKIP | | Dependency version bump (no API change) | SKIP | SKIP | SKIP | | Routine bug fix (existing behavior corrected) | SKIP | CHECK | SKIP | | Simple refactor (behavior unchanged) | SKIP | CHECK if signatures changed | SKIP | | New exported function / hook / component | SKIP | CHECK | CHECK | | New page or route | CHECK | CHECK | CHECK | | Architectural pattern introduced | SKIP | CHECK | CREATE | | Technology choice made | SKIP | CHECK | CREATE | | Breaking change to public API | CHECK | CHECK | CREATE | | Permission or role change | CHECK | CHECK | CHECK | | Security or compliance impact | CHECK | CHECK | CREATE or UPDATE |
SKIP business docs if: no user-facing surface changed; only internal utils, types, or tests were modified.
SKIP audit docs if: the diff is a routine bug fix, style change, test addition, or simple refactor with no new pattern.
ALWAYS check technical docs when hooks, components, migrations, schema, routes, or exported library APIs changed.
CREATE an audit doc if: an architectural decision was made, a new pattern was introduced, a non-obvious tradeoff was accepted, or a team member six months from now would ask "why did we do it this way?"
If all three layers are SKIP, set IMPACT_LEVEL: none and emit a SKIPPED contract immediately without opening any doc files.
User-facing guides, admin documentation, and feature descriptions. Business docs describe what users and administrators can do — not how the system works internally.
Hooks reference, components catalog, schema documentation, architecture notes, and JSDoc on exported APIs. Technical docs describe how the system is built — for developers working on the codebase.
Decision records capturing what changed, why, alternatives considered, and impact. Audit docs are written for future contributors who need to understand the reasoning behind a decision.
CREATE new when:
UPDATE existing when:
SKIP when:
docs/YYYY-MM-DD-{topic}-decision.md — adapt to the project's actual convention (e.g., docs/decisions/, docs/adr/).
## What Changed
[One paragraph describing the technical change]
## Why
[The primary reason for this decision]
## Alternatives Considered
- **{Alternative A}:** [Why it was not chosen]
- **{Alternative B}:** [Why it was not chosen]
## Impact
[Who is affected; any migration steps; ongoing maintenance implications]
The doc-syncer agent follows these five steps in order:
Step 1 — Get the diff
# For pre-commit (staged changes)
git diff --cached --stat && git diff --cached
# For post-build (last commit)
git diff HEAD~1 --stat && git diff HEAD~1
Read the full diff output before classifying.
Step 2 — Classify impact
Run the Impact Classifier table against the diff. Determine IMPACT_LEVEL (none / low / medium / high) and which layers to evaluate. If IMPACT_LEVEL is none, emit the SKIPPED contract immediately and stop.
Step 3 — Map changed files to doc targets
Use the project's ## Doc Targets from CLAUDE.md if present. Otherwise apply the generic heuristics in references/doc-target-heuristics.md. For each changed file, identify zero or more target documentation files.
Step 4 — Read then write
For each doc target:
Read the entire target file firstEdit — do not rewrite sections that are not affected by the diffRead the file again after writing to verify the edit landed correctlyFor audit docs: check whether an existing decision doc covers this topic. If yes, update it. If no, create a new file following the filename pattern.
Step 5 — Self-review
Before emitting the contract, verify:
## Docs section of CLAUDE.mdCLAUDE.md (it is an index only)This skill is loaded by the doc-syncer agent in the BUILD chain. The router spawns doc-syncer after integration-verifier passes and before the Memory Update task. The agent emits a ### Router Contract (MACHINE-READABLE) YAML block that the router validates before advancing.
Opt-out: Add DIFF_DRIVEN_DOCS: skip to the ## Session Settings section of CLAUDE.md to disable the doc-syncer for projects that manage documentation separately.
| Common excuse | Counter | |---------------|---------| | "docs can wait" | Docs are a deliverable, not a follow-up. The workflow does not close until they are done. | | "it's just a refactor" | If file paths, function signatures, or exported APIs changed, technical docs need updating. | | "the diff is small" | Run the Impact Classifier. Small diffs still trigger technical doc updates when signatures change. | | "nobody reads those docs" | Stale docs actively mislead. Empty docs are better than wrong ones. | | "I'll add JSDoc later" | JSDoc on exported APIs is a technical doc update. Later means never. | | "the tests document the behavior" | Tests document correctness, not usage. They are not a substitute for doc updates. |
tools
Safe cc10x upgrade that preserves local modifications. Stashes diffs, pulls upstream, rebuilds cache, rebases patches. Use this skill when: updating cc10x, upgrading, pulling latest cc10x, syncing plugin, refreshing cache, or checking for new versions. Triggers: update cc10x, upgrade cc10x, pull cc10x, sync plugin, refresh cc10x, check for updates, new version, update plugin, upgrade plugin.
development
Use when a bug, flaky test, or runtime/build failure needs root-cause tracing and a nearby duplicate-pattern scan before any fix.
development
THE ONLY ENTRY POINT FOR CC10X. Activate this skill for build, debug, review, and plan requests. Use when the user asks to implement, fix, review, plan, test, refactor, or continue code work. Trigger keywords: build, implement, create, write, add, review, audit, debug, fix, error, bug, broken, plan, design, architect, spec, brainstorm, test, refactor, optimize, update, change, research, cc10x, c10x. CRITICAL: Route and execute immediately. Do not stop at describing capabilities.
development
Internal skill. Use cc10x-router for all development tasks.