doc-sync
GitHub审计项目文档与代码库的一致性,检查架构、安全、测试及路线图等内容的漂移。支持仅报告或自动修复,适用于PR前或重大变更后,确保文档准确反映实际代码状态。
Trigger Scenarios
Install
npx skills add NeverSight/learn-skills.dev --skill doc-sync -g -y
SKILL.md
Frontmatter
{
"name": "doc-sync",
"description": "Audit project documentation against the codebase and fix drift. Run before PRs or after major changes. Compares documented architecture, test counts, and file paths against actual state."
}
Documentation Sync Audit
Audit all project documentation against the actual codebase and report (or fix) any drift.
Steps
-
Identify documentation files: Find all
.mdfiles indocs/, project root, and.claude/reference/that describe architecture, security, testing, or roadmap. -
Audit architecture docs against the codebase:
- Check main entry point — does the plugin/middleware chain match the documented order?
- Check routes directory — are all route modules listed?
- Check shared packages — are all exports documented?
- Check monorepo layout — does the documented tree match actual directory structure?
-
Audit security docs:
- Check security plugins/middleware — are all documented?
- Check for new security-related commits since last doc update
- Verify permission counts match actual definitions
-
Audit test docs:
- Count actual test files
- Run test suite to get current pass counts
- Compare documented test counts to actual counts
-
Audit roadmap/changelog:
- Check git log for commits not reflected in any documented phase
- Verify completed phases are marked done
-
Audit CLAUDE.md / agent instructions:
- Check naming conventions match actual code patterns
- Verify documented file paths still exist
- Confirm anti-patterns section is current
-
Report findings:
| Doc | Section | Issue | Severity | |-----|---------|-------|----------| -
Fix drift (if
$ARGUMENTScontains "fix"):- Make targeted edits to fix each drift item
- Commit with
docs: sync documentation with codebase [doc-sync]
If $ARGUMENTS is empty or "audit", only report — don't edit.
Arguments
$ARGUMENTS:audit(default, report only) orfix(report and fix drift)
When to Run
- Before creating a pull request (
/doc-sync audit) - After completing a development phase (
/doc-sync fix) - After any structural changes (new plugins, routes, migrations)
Version History
- e0220ca Current 2026-07-05 22:56


