Get the FREE Ultimate OpenClaw Setup Guide →

doc-refresh

npx machina-cli add skill littlebearapps/pitchdocs/doc-refresh --openclaw
Files (1)
SKILL.md
9.0 KB

Doc Refresh

Philosophy

Generation is solved — PitchDocs handles that. Maintenance is the unsolved problem. After the initial docs suite is created, every release needs a coordinated update: CHANGELOG entries enhanced with benefit language, README features refreshed, user guides amended, AI context files synced, and llms.txt kept current.

/doc-refresh closes the maintenance loop. It works alongside release-please: release-please handles version strings and CHANGELOG scaffolding, /doc-refresh handles prose, features, context, and metrics.

Change Detection Workflow

Step 1: Identify the Boundary

# Latest tag (the "since" point for change detection)
git describe --tags --abbrev=0 2>/dev/null

# If no tags exist, fall back to initial commit
git rev-list --max-parents=0 HEAD

# All commits since boundary
git log $(git describe --tags --abbrev=0 2>/dev/null || git rev-list --max-parents=0 HEAD)..HEAD --oneline --no-merges

# If a version argument was provided (e.g., v1.5.0..v1.7.0)
git log v1.5.0..v1.7.0 --oneline --no-merges

If no tags exist at all, recommend running /readme and /docs-audit fix instead — a full generation is more appropriate than a refresh for a brand-new repo.

Step 2: Parse Conventional Commits

Classify each commit into categories that map to documentation impacts:

Commit TypeDoc Impact
feat:CHANGELOG, README features, possibly user guides, release notes
fix:CHANGELOG, possibly troubleshooting guides
docs:Verify existing docs are consistent with changes
refactor:AI context files (if architecture changed)
perf:CHANGELOG, README metrics if benchmarks cited
chore:Usually none, unless dependencies changed significantly
BREAKING CHANGE:CHANGELOG with migration note, README, migration guide, release notes

If the repo does not use conventional commits, fall back to git diff --stat analysis — classify changes by which files they touch (source, tests, config, docs) rather than commit message prefix.

Step 3: Detect File-Level Changes

# Which areas of the project changed?
git diff --name-only $(git describe --tags --abbrev=0 2>/dev/null || git rev-list --max-parents=0 HEAD)..HEAD | head -50

# Specifically check for structural changes (new commands, skills, agents, config)
git diff --name-only $(git describe --tags --abbrev=0 2>/dev/null || git rev-list --max-parents=0 HEAD)..HEAD | grep -E '(commands/|skills/|agents/|rules/|\.config|package\.json|pyproject\.toml)'

Step 4: Build the Refresh Plan

Map detected changes to specific doc files. Output a structured plan before executing:

šŸ“‹ Documentation Refresh Plan: [project-name]

Boundary: v1.6.0..HEAD (15 commits: 8 feat, 4 fix, 2 docs, 1 chore)

Docs to update:
  → CHANGELOG.md — 8 feat + 4 fix entries to enhance with benefit language
  → README.md — 2 new features detected, metrics need updating
  → docs/guides/getting-started.md — new command added, guide needs amendment
  → AGENTS.md — commands table out of date
  → llms.txt — 2 new files to add
  ⊘ .cursorrules — no drift detected
  ⊘ Package registry — no metadata changes

In plan mode, stop here and report. Otherwise, proceed to execution.

Refresh Actions Table

What ChangedCHANGELOGREADME FeaturesREADME MetricsUser GuidesAI Contextllms.txtRelease Notes
New feature (feat:)AppendUpdate/addUpdate countsAdd/update relevant guideIf architecture changedIf new files addedInclude
Bug fix (fix:)AppendNoNoUpdate troubleshooting if relevantNoNoInclude
New command or skillAppendUpdate tablesUpdate "By the Numbers"Add to guides hubUpdateUpdateInclude
Dependency changeConditionalNoNoNoIf major dependencyNoConditional
Performance improvementAppendUpdate if metrics citedUpdate benchmarksNoNoNoInclude
Breaking changeAppend with migrationUpdateNoAdd migration guideUpdateNoInclude prominently
File renamed/movedNoUpdate if referencedNoUpdate pathsUpdate pathsUpdate pathsNo

Orchestration Workflow

Execute in this order. Each step loads the relevant skill on demand.

Step 1: Analyse (always runs first)

Run the change detection workflow above. Produce the refresh plan. In plan mode, report and stop.

Step 2: CHANGELOG

Load the changelog skill. If release-please has already created CHANGELOG entries for this version, enhance them with benefit language rather than duplicating. If no release-please entries exist, generate from scratch using conventional commits.

