Update and maintain documentation to reflect current implementation after code changes, refactoring, or new features. Remove temporal language, verify accuracy against code, and keep docs current...
Maintain clean, accurate, implementation-focused documentation that works seamlessly with the doc-lookup skill. Ensure docs always reflect current state, are structured for targeted retrieval, and include stable anchors.
The maintain-docs skill includes helper scripts for anchor management:
# Add anchors to documentation (dry-run first to preview)
python .claude/skills/maintain-docs/scripts/add_doc_anchors.py <path> --dry-run
python .claude/skills/maintain-docs/scripts/add_doc_anchors.py <path> [--recursive]
# Validate router skill references
python .claude/skills/maintain-docs/scripts/validate_doc_anchors.py
# Or use Makefile shortcuts
make docs-add-anchors-dry # Preview anchor additions
make docs-add-anchors # Add anchors to features/formats/projects docs
make docs-validate-anchors # Validate router skill references
See DOCUMENTATION_MANAGEMENT.md for complete guide.
To enable effective doc-lookup, follow these anchor requirements:
Add explicit anchors {#anchor-id} to:
Don't anchor:
Prefer coarser anchors over fine-grained ones to improve maintainability and usability:
Good (Coarser anchors):
#cli-commands for a section covering all CLI commands#mcp-tools for a section listing all MCP tools#service-architecture for service patterns overviewAvoid (Too granular):
#cli-run-command, #cli-results-command, #cli-metrics-command (separate anchors for each command)#mcp-dipeo-run-tool, #mcp-list-diagrams-tool (separate anchors for each tool)#service-registry-registration, #service-registry-lookup (separate anchors for minor subsections)Rationale:
When fine-grained anchors are acceptable:
Follow these patterns for consistency:
Domain-specific prefixes:
#cli-*: CLI-related sections (#cli-commands, #cli-flags, #cli-background)#mcp-*: MCP server sections (#mcp-tools, #mcp-registration, #mcp-architecture)#db-* or #database-*: Database sections (#database-schema, #database-queries)#handler-*: Handler implementation (#handler-patterns, #handler-lifecycle)#codegen-*: Code generation (#codegen-typescript, #codegen-ir-builders)Generic sections:
#overview: High-level introduction#core-responsibilities: Main duties/scope#common-patterns: Usage patterns and examples#troubleshooting: Common issues and solutions#escalation: When to hand off to other agentsFormat rules:
#my-section-name#cli-flags not #flags, #background-execution not #bgStructure sections to be self-contained and independently retrievable:
Good section (works well with doc-lookup):
## CLI Flags {#cli-flags}
Common flags for all CLI commands:
- `--light`: Use light diagram format (.light.yaml)
- `--debug`: Enable detailed logging to .dipeo/logs/cli.log
- `--timeout N`: Set execution timeout in seconds (default: 120)
Example:
\`\`\`bash
dipeo run my_diagram --light --debug --timeout=60
\`\`\`
See also: [CLI Commands](#cli-commands)
Bad section (hard to retrieve independently):
## CLI
The CLI has various flags that you can use. Some of them are...
[500 lines of mixed commands, flags, examples, troubleshooting]
Instead of duplicating content, use anchor links:
## Background Execution {#background-execution}
For flag details, see [CLI Flags](#cli-flags).
For status checking, see [CLI Commands](#cli-commands).
The background execution system allows...
This enables:
Good Documentation (present tense, anchored, self-contained):
## Service Registry {#service-registry}
The EnhancedServiceRegistry provides:
- Type categorization for services
- Audit trails for all registrations
- Production safety checks
Location: `/dipeo/infrastructure/service_registry.py`
See also: [EventBus](#eventbus), [Service Architecture](#service-architecture)
Bad Documentation (temporal language, no anchors):
## Service Registry
The service registry was recently enhanced to add type categorization
and audit trails. We've also improved the production safety features.
Documentation Elements:
{#anchor-id}Architecture Docs (docs/architecture/):
#service-architecture, #graphql-layer, etc.Agent Guides (docs/agents/):
Feature Docs (docs/features/):
#mcp-tools, #diagram-export, etc.API Docs:
READMEs:
Before finalizing updates:
Content Quality:
doc-lookup Compatibility:
Testing Retrieval: Test that important sections can be retrieved:
python .claude/skills/doc-lookup/scripts/section_search.py \
--query "your-anchor-name" \
--paths docs/your-file.md \
--top 1
Remove:
Warning Signs (sections that need splitting):
Anchors are referenced by:
.claude/skills/dipeo-*/SKILL.md)Before renaming an anchor:
grep -r "your-anchor" .claude/skills/ docs/When adding a new section:
After major documentation updates:
.claude/skills/dipeo-*/SKILL.md)Before (no anchors, temporal language):
## CLI
The CLI was recently updated to support background execution.
You can now run diagrams in the background using the --background flag.
We've also added better error handling.
After (anchored, present tense, cross-referenced):
## CLI Commands {#cli-commands}
Core commands:
- `dipeo run`: Execute a diagram
- `dipeo results`: Check execution results
- `dipeo metrics`: Profile execution performance
For flags, see [CLI Flags](#cli-flags).
For background execution, see [Background Execution](#background-execution).
## CLI Flags {#cli-flags}
Common flags for all commands:
- `--light`: Use light diagram format
- `--debug`: Enable detailed logging
- `--timeout N`: Set timeout in seconds
## Background Execution {#background-execution}
Execute diagrams asynchronously:
\`\`\`bash
dipeo run my_diagram --background
# Returns: {"session_id": "exec_...", "status": "started"}
\`\`\`
Check results: `dipeo results <session_id>`
Before (monolithic, no anchors):
## Architecture
DiPeO uses a service registry for managing services. It provides
type categorization and audit trails. We also have an EventBus
for communication...
[200 lines of mixed architecture topics]
After (split sections, anchored):
## Service Architecture {#service-architecture}
DiPeO's service layer uses:
- [Service Registry](#service-registry): Type-safe service management
- [EventBus](#eventbus): Unified event protocol
- [Envelope Pattern](#envelope-pattern): Standardized outputs
## Service Registry {#service-registry}
The EnhancedServiceRegistry provides:
- Type categorization (AI, STANDARD, LLM)
- Audit trails for registrations
- Production safety checks
Location: `/dipeo/infrastructure/service_registry.py`
## EventBus {#eventbus}
Unified event protocol for cross-service communication.
Location: `/dipeo/infrastructure/event_bus.py`
The goal is documentation that: