magic-docs | skill guide | OpenClaw Study

Magic Docs automatically keeps documentation in sync with code by passively detecting special file markers on read and updating those files in the backgrou…

Magic Docs automatically keeps documentation in sync with code by passively detecting special file markers on read and updating those files in the background using ephemeral agent forks. Key features include marker-based registration (# MAGIC DOC: Title and optional inline instructions), registration on FileRead calls (no expensive directory scans), and a post-sampling idle hook that sequentially forks a constrained sub-agent to edit only the target document. The update chain clones file state, reads the latest content, builds a prompt (with {{docContents}}, {{docPath}}, {{customInstructions}}), and runs a Sonnet model fork with a strict canUseTool whitelist. Prompt templates are customizable per-user and fall back silently. Use cases: keeping READMEs, API docs, design docs and onboarding material accurate, reducing manual maintenance, and ensuring non-blocking, least-privilege, just-in-time doc evolution tied to developer/agent conversations.

This page belongs to the OpenClaw Skills learning hub with install guides, category navigation, and practical links.

简体中文 繁體中文 日本語 Español Português