Detection: check if a version header (e.g., ## [1.7.0]) or ## [Unreleased] section already exists in CHANGELOG.md with entries for the commits in scope.

Step 3: README

Load the feature-benefits skill. Run a features audit to compare current README features against the codebase. Update:

  • Features section (add new, mark deprecated)
  • "By the Numbers" metrics table (command counts, skill counts, etc.)
  • Badge version references (note: release-please handles the version badge via x-release-please-version — do not duplicate)

Step 4: User Guides

Load the user-guides skill. Identify which guides are affected by checking if changed files relate to documented workflows. Update affected sections. Add new guides if a major new feature warrants one. Update the docs hub page if guides were added.

Step 5: AI Context Files

Load the ai-context skill. Run audit mode first to identify drift across CLAUDE.md, AGENTS.md, .cursorrules, copilot-instructions.md, .windsurfrules, .clinerules, GEMINI.md. Update only files with actual drift — do not regenerate all 7 when only one is stale.

Step 6: llms.txt

Load the llms-txt skill. Regenerate if files were added, removed, or renamed since the boundary. If no structural changes, skip.

Step 7: Package Registry

Load the package-registry skill. Verify that package.json/pyproject.toml metadata (description, keywords, repository, homepage) is still current. Flag any drift.

Step 7.5: Plugin Manifest (if applicable)

If the project has a .claude-plugin/plugin.json, verify the description and keywords fields still match the current README one-liner and features. CLAUDE.md notes "update on every release" — flag stale descriptions that no longer reflect the project's scope.

Step 8: Verify (always runs last)

Load the docs-verify skill. Run full verification: broken links, stale content, llms.txt sync, heading hierarchy, badge URLs, feature coverage, quality score. Report the score and any issues found.

Step 9: Release Notes (optional)

If release-notes argument was provided or running in full mode, generate a GitHub release body from the CHANGELOG entry for this version. Format with benefit-driven language and include migration notes for breaking changes.

Release-Please Integration

Responsibilityrelease-please/doc-refresh
Version strings in manifestsYesNo
Version badge in READMEYes (x-release-please-version)No
CHANGELOG scaffoldingYes (from commit messages)Enhance with benefit language
README prose, features, metricsNoYes
User guidesNoYes
AI context filesNoYes
llms.txtNoYes
Release notes bodyBasic (from commits)Enhanced with benefit language

Timing: Run /doc-refresh before merging the release-please PR:

  1. release-please creates a PR with version bumps and CHANGELOG skeleton
  2. Run /doc-refresh to enhance CHANGELOG, update README, guides, context files
  3. Commit the refreshed docs to the release-please branch
  4. Merge the PR — release-please creates the GitHub Release

Anti-Patterns

  • Do not run /doc-refresh and /readme in the same session — /doc-refresh updates README surgically (affected sections only), while /readme regenerates from scratch. Choose one.
  • Do not duplicate CHANGELOG entries — if release-please already generated entries, enhance them with benefit language rather than creating parallel entries.
  • Do not update user guides for internal refactors — only update guides when user-facing behaviour changes.
  • Do not regenerate all AI context files — audit first, update only the files with actual drift.
  • Do not manually update the version badge — release-please owns the x-release-please-version marker.

Source

git clone https://github.com/littlebearapps/pitchdocs/blob/main/.claude/skills/doc-refresh/SKILL.mdView on GitHub

Overview

Doc Refresh orchestrates documentation updates following version bumps, feature additions, or periodic maintenance. It analyzes git history since the last release, identifies affected docs, and delegates to existing skills (changelog, feature-benefits, docs-verify, ai-context, llms-txt, user-guides) for selective refresh. This keeps changelogs, readmes, user guides, and AI context in sync with code changes.

How This Skill Works

It determines the boundary with git describe and git log, classifies commits by conventional patterns, maps changes to impacted documents, and builds a targeted refresh plan. The plan is then executed by delegating to the appropriate skills for prose, metrics, context, and feature updates.

When to Use It

  • When releasing a new version and updating the changelog
  • When refreshing stale docs after a feature bump or maintenance window
  • During a release to refresh prose, context, and guides alongside version strings
  • During periodic maintenance to keep docs aligned with the codebase
  • When a breaking change or new commands requires migration notes and guides

Quick Start

  1. Step 1: Identify the boundary using git describe or initial commit if no tags exist
  2. Step 2: Parse commits to map to Doc Impacts (feat, fix, docs, refactor, perf, BREAKING CHANGE)
  3. Step 3: Build and execute the refresh plan by delegating to changelog, feature-benefits, docs-verify, ai-context, llms-txt, and user-guides

Best Practices

  • Tie doc-refresh to release gates in CI so updates accompany each release
  • Review the generated refresh plan before execution to validate scope
  • Keep CHANGELOG, README features, and user guides in sync with code changes
  • Ensure AI context and llms-txt accurately reflect the current architecture
  • Test changes in a staging environment or isolated docs preview before publishing

Example Use Cases

  • Plan shows updated CHANGELOG entries for feat and fix, refreshed README features, and new docs in docs/guides
  • A build with no conventional commits prompts git diff analysis to suggest doc-type changes
  • Changelog highlights new benefits language while user guides mention the new commands
  • AI context files updated to reflect architecture changes and llms.txt added for new metrics
  • Docs-audit clean run recommends targeted refresh instead of full-generation

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers ↗