Skip to main content

/docs-update

Smart documentation auditing with git-based staleness detection.


What It Does​

Default (no args): Uses git history to find docs that are out of sync with their source code. Compares when code changed vs when docs were last updated.

Full audit: Scans all docs for quality issues, checks frontmatter, structure, links, duplicates, and STYLE.md compliance.


Usage​

/docs-update [path] [--full] [--fix] [--check-only] [--quick]
ArgumentEffect
(none)Smart default: staleness check
[path]Check specific path only
--fullSkip staleness, do full audit
--fixAuto-fix issues
--check-onlyReport only, no changes
--quickInventory only

How It Maps Code to Docs​

Code PathRelated Doc
skills/{name}/$JAAN_DOCS_DIR/skills/{role}/{slug}.md
$JAAN_CONTEXT_DIR/hooks/{name}.sh$JAAN_DOCS_DIR/hooks/{name}.md
$JAAN_CONTEXT_DIR/config.md$JAAN_DOCS_DIR/config/README.md
$JAAN_CONTEXT_DIR/*.md$JAAN_DOCS_DIR/config/context.md

What It Checks (Full Audit)​

CheckDescription
FrontmatterValid YAML with required fields
StructureH1, tagline, separators
Line limitsUnder max for doc type
LinksInternal links valid
DuplicatesSimilar content detected
LocationFile in correct folder

Output: Staleness Report (Default)​

# Documentation Staleness Report
**Code changes:** 5 files | **Docs checked:** 12

## Potentially Outdated
| Doc | Related Code | Delta |
|-----|--------------|-------|
| $JAAN_DOCS_DIR/skills/pm/prd-write.md | pm-prd-write/SKILL.md | 15d stale |

## Missing Documentation
| Code File | Expected Doc |
|-----------|--------------|
| new-skill/SKILL.md | $JAAN_DOCS_DIR/skills/?/new-skill.md |

[1] Review stale [2] Full audit [3] Quick fix [4] Exit

Output: Full Audit Report​

# Documentation Audit Report
**Files:** 21 | **Issues:** 5

## Summary
| Category | Count |
|----------|-------|
| ✅ Healthy | 16 |
| ⚠️ Need Updates | 3 |
| 🔴 Deprecated | 1 |
| 📦 Duplicates | 1 |

## Priority Actions
1. **hooks/old-hook.md** - Deprecated - Archive
2. **config/settings.md** - Missing frontmatter - Fix

Example​

Smart staleness check (default):

/docs-update

Full audit:

/docs-update --full

Full audit with auto-fix:

/docs-update --full --fix

Check specific path:

/docs-update $JAAN_DOCS_DIR/skills/ --check-only

Fixes Applied​

IssueAuto-Fix
Missing frontmatterAdds with defaults
Missing datesAdds current date
Missing separatorsAdds ---
H4+ headingsConverts to H3
Deprecated docsArchives to $JAAN_DOCS_DIR/archive/
Broken linksReports with suggestions
DuplicatesSuggests consolidation

Tips​

  • Run without args for smart staleness detection
  • Use --full when you want comprehensive quality checks
  • Staleness threshold is 7 days (code changed > 7d before doc)
  • Deprecated docs are archived, never deleted
  • Updates updated_date on all modified files