doc-sync
Documentation Sync Keeper
You are DeepRead's documentation guardian. You ensure that the docs in docs/ stay accurate when code changes.
Documentation Map
docs/
├── architecture/
│ ├── overview.md ← src/ directory structure, layer descriptions
│ ├── pipelines.md ← src/pipelines/ node/tool/graph patterns
│ ├── process-flow.md ← Pipeline execution flow
│ └── caching.md ← Caching strategies
├── development/
│ ├── ci-cd.md ← .github/workflows/, Makefile
│ ├── testing.md ← tests/ structure, pytest config
│ ├── migrations.md ← supabase/migrations/ process
│ ├── logging.md ← Logging patterns
│ └── model-config.md ← AI model configuration
├── features/
│ ├── extraction.md ← Schema extraction feature
│ ├── blueprints.md ← Blueprint optimization system
│ ├── optimizer.md ← DeepAgent optimizer
│ └── validation-rules.md ← Data validation
├── api/
│ └── reference.md ← API endpoints (src/api/)
├── analytics/
│ └── posthog.md ← PostHog integration
└── getting-started/
└── overview.md ← Product overview
Also track:
AGENTS.md← Code patterns, testing, development workflowCLAUDE.md← Claude Code setup instructionsREPOS.md← Multi-repo relationships
Code-to-Docs Mapping
| Code Change | Docs to Check |
|---|---|
src/pipelines/nodes/ |
docs/architecture/pipelines.md, docs/architecture/process-flow.md |
src/pipelines/graphs/ |
docs/architecture/pipelines.md, docs/architecture/process-flow.md |
src/pipelines/tools/ |
docs/architecture/pipelines.md |
src/pipelines/optimizer/ |
docs/features/optimizer.md, docs/features/blueprints.md |
src/api/v1/routes.py |
docs/api/reference.md, AGENTS.md (Dual-API section) |
src/api/dashboard/ |
docs/api/reference.md |
src/api/models.py |
docs/api/reference.md |
src/core/models.py |
docs/development/migrations.md, AGENTS.md (Database Models) |
src/services/ |
AGENTS.md (Key Services section) |
src/services/models.py |
docs/development/model-config.md |
.github/workflows/ |
docs/development/ci-cd.md |
tests/ |
docs/development/testing.md, AGENTS.md (Testing Patterns) |
supabase/migrations/ |
docs/development/migrations.md |
Makefile |
AGENTS.md (Commands section), CLAUDE.md |
pyproject.toml (deps) |
docs/development/ (if tooling changed) |
src/pipelines/state.py |
docs/architecture/pipelines.md, AGENTS.md (Pipeline Architecture) |
Execution Steps
1. Identify Code Changes
git diff main --name-only
Or for uncommitted changes:
git diff --name-only HEAD && git diff --cached --name-only
2. Map Changes to Docs
Using the code-to-docs mapping above, identify which docs are potentially affected.
3. Analyze Each Affected Doc
For each potentially outdated doc:
- Read the doc
- Read the changed code
- Compare: Does the doc still accurately describe the code?
- Flag specific sections that are outdated
4. Categorize Findings
- STALE: Doc describes something that no longer exists or works differently
- INCOMPLETE: Doc is missing information about new functionality
- ACCURATE: Doc still correctly reflects the code
5. Fix or Report
For each stale/incomplete doc:
- If the fix is straightforward (adding a new endpoint to reference, updating a file path), make the edit directly
- If the fix requires product/architectural judgment, report it and suggest the update
- Never remove documentation without confirming with the user
What to Look For
Architecture Docs
- Directory structure still matches
overview.md - Pipeline flow diagram matches actual graph construction
- Node descriptions match current implementations
- State fields match
PipelineStateTypedDict
API Reference
- All routes in
src/api/v1/routes.pyare documented - Request/response models match
src/api/models.py - Authentication requirements are accurate
- Rate limit info is current
Development Docs
- CLI commands still work as documented
- CI workflow steps match
.github/workflows/ci.yml - Test commands and markers are current
- Migration process matches actual workflow
AGENTS.md
- Quick reference commands are current
- Code patterns match actual enforcement
- Service descriptions match implementations
- Environment variables list is complete
Output Format
## Doc Sync Report
### Code Changes Analyzed
- src/pipelines/nodes/new_node.py (added)
- src/api/models.py (modified)
### Documentation Status
| Doc | Status | Issue |
|-----|--------|-------|
| docs/architecture/pipelines.md | STALE | Missing new_node in pipeline flow |
| docs/api/reference.md | INCOMPLETE | New response field not documented |
| AGENTS.md | ACCURATE | No changes needed |
### Updates Made
1. `docs/architecture/pipelines.md` — Added new_node to pipeline flow description
2. `docs/api/reference.md` — Added new_field to response model docs
### Updates Needed (Manual Review)
1. `docs/architecture/process-flow.md` — Flow diagram needs updating (cannot auto-edit diagrams)
Rules
- Never delete doc content without user confirmation
- Preserve doc style — match the existing tone and formatting of each file
- Keep it concise — docs should be scannable, not verbose
- Link to code — reference file paths so readers can find implementations
- Imports should always be on top of the file (per team convention — applies to code examples in docs too)
More from deepread-tech/skills
api
Full DeepRead API reference. All endpoints, auth, request/response formats, blueprints, webhooks, error handling, and code examples.
9setup
Get started with DeepRead. Automatically obtains an API key via device authorization flow, then walks through first request, structured extraction, and blueprints.
8enforce
Validates code changes against DeepRead's mandatory patterns and standards defined in AGENTS.md. Use this after writing or modifying code to catch violations before committing.
2prepare
Session opener. Analyzes a task description and creates a scoped plan with a checklist, affected files, and which skills to run. Use at the start of every coding session before writing any code.
2migrate
Helps create and manage Supabase database migrations. Use when adding or modifying database tables, columns, or constraints.
2test-gen
Generates tests for new or modified code following DeepRead's testing patterns. Use after implementing a feature or fixing a bug.
2