Skip to content

cachevector/doqtor

Repository files navigation

Doqtor

doqtor

Your docs are lying. Doqtor keeps them in sync with your code, automatically.

npm version license


Doqtor detects documentation drift after code changes and opens pull requests with fixes. It doesn't generate docs from scratch. It makes sure your existing docs stay correct.

The Problem

Documentation goes stale the moment code changes. Developers update function signatures, rename parameters, remove APIs, and the docs keep referencing the old version. Nobody notices until a user hits a broken example.

How It Works

PR Merged → Webhook → Diff Analysis → Doc Matching → Drift Detection → Fix Generation → Docs PR
  1. A PR merges into your repo
  2. Doqtor analyzes the diff to find changed functions, parameters, and types
  3. It scans your documentation for references to those symbols
  4. It detects mismatches like wrong signatures, outdated examples, removed APIs
  5. It opens a PR with the fixes

Only processes what changed. No full-repo scans.

What It Catches

Drift Type Example
Signature mismatch createUser(name, email) changed to createUser(name)
Removed symbol Docs reference a deleted function
Renamed symbol getUsers renamed to fetchUsers but docs still say getUsers
Outdated example Code block calls a function with wrong parameters

Each detection includes a confidence score so reviewers can prioritize.

Quick Start

CLI

Install from npm:

npm install -g @doqtor/cli

Then run in any git repo with documentation:

# Check for documentation drift in your local changes
doqtor check

# Apply fixes
doqtor fix

# Preview fixes without applying
doqtor fix --dry-run

# Generate a default config file
doqtor init

Or use without installing:

npx @doqtor/cli check

GitHub App

Install the Doqtor GitHub App on your repository. Once installed, Doqtor automatically monitors merged PRs and creates follow-up PRs when documentation drift is detected.

Self-Hosting

To run your own instance of the backend:

git clone https://github.com/cachevector/doqtor.git
cd doqtor
bun install
bun run build

# Copy and configure environment
cp .env.example .env
# Edit .env with your GitHub App credentials

# Start the webhook server
bun run --cwd apps/backend dev

Configuration

Create a doqtor.config.json in your project root:

{
  "docsPaths": ["README.md", "docs/"],
  "ignore": ["node_modules/", "dist/", ".git/"],
  "ai": {
    "enabled": false,
    "provider": "openai"
  },
  "autoPR": true
}
Option Description Default
docsPaths Files/directories to scan for documentation ["README.md", "docs/"]
ignore Paths to exclude from analysis ["node_modules/", "dist/", ".git/"]
ai.enabled Use an LLM for fix generation false
ai.provider Provider to use (openai or anthropic) "openai"
autoPR Create PRs with fixes automatically true

API

Parser

Use parseSource(filePath, content) to extract symbols from a TypeScript file:

import { parseSource } from "@doqtor/parser";

const symbols = parseSource("src/index.ts", sourceCode);

Returns an array of ParsedSymbol objects with name, kind, parameters, and return type.

Development and Contributing

See CONTRIBUTING.md for setup, development commands, and guidelines.

License

MIT

About

Your docs are lying. Doqtor keeps them in sync with your code automatically.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors