home/common/ai/resources/agents/skills/docs/SKILL.md
Generate or update comprehensive project documentation beyond README. Use for API reference, architecture decision records (ADRs), developer guides, contributing guides, configuration reference, deployment guides, migration guides, runbooks, changelogs, and release notes. Supports repo (docs/) or GitHub Wiki destinations. Always updates README.md via the `readme` skill as a final step. Triggers on "write docs", "document the API", "create a developer guide", "add an ADR", "write a runbook", "generate changelog", "docs wiki", or any documentation task that is NOT a README.
npx skillsauth add kamushadenes/nix docsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generate production-grade project documentation. For README-only changes, use
the readme skill directly.
You are the orchestrator. You must NEVER write or edit documentation files
directly. All file creation, updates, and fixes must be delegated to agents
via task(). Your job is to:
The only files you interact with directly are for reading during exploration and audit. Every write goes through a delegated task.
Before writing, explore:
Compare every existing doc against the current codebase and determine the mode for each document (see [references/modes.md] for full details):
create<!-- generated-by: docs-skill --> marker and is outdated? → mode:
update (revise only inaccurate/missing sections)supplement
(append only — never modify existing content)Default mode is update, not rewrite. Preserve existing content, voice, and structure.
If all existing docs are current, complete, and well-structured → report that no updates are needed and stop. Do not rewrite documentation that already accurately reflects the codebase just to put your stamp on it.
Report the full audit to the user, clearly separating what will be updated, removed, and created. Removals require user confirmation — never delete pages without approval.
Where should the main documentation live?
- Repository (
docs/) — versioned with code- GitHub Wiki (hybrid) — guides on wiki, code-coupled docs in repo
Wiki gets guides and references browsed independently. Repo keeps code-coupled files:
| Repo file | Why in repo |
| ----------------------- | ------------------------------------------------- |
| README.md | Landing page (updated via readme skill, Step 8) |
| CONTRIBUTING.md | Shown by GitHub on PR creation |
| CHANGELOG.md | Versioned with code, tied to tags |
| docs/adr/ | Versioned with the decisions they document |
| docs/configuration.md | Changes with code, reviewed in PRs |
Repo files should be concise and link to the wiki for details. See [references/github-wiki.md] for wiki workflow and conventions.
Match to the reference:
| Type | Reference | | ------------------- | ------------------------------- | | API Reference | [references/api-reference.md] | | Architecture / ADRs | [references/architecture.md] | | Configuration | [references/configuration.md] | | Developer Guide | [references/developer-guide.md] | | Operations | [references/operations.md] | | Testing | [references/testing.md] | | Changelog | [references/changelog.md] |
Split into multiple pages when content warrants it (e.g., API by domain, Operations into deploy + runbook + migration).
Generate a full documentation suite. Present the plan for approval:
Documentation Plan (repo):
1. Architecture Overview → docs/architecture.md [create]
2. API Reference — Users → docs/api/users.md [create]
3. API Reference — Resources → docs/api/resources.md [create]
4. Developer Guide → docs/developer-guide.md [create]
5. Contributing Guide → CONTRIBUTING.md [supplement]
6. Testing Guide → docs/testing.md [create]
7. Deployment Guide → docs/deployment.md [create]
8. Configuration Reference → docs/configuration.md [create]
9. Runbook → docs/runbook.md [create]
Final step: update README.md via `readme` skill.
Proceed?
Documentation Plan (wiki + repo):
Wiki:
1. Architecture Overview → wiki: Architecture [create]
2. API Reference — Users → wiki: API-Users [create]
3. API Reference — Resources → wiki: API-Resources [create]
4. Developer Guide → wiki: Developer-Guide [create]
5. Testing Guide → wiki: Testing [create]
6. Deployment Guide → wiki: Deployment [create]
7. Configuration Reference → wiki: Configuration-Reference [create]
8. Runbook → wiki: Runbook [create]
9. Home + Sidebar → wiki: Home, _Sidebar
Repo:
1. Contributing Guide → CONTRIBUTING.md [supplement]
2. Changelog → CHANGELOG.md
3. ADRs → docs/adr/
Final step: update README.md via `readme` skill.
Proceed?
Prepare a shared brief for all writing agents (see [references/writing-agent.md] for full agent instructions):
PROJECT BRIEF:
- Project name, language/framework, repo URL
- Key terminology with definitions
- Destination: repo docs/ | GitHub Wiki
- Doc tooling: [framework name or "none"] (see references/doc-tooling.md)
- All pages being generated (for cross-references)
- Naming conventions
- Diagram requirements: for each page, list the concepts that MUST have a
Mermaid diagram (e.g., "architecture page → system component diagram +
request flow sequence diagram"; "deployment page → CI/CD pipeline flowchart
+ environment promotion flow"). Writing agents MUST include these diagrams.
In Claude Code: use the doc-writer agent for each page. In other
agents: use task(category="writing", load_skills=["docs"], run_in_background=true) with the writing-agent.md instructions.
Include the brief, mode (create/update/supplement), relevant source files, output path, and the specific reference template to follow. For update and supplement modes, include the existing file content. Fire all simultaneously.
Collect all results before verification.
Every factual claim in every doc page must be verified against the actual codebase. This catches hallucinated commands, wrong paths, stale config keys, and invented behavior.
Create a todo item per doc page for tracking. Then delegate one verification agent per page in parallel.
In Claude Code: use the doc-verifier agent for each page. In other
agents: use task(category="quick", load_skills=[], run_in_background=true) with the verification-agent.md instructions.
Include the file path, project brief, and relevant source directories. Fire all verification agents simultaneously. Collect all results. Mark each todo item complete as agents finish.
If any verification agent reports incorrect claims that could not be auto-corrected, delegate fix tasks back to writing agents in fix mode (see [references/modes.md]).
In Claude Code: use the doc-writer agent with mode=fix. In other
agents: use task(category="writing", load_skills=["docs"], run_in_background=true) with fix mode instructions.
Include the file path and the failures list {line, claim, expected, actual}
from the verifier report. Skip this step if all claims were verified correct or
auto-fixed by the verification agents.
After statement verification, delegate a consistency check across all pages:
task(
category="quick",
load_skills=[],
run_in_background=false,
description="Check cross-page consistency",
prompt="
TASK: Verify consistency across all documentation pages.
EXPECTED OUTCOME: All cross-page issues found and fixed.
REQUIRED TOOLS: Read, Grep, Edit
MUST DO:
- Read every doc page listed below
- Check for:
• Terminology: same concept uses the same name everywhere
• Cross-references: all links resolve; no broken refs
• Contradictions: no conflicting statements between pages
• Completeness: no orphan pages; navigation includes all pages
• Cleanup: no references to removed pages or dead links
• Style: consistent heading levels, code block hints, formatting
- Fix all issues found in-place
MUST NOT:
- Rewrite content beyond fixing inconsistencies
- Change factual claims (those were verified in Step 6)
CONTEXT:
- Pages: [list all doc file paths]
- Destination: [repo docs/ | GitHub Wiki]
"
)
readme SkillMandatory final step. Delegate a README update to the readme skill:
task(
category="writing",
load_skills=["readme"],
run_in_background=false,
description="Update README with docs links",
prompt="
TASK: Update README.md to reflect documentation just generated.
CONTEXT:
- Destination: [repo docs/ | GitHub Wiki]
- Pages: [list all pages with paths or wiki names]
- If README.md exists, update it (preserve existing content)
- If README.md does not exist, generate a full README
MUST DO: Include Documentation section linking to all generated pages
MUST NOT: Remove existing sections unrelated to documentation
"
)
The readme skill is docs/wiki-aware and will include a Documentation section
with correct links.
For repository docs: Also create docs/README.md as a TOC linking all doc
pages.
For GitHub Wiki: Also create Home.md as navigation hub and _Sidebar.md.
See [references/github-wiki.md].
Documentation should be a pleasant reading experience, not a wall of facts. Build knowledge progressively: start with the big picture, then layer in detail so the reader is never overwhelmed.
```mermaid fenced code blocks for
architecture diagrams, data flows, and component relationships. Never use
ASCII art for diagramsDiagrams are not optional decoration — they are required whenever prose alone would force the reader to build a mental model from text. Actively look for opportunities to add them.
When to create a diagram:
Diagram types to use (Mermaid):
graph TD/LR — architecture, component relationships, data flowsequenceDiagram — multi-party interactions, API call chainsstateDiagram-v2 — state machines, lifecycle flowsflowchart — decision trees, conditional workflowsgitgraph — branching strategies, release flowsRules:
| Type | Location |
| --------------- | ------------------------------------------------------------ |
| API Reference | docs/api.md or docs/api/ (split by domain) |
| Architecture | docs/architecture.md or docs/adr/ for ADRs |
| Configuration | docs/configuration.md |
| Developer Guide | CONTRIBUTING.md or docs/developer-guide.md |
| Operations | docs/deployment.md, docs/runbook.md, docs/migration.md |
| Testing | docs/testing.md |
| Changelog | CHANGELOG.md (root) |
| Index | docs/README.md |
Respect existing docs/ structure.
See [references/github-wiki.md].
<!-- generated-by: docs-skill --> marker on
created documents (see [references/modes.md] for ownership tracking)readme skill as the final step to update README.mdtask()readme skilldata-ai
Show MemPalace status — room counts, storage usage, and palace health.
tools
Search your MemPalace — semantic search across all mined memories, projects, and conversations.
tools
Mine a project or conversation into your MemPalace — extract and store memories for later retrieval.
development
Initialize a new MemPalace — guided setup for your AI memory palace with ChromaDB backend.