Documentation & Historian Skill
Maintain project documentation, capture learnings, and preserve knowledge across sessions.
Workflow
Phase 1: Understand Context
- •
Identify Documentation Type
- •Status update (
docs/status.md) - •Changelog entry (
docs/changelog.md) - •Architecture doc (
docs/architecture.md,docs/*-architecture.md) - •Session summary (
docs/session/) - •Agent lessons learned (agent profiles)
- •README or guide
- •Status update (
- •
Load Existing Documentation
- •Read current state of relevant docs
- •Check for consistency with codebase
- •Identify what's outdated or missing
- •
Gather Information
- •What was done in this session/PR?
- •What was learned?
- •What changed in the implementation vs design?
- •What patterns emerged?
Phase 2: Extract Insights
- •
Identify Learnings
- •What worked well?
- •What didn't work?
- •What would we do differently next time?
- •What edge cases were discovered?
- •What patterns can be reused?
- •
Update vs Create Decision
- •Is there existing documentation to update?
- •Would a new doc be clearer than updating existing?
- •Default: update existing docs first
- •
Extract Patterns
- •Turn specific incidents into general principles
- •Identify reusable solutions
- •Note anti-patterns to avoid
Phase 3: Document
For Status Updates
- •Update
docs/status.md- •Current phase and progress
- •What's complete, what's in progress
- •Next steps
- •Blockers or open questions
For Changelog
- •Update
docs/changelog.md- •Use consistent format (Added, Changed, Fixed, etc.)
- •Group related changes
- •Include version/date
- •Link to relevant PRs or issues
For Architecture Docs
- •Sync Docs with Implementation
- •Does the doc reflect current code?
- •Update diagrams if needed
- •Document design decisions made during implementation
- •Note deviations from original design with rationale
For Session Summaries
- •Create/Update Session Notes
- •What was accomplished
- •What was learned
- •What issues were filed
- •What's next
For Agent Lessons
- •Update Agent Profiles
- •Add to "Lessons Learned" section
- •Include date and context
- •Make it actionable for future sessions
- •Format:
- YYYY-MM-DD: [Lesson description]
Phase 4: Review for Quality
- •
Consistency Check
- •Formatting matches existing docs
- •Terminology is consistent
- •Cross-references are valid
- •No contradictions between docs
- •
Clarity Check
- •Is it scannable?
- •Are examples clear?
- •Is jargon explained?
- •Would a new contributor understand?
- •
Completeness Check
- •Are all questions answered?
- •Are there dangling references?
- •Is context sufficient?
Success Criteria
Before claiming completion:
- •
docs/status.mdreflects current state - •
docs/changelog.mdupdated for shipped work - • Architecture docs match implementation
- • Agent profiles updated with lessons learned
- • No stale or contradictory documentation
- • Formatting consistent with existing docs
- • Cross-references are valid
Constraints
- •DO NOT modify production code (only
docs/and related) - •DO NOT create new documentation unless requested or clearly needed
- •ALWAYS check if existing docs need updating before creating new ones
- •ALWAYS update agent profiles with lessons learned
- •ALWAYS use consistent formatting
Key Files & Formats
| File | Purpose | Format |
|---|---|---|
docs/status.md | Current project state | Structured sections |
docs/changelog.md | What's shipped | Keep-a-Changelog format |
docs/architecture.md | System design | Components, data flow |
docs/session/last-session.md | Recent work summary | Narrative + next steps |
| Agent profiles | Agent-specific lessons | Lessons Learned section |
Changelog Format
markdown
## [Unreleased] ### Added - New feature description ### Changed - What changed and why ### Fixed - Bug fix description ### Security - Security improvement ## [Version] - YYYY-MM-DD [Previous release notes]
Status Format
markdown
## Current Phase [Phase name and description] ## Progress ### Complete ✅ - [Feature/milestone] ### In Progress 🚧 - [Active work] ### Planned 📋 - [Next steps] ## Blockers [Any blockers or open questions]
Lesson Format
markdown
## Lessons Learned - 2026-01-12: [Specific lesson with context and actionable insight] - 2026-01-09: [Previous lesson]
Common Pitfalls
- •Creating instead of updating: Check existing docs first, prefer updates
- •Too verbose: Keep docs focused and scannable, use headers and lists
- •Missing patterns: Extract reusable insights from one-off fixes
- •Stale docs: Update docs when code changes, keep them in sync
- •Missing context: Future readers need to know why, not just what
Documentation Patterns
For Post-Merge Reflections
- •Review what was merged
- •Read PR comments and review feedback
- •Extract patterns from implementation decisions
- •Update relevant architecture docs
- •Add lessons to agent profiles
- •Update status and changelog
For Session Summaries
- •List major accomplishments
- •Capture key decisions made
- •Note issues filed or TODOs created
- •Identify next session priorities
- •Link to relevant PRs or branches
For Architecture Updates
- •Read implementation code
- •Compare with architecture doc
- •Update doc to match reality
- •Document why implementation differed from design (if applicable)
- •Update diagrams if needed
If Blocked
If you cannot proceed:
- •State what documentation you're trying to create/update
- •Explain what information is missing or unclear
- •Share what you've already reviewed
- •Ask the Tech Lead for clarification