How tomdevtech/docdrift works
docdrift maintains two independent documentation flows: a local technical-doc flow triggered by a push or manual run, and a merge-triggered product-doc flow. The local pipeline analyzes Git changes deterministically, then generates per-file notes, optional ADR drafts, and a conditional architecture overview for an Obsidian vault. The merge flow filters for user-visible changes and dispatches either a Copilot task or LLM-based documentation edits. Edges reflect the excerpts, SOURCE INDEX references, and README; some subsystem internals were not sampled.
Main entry points: pipeline.py Local run pipeline · task.py Merge task and filter · commands.py CLI commands · llm.py Product-doc LLM engine
Components 22
Entry and setup
- CLI commands
src/docdrift/cli/commands.py - Setup installer
src/docdrift/setup/install.py - Setup checks
src/docdrift/setup/doctor.py
Shared change analysis
- Configuration
src/docdrift/core/config.py - Git operations
src/docdrift/core/git_utils.py - Change collection
src/docdrift/core/changes.py - AST analysis
src/docdrift/core/analysis.py
Local technical docs
- Local run pipeline
src/docdrift/local/pipeline.py - Run state
src/docdrift/local/state.py - Prompt playbooks
src/docdrift/local/playbook_loader.py - Local LLM client
src/docdrift/local/llm_client.py - ADR drafting
src/docdrift/local/adr.py - Vault access
src/docdrift/local/vault.py
Merge product docs
- Merge task and filter
src/docdrift/merge/task.py - Docs pre-check
src/docdrift/merge/docs_check.py - Product-doc LLM engine
src/docdrift/merge/llm.py
Other components
- Developer
- Local LLM server
- Obsidian vault
- OpenAI-compatible API
- Copilot agent
- README and docs
Connections 26
- Developer → CLI commands: runs commands
README.md - CLI commands → Setup installer: installs hooks
src/docdrift/cli/commands.py - CLI commands → Setup checks: runs checks
src/docdrift/cli/commands.py - CLI commands → Local run pipeline: starts local run
src/docdrift/cli/commands.py - CLI commands → Merge task and filter: builds merge task
src/docdrift/cli/commands.py - CLI commands → Product-doc LLM engine: runs docs updates
src/docdrift/cli/commands.py - Local run pipeline → Configuration: loads settings
src/docdrift/local/pipeline.py - Local run pipeline → Run state: locks and saves
src/docdrift/local/pipeline.py - Local run pipeline → Change collection: collects changes
src/docdrift/core/changes.py - Change collection → Git operations: reads Git range
src/docdrift/core/changes.py - Change collection → AST analysis: analyzes snapshots
src/docdrift/core/changes.py - Local run pipeline → Prompt playbooks: loads prompts
src/docdrift/local/pipeline.py - Local run pipeline → Local LLM client: requests generated text
src/docdrift/local/pipeline.py - Local LLM client → Local LLM server: sends chat request
src/docdrift/local/llm_client.py - Local run pipeline → ADR drafting: assesses and drafts ADR
src/docdrift/local/pipeline.py - Local run pipeline → Vault access: writes technical notes
src/docdrift/local/pipeline.py - ADR drafting → Vault access: reads and writes ADRs
src/docdrift/local/adr.py - Vault access → Obsidian vault: stores notes
src/docdrift/local/vault.py - Merge task and filter → Configuration: uses settings
src/docdrift/merge/task.py - Merge task and filter → Git operations: resolves PR range
src/docdrift/merge/task.py - Merge task and filter → Docs pre-check: checks relevance
src/docdrift/merge/task.py - Merge task and filter → Change collection: collects structural hints
src/docdrift/merge/task.py - Merge task and filter → Copilot agent: creates agent task
README.md - Product-doc LLM engine → Merge task and filter: uses task hints
src/docdrift/merge/llm.py - Product-doc LLM engine → OpenAI-compatible API: sends chat requests
src/docdrift/merge/llm.py - Product-doc LLM engine → README and docs: updates selected docs
README.md