dh-create-documentation
Create structured docs (Markdown/HTML/Mermaid): project docs, API refs, READMEs, guides, plus evolution and observation notes recording software evolution and session learnings; Obsidian vault = {project_root}, ALL docs under {project_root}/docs, frontmatter metadata. Use to document this, write a README, generate documentation, create evolution/observation notes, or capture learnings.
- License 许可
- MIT
- 最近更新
- 2026-11-10
- Stars
- ★ 8
- Forks
- 1
01 前言 Front Matter
- name
- dh-create-documentation
- license
- MIT
- metadata
- { "audience": "developers", "workflow": "documentation" }
- description
- Create structured docs (Markdown/HTML/Mermaid): project docs, API refs, READMEs, guides, plus evolution and observation notes recording software evolution and session learnings; Obsidian vault = {project_root}, ALL docs under {project_root}/docs, frontmatter metadata. Use to document this, write a README, generate documentation, create evolution/observation notes, or capture learnings.
- allowed-tools
- bash, read, write, edit, glob
- compatibility
- opencode, copilot, antigravity
02 资源文件 4
- 参考文档references/complete-example.md1.3 KB
- 参考文档references/evolution-notes.md8.4 KB
- 参考文档references/format-guide.md2.4 KB
- 参考文档references/obsidian-push.md4.3 KB
03 SKILL.md 正文
Documentation Generator
Generate structured, cross-referenced documentation in any format, at any location, then push a copy to Obsidian with complete metadata for vault discoverability.
Documentation Contract (mandatory)
- Owner: the best available documentation agent (bundled documentation
capability as fallback, resolved with
../dh-planning/references/agent-selection.md) is the main and only responsible role for create/update/delete/retrieve of generated documents (EXCLUDINGdocs/plans/). All document work is delegated to it; this skill is the tool it uses. - Format: Markdown is the PRIMARY format for every document.
Complementary information and tables may use
csv,xml,yaml, orjson. - Mermaid: every complex workflow or design MUST include a mermaid
diagram (native in Obsidian — no conversion needed). For complex diagrams,
invoke the
dh-mermaidskill. - ASCII wireframes: every UI representation MUST include an ASCII wireframe (code block).
- Obsidian frontmatter: REQUIRED on every document (
title,tags,project,created,updated,stack,feature,epic). - Retrieval: use
notesmd-cli search-content "<term>" --vault "<project>"(preferred) orobsidian search query="<term>"to retrieve information from documents;rgas fallback. - Parsing extra formats: use
jq(json),yq(yaml),xq(xml), and DuckDB (dh_read_sheet,dh_update_sheet,dh_sheet_schema) for tabular data. These tools are exposed by the project-scopedhMCP server; under Code Mode they are called astools.dh.<tool>, anddh_<tool>is the tool's normalized name (permission actions matchdh_*). - Command execution: run retrieval, search, and vault-push commands
through the
dh-execute-cliskill; never run bash directly.
Custom Directives: Evolution & Observation Notes
After plan completion, a release, an architecture change, or session learnings worth keeping, create BOTH notes and register them:
- Evolution note — how the software evolved (what changed, why,
architecture/modules, validation/release, follow-ups):
{project_root}/docs/evolution/<YYYY-MM-DD>-<slug>.md - Observation note — session learnings (what worked, what didn't,
decisions, follow-ups):
{project_root}/docs/evolution/observations/<YYYY-MM-DD>-<HHMM>-<slug>.md - Index — prepend one row per note to
{project_root}/docs/evolution/index.md(newest first).
Rules:
- All paths stay under
{project_root}/docs; never write notes underdocs/plans/. docs/evolve/is historical: do not migrate, delete, or rewrite it — new notes go todocs/evolution/.- These directives replace the external
evolve/state-syncworkflow for plan close-out. - Templates, rules, workflow, and verification:
references/evolution-notes.md.
Workflow
Follow this sequence for every documentation request:
- Discover — Determine what to document and its scope
- Design — Plan the document structure (single file or multi-file)
- Generate — Write the documents in the requested format
- Cross-reference — Link related documents together
- Obsidian push — Copy to Obsidian with frontmatter metadata
Step 1: Discovery
Before writing, clarify with the user (or infer from context):
| Question | Default |
|---|---|
| What are we documenting? | Current project, recent changes, or user-specified topic |
| Output format? | markdown (also supports html, mermaid) |
| Output location? | {project_root}/docs (ALL documentation lives here) |
| Single file or multi-file? | Multi-file for >3 sections, single otherwise |
| Obsidian vault path? | The vault IS the project root — git rev-parse --show-toplevel; docs are a folder inside it ({project_root}/docs) |
| Existing docs to extend? | Check {project_root}/docs/ first, extend if found |
Ask if critical info is missing. For simple requests ("document this function"), infer defaults and proceed.
When the project graph is indexed, use the dh-code-query skill during
discovery to inventory modules, public definitions, importers, and the tests
that reach them. Use it to choose what to document; verify every symbol and
signature in the source before writing.
Step 2: Structure Design
Single-file structure
For focused topics (one class, one endpoint, one workflow):
# Title
## Overview
Brief description of what this documents.
## Details
### Section 1
Content.
### Section 2
Content.
## Related
- [Other doc](./other.md)
Multi-file structure
For broad topics (full API, architecture, project handbook). Always create an index. All documentation lives under {project_root}/docs (a folder of the Obsidian vault):
{project_root}/ ← Obsidian vault (the project root)
docs/ ← ALL documentation goes here
index.md ← Entry point with links to all sections
getting-started.md ← Quickstart guide
architecture.md ← System design
api/
index.md ← API overview
endpoints.md ← Endpoint reference
authentication.md ← Auth flow
guides/
deployment.md ← How to deploy
troubleshooting.md ← Common issues
Index file template:
# {Project Name} Documentation
Last updated: {date}
## Sections
- [Getting Started](./getting-started.md) — Quickstart and prerequisites
- [Architecture](./architecture.md) — System design and decisions
- [API Reference](./api/index.md) — Endpoints, auth, and examples
- [Guides](./guides/) — Deployment, troubleshooting, recipes
## Quick Links
- [Installation](./getting-started.md#installation)
- [Configuration](./getting-started.md#configuration)
Reference triggers
Use these detailed references only when the specific sub-task requires them:
| Reference | When to use | File |
|---|---|---|
| Format guide | User requests HTML or Mermaid output, or detailed Markdown formatting examples | references/format-guide.md |
| Obsidian push | Time to push documentation to Obsidian (Step 5 of the workflow) | references/obsidian-push.md |
| Complete example | User wants to see a full end-to-end example | references/complete-example.md |
| Evolution & observation notes | Plan completion, release, architecture change, or "capture learnings" | references/evolution-notes.md |
| Complex diagrams | Architecture, current/desired state, critical changes, or component graphs | dh-mermaid |
Step 4: Content Standards
Every document must have
- Title — Clear, specific
# Titleat the top - Overview — 2-3 sentences explaining what this doc covers
- Body — Structured with
##headings, no more than 4 levels deep - Related links — References to other docs in the set
File naming
| Good | Bad |
|---|---|
getting-started.md |
Getting Started.md |
api-endpoints.md |
API-v2.3-ref.md |
deployment-guide.md |
deploy.md |
Use lowercase, hyphens for spaces, descriptive names.
Cross-references
When generating multi-file docs, link documents together:
## Authentication
Before calling endpoints, obtain a token as described in [Authentication](./authentication.md).
All endpoints require the header documented in [API Overview](./index.md#headers).
For Obsidian compatibility, also include [[wikilinks]] as comments:
<!-- obsidian: [[authentication]] [[api-overview]] -->
Gotchas
- Nested directories: Create parent directories first (
mkdir -p) before writing files. - Frontmatter conflicts: If source Markdown already has frontmatter, merge the Obsidian metadata into the existing block — don't create two
---blocks. - Obsidian not running: The Obsidian push is best-effort. If
obsidianCLI fails, write files directly to the vault path and tell the user to open Obsidian to see them. - Vault path: The Obsidian vault IS the project root (
{project_root}, auto-detected viagit rev-parse --show-toplevel). ALL documentation must be written under{project_root}/docs— Obsidian sees it as adocs/folder inside the vault; there is no{vault}/{project}/nesting. Override the vault with theOBSIDIAN_VAULTenvironment variable (e.g., for a dedicated notes vault) — docs still land in{vault}/docs. - Large docs: For 20+ files, batch the push and report progress per batch.
- HTML docs in Obsidian: Obsidian primarily renders Markdown. If HTML is requested, still push a
.mdversion with an embedded<iframe>or link to the HTML version. - Mermaid in Obsidian: Obsidian renders Mermaid natively inside code blocks. No conversion needed — Mermaid syntax works directly in
.mdfiles.
Verification Checklist
After generating documentation:
- [ ] All files exist in
{project_root}/docs/(the documentation folder of the vault) - [ ] Index file (
index.md) links to every document - [ ] Cross-references between documents resolve correctly
- [ ] Every document inside
{project_root}/docs/has complete frontmatter (tags, project, created, stack, updated) - [ ] Mermaid diagrams render correctly (check syntax)
- [ ] HTML files have proper structure with embedded styles
Doc search
Documentation management: delegate create / update / delete / retrieve of generated documents (excluding docs/plans) to the best available documentation agent (bundled documentation capability as fallback) — the main and only documentation owner (see dh-create-documentation).
Search generated documentation quickly: notesmd-cli search-content "<term>" --vault "<project-name>" or obsidian search query="<term>" (fallback: rg --glob '*.md' "<term>" docs/).
04 同仓库更多 Skills
dh-simplify
Review changed code for reuse, quality, and efficiency (three parallel reviews), then fix findings directly. Use after making changes or when asked to clean up, refactor, simplify, or improve this code.
dh-setup
Audit system software, configure user MCPs/plugins, scaffold project QA (hooks + per-stack tools), bootstrap docs/architecture with the selected architecture agent, and write harness directives into AGENTS.md. Use to check requirements or setup the environment.
dh-semver
Apply strict Semantic Versioning — analyze commits since the last tag to determine the bump type (major/minor/patch from conventional commit prefixes), generate an automated changelog grouped by breaking changes, features, fixes, and chores, and create a git tag locally without pushing until confirmed, handling both conventional commits and manual version decisions. Use when preparing a release, invoked by dh-execute-plan after plan completion and dh-final-review for release readiness, or when the user asks "what version is next?", "bump version", "generate changelog", "tag release", or "what changed since last release?".
dh-review
Verify a plan sub-task against acceptance criteria, scope, done-when; review diff, validation, regression risk; structured verdict to tasks/review.md. Plan Alignment Mode (fast execution) is a separate mode: no sub-task selection, no diff review, no code review — it compares plan.md with plan_fast.md and writes tasks/review-fast.md (pre-execution) or tasks/review-fast-final.md (plan-end). Use after implementation, to review/verify the sub-task, or to check fast-plan alignment.
dh-resume-plan
Resume a paused phased plan from docs/plans/<slug>/handoff.md: validate the contract, detect drift, rehydrate context, mark the handoff resumed, and continue via dh-execute-plan resume mode. Use when the user says "resume the plan", "continue where we stopped", "pick up the plan", or "resume after a pause".
dh-preflight
Run tests, linters, static analysis as a release gate: auto-detect tooling, check dirty state, pass/fail verdict with actionable failures (no auto-fixes). Use to run preflight, pre-release check, or validate before release.