Docs that stay true to your code.
AI coding agents ship code 5–10× faster than documentation can be written. DocSync detects when your docs drift from reality and automatically opens a PR to fix them.
Uses Tree-sitter AST parsing · GitHub Models (zero-config) · GitHub Actions · Works on every PR
Open source · MIT License · Built by @ishwar-prog
The Problem
70% of engineering docs are stale within 30 days of a deploy
Source: GitHub Octoverse 2025. With AI coding tools shipping code 5–10× faster, the gap between code and docs widens every single day.
/**
* Creates a new user account.
* @param {string} email
* @param {string} password
* @returns {Promise<User>}
*/
async function createUser(
email,
password
) {}async function createUser( email, password, role, // new — breaks callers organizationId // new — required field ) {}
⚠️ Two new required parameters. Zero documentation updates.
Every developer who reads the old docs writes broken code. DocSync catches this the moment the PR is opened.
How It Works
DocSync catches drift before it ships
Three steps that happen automatically on every PR. Zero configuration after setup.
AST Parsing
Tree-sitter reads your code as a structured syntax tree — not plain text. Extracts every function signature, class, and API route with full type information. Handles TypeScript, JSX, incomplete code, and syntax errors gracefully.
Drift Detection
Compares extracted signatures against your committed baseline snapshot. Calculates a Drift Score (0–100) per construct. Distinguishes between interface changes (high drift) and internal refactors (zero drift). No false positives.
AI Documentation
When drift exceeds your threshold, DocSync calls an LLM with a surgical prompt engineered to produce senior-engineer-quality documentation, then opens a companion PR automatically. Works out of the box using GitHub Models via your existing GITHUB_TOKEN — no signup, no API key. Bring your own Groq or Anthropic key for higher throughput or a different model.
The Automated Flow
Developer reviews PR #43, merges both. Docs stay true. Forever.
DocSync — Drift Check ───────────────────── Drift Score: 83/100 ████████░░ Threshold: 75/100 Status: ⚠ DRIFT DETECTED — docs need updating Changes Detected (3 total across 1 file) ───────────────────────────────────────── + New parameter organizationId added to createUser — not documented + New parameter role added to createUser — not documented ~ Return type changed: User → Promise<User> Next Steps ────────── Run npx @ishwarrr/docsync fix to auto-generate updated documentation
Installation
Up and running in 2 minutes
Three commands. No server. No account. No credit card.
# Scan your codebase, extract all function signatures, # create a baseline snapshot in .docsync/snapshot.json npx @ishwarrr/docsync init # Commit the snapshot — this is your documentation baseline git add .docsync/snapshot.json git commit -m "docs: initialize DocSync baseline"
# Run after any code change to see your drift score npx @ishwarrr/docsync check # Machine-readable output for CI scripts npx @ishwarrr/docsync check --json
# Running locally needs a token with GitHub Models access: export GITHUB_TOKEN=$(gh auth token) # Or bring your own key instead (optional, higher throughput): # GROQ_API_KEY=... or ANTHROPIC_API_KEY=... # Generate documentation for all drifted constructs npx @ishwarrr/docsync fix
# .github/workflows/docsync.yml # Copy this into your repo. No API key needed. Done. name: DocSync on: [pull_request] permissions: contents: write pull-requests: write models: read # lets DocSync call GitHub Models 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 or anthropic-api-key input — it takes precedence.# Which files to watch track: - src/**/*.ts - src/**/*.js # Drift score above this opens a companion PR drift: threshold: 75 # 0=loose 100=strict auto_pr: true output: format: markdown # markdown | mdx
The Drift Score
Not file hashes. Signature semantics.
Most tools detect "file changed." DocSync detects "public API changed." A refactor that doesn't touch the interface scores 0. An added parameter scores 60. This eliminates false positives entirely.
SCORE: 0 — No drift
// Renamed internal variable
// File hash changed — but interface identical
// DocSync correctly scores this 0
function createUser(email, password) {
const usr = await db.insert(...) // was: user
return usr
}SCORE: 83 — Drift detected
// Added 2 required parameters // Public API changed — every caller affected // DocSync correctly flags this function createUser( email, password, role, // +60 drift organizationId // +60 drift → capped 83 )
| Score | Status | Meaning | Action |
|---|---|---|---|
| 0 | ✅ In Sync | Docs match code exactly | Nothing needed |
| 1–39 | 🟡 Minor | Small internal changes | Monitor |
| 40–74 | 🟠 Moderate | Docs are misleading | Update soon |
| 75–100 | 🔴 Severe | Docs actively wrong | DocSync fixes automatically |
Comparison
The only tool that closes the loop
Every other tool generates docs once and walks away. DocSync is the only tool that detects when those docs become lies and automatically fixes them.
| Tool | Generates Docs | Detects Drift | Auto-PRs Fix | Works in CI | Free Tier |
|---|---|---|---|---|---|
| Mintlify | ✅ | ❌ | ❌ | ❌ | ❌ |
| Swimm | ✅ | ⚠️ | ❌ | ✅ | ⚠️ |
| GitHub Copilot | ✅ | ❌ | ❌ | ❌ | ❌ |
| JSDoc / TSDoc | ❌ | ❌ | ❌ | ❌ | ✅ |
| DocSync ✨ | ✅ | ✅ | ✅ | ✅ | ✅ |
⚠️ = Partial support · Free tier = no credit card required to start
Supported Languages
JavaScript
.js .mjs .cjs
✅ Full
TypeScript
.ts .tsx
✅ Full
JSX / React
.jsx .tsx
✅ Full
Python
.py
🔜 v0.2
Stop letting docs lie.
Every broken doc is a developer losing hours. Every stale API reference is a bug waiting to happen. DocSync makes stale docs impossible.
Free forever for open source · Zero-config via GitHub Models · No credit card