← 返回
开发者工具 Key 中文

DocSync

Generate and auto-sync documentation from code with git hooks; detect and fix doc drift using tree-sitter parsing and semantic diffs locally.
通过 git hooks 自动生成并同步文档;使用 tree‑sitter 解析和语义 diff 在本地检测并修复文档漂移。
suhteevah
开发者工具 clawhub v1.0.1 1 版本 100000 Key: 需要
★ 0
Stars
📥 1,278
下载
💾 6
安装
1
版本
#latest

概述

DocSync — Living Documentation for Your Codebase

DocSync generates documentation from your code and keeps it in sync automatically. It uses tree-sitter for multi-language AST parsing, lefthook for git hook integration, and difftastic for semantic change detection.

Commands

Free Tier (No license required)

docsync generate

Generate a one-shot README or API doc for a single file or directory.

How to execute:

bash "<SKILL_DIR>/scripts/docsync.sh" generate <target>

What it does:

  1. Parses the target file(s) with tree-sitter to extract symbols (functions, classes, exports, types, interfaces)
  2. Applies the appropriate template from /templates/
  3. Generates a markdown documentation file alongside the source

Example usage scenarios:

  • "Generate docs for src/utils/auth.ts" → runs docsync generate src/utils/auth.ts
  • "Document this whole directory" → runs docsync generate src/api/
  • "Create a README for this project" → runs docsync generate .

Pro Tier ($29/user/month — requires DOCSYNC_LICENSE_KEY)

docsync drift [directory]

Scan for documentation drift — find where code has changed but docs haven't been updated.

How to execute:

bash "<SKILL_DIR>/scripts/docsync.sh" drift [directory]

What it does:

  1. Validates license key from config
  2. Parses all source files with tree-sitter
  3. Compares extracted symbols against existing documentation
  4. Reports: new undocumented symbols, changed signatures with stale docs, deleted symbols still in docs
  5. Outputs a drift report with severity levels (critical/warning/info)

docsync hooks install

Install git hooks that automatically check for doc drift on every commit.

How to execute:

bash "<SKILL_DIR>/scripts/docsync.sh" hooks install

What it does:

  1. Validates Pro+ license
  2. Copies lefthook config to project root
  3. Installs lefthook pre-commit hook
  4. On every commit: analyzes staged files, blocks commit if critical drift detected, offers auto-regen

docsync hooks uninstall

Remove DocSync git hooks.

bash "<SKILL_DIR>/scripts/docsync.sh" hooks uninstall

docsync auto-fix [directory]

Auto-regenerate stale documentation for files with detected drift.

bash "<SKILL_DIR>/scripts/docsync.sh" auto-fix [directory]

Team Tier ($49/user/month — requires DOCSYNC_LICENSE_KEY with team tier)

docsync onboarding [directory]

Generate a comprehensive onboarding guide for new developers.

bash "<SKILL_DIR>/scripts/docsync.sh" onboarding [directory]

docsync architecture [directory]

Generate architecture documentation showing module relationships and data flow.

bash "<SKILL_DIR>/scripts/docsync.sh" architecture [directory]

Supported Languages

DocSync uses tree-sitter grammars and supports:

  • JavaScript / TypeScript (including JSX/TSX)
  • Python
  • Rust
  • Go
  • Java
  • C / C++
  • Ruby
  • PHP
  • C#
  • Swift
  • Kotlin

Configuration

Users can configure DocSync in ~/.openclaw/openclaw.json:

{
  "skills": {
    "entries": {
      "docsync": {
        "enabled": true,
        "apiKey": "YOUR_LICENSE_KEY_HERE",
        "config": {
          "outputDir": "docs",
          "templateOverrides": {},
          "excludePatterns": ["**/node_modules/**", "**/dist/**", "**/.git/**"],
          "languages": ["typescript", "python", "go"],
          "driftThreshold": "warning",
          "autoFix": false
        }
      }
    }
  }
}

Important Notes

  • Free tier works immediately with no configuration
  • Pro/Team tiers require a license key from https://docsync.pages.dev
  • All processing happens locally — no code is sent to external servers
  • License validation is offline — no network calls needed
  • Git hooks use lefthook which must be installed (see install metadata above)
  • tree-sitter and difftastic are optional but recommended for best results; the skill falls back to regex-based parsing if unavailable

Error Handling

  • If tree-sitter is not installed, fall back to regex-based symbol extraction (less accurate but functional)
  • If lefthook is not installed and user tries hooks install, prompt to install it
  • If license key is invalid or expired, show clear message with link to https://docsync.pages.dev/renew
  • If a language grammar is not available, skip that file with a warning

When to Use DocSync

The user might say things like:

  • "Generate docs for this file/project"
  • "Are my docs up to date?"
  • "Check for documentation drift"
  • "Set up auto-docs on my commits"
  • "Create an onboarding guide"
  • "Document the architecture"
  • "What's undocumented in this codebase?"

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-03-29 04:44 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 668 📥 323,831
developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 921 📥 185,735
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 66 📥 179,863