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.
git clone https://github.com/EasyJoy-Technologies/openclaw-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"
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"
skills/magic-docs/SKILL.mdMagic 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:
- Create the file with the MAGIC DOC header
- Add optional instruction line in italics
- Populate with current known information
- 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
- Read the current Magic Doc content
- Identify new information from the conversation that belongs in the document
- Determine where it fits in the existing structure
- Apply the update using file edit (preserve existing structure)
- 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
| Document | Update Trigger |
|---|---|
| Service port map | New service deployed, port changed |
| Domain/URL reference | New domain configured, URL changed |
| Docker container list | Container added/removed/updated |
| Deploy runbook | Deploy process changed |
| API endpoint reference | New endpoint added, signature changed |
| Dependency inventory | Package added/upgraded/removed |
| Architecture overview | New component, changed integration |
| Troubleshooting guide | New 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)