$npx -y skills add giuseppe-trisciuoglio/developer-kit --skill docs-updaterProvides automated documentation updates by analyzing git changes between the current branch and the last release tag. Performs git diff analysis to identify modifications, then updates README.md, CHANGELOG.md following Keep a Changelog standard, and discovers documentation folde
| 1 | # Universal Documentation Updater |
| 2 | |
| 3 | Analyzes git changes since the latest release tag and updates the documentation files that should change with them. |
| 4 | |
| 5 | ## Overview |
| 6 | |
| 7 | Use git history to identify release-relevant changes, then update `README.md`, `CHANGELOG.md`, and any relevant documentation folders. Keep the workflow focused on explicit user approval, precise edits, and repository-specific documentation structure. |
| 8 | |
| 9 | ## When to Use |
| 10 | |
| 11 | Use this skill when: |
| 12 | |
| 13 | - Preparing release notes or an `Unreleased` changelog update |
| 14 | - Syncing `README.md` or documentation after feature work lands |
| 15 | - Reviewing what changed since the last release before a PR or release |
| 16 | |
| 17 | ## Prerequisites |
| 18 | |
| 19 | Before starting, verify that the following conditions are met: |
| 20 | |
| 21 | ```bash |
| 22 | # Verify we're in a git repository |
| 23 | git rev-parse --git-dir |
| 24 | |
| 25 | # Check that git tags exist |
| 26 | git tag --list | head -5 |
| 27 | |
| 28 | # Verify documentation files exist |
| 29 | test -f README.md || echo "README.md not found" |
| 30 | test -f CHANGELOG.md || echo "CHANGELOG.md not found" |
| 31 | ``` |
| 32 | |
| 33 | If no tags exist, inform the user that this skill requires at least one release tag to compare against. |
| 34 | |
| 35 | ## Instructions |
| 36 | |
| 37 | ### Phase 1: Detect Last Release Version |
| 38 | |
| 39 | **Goal**: Identify the latest released version to compare against. |
| 40 | |
| 41 | **Actions:** |
| 42 | |
| 43 | 1. Detect the comparison baseline and display it: |
| 44 | |
| 45 | ```bash |
| 46 | LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null) |
| 47 | |
| 48 | if [ -z "$LATEST_TAG" ]; then |
| 49 | echo "No git tags found. This skill requires at least one release tag." |
| 50 | echo "Please create a release tag first (e.g., git tag -a v1.0.0 -m 'Initial release')" |
| 51 | exit 1 |
| 52 | fi |
| 53 | |
| 54 | CURRENT_BRANCH=$(git branch --show-current) |
| 55 | VERSION=$(echo "$LATEST_TAG" | sed -E 's/^[^0-9]*([0-9]+\.[0-9]+\.[0-9]+).*/\1/') |
| 56 | |
| 57 | echo "Latest release tag: $LATEST_TAG" |
| 58 | echo "Version detected: $VERSION" |
| 59 | echo "Comparing: $LATEST_TAG -> $CURRENT_BRANCH" |
| 60 | ``` |
| 61 | |
| 62 | ### Phase 2: Perform Git Diff Analysis |
| 63 | |
| 64 | **Goal**: Analyze all changes between the last release and current branch. |
| 65 | |
| 66 | **Actions:** |
| 67 | |
| 68 | 1. Get the commit range and statistics: |
| 69 | |
| 70 | ```bash |
| 71 | # Get commit count between tag and HEAD |
| 72 | COMMIT_COUNT=$(git rev-list --count ${LATEST_TAG}..HEAD 2>/dev/null || echo "0") |
| 73 | echo "Commits since $LATEST_TAG: $COMMIT_COUNT" |
| 74 | |
| 75 | # Get file change statistics |
| 76 | git diff --stat ${LATEST_TAG}..HEAD |
| 77 | ``` |
| 78 | |
| 79 | 2. Extract commit messages for analysis: |
| 80 | |
| 81 | ```bash |
| 82 | # Get all commit messages in the range |
| 83 | COMMITS=$(git log ${LATEST_TAG}..HEAD --pretty=format:"%h|%s|%b" --reverse) |
| 84 | |
| 85 | # Display commits for review |
| 86 | echo "$COMMITS" |
| 87 | ``` |
| 88 | |
| 89 | 3. Get detailed file changes: |
| 90 | |
| 91 | ```bash |
| 92 | # Get list of changed files |
| 93 | CHANGED_FILES=$(git diff --name-only ${LATEST_TAG}..HEAD) |
| 94 | |
| 95 | # Show add/modify/delete status for quick categorization |
| 96 | git diff --name-status ${LATEST_TAG}..HEAD |
| 97 | ``` |
| 98 | |
| 99 | 4. Identify component areas based on file paths: |
| 100 | |
| 101 | ```bash |
| 102 | # Detect which components/areas changed |
| 103 | echo "$CHANGED_FILES" | grep -E "^plugins/" | cut -d'/' -f2 | sort -u |
| 104 | ``` |
| 105 | |
| 106 | ### Phase 3: Discover Documentation Structure |
| 107 | |
| 108 | **Goal**: Identify all relevant documentation locations in the project. |
| 109 | |
| 110 | **Actions:** |
| 111 | |
| 112 | 1. Find standard documentation folders: |
| 113 | |
| 114 | ```bash |
| 115 | # Check for common documentation locations |
| 116 | DOC_FOLDERS=() |
| 117 | |
| 118 | [ -d "docs" ] && DOC_FOLDERS+=("docs/") |
| 119 | [ -d "documentation" ] && DOC_FOLDERS+=("documentation/") |
| 120 | [ -d "doc" ] && DOC_FOLDERS+=("doc/") |
| 121 | |
| 122 | # Find plugin-specific docs |
| 123 | for plugin_dir in plugins/*/; do |
| 124 | if [ -d "${plugin_dir}docs" ]; then |
| 125 | DOC_FOLDERS+=("${plugin_dir}docs/") |
| 126 | fi |
| 127 | done |
| 128 | |
| 129 | echo "Documentation folders found:" |
| 130 | printf ' - %s\n' "${DOC_FOLDERS[@]}" |
| 131 | ``` |
| 132 | |
| 133 | 2. Identify existing documentation files: |
| 134 | |
| 135 | ```bash |
| 136 | # Check for standard doc files |
| 137 | DOC_FILES=() |
| 138 | |
| 139 | [ -f "README.md" ] && DOC_FILES+=("README.md") |
| 140 | [ -f "CHANGELOG.md" ] && DOC_FILES+=("CHANGELOG.md") |
| 141 | [ -f "CONTRIBUTING.md" ] && DOC_FILES+=("CONTRIBUTING.md") |
| 142 | [ -f "docs/GUIDE.md" ] && DOC_FILES+=("docs/GUIDE.md") |
| 143 | |
| 144 | echo "Documentation files found:" |
| 145 | printf ' - %s\n' "${DOC_FILES[@]}" |
| 146 | ``` |
| 147 | |
| 148 | ### Phase 4: Generate CHANGELOG Updates |
| 149 | |
| 150 | **Goal**: Create categorized changelog entries following Keep a Changelog standard. |
| 151 | |
| 152 | **Actions:** |
| 153 | |
| 154 | 1. Parse commits using conventional commit semantics and map them into Keep a Changelog sections such as `Added`, `Changed`, `Fixed`, `Removed`, and `Security`. |
| 155 | |
| 156 | 2. Read the existing CHANGELOG.md to understand structure, then generate new entries following Keep a Changelog format. |
| 157 | |
| 158 | See `references/examples.md` for detailed bash commands and changelog templates. |
| 159 | |
| 160 | ### Phase 5: Update README.m |