docs-updater by giuseppe-trisciuoglio/developer-kit
npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill docs-updater自动化保持项目文档与代码库变更同步的过程。此技能分析当前工作分支与上一个发布版本之间的 git 差异,然后智能地更新相关文档文件。
通用文档自动更新器提供了一种与语言无关的文档维护方法。通过利用 git 操作来识别自上次发布以来的变更,它为 README.md、CHANGELOG.md 和项目文档文件夹生成有针对性的更新。
主要特性:
在以下情况下使用此技能:
触发短语: "update docs", "update changelog", "sync documentation", "update readme", "prepare release documentation", "what changed since last release", "generate release notes"
开始之前,请验证是否满足以下条件:
# 验证我们是否在 git 仓库中
git rev-parse --git-dir
# 检查 git 标签是否存在
git tag --list | head -5
# 验证文档文件是否存在
test -f README.md || echo "README.md not found"
test -f CHANGELOG.md || echo "CHANGELOG.md not found"
如果不存在任何标签,请告知用户此技能需要至少一个发布标签来进行比较。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
目标 : 识别最新的发布版本以进行比较。
操作:
# 获取最新的标签
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null)
# 如果未找到标签,通知用户
if [ -z "$LATEST_TAG" ]; then
echo "No git tags found. This skill requires at least one release tag."
echo "Please create a release tag first (e.g., git tag -a v1.0.0 -m 'Initial release')"
exit 1
fi
echo "Latest release tag: $LATEST_TAG"
echo "Current branch: $(git branch --show-current)"
2. 提取版本信息以供显示:
# 从标签解析版本(处理 v1.2.3、1.2.3、release-1.2.3 等格式)
VERSION=$(echo "$LATEST_TAG" | sed -E 's/^[^0-9]*([0-9]+\.[0-9]+\.[0-9]+).*/\1/')
echo "Version detected: $VERSION"
3. 获取当前分支名称:
CURRENT_BRANCH=$(git branch --show-current)
echo "Comparing: $LATEST_TAG -> $CURRENT_BRANCH"
目标 : 分析上一个发布版本与当前分支之间的所有变更。
操作:
# 获取标签与 HEAD 之间的提交数量
COMMIT_COUNT=$(git rev-list --count ${LATEST_TAG}..HEAD 2>/dev/null || echo "0")
echo "Commits since $LATEST_TAG: $COMMIT_COUNT"
# 获取文件变更统计信息
git diff --stat ${LATEST_TAG}..HEAD
2. 提取提交消息以供分析:
# 获取范围内的所有提交消息
COMMITS=$(git log ${LATEST_TAG}..HEAD --pretty=format:"%h|%s|%b" --reverse)
# 显示提交以供审查
echo "$COMMITS"
3. 获取详细的文件变更:
# 获取已更改文件列表
CHANGED_FILES=$(git diff --name-only ${LATEST_TAG}..HEAD)
# 按类型分类变更
ADDED_FILES=$(git diff --name-only --diff-filter=A ${LATEST_TAG}..HEAD)
DELETED_FILES=$(git diff --name-only --diff-filter=D ${LATEST_TAG}..HEAD)
MODIFIED_FILES=$(git diff --name-only --diff-filter=M ${LATEST_TAG}..HEAD)
4. 根据文件路径识别组件区域:
# 检测哪些组件/区域发生了变更
echo "$CHANGED_FILES" | grep -E "^plugins/" | cut -d'/' -f2 | sort -u
目标 : 识别项目中所有相关的文档位置。
操作:
# 检查常见的文档位置
DOC_FOLDERS=()
[ -d "docs" ] && DOC_FOLDERS+=("docs/")
[ -d "documentation" ] && DOC_FOLDERS+=("documentation/")
[ -d "doc" ] && DOC_FOLDERS+=("doc/")
# 查找特定于插件的文档
for plugin_dir in plugins/*/; do
if [ -d "${plugin_dir}docs" ]; then
DOC_FOLDERS+=("${plugin_dir}docs/")
fi
done
echo "Documentation folders found:"
printf ' - %s\n' "${DOC_FOLDERS[@]}"
2. 识别现有的文档文件:
# 检查标准文档文件
DOC_FILES=()
[ -f "README.md" ] && DOC_FILES+=("README.md")
[ -f "CHANGELOG.md" ] && DOC_FILES+=("CHANGELOG.md")
[ -f "CONTRIBUTING.md" ] && DOC_FILES+=("CONTRIBUTING.md")
[ -f "docs/GUIDE.md" ] && DOC_FILES+=("docs/GUIDE.md")
echo "Documentation files found:"
printf ' - %s\n' "${DOC_FILES[@]}"
目标 : 创建遵循 Keep a Changelog 标准的分类变更日志条目。
操作:
有关详细的 bash 命令和变更日志模板,请参阅 references/examples.md。
目标 : 使用相关的高级变更更新主 README。
操作:
目标 : 将变更传播到 docs/ 文件夹中的相关文档。
操作:
有关详细的发现模式和更新策略,请参阅 references/examples.md。
目标 : 在应用更改之前向用户展示将要更新的内容。
操作:
## 建议的文档更新
### 版本信息
- 上一个发布版本: $LATEST_TAG
- 当前分支: $CURRENT_BRANCH
- 已分析的提交: $COMMIT_COUNT
### 要更新的文件
- [ ] CHANGELOG.md - 添加带有分类变更的新版本部分
- [ ] README.md - 更新 [特定部分]
- [ ] docs/[特定文件] - 更新文档
### 变更摘要
**新增**: N 个新功能
**变更**: N 个修改
**修复**: N 个错误修复
**破坏性变更**: N 个破坏性变更
2. 通过 AskUserQuestion 向用户请求确认:
目标 : 将更新写入文档文件。
操作:
# 读取当前变更日志
CURRENT_CHANGELOG=$(cat CHANGELOG.md)
# 前置新部分
cat > CHANGELOG.md << 'EOF'
# 变更日志
本项目所有重要的变更都将记录在此文件中。
格式基于 [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
并且本项目遵循 [语义化版本控制](https://semver.org/spec/v2.0.0.html)。
## [未发布]
[新内容放在这里]
[现有变更日志的其余部分]
EOF
2. 使用 Edit 工具更新 README.md:
# 对于每个需要更新的文档文件
# 使用 Edit 工具进行精确更改
4. 显示变更的 git diff:
# 显示将要更改的内容
git diff CHANGELOG.md
git diff README.md
git diff docs/
用户请求: "为我刚添加的新功能更新文档"
输出:
用户请求: "为 v2.5.0 发布准备文档"
输出:
用户请求: "同步文档,我做了一些更改"
输出:
有关详细的会话记录和故障排除,请参阅 references/examples.md。
每周安装次数
103
仓库
GitHub 星标数
173
首次出现
2026年3月4日
安全审计
安装于
codex89
gemini-cli88
claude-code88
github-copilot88
amp85
cline85
Automates the process of keeping project documentation synchronized with codebase changes. This skill analyzes git differences between the current working branch and the last released version, then intelligently updates relevant documentation files.
The Universal Documentation Auto-Updater provides a language-agnostic approach to documentation maintenance. By leveraging git operations to identify what has changed since the last release, it generates targeted updates for README.md, CHANGELOG.md, and project documentation folders.
Key Features:
Use this skill when:
Trigger phrases: "update docs", "update changelog", "sync documentation", "update readme", "prepare release documentation", "what changed since last release", "generate release notes"
Before starting, verify that the following conditions are met:
# Verify we're in a git repository
git rev-parse --git-dir
# Check that git tags exist
git tag --list | head -5
# Verify documentation files exist
test -f README.md || echo "README.md not found"
test -f CHANGELOG.md || echo "CHANGELOG.md not found"
If no tags exist, inform the user that this skill requires at least one release tag to compare against.
Goal : Identify the latest released version to compare against.
Actions:
# Get the most recent tag
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null)
# If no tags found, inform the user
if [ -z "$LATEST_TAG" ]; then
echo "No git tags found. This skill requires at least one release tag."
echo "Please create a release tag first (e.g., git tag -a v1.0.0 -m 'Initial release')"
exit 1
fi
echo "Latest release tag: $LATEST_TAG"
echo "Current branch: $(git branch --show-current)"
2. Extract version information for display:
# Parse version from tag (handles v1.2.3, 1.2.3, release-1.2.3 formats)
VERSION=$(echo "$LATEST_TAG" | sed -E 's/^[^0-9]*([0-9]+\.[0-9]+\.[0-9]+).*/\1/')
echo "Version detected: $VERSION"
3. Get the current branch name:
CURRENT_BRANCH=$(git branch --show-current)
echo "Comparing: $LATEST_TAG -> $CURRENT_BRANCH"
Goal : Analyze all changes between the last release and current branch.
Actions:
# Get commit count between tag and HEAD
COMMIT_COUNT=$(git rev-list --count ${LATEST_TAG}..HEAD 2>/dev/null || echo "0")
echo "Commits since $LATEST_TAG: $COMMIT_COUNT"
# Get file change statistics
git diff --stat ${LATEST_TAG}..HEAD
2. Extract commit messages for analysis:
# Get all commit messages in the range
COMMITS=$(git log ${LATEST_TAG}..HEAD --pretty=format:"%h|%s|%b" --reverse)
# Display commits for review
echo "$COMMITS"
3. Get detailed file changes:
# Get list of changed files
CHANGED_FILES=$(git diff --name-only ${LATEST_TAG}..HEAD)
# Categorize changes by type
ADDED_FILES=$(git diff --name-only --diff-filter=A ${LATEST_TAG}..HEAD)
DELETED_FILES=$(git diff --name-only --diff-filter=D ${LATEST_TAG}..HEAD)
MODIFIED_FILES=$(git diff --name-only --diff-filter=M ${LATEST_TAG}..HEAD)
4. Identify component areas based on file paths:
# Detect which components/areas changed
echo "$CHANGED_FILES" | grep -E "^plugins/" | cut -d'/' -f2 | sort -u
Goal : Identify all relevant documentation locations in the project.
Actions:
# Check for common documentation locations
DOC_FOLDERS=()
[ -d "docs" ] && DOC_FOLDERS+=("docs/")
[ -d "documentation" ] && DOC_FOLDERS+=("documentation/")
[ -d "doc" ] && DOC_FOLDERS+=("doc/")
# Find plugin-specific docs
for plugin_dir in plugins/*/; do
if [ -d "${plugin_dir}docs" ]; then
DOC_FOLDERS+=("${plugin_dir}docs/")
fi
done
echo "Documentation folders found:"
printf ' - %s\n' "${DOC_FOLDERS[@]}"
2. Identify existing documentation files:
# Check for standard doc files
DOC_FILES=()
[ -f "README.md" ] && DOC_FILES+=("README.md")
[ -f "CHANGELOG.md" ] && DOC_FILES+=("CHANGELOG.md")
[ -f "CONTRIBUTING.md" ] && DOC_FILES+=("CONTRIBUTING.md")
[ -f "docs/GUIDE.md" ] && DOC_FILES+=("docs/GUIDE.md")
echo "Documentation files found:"
printf ' - %s\n' "${DOC_FILES[@]}"
Goal : Create categorized changelog entries following Keep a Changelog standard.
Actions:
See references/examples.md for detailed bash commands and changelog templates.
Goal : Update the main README with relevant high-level changes.
Actions:
Goal : Propagate changes to relevant documentation in docs/ folders.
Actions:
See references/examples.md for detailed discovery patterns and update strategies.
Goal : Show the user what will be updated before applying changes.
Actions:
## Proposed Documentation Updates
### Version Information
- Previous release: $LATEST_TAG
- Current branch: $CURRENT_BRANCH
- Commits analyzed: $COMMIT_COUNT
### Files to Update
- [ ] CHANGELOG.md - Add new version section with categorized changes
- [ ] README.md - Update [specific sections]
- [ ] docs/[specific files] - Update documentation
### Summary of Changes
**Added**: N new features
**Changed**: N modifications
**Fixed**: N bug fixes
**Breaking**: N breaking changes
2. Ask the user for confirmation via AskUserQuestion :
Goal : Write the updates to the documentation files.
Actions:
# Read current changelog
CURRENT_CHANGELOG=$(cat CHANGELOG.md)
# Prepend new section
cat > CHANGELOG.md << 'EOF'
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
[New content goes here]
[Rest of existing changelog]
EOF
2. Update README.md using Edit tool:
# For each documentation file that needs updates
# Use Edit tool to make precise changes
4. Show git diff of changes:
# Show what will change
git diff CHANGELOG.md
git diff README.md
git diff docs/
User request: "Update docs for the new features I just added"
Output:
User request: "Prepare documentation for v2.5.0 release"
Output:
User request: "Sync docs, I've made some changes"
Output:
See references/examples.md for detailed session transcripts and troubleshooting.
Weekly Installs
103
Repository
GitHub Stars
173
First Seen
Mar 4, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex89
gemini-cli88
claude-code88
github-copilot88
amp85
cline85