Best for
- User says "document this codebase", "generate a wiki", "make architecture diagrams"
- Onboarding to an unfamiliar repo and wants a structured reference
- User points at a GitHub URL and asks for documentation
NousResearch/hermes-agent/optional-skills/software-development/code-wiki/SKILL.md
Generate wiki docs + Mermaid diagrams for any codebase.
Decision brief
Generate a full wiki for any codebase — overview, architecture, per-module deep-dives, Mermaid class and sequence diagrams. Inspired by Google CodeWiki, but works on local repos, private repos, and any language. Uses only existing Hermes tools (terminal, readfile, searchfiles, w…
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/NousResearch/hermes-agent --skill "optional-skills/software-development/code-wiki"Inspect the Agent Skill "code-wiki" from https://github.com/NousResearch/hermes-agent/blob/64a6f42cb38def7ad6524bdfe640a16997c88760/optional-skills/software-development/code-wiki/SKILL.md at commit 64a6f42cb38def7ad6524bdfe640a16997c88760. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
Invoke through the terminal tool from the target repo's root, then use readfile / searchfiles / writefile to produce the wiki. Default output location is /.hermes/wikis//. Only write into the repo (docs/wiki/) when the user explicitly requests it.
For a local path (or cwd if none given):
See getting-started.md. markdown
1. User input — cli.py:HermesCLI.runsession 2. Message dispatch — runagent.py:AIAgent.chat markdown
1. Mermaid blocks balance — opens equal closes per file: mermaid' "$f") total=$(grep -c '^ 2. All expected files exist —
Permission review
The documentation asks the agent to run terminal commands or scripts.
Invoke through the `terminal` tool from the target repo's root, then use `read_file` / `search_files` / `write_file` to produce the wiki. Default output location is `~/.hermes/wikis/<repo-name>/`. Only write into the repo (`docs/wiki/`) wheThe documentation asks the agent to create, modify, or delete local files.
Invoke through the `terminal` tool from the target repo's root, then use `read_file` / `search_files` / `write_file` to produce the wiki. Default output location is `~/.hermes/wikis/<repo-name>/`. Only write into the repo (`docs/wiki/`) wheThe documentation asks the agent to run terminal commands or scripts.
git clone --depth 50 <url> "$WIKI_TMP/repo"The documentation asks the agent to read local files, directories, or repositories.
### 2. Scan repo structureThe documentation asks the agent to create, modify, or delete local files.
### 11. Write the state fileEvidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 91/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 235,927 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Generate a full wiki for any codebase — overview, architecture, per-module deep-dives, Mermaid class and sequence diagrams. Inspired by Google CodeWiki, but works on local repos, private repos, and any language. Uses only existing Hermes tools (terminal, read_file, search_files, write_file); no Docker, no external services, no extra dependencies.
This skill produces reference documentation (what/how). It does not produce strategic narrative (why — that's a different skill).
Do NOT use this for:
read_file and answer inlinegit on PATH for repo SHA tracking and remote clones.pygount for language-breakdown stats (see the codebase-inspection skill).Invoke through the terminal tool from the target repo's root, then use read_file / search_files / write_file to produce the wiki. Default output location is ~/.hermes/wikis/<repo-name>/. Only write into the repo (docs/wiki/) when the user explicitly requests it.
| Step | Action |
|---|---|
| 1 | Resolve target — local cwd, given path, or git clone --depth 50 <url> to a temp dir |
| 2 | Scan structure — ls, find -maxdepth 3, manifest files, README |
| 3 | Pick 8–10 modules to document |
| 4 | Write README.md (overview + module map) |
| 5 | Write architecture.md with Mermaid flowchart |
| 6 | Write per-module docs in modules/ |
| 7 | Write diagrams/class-diagram.md (Mermaid classDiagram) |
| 8 | Write diagrams/sequences.md (Mermaid sequenceDiagram, 2–4 workflows) |
| 9 | Write getting-started.md |
| 10 | Write api.md if applicable, else skip |
| 11 | Write .codewiki-state.json |
| 12 | Report paths to user |
For a GitHub URL:
WIKI_TMP=$(mktemp -d)
git clone --depth 50 <url> "$WIKI_TMP/repo"
cd "$WIKI_TMP/repo"
REPO_SHA=$(git rev-parse HEAD)
REPO_NAME=$(basename <url> .git)
For a local path (or cwd if none given):
cd <path>
REPO_SHA=$(git rev-parse HEAD 2>/dev/null || echo "uncommitted")
REPO_NAME=$(basename "$PWD")
Then set the output dir:
OUTPUT_DIR="$HOME/.hermes/wikis/$REPO_NAME"
mkdir -p "$OUTPUT_DIR/modules" "$OUTPUT_DIR/diagrams"
Use the terminal tool for the shell work, read_file for manifests:
# Shallow tree first
ls -la
# Deeper tree, noise filtered
find . -type d \
-not -path '*/\.*' \
-not -path '*/node_modules*' \
-not -path '*/venv*' \
-not -path '*/__pycache__*' \
-not -path '*/dist*' \
-not -path '*/build*' \
-not -path '*/target*' \
-maxdepth 3 | sort
# Language breakdown (skip if pygount unavailable)
pygount --format=summary \
--folders-to-skip=".git,node_modules,venv,.venv,__pycache__,.cache,dist,build,target" \
. 2>/dev/null || true
Then read_file the relevant manifests (package.json, pyproject.toml, setup.py, Cargo.toml, go.mod, pom.xml, build.gradle) and the project README. Use search_files target='files' to find them rather than guessing names.
Cap initial pass at 8–10 modules. Heuristics by language:
__init__.py), plus subsystem dirssrc/<subdir>, top-level workspace dirssrc/<module> dirsFor very large repos, prioritize by:
State the module list to the user before generating per-module docs on big repos — gives them a chance to redirect.
README.mdread_file the actual project README plus the top 2–3 entry-point files. Then write_file:
# <Project Name>
<One paragraph: what it is and what it's for. Self-contained — don't assume the
reader has the source README.>
## Key Concepts
- **<Concept 1>** — <one line>
- **<Concept 2>** — <one line>
## Entry Points
- [`path/to/main.py`](<link>) — <what runs when you start it>
- [`path/to/cli.py`](<link>) — <CLI surface>
## High-Level Architecture
<2-3 sentences. Detail goes in architecture.md.>
See [architecture.md](architecture.md).
## Module Map
| Module | Purpose |
|---|---|
| [`<module>`](modules/<module>.md) | <one-line purpose> |
## Getting Started
See [getting-started.md](getting-started.md).
For link targets in local mode use relative paths. For cloned repos use https://github.com/<owner>/<repo>/blob/<sha>/<path> so links survive future commits.
architecture.md# Architecture
<2-3 paragraphs: shape of the system. What talks to what. Where data enters,
where it exits, where state lives.>
## Components
- **<Component>** — <1-2 sentences>. See [`modules/<module>.md`](modules/<module>.md).
## System Diagram
```mermaid
flowchart TD
User([User]) --> Entry[Entry Point]
Entry --> Core[Core Engine]
Core --> StorageA[(Database)]
Core --> ExternalAPI{{External API}}
```
## Data Flow
1. **<Step>** — [`<file>`](<link>)
2. **<Step>** — [`<file>`](<link>)
## Key Design Decisions
- <Anything load-bearing the reader should know>
Mermaid shape semantics:
[] = component[()] = database / storage{{}} = external service(()) = entry point or terminal--> = sync call, -.-> = async/eventCap at ~20 nodes per diagram. Split into sub-diagrams if larger.
modules/For each selected module, inspect its layout with ls, identify 3–5 most important files (by size, by being named core.py / main.py / __init__.py, by being imported a lot), then read_file those files (use offset / limit to read only what you need; prefer search_files for specific symbols).
# Module: `<module>`
<1-2 sentence purpose.>
## Responsibilities
- <bullet>
- <bullet>
## Key Files
- [`<module>/<file>`](<link>) — <what it does>
## Public API
<Functions/classes/constants other code uses. Group related items. Show
signatures, not full implementations.>
## Internal Structure
<How the module is organized internally. State management.>
## Dependencies
- **Used by:** <other modules>
- **Uses:** <other modules + external libs>
## Notable Patterns / Gotchas
- <Anything non-obvious>
diagrams/class-diagram.mdPick the 5–10 most important classes/types. read_file them, then write:
# Class Diagram
## Core Types
```mermaid
classDiagram
class Agent {
+string name
+list~Tool~ tools
+chat(message) string
}
class Tool {
<<interface>>
+name string
+execute(args) any
}
Agent --> Tool : uses
Tool <|-- TerminalTool
Tool <|-- WebTool
```
## Notes
<Anything the diagram can't express — lifecycle, threading, etc.>
For languages without classes (Go, C, Rust): use the diagram for struct relationships, or skip class-diagram.md and explain it in prose in architecture.md. Don't force-fit.
diagrams/sequences.mdPick 2–4 of the most important workflows. Trace each call path through the code (read entry point, follow function calls), then:
# Sequence Diagrams
## Workflow: <Name>
<1 sentence describing what this does and when it runs.>
```mermaid
sequenceDiagram
participant User
participant CLI
participant Agent
participant LLM
User->>CLI: types message
CLI->>Agent: chat(message)
Agent->>LLM: API call
LLM-->>Agent: response + tool_calls
Agent->>Agent: execute tools
Agent-->>CLI: final response
```
### Walkthrough
1. **User input** — [`cli.py:HermesCLI.run_session`](<link>)
2. **Message dispatch** — [`run_agent.py:AIAgent.chat`](<link>)
Don't invent participants. Every box must correspond to a real component the reader can find in the code.
getting-started.md# Getting Started
## Prerequisites
<From manifest files + README. Be specific — versions if pinned.>
## Installation
```bash
<exact commands>
```
## First Run
```bash
<minimum command to see the system do something useful>
```
## Common Workflows
### <Workflow 1>
<commands>
## Configuration
- `<config-file>` — <what it controls>
- Env var `<VAR>` — <what it controls>
## Where to Go Next
- Architecture: [architecture.md](architecture.md)
- Module reference: [README.md#module-map](README.md#module-map)
api.md (skip if not applicable)Only write this if the project is a library or API server. If it is:
__init__.py exports, OpenAPI specs, route handlers, exported types)cat > "$OUTPUT_DIR/.codewiki-state.json" <<EOF
{
"repo_name": "$REPO_NAME",
"source_path": "$PWD",
"source_sha": "$REPO_SHA",
"generated_at": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
"generator": "hermes-agent code-wiki skill v0.1.0",
"modules_documented": []
}
EOF
State exactly what was generated and where:
Generated wiki at ~/.hermes/wikis/<repo-name>/:
README.md project overview, module map
architecture.md system architecture + flowchart
getting-started.md setup, first run, workflows
modules/<N files> per-module deep-dives
diagrams/architecture.md Mermaid flowchart
diagrams/class-diagram.md Mermaid class diagram
diagrams/sequences.md Mermaid sequence diagrams
If you cloned to a temp dir, remind the user it can be removed (rm -rf "$WIKI_TMP") after they've reviewed the wiki.
Generating a full wiki for a 500K-LOC monorepo is wildly token-expensive. Default to bounded scope:
search_files for symbols + read_file with offset/limit over full readsvendor/, third_party/, generated code, _pb2.py, .min.js)If the user says "do the whole thing exhaustively", believe them — but ballpark the cost first: "this repo has ~340 source files, comprehensive coverage will be expensive — confirm?"
If .codewiki-state.json already exists at the target path:
git diff --name-only <old-sha> HEAD)Full incremental-regeneration is a future enhancement — for now, regenerating the whole thing is acceptable.
read_file before writing. The single biggest failure mode for auto-generated docs is plausible-sounding fabrication.process function processes things by calling process_item on each item" is worse than just linking to the function.~/.hermes/wikis/. Only write into the repo when the user explicitly requests it.A["Tool / Agent"] not A[Tool / Agent]. <br> for line breaks inside a node.```mermaid doesn't close the outer. (This SKILL.md does it.)~T~ (e.g. List~Tool~), not <T>.%%{init: ...}%% blocks; they're stripped on render.After writing, verify:
for f in "$OUTPUT_DIR"/diagrams/*.md "$OUTPUT_DIR"/architecture.md; do
opens=$(grep -c '^```mermaid' "$f")
total=$(grep -c '^```' "$f")
echo "$f: $opens mermaid blocks, $total total fences (expect total = opens*2)"
done
ls "$OUTPUT_DIR"/{README.md,architecture.md,getting-started.md,.codewiki-state.json} \
"$OUTPUT_DIR"/modules/ "$OUTPUT_DIR"/diagrams/
ls "$OUTPUT_DIR/modules" | wc -l should equal the number of modules you committed to in Step 3.Frequently asked questions
Generate a full wiki for any codebase — overview, architecture, per-module deep-dives, Mermaid class and sequence diagrams. Inspired by Google CodeWiki, but works on local repos, private repos, and any language. Uses only existing Hermes tools (terminal, readfile, searchfiles, w…
The source record exposes this install command: npx skills add https://github.com/NousResearch/hermes-agent --skill "optional-skills/software-development/code-wiki". Inspect the command and pinned source before running it.
Static rules flagged exec-script, write-files, read-files in the source; the page lists the matching lines and excerpts.
Alternatives
oaustegard/claude-skills
Generate hierarchical _FEATURES.md files that describe what a codebase DOES from a user/consumer perspective, anchored to source symbols via tree-sitting. Supports large complex codebases through feature-driven decomposition into sub-feature files. Uses a multi-pass synthesis: orientation → detail → overview rewrite. Use when someone says "what does this do", "document features", "feature inventory", "_FEATURES.md", or needs to understand a codebase's purpose before modifying it. Complements tre
enuno/unifi-mcp-server
Specialized guide for adding new MCP tools to the UniFi MCP Server following project standards, UniFi API patterns, and test-driven development practices. Use when implementing new UniFi Network Controller features as MCP tools.
PaulRBerg/agent-skills
Create/scaffold/init a project-local agent skill under `.agents/skills` in an ordinary repository; defer to repository instructions that define a source catalog and lifecycle.
NintendaDev/unikit-ai
Generate and maintain the project's TECHNICAL documentation from its codebase — scans the project structure, tech stack, and module boundaries, then writes a lean README landing page plus detailed topic pages (architecture, modules, setup, build, APIs), only the docs that are relevant. Use whenever the user wants to create, update, or validate documentation of the CODE or the project itself, e.g. "generate documentation", "create docs", "write the README", "update the project docs", "document th