docs-governance
Enforces documentation file structure and governance rules to prevent stray files.
Install
mkdir -p .claude/skills/docs-governance && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/14523" && unzip -o skill.zip -d .claude/skills/docs-governance && rm skill.zipInstalls to .claude/skills/docs-governance
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Before creating, renaming, or moving any `.md` file outside `src/`, or when the user says \"stray docs\", \"docs governance\", \"where should this doc live\", or runs the stray-doc auditor: invoke `Skill('docs-governance')` and place the file using its vault-synced allowlist and filename-heuristic table.Key capabilities
- →Place non-code documentation in authorized paths
- →Identify and move stray `.md` files
- →Propose target locations using filename heuristics
- →Update internal links after moving files
- →Generate an inventory of skills, commands, and agents
How it works
The skill identifies stray `.md` files by comparing all `.md` files against an allowlist of authorized paths. It then uses filename heuristics to propose a target location and performs a `git mv` operation, updating internal links.
Inputs & outputs
When to use docs-governance
- →Fixing stray documentation files
- →Organizing project docs
- →Moving documentation to standard locations
About this skill
Before you start
- Check if
docs/sessions/$(date +%Y-%m-%d).mdexists - If not, create it with a session header:
## Session — HH:MM+**Objective:** one-line summary - Log your work continuously as you go — do not wait until the end
Docs Governance
Every piece of non-code documentation in this repo must live in a path that the Obsidian vault-sync agent mirrors. That way anyone browsing the vault, or the in-app "Vault Docs" tab, sees the full picture. Stray .md files are a bug.
The rule
Documentation lives in one of these locations (authoritative list — sync script mirrors each of them):
| Location | Purpose |
|---|---|
docs/** | Long-form docs, decisions, system specs, session logs, research |
.claude/bugs/** | Bug tracker (agent-reported, user-reported, per-workflow) |
.claude/test-runs/** | Fix-loop test-run artifacts |
.claude/workflows.md | Workflow registry |
.claude/skills/** | Claude skills (SKILL.md files) |
.claude/commands/** | Slash-command definitions |
.claude/agents/** | Subagent definitions |
README.md, AGENTS.md, CLAUDE.md (root only) | Top-level entry points |
Anything else that is "documentation" (not code, not generated, not vendored) is stray and must be moved into one of those paths.
Not in scope
src/**— inline code comments are not docsplans/**,templates/**— separate systemsnode_modules/**,.next/**, build artifacts- Scoped
AGENTS.mdfiles (e.g.server/AGENTS.md) — legitimate, keep in place - Tool-specific configs like
.github/copilot-instructions.md tests/e2e-*.mdtest runbooks — judgment call: move todocs/testing/unless the test runner reads them
Detection
Run the auditor:
scripts/docs/audit-stray-docs.sh
It globs every *.md in the repo, subtracts the in-scope and out-of-scope lists above, and prints what's left. Exit code 0 if clean, 1 if any stray docs remain.
Prompt-to-fix flow
For each stray file the auditor reports:
- Read the first ~40 lines to understand what it is.
- Propose a target under the allowlist using these filename heuristics (apply the first that matches):
| Pattern / content signal | Target |
|---|---|
*_RUNBOOK*.md, *PRODUCTION*.md, "how to deploy", "rollback", "oncall" | docs/runbooks/ |
*_BLUEPRINT*.md, *DESIGN*.md, "architecture", "system diagram" | docs/architecture/ |
ADR-*, *DECISION*.md, "we chose X because" | docs/decisions/ |
*HANDOFF*.md, "what's next", "picking up from" | docs/handoffs/ |
*SPIKE*.md, *RESEARCH*.md, *_NOTES.md, technical option analysis | docs/research/ |
*COMPETITOR*.md, *COMPARISON*.md, competitor analysis | docs/product/competitors/ |
*INTERVIEW*.md, *FEEDBACK*.md, *PERSONA*.md, user research | docs/product/users/ |
*FEATURE*.md, *PROPOSAL*.md, "feature request", "proposal" | docs/product/features/ |
*IDEA*.md, ideas*.md, half-baked thoughts | docs/product/ideas/ |
*POLICIES*.md, *GOVERNANCE*.md, permissions/RBAC | docs/system/ |
*_OVERVIEW.md at root | docs/SYSTEM_OVERVIEW.md (if project's overview is empty, merge; otherwise docs/architecture/) |
| Anything else doc-shaped | docs/ (root) — let the user pick a subdir |
- Ask the user before moving — one confirmation per file, or a batched
"move all to <target>"if several share the same target. git mvthe file (preserves history). Update any internal links that referenced the old path — grep the repo for the old basename first.- Wait for next vault-sync cycle (up to 5 min) — the old vault copy clears via
rsync --delete.
Do not auto-move without confirmation. Stray files often encode history that's worth glancing at — and sometimes the right answer is "delete it," not "move it."
Skills inventory
The same principle applies to skills, commands, and agents. To see the current inventory classified as standard (present in templates/claude-project-template/.claude/) vs project-specific (only in this repo), regenerate the index:
scripts/docs/generate-skills-index.sh
This writes docs/meta/SKILLS.md. The file is committed and auto-syncs to the vault, so it's browsable from the Vault Docs tab. Regenerate it whenever you add, remove, or rename a skill / command / agent.
Classification rules the generator applies
- standard — filename exists in the template at the same relative path.
- project-specific — exists in this repo, not in the template.
- drifted — exists in both but content differs (informational only; drift is often intentional).
- missing — exists in template, not in this repo (flag for review).
When to run this skill
- After creating any
.mdoutside the allowlist (the file watchers in editors don't enforce it). - Before cutting a release, as part of the pre-commit walk.
- After adding / renaming / removing a skill, command, or agent.
- Periodically, as part of the
/session-loghousekeeping (~monthly).
Template propagation
This skill is part of the standard project template. When it changes, also update:
templates/claude-project-template/.claude/skills/docs-governance/SKILL.md
…so /new-repo inherits the current version.
When not to use it
- →The file is inline code comments in `src/**`
- →The file is a tool-specific config like `.github/copilot-instructions.md`
- →The file is a scoped `AGENTS.md` (e.g., `server/AGENTS.md`)
Limitations
- →Requires user confirmation before moving files
- →Does not automatically delete files; requires user decision
- →Filename heuristics are a guide, not a definitive rule
How it compares
This skill enforces a structured documentation governance policy by automatically identifying and relocating non-compliant `.md` files, ensuring all documentation is discoverable within a vault-synced system.
Compared to similar skills
docs-governance side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| docs-governance (this skill) | 0 | 3mo | Review | Beginner |
| marker | 22 | 6mo | Review | Beginner |
| markdown-converter | 5 | 2mo | Review | Beginner |
| enhance-claude-memory | 11 | 5mo | Review | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
marker
benchflow-ai
Convert PDF documents to Markdown using marker_single. Use when Claude needs to extract text content from PDFs while preserving LaTeX formulas, equations, and document structure. Ideal for academic papers and technical documents containing mathematical notation.
markdown-converter
steipete
Convert documents and files to Markdown using markitdown. Use when converting PDF, Word (.docx), PowerPoint (.pptx), Excel (.xlsx, .xls), HTML, CSV, JSON, XML, images (with EXIF/OCR), audio (with transcription), ZIP archives, YouTube URLs, or EPubs to Markdown format for LLM processing or text analysis.
enhance-claude-memory
avifenesh
Use when improving CLAUDE.md or AGENTS.md project memory files.
doc-sync
solatis
Synchronizes docs across a repository. Use when user asks to sync docs.
wiki-sync
zoraxl
Use to sync the wiki from a merged PR or from a source doc/file path. Two modes — PR mode (post-merge: creates ADR if needed, flips ADR to accepted, updates wiki pages, appends log, records idempotency, archives related plan/source files) and doc mode (ingests existing implemented knowledge from a f
markdown-to-pdf
duc01226
[Document Processing] Use when you need to convert markdown files to PDF with syntax highlighting and custom CSS support.