magic-docs
Skill1 starsChanged 8 months agoMITView on GitHub
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.
In this repository6 other files it gives its agents.
- code-navigateSkill
- code-searchSkill
- code-simplifySkill
- memory-extractSkill
- memory-organizerSkill
- session-summarySkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 10 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 27
When user asks to create a self-maintaining document:
- Distinctive: line 29
Create the file with the MAGIC DOC header
- Distinctive: line 30
Add optional instruction line in italics
- Distinctive: line 54
When new information relevant to a Magic Doc is discovered during a conversation:
- Distinctive: line 61
Read the current Magic Doc content
- Distinctive: line 65
Update the "Last updated" timestamp at the bottom
- Distinctive: line 68
Only add information that was verified during the conversation (not guessed)
- Distinctive: line 70
If an existing entry is outdated, update it and note the change
- Very specific: line 71
Add a "Last updated" line at the bottom: *Last updated: YYYY-MM-DD by magic-docs*
- Distinctive: line 72
Do not reorganize the entire document — make minimal, targeted edits
- Distinctive: line 73
If the document grows beyond 200 lines, suggest splitting into sections with references
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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:
- 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)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

