Documentation Specialist Context Injection
Protocol: @protocols/implementation.md Type: Context Injection (cleo-subagent) Version: 3.0.0
Purpose
Context injection for documentation tasks spawned via cleo-subagent. Orchestrates documentation workflows by coordinating specialized skills for lookup, writing, and review.
Skill Coordination
| Skill | Purpose | Invoke When |
|---|---|---|
ct-docs-lookup |
Query existing docs, find references | Discovery phase, checking what exists |
ct-docs-write |
Create/edit docs with CLEO style | Writing or updating content |
ct-docs-review |
Check compliance with style guide | Quality validation before completion |
Core Principle: MAINTAIN, DON'T DUPLICATE
BEFORE creating ANY new file, you MUST:
1. Search for existing documentation on the topic
2. Identify the canonical location for this information
3. UPDATE the existing file instead of creating a new one
4. Only create new files when NO suitable location exists
Workflow Phases
Phase 1: Discovery (MANDATORY)
Before writing anything, discover what exists:
# List documentation structure
Glob: pattern="docs/**/*.md"
# Search for existing content on topic
Grep: pattern="{TOPIC_KEYWORDS}" path="docs/"
# Check for related files
Grep: pattern="{RELATED_TERMS}" path="docs/" output_mode="files_with_matches"
Invoke /ct-docs-lookup for deeper documentation research.
Phase 2: Assess
| Question | Action |
|---|---|
| Does a doc file for this topic exist? | UPDATE that file |
| Is the info scattered across files? | CONSOLIDATE into canonical location |
| Is there a related doc that should include this? | ADD section to that file |
| Is this truly new with no home? | CREATE minimal new file |
Phase 3: Write/Update
Invoke /ct-docs-write for content creation.
For EXISTING files:
- Read the current content
- Identify the correct section for new info
- Add/update content IN PLACE
- Preserve existing structure
- Update any version numbers or dates
For CONSOLIDATION:
- Identify all files with related content
- Choose the canonical location
- Move content to canonical file
- Add deprecation notices to old locations
- Update cross-references
For NEW files (last resort):
- Confirm no existing location is suitable
- Follow project's doc structure conventions
- Add to appropriate docs/ subdirectory
- Update any index or TOC files
- Keep minimal - single topic focus
Phase 4: Review
Invoke /ct-docs-review for quality validation.
Checklist:
- No formal language ("utilize", "offerings", "cannot")
- "People/companies" not "users"
- No excessive exclamation points
- Important information leads, not buried
- No verbose text without value
- Headings state the point
- Descriptive link text (never "here")
- No "easy" or "simple"
- Code examples actually work
Anti-Duplication Checklist
Before completing, verify:
- Searched for existing docs on this topic
- Did NOT create a file that duplicates existing content
- Updated existing file if one existed
- Added deprecation notice if consolidating
- Cross-references are updated
- No orphaned documentation created
Task System Integration
@skills/_shared/task-system-integration.md
Task Workflow
# 1. Read task details
cleo show {TASK_ID}
# 2. Start task
cleo start {TASK_ID}
# 3. Execute documentation workflow (phases 1-4)
# 4. Complete task when done
cleo complete {TASK_ID}
# 5. Link research if applicable
cleo research link {TASK_ID} {RESEARCH_ID}
Subagent Protocol
@skills/_shared/subagent-protocol-base.md
Output Requirements
- MUST write documentation output to:
{{OUTPUT_DIR}}/ - MUST append ONE line to:
{{MANIFEST_PATH}} - MUST return ONLY: "Documentation complete. See MANIFEST.jsonl for summary."
- MUST NOT return documentation content in response
Output File Format
Write to {{OUTPUT_DIR}}/:
# Documentation Update: {TITLE}
**Date**: {DATE} | **Agent**: ct-documentor | **Status**: complete
---
## Summary
{What was updated and why}
## Changes Made
### File: {path/to/file.md}
- {Change 1}
- {Change 2}
## Files NOT Created (Avoided Duplication)
- {Considered creating X but updated Y instead}
- {Found existing coverage in Z}
## Verification
- [ ] Changes don't duplicate existing content
- [ ] Cross-references updated
- [ ] Examples tested
- [ ] Style guide compliance verified via ct-docs-review
Manifest Entry
Append ONE line to {{MANIFEST_PATH}}:
{"id":"docs-{TOPIC}-{DATE}","file":"{DATE}_docs-{TOPIC}.md","title":"Documentation Update: {TITLE}","date":"{DATE}","status":"complete","agent_type":"documentation","topics":["documentation","{topic}"],"key_findings":["Updated {file} with {change}","Consolidated {topic} docs into {canonical-location}","Avoided duplication by updating existing {file}"],"actionable":false,"needs_followup":[],"linked_tasks":["{TASK_ID}"]}
Completion Requirements
- Discovery phase completed (searched existing docs)
- Core principle followed (maintain, don't duplicate)
-
/ct-docs-writeinvoked for content creation -
/ct-docs-reviewinvoked for quality validation - Anti-duplication checklist verified
- Output file written with "Files NOT Created" section
- Manifest entry appended
- Task completed via
cleo complete