Documentation Refresh Process¶
This guide documents the process for refreshing Campaign Brain documentation when platform modules are updated. It is designed for both AI assistants (Claude Code) and human operators.
Overview¶
The Campaign Brain platform consists of 18 modules (cb*), each with its own /docs directory. The central documentation hub (cbdocs) aggregates these via symlinks and publishes to docs.nominate.ai.
Key principle: Only refresh documentation for projects that have changed since the last refresh, tracked via git modification timestamps.
Quick Start¶
# Check which projects have changes
./scripts/docs-refresh.sh --check
# After reviewing and updating docs, mark as processed
./scripts/docs-refresh.sh --update
# Full refresh (ignore timestamps)
./scripts/docs-refresh.sh --full
Architecture¶
Directory Structure¶
~/projects/nominate/
├── cb/ # Symlink directory
│ ├── cbapp -> ../cbapp
│ ├── cbauth -> ../cbauth
│ └── ...
├── cbdocs/ # Documentation hub
│ ├── docs/
│ │ ├── .last-refresh.json # Timestamp tracking
│ │ ├── cbapp-docs -> ../../cbapp/docs
│ │ ├── cbauth-docs -> ../../cbauth/docs
│ │ └── ...
│ ├── scripts/
│ │ ├── docs-refresh.sh # Change detection
│ │ └── refresh_dev_status.sh # GitHub issues sync
│ └── mkdocs.yml # Navigation config
└── {cb*}/ # Individual modules
└── docs/ # Source documentation
Timestamp Tracking¶
The system uses .git directory modification times to detect changes:
~/projects/nominate/cb/recent-modifications.sh- Lists all project modification timesdocs/.last-refresh.json- Stores last processed timestamps per project
Refresh Process Steps¶
Step 1: Detect Changes¶
This will output: - Projects with changes since last refresh - Last git modification time - Last processed time - Number of docs files
Step 2: Review Changed Projects¶
For each changed project, review the docs directory:
# Example: cbapp changed
ls ~/projects/nominate/cbapp/docs/
# Look for new/updated files
find ~/projects/nominate/cbapp/docs -name "*.md" -newer ~/projects/nominate/cbdocs/docs/.last-refresh.json
Step 3: Update Documentation Hub¶
For each changed project, you may need to:
-
Check symlinks exist
-
Update mkdocs.yml navigation
- Add new pages to appropriate sections
- Remove pages that no longer exist
-
Reorganize if structure changed
-
Update service tables (if service info changed)
docs/index.md- Platform Services tabledocs/overview.md- Component descriptionsdocs/reference/inventory.md- Complete inventorydocs/DOCS-META-INDEX.md- Module list
Step 4: Build and Verify¶
cd ~/projects/nominate/cbdocs
mkdocs build --clean
# Check for broken links in build output
# Restart if changes are ready
sudo systemctl restart mkdocs
Step 5: Mark as Processed¶
This updates the timestamp file so these changes won't be flagged next run.
For AI Assistants (Claude Code)¶
When instructed to refresh documentation:
Initial Assessment¶
Per-Project Review Checklist¶
For each changed project:
-
Read the project's docs directory
-
Compare with mkdocs.yml navigation
- Are all docs files referenced?
- Are there new files not yet in navigation?
-
Are there removed files still referenced?
-
Check for new features/services
- New systemd services?
- New API endpoints?
- New ports?
-
New domains?
-
Update the four key files if needed
docs/index.mddocs/overview.mddocs/reference/inventory.mdmkdocs.yml
Common Updates¶
| Change Type | Files to Update |
|---|---|
| New project | All 4 key files + create symlink |
| New docs page | mkdocs.yml only |
| New port/domain | index.md, inventory.md |
| Service description | overview.md, index.md |
| Renamed docs | mkdocs.yml |
After Updates¶
# Build to verify
mkdocs build --clean
# Restart service
sudo systemctl restart mkdocs
# Update timestamps
./scripts/docs-refresh.sh --update
# Optionally commit
git add -A && git commit -m "Refresh docs for {projects}"
Automation (Cron)¶
To run automatically at 4am daily:
# Add to crontab
0 4 * * * /home/bisenbek/projects/nominate/cbdocs/scripts/docs-refresh.sh --json > /tmp/docs-changes.json 2>&1
The JSON output can be used by: - Monitoring systems (alert if changes detected) - AI assistants (provide as context for refresh) - CI/CD pipelines (trigger doc builds)
Project Reference¶
All 18 Modules¶
| Project | Nav Section | Typical Docs |
|---|---|---|
| cbai | AI Service | index.md |
| cbapp | Campaign App | 30+ files, screenshots/, style-guide/ |
| cbauth | Authentication | index.md, START-HERE.md, INFRA-GUIDE.md |
| cbdistricts | Districts Service | API docs, architecture |
| cbdocs | N/A (this hub) | Self-referential |
| cbetl | ETL Pipeline | index.md |
| cbfiles | File Storage (CDN) | index.md, DEVELOPERS.md |
| cbinfra | Infrastructure | Runbooks, guides |
| cbintel | Intelligence Service | api/, guides/, reference/ |
| cbmesh | API Mesh | index.md, START-HERE.md |
| cbmodels | Models & Analytics | API architecture, integration |
| cbos | Session Manager | MVP, streaming, workflow |
| cbproject | Executive Publication | Screenshots, image index |
| cbpublic | Public Website | Website plan, partners/ |
| cbradio | Radio Advertising | FCC integration, rate cards |
| cbsurveys | Survey Platform | index.md |
| cbtenant | Tenant Manager | Deployment guides |
| cbworkflow | Workflow Engine | API, engine analysis |
Key Files Summary¶
| File | Purpose | Update When |
|---|---|---|
docs/.last-refresh.json |
Timestamp tracking | Auto-updated by script |
docs/DOCS-META-INDEX.md |
Index of doc locations | New module added |
docs/index.md |
Homepage with service tables | Service changes |
docs/overview.md |
Platform component details | Architecture changes |
docs/reference/inventory.md |
Complete inventory | Any infrastructure change |
mkdocs.yml |
Navigation structure | Any docs structure change |
Troubleshooting¶
Symlink Missing¶
Build Errors¶
Timestamp File Corrupt¶
This guide is maintained in cbdocs/docs/guides/docs-refresh-process.md. Update when the refresh process changes.