From docs
Generate and update documentation using templates for any Diataxis type (tutorial, howto, reference, explanation), AI files (CLAUDE.md, AGENTS.md, llms.txt), architecture docs (C4 context/container, system overview, Mermaid diagrams), and project files (README, CONTRIBUTING, glossary). Template-driven with idempotent updates that preserve custom sections. Use when creating or updating documentation. Triggers on "write docs for", "create a tutorial", "document the API", "generate README", "create AGENTS.md", "write architecture overview".
How this skill is triggered — by the user, by Claude, or both
Slash command
/docs:write [doc-type] [subject] e.g. 'howto authentication' or 'AGENTS.md'[doc-type] [subject] e.g. 'howto authentication' or 'AGENTS.md'The summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Philosophy:** Template-driven documentation with progressive disclosure. Load only the reference template needed for the current request. Respect existing project conventions. Preserve custom content when updating.
references/ai-files/agents-md.mdreferences/ai-files/claude-md.mdreferences/ai-files/llms-txt.mdreferences/architecture/c4-container.mdreferences/architecture/c4-context.mdreferences/architecture/diagram-mermaid.mdreferences/architecture/system-overview.mdreferences/diataxis/explanation.mdreferences/diataxis/howto.mdreferences/diataxis/reference.mdreferences/diataxis/tutorial.mdreferences/project/contributing.mdreferences/project/glossary.mdreferences/project/readme.mdPhilosophy: Template-driven documentation with progressive disclosure. Load only the reference template needed for the current request. Respect existing project conventions. Preserve custom content when updating.
Run this skill when:
Do NOT use this skill for:
docs:auditdocs:adrdocs:auditdocs:adrStep 0.1 - Resolve Project Root:
PROJECT_ROOT=$(git rev-parse --show-toplevel)
echo "Project root: ${PROJECT_ROOT}"
# Ensure docs folder exists
mkdir -p "${PROJECT_ROOT}/docs"
Step 0.2 - Check Existing Documentation:
# Check if target doc already exists
ls "${PROJECT_ROOT}/docs/"
# Check existing folder conventions (tutorials/ vs guides/ etc.)
find "${PROJECT_ROOT}/docs" -type d -maxdepth 2
Verify:
[ ] PROJECT_ROOT resolved correctly
[ ] docs/ folder exists (created if needed)
[ ] Checked for existing doc with same name/topic
[ ] Noted existing folder conventions
Classify the request and select the appropriate reference template. Load only one reference file.
| Trigger Keywords | Reference File | Doc Type |
|---|---|---|
| "tutorial", "learn", "getting started", "beginner" | references/diataxis/tutorial.md | Learning-oriented lesson |
| "how to", "howto", "guide", "steps to" | references/diataxis/howto.md | Task-oriented guide |
| "API", "reference", "specification", "config" | references/diataxis/reference.md | Information-oriented reference |
| "why", "concept", "explanation", "about", "understanding" | references/diataxis/explanation.md | Understanding-oriented discussion |
| Trigger Keywords | Reference File | Doc Type |
|---|---|---|
| "CLAUDE.md", "claude instructions" | references/ai-files/claude-md.md | Project instructions for Claude |
| "AGENTS.md", "agent instructions" | references/ai-files/agents-md.md | Cross-platform agent instructions |
| "llms.txt", "llm index" | references/ai-files/llms-txt.md | LLM context optimization index |
| Trigger Keywords | Reference File | Doc Type |
|---|---|---|
| "context diagram", "C4 context", "system context" | references/architecture/c4-context.md | C4 context diagram |
| "container diagram", "C4 container" | references/architecture/c4-container.md | C4 container diagram |
| "system overview", "architecture overview", "arc42" | references/architecture/system-overview.md | System architecture overview |
| "diagram", "mermaid", "diagram conventions" | references/architecture/diagram-mermaid.md | Mermaid diagram guide |
| Trigger Keywords | Reference File | Doc Type |
|---|---|---|
| "README", "project readme" | references/project/readme.md | Project README |
| "CONTRIBUTING", "contribution guide" | references/project/contributing.md | Contributor guide |
| "glossary", "terminology", "domain terms" | references/project/glossary.md | Domain glossary |
| Trigger Keywords | Action |
|---|---|
| "ADR", "decision", "why we chose" | → Redirect to docs:adr |
| "audit", "review docs", "what's missing" | → Redirect to docs:audit |
| Ambiguous or unclear request | → Ask user to clarify doc type |
If the request is ambiguous, ask the user:
"What type of documentation would you like? Options: tutorial, how-to guide, reference, explanation, AI file (CLAUDE.md/AGENTS.md/llms.txt), architecture doc, or project file (README/CONTRIBUTING)?"
Read the selected reference file from references/:
- Load ONLY the one reference file identified in Phase 1
- Parse the template structure, required sections, and anti-patterns
- Note guidance specific to this doc type
Before generating content, understand the project:
- Read existing docs to match style and tone
- Extract relevant code context for the subject being documented
- Check for existing glossary terms (if glossary exists)
- Identify related docs to cross-reference
- Detect naming conventions (kebab-case files? docs/tutorials/ or docs/guides/?)
Fill the template with project-specific content:
- Apply template structure from the loaded reference
- Add project-specific examples from the codebase
- Include cross-references to related documentation
- Use terminology consistent with existing docs and code
- Follow detected folder conventions for file placement
Before writing, check:
[ ] Single H1 heading
[ ] Logical heading hierarchy (no skipped levels)
[ ] All internal links resolve to existing targets
[ ] Code examples are syntactically valid
[ ] Cross-references to related docs included
[ ] Terminology matches existing glossary (if one exists)
[ ] File path follows project conventions
New file: Write the complete document at the appropriate path.
Existing file (update): Use idempotent update with managed sections:
<!-- BEGIN MANAGED SECTION: {section-name} -->
<!-- Auto-generated by docs:write. Do not edit manually. -->
{Generated content here}
<!-- END MANAGED SECTION: {section-name} -->
## Custom Notes
Your custom content here is preserved across updates.
Update rules:
BEGIN/END MANAGED SECTION markers❌ Ignoring existing doc structure
Creating docs/guides/howto-auth.md when project uses docs/tutorials/
✅ Follow existing conventions
"Detected existing structure: docs/tutorials/, docs/reference/"
"Creating docs/tutorials/authentication.md to match convention"
❌ Overwriting custom content
Replacing entire file when only managed sections changed
✅ Idempotent updates with managed sections
<!-- BEGIN MANAGED SECTION: api-reference -->
This content is auto-generated. Do not edit manually.
<!-- END MANAGED SECTION: api-reference -->
## Custom Notes
Your custom content is preserved across updates.
❌ Loading multiple templates
Reading all 14 reference files to decide which template to use
✅ Route then load
"Request is for a how-to guide → loading references/diataxis/howto.md"
(Only one reference file loaded)
❌ Guessing doc type when ambiguous
User says "document authentication" → silently picking "reference"
✅ Ask when ambiguous
"Would you like a how-to guide (task steps), reference (API details),
tutorial (learning exercise), or explanation (design rationale)?"
❌ Generic content without project context
Writing a README with placeholder text and no project-specific details
✅ Content informed by codebase
"Extracted build commands from package.json"
"Found 3 API endpoints to document from src/routes/"
"Using terminology from existing glossary"
❌ Skipping AI-friendliness
"Documentation is complete" (but no AGENTS.md, CLAUDE.md)
✅ Including AI optimization
"Documentation complete. Also generated:"
"- AGENTS.md for cross-platform AI agent support"
"- CLAUDE.md with project-specific instructions"
"- llms.txt index for context optimization"
| Signal | Meaning |
|---|---|
| "docs committed" | File written, ready for review |
| "refine" | Continue iterating on content |
| "abort" | Cancel current operation |
| "audit docs" | → Redirect to docs:audit |
| "record decision" | → Redirect to docs:adr |
| "create ADR" | → Redirect to docs:adr |
When complete: "Documentation written. Review the generated file and refine if needed."
npx claudepluginhub dirkkok101/skills --plugin docsProvides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.