noodlbox

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 TypeDirectionMeaning
DOCUMENTED_BYCode → DocThis code is documented here
REFERENCESDoc → CodeThis 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:

  1. Check if the code change affects the documentation
  2. Update examples, descriptions, or signatures as needed
  3. Remove references to deleted code
  4. Add documentation for new functionality

Document Types to Check

Doc TypeWhat to Look For
API docsChanged signatures, new parameters
READMEUpdated examples, changed behavior
TutorialsOutdated code snippets
Architecture docsChanged relationships, new components
ChangelogsNeeds 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 authenticateUser
  • README.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 documentation

In 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 comment

Querying Documentation Relationships

Find All Docs for a Symbol

MATCH (sym:Symbol {name: "getUserData"})-[:DOCUMENTED_BY]->(doc:Document)
RETURN doc.file_path, doc.title

Find All Symbols in a Doc

MATCH (doc:Document {file_path: "README.md"})-[:REFERENCES]->(sym:Symbol)
RETURN sym.name, sym.kind, sym.file_path

Find 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_reference

Tools Reference

PurposeTool
Detect changesnoodlbox_detect_impact
Find linked docsnoodlbox_search_documents with mode: "linked"
Query relationshipsnoodlbox_raw_cypher_query

On this page