Map of Content (MOC) generation spec — hook-sourcing precedence, lightweight generic vs strict wiki output, and conflict rules for indexing an arbitrary docs folder into a single MOC.md. Loaded by the docs-forge moc workflow.
Installation
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Map of Content (MOC) generation spec — hook-sourcing precedence, lightweight generic vs strict wiki output, and conflict rules for indexing an arbitrary docs folder into a single MOC.md. Loaded by the docs-forge moc workflow.
MOC Guide
The cross-runtime SSOT for generating a Map of Content index over an arbitrary docs folder. The ## Quick Reference below is binding for the moc command and any agent.
Bullets - [title](domain/slug.md) — hook; when a file's frontmatter has id, prefer [[id]] link form.
An MOC intro paragraph and a typed-cross-ref legend (> Refines: / > See-also: / etc.) as scaffolding.
The full frontmatter / staleness model is NOT enforced here — real lore wiki is owned by the llm-wiki plugin. This is a generalized mirror, not a replacement.
Hook source precedence (first hit wins)
frontmatter description: / summary:
first non-empty paragraph after the first # H1 (truncate ~100-120 chars)
first ## subheading text
fallback: humanized filename + hook = (요약 없음) flag
Link text precedence: frontmatter title: -> first # H1 -> filename.
Conflict rules
Output is <folder>/MOC.md (or --out). Never overwrite an existing index.md or README.md — exclude them from the scan AND from the output target: if --out's basename case-insensitively matches readme.md / index.md, refuse or confirm-then-route to MOC.md instead of clobbering it (case-insensitive filesystems alias INDEX.md to index.md).
If MOC.md already exists, confirm and update in place.