npx skills add https://github.com/paulrberg/agent-skills --skill md-docs管理 Claude Code 工作流的项目文档,包括上下文文件、README 和智能体指令。此技能为维护准确、最新的文档提供了结构化自动化,确保文档与实际的代码库结构和功能保持一致。在初始化新项目、更新现有文档或确保上下文文件准确反映当前代码时使用此技能。
该技能强调验证和确认而非盲目生成——在创建或更新文档之前,先分析实际的代码库结构、文件内容和模式。所有生成的内容都应简洁、使用祈使语气,并采用专家对专家的风格,而非冗长或教程式。
在使用任何文档工作流之前,请验证基本项目结构:
git rev-parse --git-dir
确保输出确认您位于一个 git 仓库中。如果未初始化,文档工作流可能仍会继续,但特定于 git 的功能将被跳过。
对于更新工作流,请验证目标文件是否存在:
ls -la CLAUDE.md AGENTS.md DOCS.md README.md CONTRIBUTING.md
在尝试更新之前,检查存在哪些文件。缺失的文件将显示错误,这有助于识别需要初始化的内容。请注意,DOCS.md 是可选的,仅与具有 API 或公共接口的项目相关。CONTRIBUTING.md 是可选的,仅当仓库已定义贡献指南时才相关。
根据实际代码库验证并修复 AGENTS.md,以及可选的 DOCS.md 和 CONTRIBUTING.md。CLAUDE.md 是 AGENTS.md 的符号链接,无需单独处理。此工作流读取现有的上下文文件,分析代码库结构,识别差异,并更新文档以匹配实际情况。仅当 DOCS.md 和 CONTRIBUTING.md 存在于仓库中时,才会处理它们。
解析参数
支持以下参数:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
--dry-run:显示将进行的更改而不写入文件--preserve:保留现有内容结构,仅修复不准确之处--thorough:对所有文件进行深度分析(较慢但全面)--minimal:仅关注高层结构的快速验证验证 Git 仓库
确认工作目录是一个 git 仓库。如果不是,则警告用户但继续执行(无法分析 git 历史记录或分支)。
读取现有上下文文件
读取当前的 AGENTS.md、DOCS.md 和 CONTRIBUTING.md(如果存在)的内容。CLAUDE.md 是 AGENTS.md 的符号链接,无需单独读取:
cat AGENTS.md
cat DOCS.md # 如果存在
cat CONTRIBUTING.md # 如果存在
解析结构并提取已记录的信息,包括:
分析代码库
扫描项目以收集准确信息:
ls -la,如果可用则使用 tree)package.json、pyproject.toml、Cargo.toml 等)对于 --thorough 模式,还分析:
识别差异
将已记录的信息与实际代码库进行比较:
CLAUDE.md 符号链接(应指向 AGENTS.md)创建备份
在覆盖之前,创建备份文件。CLAUDE.md 是 AGENTS.md 的符号链接,无需单独备份:
cp AGENTS.md AGENTS.md.backup
test -f DOCS.md && cp DOCS.md DOCS.md.backup
test -f CONTRIBUTING.md && cp CONTRIBUTING.md CONTRIBUTING.md.backup
更新上下文文件
写入修正后的版本,当使用 --preserve 时保持现有结构,否则为清晰起见进行重组。确保 CLAUDE.md 符号链接存在(ln -sf AGENTS.md CLAUDE.md)。对于 --dry-run,显示差异而不写入:
diff -u AGENTS.md.backup AGENTS.md
生成报告
显示更改摘要。
当 DOCS.md 存在时:
✓ 已更新 AGENTS.md
- 修复了过时的构建命令
- 在结构中添加了新的 /api 目录
- 更新了测试运行器触发模式
✓ 已更新 DOCS.md
- 修复了过时的端点路径 /api/v1/users
- 更新了 createUser() 的函数签名
✓ 已更新 CONTRIBUTING.md
- 更新了分支命名约定
- 修复了过时的 PR 模板引用
✓ CLAUDE.md 符号链接已验证
当可选文件不存在时:
✓ 已更新 AGENTS.md
- 修复了过时的构建命令
✓ CLAUDE.md 符号链接已验证
⊘ 未找到 DOCS.md(已跳过)
⊘ 未找到 CONTRIBUTING.md(已跳过)
有关完整的更新上下文文件工作流,包括验证策略、差异示例和边缘情况,请参阅 references/update-agents.md。
根据项目结构、包元数据和代码库分析生成或更新 README.md。此工作流创建全面、准确的 README,以反映项目的实际状态。
解析参数
支持以下参数:
--dry-run:预览 README 内容而不写入--preserve:保留现有章节,仅更新过时信息--minimal:生成最小化的 README(标题、描述、安装、用法)--full:生成包含所有可选章节的全面 README分析项目结构
从多个来源收集信息:
# 包元数据
cat package.json
cat pyproject.toml
cat Cargo.toml
# Git 信息
git remote get-url origin
git describe --tags
# 目录结构
ls -la
提取:
读取现有 README
如果 README.md 存在且使用了 --preserve:
cat README.md
解析现有章节,在更新技术细节的同时保留自定义内容。
读取 CONTRIBUTING.md(可选)
如果 CONTRIBUTING.md 存在,则读取它并将其视为贡献指南的可靠来源。不要在 README 中重复详细的贡献步骤;而是链接到 CONTRIBUTING.md。
test -f CONTRIBUTING.md && cat CONTRIBUTING.md
创建备份
在覆盖现有 README 之前:
cp README.md README.md.backup
生成 README 内容
创建具有适当章节的结构化内容:
对于 --minimal 模式,仅包括标题、描述、安装和用法。
对于 --full 模式,还包括:
写入 README
保存生成的内容。对于 --dry-run,仅显示而不写入。
生成报告
显示摘要:
✓ 已更新 README.md
- 添加了安装章节
- 更新了构建命令以匹配 package.json
- 添加了许可证和版本徽章
有关完整的更新 README 工作流,包括章节模板、元数据提取策略和格式化示例,请参阅 references/update-readme.md。
根据当前代码库工具和工作流更新 CONTRIBUTING.md。此工作流仅在 CONTRIBUTING.md 已存在于仓库中时运行。 如果 CONTRIBUTING.md 不存在,则完全跳过此工作流——不要自动创建贡献指南。
在继续之前,验证文件是否存在:
test -f CONTRIBUTING.md && echo "exists" || echo "missing"
如果缺失,则向用户报告并停止。除非明确请求,否则不要创建 CONTRIBUTING.md。
解析参数
支持以下参数:
--dry-run:显示将进行的更改而不写入文件--preserve:最大程度保留;仅修复损坏的命令/链接--thorough:深度分析;验证所有链接和命令是否有效读取现有 CONTRIBUTING.md
cat CONTRIBUTING.md
解析文档结构:
收集代码库信息
检测当前工具并与记录的内容进行比较:
识别差异
将已记录的信息与实际代码库进行比较:
更新内容
修复技术不准确之处,同时保留:
生成报告
显示摘要:
✓ 已更新 CONTRIBUTING.md
- 修复了包管理器:npm → pnpm
- 更正了分支引用:master → main
- 更新了测试命令
⊘ 政策章节已保留(CLA、审查流程)
有关完整的更新 CONTRIBUTING 工作流,包括验证策略和示例,请参阅 references/update-contributing.md。
根据代码库分析从头开始创建项目特定的 AGENTS.md。此工作流非常适合新项目或缺乏上下文文档的仓库。
解析参数
支持以下参数:
--dry-run:预览生成的内容而不写入--minimal:创建最小化的上下文文件(项目描述、结构)--full:创建包含所有相关章节的全面上下文文件验证没有现有的 AGENTS.md
检查 AGENTS.md 是否已存在:
test -f AGENTS.md && echo "exists" || echo "missing"
如果存在,则警告用户并建议改用更新工作流。允许使用 --force 标志覆盖。
分析项目
收集全面信息:
生成 AGENTS.md 内容
创建结构化章节:
# 上下文
简要的项目描述和目的。
## 结构
目录组织和关键文件。
## 构建
用于构建项目的命令。
## 测试
用于运行测试的命令。
## 开发
约定、模式和工作流。
根据项目类型调整章节。对于 --minimal,仅包括上下文和结构。对于 --full,添加所有适用的章节,包括部署、故障排除和自定义工具。
写入 AGENTS.md
保存生成的内容并创建 CLAUDE.md 符号链接(ln -sf AGENTS.md CLAUDE.md)。对于 --dry-run,仅显示而不写入。
生成报告
显示摘要:
✓ 已创建 AGENTS.md
- 检测到 Next.js 项目
- 从 package.json 添加了 npm 脚本
- 记录了项目结构
- 为 Jest 添加了测试章节
✓ 已创建 CLAUDE.md 符号链接
有关完整的初始化上下文工作流,包括特定于语言的模板、检测策略和自定义选项,请参阅 references/init-agents.md。
DOCS.md 是可选的,默认不创建。当项目具有以下情况时,手动创建 DOCS.md:
如果更新上下文工作流检测到存在大量 API 但没有相应的文档,则会建议创建 DOCS.md。
有关详细的工作流、示例和实施指南,请参阅这些参考文档:
references/common-patterns.md - 参数解析、备份处理、写作风格、报告格式化、文件检测和元数据提取references/update-agents.md - 完整的上下文文件更新工作流,包括验证策略、差异生成和差异检测references/update-readme.md - 完整的 README 更新工作流,包括章节模板、元数据提取和格式化约定references/update-contributing.md - 完整的 CONTRIBUTING.md 更新工作流,包括范围、模板和验证(仅当 CONTRIBUTING.md 存在时)references/init-agents.md - 完整的上下文初始化工作流,包括特定于语言的模板、检测策略和自定义选项这些参考资料为每种工作流类型提供了实施细节、代码示例和故障排除指南。
每周安装数
112
仓库
GitHub 星标数
41
首次出现
2026年2月5日
安全审计
安装于
claude-code103
codex94
gemini-cli90
github-copilot90
amp89
kimi-cli89
Manage project documentation for Claude Code workflows including context files, READMEs, and agent instructions. This skill provides structured automation for maintaining accurate, up-to-date documentation that aligns with actual codebase structure and functionality. Use this skill when initializing new projects, updating existing documentation, or ensuring context files accurately reflect current code.
The skill emphasizes verification and validation over blind generation—analyze the actual codebase structure, file contents, and patterns before creating or updating documentation. All generated content should be terse, imperative, and expert-to-expert rather than verbose or tutorial-style.
Before using any documentation workflow, verify basic project structure:
git rev-parse --git-dir
Ensure the output confirms you are in a git repository. If not initialized, documentation workflows may still proceed but git-specific features will be skipped.
For update workflows, verify target files exist:
ls -la CLAUDE.md AGENTS.md DOCS.md README.md CONTRIBUTING.md
Check which files are present before attempting updates. Missing files will show errors, which helps identify what needs initialization. Note that DOCS.md is optional and only relevant for projects with APIs or public interfaces. CONTRIBUTING.md is optional and only relevant if the repo already defines contribution guidance.
Verify and fix AGENTS.md, and optionally DOCS.md and CONTRIBUTING.md against the actual codebase. CLAUDE.md is a symlink to AGENTS.md and does not need separate processing. This workflow reads existing context files, analyzes the codebase structure, identifies discrepancies, and updates documentation to match reality. DOCS.md and CONTRIBUTING.md are only processed if they exist in the repository.
Parse Arguments
Support the following arguments:
--dry-run: Show what would change without writing files--preserve: Keep existing content structure, only fix inaccuracies--thorough: Perform deep analysis of all files (slower but comprehensive)--minimal: Quick verification focusing on high-level structure onlyVerify Git Repository
Confirm working directory is a git repository. If not, warn the user but proceed with limitations (cannot analyze git history or branches).
Read Existing Context Files
Read current AGENTS.md, DOCS.md, and CONTRIBUTING.md (if present) contents. CLAUDE.md is a symlink to AGENTS.md and does not need a separate read:
cat AGENTS.md
cat DOCS.md # if exists
cat CONTRIBUTING.md # if exists
Parse the structure and extract documented information including:
Analyze Codebase
Scan the project to gather accurate information:
ls -la, tree if available)package.json, pyproject.toml, Cargo.toml, etc.)For --thorough mode, also analyze:
Identify Discrepancies
Compare documented information against actual codebase:
CLAUDE.md symlink (should point to AGENTS.md)Create Backups
Before overwriting, create backup files. CLAUDE.md is a symlink to AGENTS.md and does not need a separate backup:
cp AGENTS.md AGENTS.md.backup
test -f DOCS.md && cp DOCS.md DOCS.md.backup
test -f CONTRIBUTING.md && cp CONTRIBUTING.md CONTRIBUTING.md.backup
Update Context Files
Write corrected versions maintaining the existing structure when --preserve is used, or reorganizing for clarity when not. Ensure the CLAUDE.md symlink exists (ln -sf AGENTS.md CLAUDE.md). For --dry-run, display the diff without writing:
diff -u AGENTS.md.backup AGENTS.md
Generate Report
Display a summary of changes.
When DOCS.md exists:
✓ Updated AGENTS.md
- Fixed outdated build command
- Added new /api directory to structure
- Updated test-runner trigger pattern
✓ Updated DOCS.md
- Fixed outdated endpoint path /api/v1/users
- Updated function signature for createUser()
✓ Updated CONTRIBUTING.md
- Updated branch naming convention
- Fixed outdated PR template reference
✓ CLAUDE.md symlink verified
When optional files are absent:
✓ Updated AGENTS.md
- Fixed outdated build command
✓ CLAUDE.md symlink verified
⊘ DOCS.md not found (skipped)
⊘ CONTRIBUTING.md not found (skipped)
For the complete update context files workflow with verification strategies, diff examples, and edge cases, refer to references/update-agents.md.
Generate or update README.md based on project structure, package metadata, and codebase analysis. This workflow creates comprehensive, accurate READMEs that reflect the actual state of the project.
Parse Arguments
Support the following arguments:
--dry-run: Preview README content without writing--preserve: Keep existing sections, only update outdated information--minimal: Generate minimal README (title, description, installation, usage)--full: Generate comprehensive README with all optional sectionsAnalyze Project Structure
Gather information from multiple sources:
# Package metadata
cat package.json
cat pyproject.toml
cat Cargo.toml
# Git information
git remote get-url origin
git describe --tags
# Directory structure
ls -la
Extract:
Read Existing README
If README.md exists and --preserve is used:
cat README.md
Parse existing sections to preserve custom content while updating technical details.
Read CONTRIBUTING.md (Optional)
If CONTRIBUTING.md exists, read it and treat it as the source of truth for contribution guidance. Do not duplicate detailed contribution steps in README; link to CONTRIBUTING.md instead.
test -f CONTRIBUTING.md && cat CONTRIBUTING.md
Create Backup
Before overwriting existing README:
cp README.md README.md.backup
Generate README Content
Create structured content with appropriate sections:
For --minimal mode, include only title, description, installation, and usage.
For --full mode, also include:
Write README
Save the generated content. For --dry-run, display without writing.
Generate Report
Display summary:
✓ Updated README.md
- Added installation section
- Updated build commands to match package.json
- Added badges for license and version
For the complete update README workflow with section templates, metadata extraction strategies, and formatting examples, refer to references/update-readme.md.
Update CONTRIBUTING.md based on current codebase tooling and workflows. This workflow only runs when CONTRIBUTING.md already exists in the repository. If CONTRIBUTING.md is absent, skip this workflow entirely—do not auto-create contribution guidelines.
Before proceeding, verify the file exists:
test -f CONTRIBUTING.md && echo "exists" || echo "missing"
If missing, report to the user and stop. Do not create CONTRIBUTING.md unless explicitly requested.
Parse Arguments
Support the following arguments:
--dry-run: Show what would change without writing files--preserve: Maximum preservation; only fix broken commands/links--thorough: Deep analysis; verify all links and commands workRead Existing CONTRIBUTING.md
cat CONTRIBUTING.md
Parse the document structure:
Gather Codebase Intelligence
Detect current tooling and compare against documented content:
Identify Discrepancies
Compare documented information against actual codebase:
Update Content
Fix technical inaccuracies while preserving:
Generate Report
Display summary:
✓ Updated CONTRIBUTING.md
- Fixed package manager: npm → pnpm
- Corrected branch reference: master → main
- Updated test command
⊘ Policy sections preserved (CLA, review process)
For the complete update CONTRIBUTING workflow with verification strategies and examples, refer to references/update-contributing.md.
Create project-specific AGENTS.md from scratch based on codebase analysis. This workflow is ideal for new projects or repositories lacking context documentation.
Parse Arguments
Support the following arguments:
--dry-run: Preview generated content without writing--minimal: Create minimal context file (project description, structure)--full: Create comprehensive context file with all relevant sectionsVerify No Existing AGENTS.md
Check if AGENTS.md already exists:
test -f AGENTS.md && echo "exists" || echo "missing"
If exists, warn the user and suggest using the update workflow instead. Allow override with --force flag.
Analyze Project
Gather comprehensive information:
Generate AGENTS.md Content
Create structured sections:
# Context
Brief project description and purpose.
## Structure
Directory organization and key files.
## Build
Commands for building the project.
## Test
Commands for running tests.
## Development
Conventions, patterns, and workflows.
Adapt sections based on project type. For --minimal, include only Context and Structure. For --full, add all applicable sections including deployment, troubleshooting, and custom tooling.
Write AGENTS.md
Save generated content and create CLAUDE.md symlink (ln -sf AGENTS.md CLAUDE.md). For --dry-run, display without writing.
Generate Report
Display summary:
✓ Created AGENTS.md
- Detected Next.js project
- Added npm scripts from package.json
- Documented project structure
- Added testing section for Jest
✓ Created CLAUDE.md symlink
For the complete initialize context workflow with language-specific templates, detection strategies, and customization options, refer to references/init-agents.md.
DOCS.md is optional and not created by default. Create DOCS.md manually when the project has:
The update context workflow will suggest creating DOCS.md if it detects significant APIs without corresponding documentation.
For detailed workflows, examples, and implementation guidance, refer to these reference documents:
references/common-patterns.md - Argument parsing, backup handling, writing style, report formatting, file detection, and metadata extractionreferences/update-agents.md - Complete context file update workflow including verification strategies, diff generation, and discrepancy detectionreferences/update-readme.md - Complete README update workflow including section templates, metadata extraction, and formatting conventionsreferences/update-contributing.md - Complete CONTRIBUTING.md update workflow including scope, templates, and validation (only when CONTRIBUTING.md exists)references/init-agents.md - Complete context initialization workflow including language-specific templates, detection strategies, and customization optionsThese references provide implementation details, code examples, and troubleshooting guidance for each workflow type.
Weekly Installs
112
Repository
GitHub Stars
41
First Seen
Feb 5, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
claude-code103
codex94
gemini-cli90
github-copilot90
amp89
kimi-cli89
iOS HIG 设计指南:原生应用界面开发框架与 SwiftUI/UIKit 最佳实践
679 周安装
客户调研技能指南:多源调研方法、来源优先级与答案置信度评估
659 周安装
企业搜索策略:如何将自然语言问题转换为多来源并行搜索并生成排序结果
692 周安装
PPTX 文件处理与自动化:创建、编辑、分析 .pptx 文件的完整指南
108 周安装
doc-parser 文档解析技能:使用 IBM docling 库解析 PDF、Word、图像,提取表格和结构化数据
665 周安装
AWS 解决方案架构师技能 | Claude AI 助手插件 | 云服务架构设计与优化
687 周安装