Openclaw-skills magic-docs

Automatically maintain markdown documentation files marked with a MAGIC DOC header. When a file containing "MAGIC DOC:" is read or mentioned, update it with new information from the current conversation. Use when asked to "create a magic doc", "auto-update this doc", "keep this document current", "maintain documentation", or when encountering a file with a MAGIC DOC header. Also use for creating self-maintaining documentation like port lists, API references, architecture overviews, or runbooks.

install
source · Clone the upstream repo
git clone https://github.com/EasyJoy-Technologies/openclaw-skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/EasyJoy-Technologies/openclaw-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/magic-docs" ~/.claude/skills/easyjoy-technologies-openclaw-skills-magic-docs && rm -rf "$T"
OpenClaw · Install into ~/.openclaw/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/EasyJoy-Technologies/openclaw-skills "$T" && mkdir -p ~/.openclaw/skills && cp -r "$T/skills/magic-docs" ~/.openclaw/skills/easyjoy-technologies-openclaw-skills-magic-docs && rm -rf "$T"
manifest: skills/magic-docs/SKILL.md
source content

Magic Docs — Self-Maintaining Documentation

Automatically maintain documentation files marked with a special header. When a Magic Doc is encountered, update it with relevant new information discovered during the conversation.

Magic Doc Format

A Magic Doc is any markdown file whose first line matches:

# MAGIC DOC: <Title>

Optional second line (italics) provides update instructions:

# MAGIC DOC: Service Port Map
_Update whenever a new service, port, or domain is discovered_

Creating a New Magic Doc

When user asks to create a self-maintaining document:

  1. Create the file with the MAGIC DOC header
  2. Add optional instruction line in italics
  3. Populate with current known information
  4. Inform the user that this doc will be updated automatically when relevant information appears in conversation

Example:

# MAGIC DOC: Project Architecture
_Update when new services, dependencies, or architectural decisions are discovered_

## Services
- **OpenClaw Gateway**: port 18789, loopback
- **WeCom Bridge**: port 9000, loopback

## Dependencies
- Node.js v24
- Nginx (custom build at /usr/local/nginx)

---
*Last updated: 2026-03-31 by magic-docs*

Updating a Magic Doc

When new information relevant to a Magic Doc is discovered during a conversation:

Detection

  • The document was read earlier in the conversation
  • New facts related to its topic were discovered (new port, new service, config change, etc.)

Update Process

  1. Read the current Magic Doc content
  2. Identify new information from the conversation that belongs in the document
  3. Determine where it fits in the existing structure
  4. Apply the update using file edit (preserve existing structure)
  5. Update the "Last updated" timestamp at the bottom

Update Rules

  • Only add information that was verified during the conversation (not guessed)
  • Preserve existing entries unless they are confirmed outdated
  • If an existing entry is outdated, update it and note the change
  • Add a "Last updated" line at the bottom:
    *Last updated: YYYY-MM-DD by magic-docs*
  • Do not reorganize the entire document — make minimal, targeted edits
  • If the document grows beyond 200 lines, suggest splitting into sections with references

Good Candidates for Magic Docs

DocumentUpdate Trigger
Service port mapNew service deployed, port changed
Domain/URL referenceNew domain configured, URL changed
Docker container listContainer added/removed/updated
Deploy runbookDeploy process changed
API endpoint referenceNew endpoint added, signature changed
Dependency inventoryPackage added/upgraded/removed
Architecture overviewNew component, changed integration
Troubleshooting guideNew failure mode discovered and solved

Not Good Candidates

  • Files that change via git commits (the source of truth is git, not conversation)
  • Files with strict formatting requirements (generated configs, JSON, YAML)
  • Temporary notes (use session-summary instead)