Auto-updating documentation that stays true to your code.
AI coding agents ship code 5–10× faster than documentation can be written. DocSync detects when your docs drift from your code — and fixes it automatically.
// Your docs say:
async function createUser(email, password) {}
// Your code now says:
async function createUser(email, password, role, organizationId) {}Two new required parameters. Zero documentation updates. Every developer who reads the old docs writes broken code. DocSync catches this the moment it happens.
DocSync uses Tree-sitter AST parsing to understand your code structurally — not as text, but as a semantic tree of functions, classes, and API routes.
On every Pull Request:
- Parses changed JS/TS files with Tree-sitter
- Compares extracted signatures against your documentation baseline
- Calculates a Drift Score (0–100) for each changed construct
- If drift exceeds your threshold, generates updated docs using AI
- Opens a companion PR with the updated documentation
As a CLI tool:
npm install -g @ishwarrr/docsync
# or without installing:
npx @ishwarrr/docsync initAs a GitHub Action (recommended):
# .github/workflows/docsync.yml
- uses: ishwar-prog/docsync@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
groq-api-key: ${{ secrets.GROQ_API_KEY }}1. Initialize your repo (run once):
npx @ishwarrr/docsync init
git add .docsync/snapshot.json
git commit -m "docs: initialize DocSync baseline"2. Check for drift anytime:
npx @ishwarrr/docsync check3. Auto-fix with AI:
npx @ishwarrr/docsync fixDocSync calls the AI, generates documentation for every drifted construct,
and writes professional Markdown to your docs/ folder.
Add DocSync to any repository in 3 lines:
name: DocSync
on: [pull_request]
permissions:
contents: write
pull-requests: write
jobs:
docsync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ishwar-prog/docsync@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
groq-api-key: ${{ secrets.GROQ_API_KEY }}Get a free Groq API key at console.groq.com — no credit card required.
| Command | Description |
|---|---|
npx @ishwarrr/docsync init |
Scan repo, parse all files, create baseline snapshot |
npx @ishwarrr/docsync check |
Detect documentation drift, show drift score |
npx @ishwarrr/docsync fix |
Generate AI documentation for all drifted constructs |
npx @ishwarrr/docsync check --json |
Machine-readable output for CI integration |
# docsync.yaml
version: 1
track:
- src/**/*.ts
- src/**/*.js
ignore:
- "**/*.test.ts"
- "**/node_modules/**"
output:
format: markdown # markdown | mdx
dir: docs/
drift:
threshold: 75 # 0-100. Higher = stricter
auto_pr: true| Score | Status | What It Means |
|---|---|---|
| 0 | ✅ In Sync | Documentation matches code |
| 1–39 | 🟡 Minor Drift | Small changes, low priority |
| 40–74 | 🟠 Moderate Drift | Documentation is misleading |
| 75–100 | 🔴 Severe Drift | Documentation is wrong |
| Tool | Generates Docs | Detects Drift | Auto-PRs Fix | Works in CI |
|---|---|---|---|---|
| Mintlify | ✅ | ❌ | ❌ | ❌ |
| Swimm | ✅ | Partial | ❌ | ✅ |
| GitHub Copilot | ✅ inline | ❌ | ❌ | ❌ |
| DocSync | ✅ | ✅ | ✅ | ✅ |
| Language | Parsing | Route Detection |
|---|---|---|
| JavaScript | ✅ | ✅ Express.js |
| TypeScript | ✅ | ✅ Express.js |
| JSX / TSX | ✅ | ✅ |
| Python | 🔜 Coming soon | 🔜 |
| Go | 🔜 Coming soon | 🔜 |
git clone https://github.com/ishwar-prog/docsync
cd docsync
npm install
npm link
npx @ishwarrr/docsync initSee CONTRIBUTING.md for guidelines.
MIT © Ishwar Suthar
Built with Tree-sitter · Groq Llama 3.3 · GitHub Actions · Node.js
@ishwarrr/docsync · If DocSync saves you time, give it a ⭐