Maintain living documentation with single source of truth approach, journal reconciliation, and worklog.db integration
/plugin marketplace add gaurangrshah/gsc-plugins/plugin install docs@gsc-pluginsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Maintain documentation using the single source of truth philosophy. All system documentation flows through one main guide file with inline updates.
Set these environment variables or create a local config file (e.g., ~/.claude/docs.local.md):
# Required - set for your environment
DOCS_ROOT="${DOCS_ROOT:-~/docs}"
MAIN_GUIDE="${MAIN_GUIDE:-$DOCS_ROOT/guide.md}"
KNOWLEDGE_BASE="${KNOWLEDGE_BASE:-~/.claude/knowledge}"
# Optional - worklog integration (auto-detected if worklog plugin installed)
WORKLOG_DB="${WORKLOG_DB:-}"
# Optional - documentation query script
DOCS_QUERY_SCRIPT="${DOCS_QUERY_SCRIPT:-}"
With Worklog Integration:
DOCS_ROOT=~/docs
MAIN_GUIDE=~/docs/system-guide.md
KNOWLEDGE_BASE=~/.claude/knowledge
WORKLOG_DB=~/.claude/worklog/worklog.db
DOCS_QUERY_SCRIPT=~/scripts/query-docs.sh
Shared Database (Multi-System):
DOCS_ROOT=~/docs
MAIN_GUIDE=~/docs/system-guide.md
KNOWLEDGE_BASE=~/.claude/knowledge
WORKLOG_DB=/mnt/share/path/to/worklog.db # Adjust to your mount path
DOCS_QUERY_SCRIPT=~/scripts/query-docs.sh
Standalone (no worklog):
DOCS_ROOT=~/docs
MAIN_GUIDE=~/docs/project-guide.md
KNOWLEDGE_BASE=~/.claude/knowledge
ALL system documentation goes into your main guide (
$MAIN_GUIDE)Update it inline. NO separate files. NO exceptions.
While working on tasks:
/tmp/ for your own process notes, logs, investigation resultsWhen task complete:
/tmp/ working files✅ Create ONLY when:
❌ Don't create for:
# 1. Use /tmp for your working notes
echo "Investigating issue X..." > /tmp/work-notes.md
# ... continue adding as you work ...
# 2. When done, review
cat /tmp/work-notes.md
# 3. Promote selectively:
# - System config changes → $MAIN_GUIDE (inline update)
# - Script automation → project scripts directory
# - Everything else → let it vanish
# 4. Default: Don't persist
Rule: Default to /tmp. Only persist when human actually needs it.
| Type | Where | When |
|---|---|---|
| System config changes | $MAIN_GUIDE inline | Firewall, SSH, network changes |
| Service deployments | $MAIN_GUIDE inline | New services, modifications |
| Security changes | $MAIN_GUIDE + security/ | Any security-related change |
| Architectural decisions | $KNOWLEDGE_BASE/decisions/ | Major design choices |
| Lessons learned | $MAIN_GUIDE "Key Lessons" | Gotchas, patterns discovered |
| Type | Why Not | Alternative |
|---|---|---|
| Routine operations | No lasting value | None needed |
| Typo corrections | Trivial | Git commit message |
| Temporary investigations | Ephemeral | /tmp/ notes |
| Hypothetical configs | Not real | Wait until implemented |
Rule: If it changes system behavior or you'll need to reference it later → Document.
CRITICAL: Before creating ANY .md file, follow this decision tree:
1. Is this temporary work/planning?
YES → /tmp/{task}-{date}.md (ephemeral)
STOP
2. Is this system configuration?
YES → $MAIN_GUIDE (inline update)
STOP
3. Is this a cross-project pattern/decision/learning?
YES → $KNOWLEDGE_BASE/
├─ decisions/ - Architecture decisions (ADRs)
├─ guides/ - Cross-project how-tos
└─ learnings/ - Incident learnings
STOP
4. Is this project-specific documentation?
YES → $DOCS_ROOT/{category}/
├─ security/ - Security configs
├─ guides/ - How-to guides
├─ services/ - Service docs
└─ audits/ - System audits
STOP
NEVER:
$DOCS_ROOT/decisions/ directory (use $KNOWLEDGE_BASE/decisions/)ALL new documentation MUST include:
---
title: "Descriptive title"
type: decision|learning|guide|reference|audit|changelog|environment
created: YYYY-MM-DD
---
# Edit the one true guide
$EDITOR $MAIN_GUIDE
Find the relevant section:
Update these 3 places:
Update header:
DO write:
DON'T write:
Example - Good:
### Firewall
**Rules:** 2 (LAN + Tailscale)
**Lesson:** Firewall is inbound-only. No loopback/Docker rules needed.
Example - Bad:
### Firewall Configuration Documentation
This section comprehensively documents the complete firewall
configuration strategy implemented across the system...
[10 paragraphs explaining obvious things]
WRONG:
# DON'T create permanent docs for agent work:
touch $DOCS_ROOT/how-i-fixed-docker-2025-11-08.md
touch ~/investigation-summary.md
touch ~/complete-fixes-summary.md
RIGHT:
# DO use /tmp for process work:
vi /tmp/docker-fix-notes.md
# Only persist if human actually needs it
WRONG:
# DON'T do this:
touch $DOCS_ROOT/firewall-update-2025-11-08.md
touch $DOCS_ROOT/ssh-key-implementation.md
touch $DOCS_ROOT/docker-networking-fix.md
RIGHT:
# DO this:
$EDITOR $MAIN_GUIDE
# Update relevant section inline
WRONG:
## Firewall Rule Addition Procedure
### Prerequisites
- [ ] Understand network topology
- [ ] Review security policies
- [ ] Obtain change approval
...
### Step 1: Access Web Interface
Navigate to the control panel by opening your web browser
and entering the IP address... [500 more words]
RIGHT:
### Firewall
Add rules: Web UI → Control Panel → Security → Firewall
WRONG: Keeping old configuration details after they've changed
RIGHT: Update inline, note in Change History what changed
Time: 2-5 minutes max
If you discover a pattern or learn something important:
If adding entirely new domain (rare):
Scenario: "I added Tailscale to the firewall whitelist."
Action:
# Open $MAIN_GUIDE
# 1. Update Firewall section:
### Current Configuration
Rules:
1. Allow local network (e.g., 192.168.x.0/24)
2. Allow VPN network (e.g., 100.64.0.0/10 for Tailscale)
# 2. Update Current State table:
| Firewall | ✅ ENABLED | 2 rules (LAN + VPN) |
# 3. Add to Change History:
### 2025-01-15
- Added VPN firewall rule
# 4. Update header:
Last Updated: 2025-01-15
Time: 2 minutes
Scenario: "Fixed typo in .zshrc comment."
Action: None. No documentation needed (non-material change).
Scenario: "TIL: Firewall is inbound-only."
Action:
# Open $MAIN_GUIDE
# Add to Firewall → Key Lessons:
**Key insight:** Firewall is inbound-only.
No loopback or Docker rules needed.
Time: 30 seconds
Commit documentation changes with your project's git workflow:
git add $MAIN_GUIDE
git commit -m "docs: Update firewall configuration"
$MAIN_GUIDE is for:
$KNOWLEDGE_BASE is for:
If in doubt: Put it in $MAIN_GUIDE (safer)
$DOCS_ROOT/
├── README.md # Navigation hub and quick reference
├── {system}-guide.md # THE GUIDE (single source of truth)
├── FRONTMATTER-SCHEMA.md # Documentation standards
├── security/ # ALL security documentation
│ ├── README.md
│ └── *.md
├── guides/ # How-to guides and procedures
│ ├── README.md
│ └── *.md
├── services/ # Service deployment documentation
│ ├── README.md
│ └── *.md
├── audits/ # System audits and assessments
│ └── YYYY-MM-DD-*.md
├── archive/ # Historical documentation (reference only)
│ └── *.md
└── baselines/ # System state baselines
└── current.json
Documentation Guidelines:
$MAIN_GUIDE inlinesecurity/guides/ with frontmatterservices/audits/ with frontmatterNever:
Good documentation system:
Bad documentation system:
All documentation uses YAML frontmatter for queryability
---
title: "Brief descriptive title"
type: decision|learning|guide|reference|changelog|environment
created: YYYY-MM-DD
---
updated: YYYY-MM-DD
tags: [tag1, tag2, tag3]
status: active|deprecated|superseded
category: "Primary category"
related: [path/to/doc.md]
commit: abc1234
environment: system-name
| Type | Use Case |
|---|---|
decision | Architectural or operational decisions |
learning | Lessons learned from incidents |
guide | How-to documentation |
reference | Reference docs and indexes |
changelog | Change history |
environment | Environment-specific docs |
---
title: "Decision title"
type: decision
category: infrastructure|security|tooling
tags: [relevant, tags]
status: active
created: YYYY-MM-DD
---
## Context
Why this decision was needed
## Decision
What was decided
## Rationale
- Reason 1
- Reason 2
## Consequences
**Positive:** What this enables
**Negative:** Trade-offs
## Alternatives Considered
- Option A: Why not
---
title: "What we learned"
type: learning
category: incident|optimization|troubleshooting
tags: [relevant, tags]
created: YYYY-MM-DD
---
## What Happened
Situation description
## Root Cause
What caused it
## Solution
How resolved
## Prevention
How to avoid
---
title: "How to [do thing]"
type: guide
category: operations|security|maintenance
tags: [relevant, tags]
status: active
created: YYYY-MM-DD
---
## Purpose
What this accomplishes
## Prerequisites
What you need
## Steps
1. Step one
2. Step two
## Verification
How to verify
## Troubleshooting
Common issues
If $DOCS_QUERY_SCRIPT is configured:
# Find security decisions
$DOCS_QUERY_SCRIPT --type decision --tag security
# Find recent learnings
$DOCS_QUERY_SCRIPT --type learning --updated-last 30d
# Find all guides
$DOCS_QUERY_SCRIPT --type guide --status active
# See all options
$DOCS_QUERY_SCRIPT --help
Purpose: Convert agent journal notes into permanent documentation after task completion.
When called with a journal file path (e.g., /tmp/journal-fix-auth-2025-01-15.md):
Read and analyze the journal
Determine documentation actions Use this decision tree for each finding:
Finding Type → Documentation Action
─────────────────────────────────────────────────────
System config change → Update $MAIN_GUIDE inline
Service deployment → Update services/ doc or $MAIN_GUIDE
Security change → Update security/ doc AND $MAIN_GUIDE
Architecture decision → Create/update $KNOWLEDGE_BASE/decisions/
Lesson learned → Add to relevant section's "Key Lessons"
New pattern/approach → Create $KNOWLEDGE_BASE/guides/ if cross-project
Bug fix (non-trivial) → Add to relevant troubleshooting section
Code change only → Update CHANGELOG only (if significant)
Trivial change → No documentation needed
Execute documentation updates For each required update:
Update CHANGELOGs
Date - Title, Changed, Why, ImpactConfirm reconciliation Report back:
| Entry Type | Typical Action |
|---|---|
## Task Started | Context only, rarely needs docs |
## Discovery | May need docs if significant finding |
## Decision | Often needs $KNOWLEDGE_BASE/decisions/ or inline update |
## Blocker | May need troubleshooting section update |
## Checkpoint | Context only, rarely needs docs |
## Recovery | May warrant learning doc if significant |
## Completed | Summary guides what needs documentation |
Journal excerpt:
### Decision - 14:32
**Context:** Choosing auth strategy for new API
**Content:** Going with JWT over sessions - API is stateless, mobile clients
**Next:** Implement in auth.service.ts
### Completed - 16:45
**Context:** JWT auth implementation done
**Content:** Added JWT middleware, refresh token rotation, 15min access tokens
Reconciliation actions:
$KNOWLEDGE_BASE/decisions/jwt-auth-strategy.md (architecture decision)# After task completion, invoke skill with journal path:
# "Reconcile journal at /tmp/journal-fix-auth-2025-01-15.md"
# Or programmatically in workflow:
# 1. Complete task
# 2. Invoke docs-manager skill
# 3. Provide journal path
# 4. Skill performs reconciliation
# 5. Delete journal after confirmation
Purpose: Use shared worklog.db for cross-system knowledge persistence and work tracking.
When $WORKLOG_DB is set, the skill integrates with the worklog database.
Example paths by setup:
| Setup | Path |
|---|---|
| Local (default) | ~/.claude/worklog/worklog.db |
| Shared (network) | /mnt/share/path/to/worklog.db |
| Scenario | Store? | Table |
|---|---|---|
| System config change | After documenting | entries |
| Reusable knowledge/pattern | Yes | knowledge_base |
| Architectural decision | Yes (+ decisions/ doc) | knowledge_base |
| Task completion with learnings | Yes | entries + knowledge_base |
| Incident/issue resolution | Yes | incidents |
| Research findings | Yes | research |
| Trivial changes | No | - |
sqlite3 "$WORKLOG_DB" "INSERT INTO knowledge_base
(category, title, content, tags, source_agent, system) VALUES (
'category-here',
'Title of the Knowledge',
'**Problem:** What was the issue
**Solution:** How to solve it
**Notes:** Gotchas, warnings',
'comma,separated,tags',
'$(hostname)',
'$(hostname)'
);"
Categories: learnings, guides, patterns, protocols, decisions
sqlite3 "$WORKLOG_DB" "INSERT INTO entries
(agent, task_type, title, details, decision_rationale, outcome, tags, related_files) VALUES (
'$(hostname)',
'documentation',
'Task Title',
'What was done',
'Why this approach',
'Result/outcome',
'docs,tags',
'/path/to/files'
);"
When reconciling journals:
knowledge_base tableentries table# Search for relevant patterns
sqlite3 "$WORKLOG_DB" \
"SELECT title, content FROM knowledge_base WHERE tags LIKE '%pattern%';"
# Check recent related work
sqlite3 "$WORKLOG_DB" \
"SELECT title, outcome FROM entries WHERE tags LIKE '%topic%' ORDER BY timestamp DESC LIMIT 5;"
For session-to-session context during tasks:
# Store working memory
sqlite3 "$WORKLOG_DB" "INSERT INTO memories
(key, content, memory_type, importance, source_agent, system, tags) VALUES (
'mem_' || lower(hex(randomblob(8))),
'[DECISION] Brief title | Details of the decision',
'fact',
7,
'$(hostname)',
'$(hostname)',
'system:shared,type:decision'
);"
# Recall memories
sqlite3 "$WORKLOG_DB" "SELECT key, content FROM memories
WHERE status != 'archived' ORDER BY importance DESC LIMIT 10;"
Starting a new session?
$DOCS_ROOT/README.md (navigation)$MAIN_GUIDEAfter completing tasks:
Never:
Remember: This system works because it's simple. Keep it simple.
Skill Version: 2.0.0 Philosophy: Single source of truth. Inline updates. Structured knowledge. Queryable metadata. Journal-driven reconciliation. Cross-system worklog.db persistence.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.