Document Sync
Find stale documentation that needs updating
Find stale documentation that needs updating when code changes.
Quick Start
"What docs need updating after my changes?"
"Find documentation that references the functions I modified"
"Are there any stale docs referencing getUserData?"
When to Use
Use this workflow:
- Before committing code changes
- During code review
- As part of your release process
- When updating APIs or public interfaces
How It Works
Noodlbox creates bidirectional links between code and documentation:
| Edge Type | Direction | Meaning |
|---|---|---|
DOCUMENTED_BY | Code → Doc | This code is documented here |
REFERENCES | Doc → Code | This doc mentions this code |
Links are created when documentation contains:
- Inline code references:
`functionName` - Code blocks with function calls
- Prose mentioning symbol names
Document Sync Workflow
Detect Changed Symbols
First, find what code has changed:
"What's the impact of my unstaged changes?"
Uses: noodlbox_detect_impact tool
This returns changed_symbols with UIDs for each modified symbol.
Extract Symbol UIDs
From the impact detection response, collect the uid field from each changed symbol.
Example response:
{
"changed_symbols": [
{ "name": "getUserData", "uid": "sym_abc123", ... },
{ "name": "UserService", "uid": "sym_def456", ... }
]
}Search for Linked Documentation
Find docs that reference the changed symbols:
"Find documentation that references sym_abc123 and sym_def456"
Uses: noodlbox_search_documents tool with:
mode: "linked"symbol_uids: ["sym_abc123", "sym_def456"]
This returns documentation files that:
- Are documented by these symbols
- Reference these symbols in their content
Review and Update
For each flagged document:
- Check if the code change affects the documentation
- Update examples, descriptions, or signatures as needed
- Remove references to deleted code
- Add documentation for new functionality
Document Types to Check
| Doc Type | What to Look For |
|---|---|
| API docs | Changed signatures, new parameters |
| README | Updated examples, changed behavior |
| Tutorials | Outdated code snippets |
| Architecture docs | Changed relationships, new components |
| Changelogs | Needs new entry |
Example: Pre-Commit Doc Check
Scenario: You've updated the authentication flow and want to check docs before committing.
Run Impact Detection
"Check the impact of my unstaged changes"
Results:
{
"changed_symbols": [
{ "name": "authenticateUser", "uid": "sym_auth1" },
{ "name": "validateToken", "uid": "sym_tok1" },
{ "name": "refreshSession", "uid": "sym_sess1" }
]
}Search Linked Docs
"Find docs linked to sym_auth1, sym_tok1, sym_sess1"
Results:
docs/authentication.md- references authenticateUserREADME.md- contains auth example
Review Each Document
docs/authentication.md:
- Section "How to Authenticate" uses old function signature
- Update to reflect new parameter
README.md:
- Quick start example still valid
- No changes needed
Commit with Doc Updates
Stage both code and documentation changes together.
Automating Doc Sync
In Code Review
Add doc sync check to your PR checklist:
## PR Checklist
- [ ] Ran impact detection
- [ ] Checked affected_documents
- [ ] Updated stale documentationIn CI/CD
Run doc sync check as part of your pipeline:
# Example: Flag PRs with potentially stale docs
- name: Check doc sync
run: |
# Run impact detection comparing PR to base
# If affected_documents is non-empty, add PR commentQuerying Documentation Relationships
Find All Docs for a Symbol
MATCH (sym:Symbol {name: "getUserData"})-[:DOCUMENTED_BY]->(doc:Document)
RETURN doc.file_path, doc.titleFind All Symbols in a Doc
MATCH (doc:Document {file_path: "README.md"})-[:REFERENCES]->(sym:Symbol)
RETURN sym.name, sym.kind, sym.file_pathFind Potentially Stale Docs
MATCH (sym:Symbol)-[:DOCUMENTED_BY]->(doc:Document)
WHERE sym.updated_at > doc.updated_at
RETURN doc.file_path, sym.name as stale_referenceTools Reference
| Purpose | Tool |
|---|---|
| Detect changes | noodlbox_detect_impact |
| Find linked docs | noodlbox_search_documents with mode: "linked" |
| Query relationships | noodlbox_raw_cypher_query |