skills/sync-docs/SKILL.md
Doc audit and structural sync for xtrm projects. Use whenever the README feels too long, docs are out of sync after a sprint, the CHANGELOG is behind, or the user asks to "sync docs", "doc audit", "split readme", "check docs health", or "detect drift". Prefer the xtrm docs command suite (`xtrm docs list`, `xtrm docs show`, `xtrm docs cross-check`) for operator-facing inspection, then use docs-only drift detection on README.md, CHANGELOG.md, and docs/ plus the Python analyzers as validation/backstop tools.
npx skillsauth add jaggerxtrm/jaggers-agent-tools sync-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.
Keeps project documentation in sync with code reality.
Phase 1: Gather context — what changed recently?
Phase 2: Inspect with xtrm — what does the docs suite already report?
Phase 3: Detect docs drift — which docs/ files are stale?
Phase 4: Analyze structure — what belongs outside README?
Phase 5: Plan + execute — fix docs and changelog
Phase 6: Validate — schema-check all docs/
Preferred workflow: use the xtrm docs command suite first for human/operator-facing inspection, then use the Python scripts for drift validation, structure analysis, metadata checks, and sync checkpoints.
Audit vs Execute mode: If the user asked for an audit/report/check-only task, stop after Phase 4. Only run fixes when the user explicitly asks for changes.
Start with the user-facing docs suite so the agent sees the same command surfaces users do:
xtrm docs list
xtrm docs list --json
xtrm docs show --json
xtrm docs cross-check --json --days 30
Use these commands for:
xtrm docs list — inventory docs files, paths, titles, types, and cache-backed scansxtrm docs show --json — inspect frontmatter for README, CHANGELOG, and docs/*.mdxtrm docs cross-check --json — gather stale-doc, coverage-gap, and open-issue-ref signalsThen gather deeper repository context if needed:
# Global install
python3 "$HOME/.agents/skills/sync-docs/scripts/context_gatherer.py" [--since=30]
# From repository
python3 "skills/sync-docs/scripts/context_gatherer.py" [--since=30]
Outputs JSON with:
sync-docs/scripts/drift_detector.pyxtrm docsTreat the CLI docs suite as the primary operator workflow:
xtrm docs --help
xtrm docs list --json
xtrm docs show --json
xtrm docs cross-check --json --days 30
Use it to answer:
If the xtrm docs suite already isolates the problem clearly, proceed directly to fixes. If you need machine-level drift validation for docs/*.md, continue to the Python drift detector.
Use the Python detector as the authoritative drift/backstop check for tracked docs/*.md pages:
python3 "skills/sync-docs/scripts/drift_detector.py" scan --since 30
# optional JSON:
python3 "skills/sync-docs/scripts/drift_detector.py" scan --since 30 --json
A docs file is stale when:
source_of_truth_for globs in frontmattersynced_at hashAdd synced_at: <git-hash> to doc frontmatter to mark the last sync point:
---
title: Hooks Reference
updated: 2026-03-21
synced_at: a1b2c3d # git hash when doc was last synced
source_of_truth_for:
- "hooks/**/*.mjs"
---
After updating a doc, run:
python3 "skills/sync-docs/scripts/drift_detector.py" update-sync docs/hooks.md
This sets synced_at to current HEAD, marking the doc as synced.
python3 "skills/sync-docs/scripts/doc_structure_analyzer.py"
Checks:
Statuses: BLOATED, EXTRACTABLE, MISSING, STALE, INVALID_SCHEMA, OK.
If this is audit-only, stop here and report. In the report, include both:
xtrm docs findings (operator-facing)| Situation | Action |
|---|---|
| README bloated | Extract large sections to focused docs files |
| Missing docs file | Generate scaffold via validate_doc.py --generate |
| Stale docs file | Update content + bump version + updated |
| Stale CHANGELOG | Add entry with local changelog script |
| Invalid schema | Fix frontmatter and regenerate INDEX |
python3 "skills/sync-docs/scripts/doc_structure_analyzer.py" --fix
python3 "skills/sync-docs/scripts/doc_structure_analyzer.py" --fix --bd-remember
python3 "skills/sync-docs/scripts/validate_doc.py" --generate docs/hooks.md \
--title "Hooks Reference" --scope "hooks" --category "reference" \
--source-for "hooks/**/*.mjs,policies/*.json"
python3 "skills/sync-docs/scripts/validate_metadata.py" docs/
xtrm docs list --json
xtrm docs show --json
xtrm docs cross-check --json --days 30
Use this pass to confirm the user-facing docs workflow now reflects the repaired state before final validation.
python3 "skills/sync-docs/scripts/changelog/add_entry.py" \
CHANGELOG.md Added "Describe the documentation update"
Run both layers:
xtrm docs list --json
xtrm docs show --json
xtrm docs cross-check --json --days 30
python3 "skills/sync-docs/scripts/validate_doc.py" docs/
python3 "skills/sync-docs/scripts/drift_detector.py" scan --since 30
The xtrm docs commands confirm the end-user/operator view; the Python tools confirm schema and tracked-doc drift guarantees.
All docs/*.md files require valid YAML frontmatter. Scripts only validate docs/*.md (not subdirectories).
| Field | Format | Example |
|-------|--------|---------|
| title | string (quote if contains colon) | "Session-Flow: Pi Parity" |
| scope | string | hooks |
| category | enum (see below) | reference |
| version | semver | 1.0.0 |
| updated | date | 2026-03-22 |
Only these values pass validation:
| Category | Use for |
|----------|---------|
| api | API documentation |
| architecture | System design, architecture decisions |
| guide | How-to guides, tutorials |
| overview | High-level introductions |
| plan | Planning documents, roadmaps |
| reference | Reference documentation |
Invalid: roadmap, deprecated, complete — will fail validation.
Titles with special characters (colons, quotes) must be quoted:
# ✅ Correct
title: "Session-Flow: Pi Parity"
title: "What's New in v2.0"
# ❌ Incorrect — YAML parse error
title: Session-Flow: Pi Parity
title: What's New in v2.0
| Field | Format | Use |
|-------|--------|-----|
| description | string (quoted) | Brief summary |
| source_of_truth_for | list of globs | Link to code areas |
| synced_at | git hash | Drift checkpoint |
| domain | list of tags | Categorization |
docs/ is the only source of truth for project documentation in this workflow.
Scripts validate docs/*.md only — subdirectories (docs/plans/, docs/reference/) are ignored.
Use frontmatter (source_of_truth_for) to link docs pages to code areas and detect drift.
Use xtrm docs commands first when the task is about understanding the current docs state:
xtrm docs list --json → inventory and filteringxtrm docs show --json → frontmatter inspectionxtrm docs cross-check --json → recent-work drift, coverage gaps, open issue refsUse Python scripts when the task is about enforcement or synchronization internals:
drift_detector.py → synced_at / source_of_truth_for drift checks for docs/*.mddoc_structure_analyzer.py → README bloat, missing focused docs, changelog version gapsvalidate_metadata.py / validate_doc.py → schema/index validationDo not replace the Python tools with xtrm docs; use the CLI for operator-facing inspection and the scripts for authoritative structural validation.
development
Operational service-knowledge system for a project's services. One skill that creates, discovers, activates, updates, and scopes per-service expert skill packages (SKILL.md + diagnostic scripts + references), kept in sync with the code via a GitNexus-aware drift engine. Use when onboarding to a service, routing a task to the right expert, scaffolding a missing skill, or syncing a skill after the implementation drifted. Triggers: /service-skills, /creating-service-skills, /using-service-skills, /updating-service-skills, /scope, or any task that touches a registered service territory.
development
Bootstrap a complete security pipeline (Dependabot + OSV + Semgrep + gitleaks + pre-commit hooks + Codex review) on any GitHub repo. Designed for free user-private repos where GitHub Advanced Security is unavailable. Reusable across Python/TypeScript/Go/Rust stacks.
testing
Merges queued PRs from xt worktree sessions in the correct order (FIFO), maintaining linear history by rebasing remaining PRs after each merge. Use this skill whenever the user has multiple open PRs from xt worktrees, asks to "merge my PRs", "process the PR queue", "drain the queue", "merge worktree branches", or says "what PRs do I have open". Also activate after any xt-end completion when other PRs are already open, or when the user asks "can I merge yet" or "is CI green". Handles the full sequence: list → sort → CI check → merge oldest → rebase cascade → repeat until queue is empty.
testing
Autonomous session close flow for xt worktree sessions. Use this skill whenever the user says "done", "finished", "wrap up", "close session", "ship it", "I'm done", "ready to merge", or similar. Also activate when all beads issues in the session are closed, or when the user explicitly runs /xt-end. This skill is designed for headless/specialist use: it must make deterministic decisions, auto-remediate common anomalies, and avoid clarification questions unless execution is truly blocked.