nafisrayan/100x-agent-toolkit/code-wiki

Claude Code and agent skill by nafisrayan/100x-agent-toolkit

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Generate wiki docs + Mermaid diagrams for any codebase

Install

npx vskill@latest install nafisrayan/100x-agent-toolkit/code-wiki

SKILL.md

The same SKILL.md was published earlier as nafisrayan/100x-agent-toolkit/code-wiki.

Code Wiki Skill

Overview

Generate a comprehensive 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).

When to Use

  • 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
  • Need a stable artifact (markdown + Mermaid) that renders on GitHub

Do NOT use this for:

  • Single-file or single-function documentation — just answer directly
  • API reference for one specific endpoint — use read_file and answer inline
  • Strategic "why does this exist" narrative — different skill, different purpose
  • Codebases the user is actively developing in this session — just answer questions as they come

Prerequisites

  • No env vars required.
  • git on PATH for repo SHA tracking and remote clones.
  • Optional: pygount for language-breakdown stats (see the codebase-inspection skill).

How to Run

Invoke through the terminal tool from the target repo's root, then use read_file / search_files / write_file to produce the wiki. By default the generator writes to a temporary output directory outside the repository to avoid in-repo changes; only write into the repo (for example, docs/wiki/ or .<repo-root>/.code-wiki/) when the user explicitly requests it.

Quick Reference

StepAction
1Resolve target — local cwd, given path, or git clone --depth 50 <url> to a temp dir
2Scan structure — ls, find -maxdepth 3, manifest files, README
3Pick 8–10 modules to document
4Write README.md (overview + module map)
5Write architecture.md (prose) and diagrams/architecture.md (Mermaid flowchart)
6Write per-module docs in modules/
7Write diagrams/class-diagram.md (Mermaid classDiagram)
8Write diagrams/sequences.md (Mermaid sequenceDiagram, 2–4 workflows)
9Write getting-started.md
10Write api.md if applicable, else skip
11Write .codewiki-state.json
12Report paths to user

Procedure

1. Resolve the target

For a GitHub URL:

bash
WIKI_TMP=$(mktemp -d)
GIT_TERMINAL_PROMPT=0 git clone --depth 50 <url> "$WIKI_TMP/repo" || {
echo "Clone failed (authentication or network). Provide a local path or authenticate git." >&2
exit 1
}
cd "$WIKI_TMP/repo"
REPO_SHA=$(git rev-parse HEAD)
REPO_NAME=$(basename <url> .git)

For a local path (or cwd if none given):

bash
cd <path>
REPO_SHA=$(git rev-parse HEAD 2>/dev/null || echo "uncommitted")
REPO_NAME=$(basename "$PWD")

Then set the output dir. Default behavior is to place generated files in a temporary output directory outside the repo to avoid unprompted in-repo writes. If the user explicitly requests in-repo output, write into the repository instead.

bash
# Default: temporary output dir outside the repo (safe, non-destructive)
OUTPUT_DIR="${WIKI_TMP:-$(mktemp -d)}/.code-wiki/$REPO_NAME"
mkdir -p "$OUTPUT_DIR/modules" "$OUTPUT_DIR/diagrams"
# If you have explicit permission to write into the repo, set:
# OUTPUT_DIR="$PWD/.code-wiki/$REPO_NAME"
# mkdir -p "$OUTPUT_DIR/modules" "$OUTPUT_DIR/diagrams"
1.5 Check previous state

If a .codewiki-state.json already exists at the intended output path, stop and surface the previous state to the user before proceeding. Read the state file and compare source_sha to the current REPO_SHA.

  • If the SHA matches: continue generating (no changes detected).
  • If the SHA differs: abort the run and return to the user with the list of changed files and the option to (a) regenerate everything, (b) regenerate only changed modules, or (c) cancel. Do not continue generating without the user's explicit choice.

This step prevents ambiguous mid-run branching and avoids unprompted overwrites.

2. Scan repo structure

Use the terminal tool for the shell work, read_file for manifests:

bash
# 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.

3. Pick modules to document

Cap initial pass at 8–10 modules. Heuristics by language:

  • Python: top-level packages (dirs with __init__.py), plus subsystem dirs
  • JS/TS: src/<subdir>, top-level workspace dirs
  • Rust: each crate in a workspace, or top-level src/<module> dirs
  • Go: each top-level package directory
  • Mixed/unfamiliar: top-level directories that contain source code (not config, not tests)

For very large repos, prioritize by:

  1. Imported-from count (a module imported by many is core)
  2. LOC (bigger modules usually warrant their own doc)
  3. Mentions in README / top-level docs

State the module list to the user before generating per-module docs if the repository has more than 10 modules or more than 100 source files — gives them a chance to redirect.

4. Write README.md

read_file the actual project README plus the top 2–3 entry-point files. Then write_file:

`markdown
# <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>
## High-Level Architecture
<2-3 sentences. Detail goes in architecture.md.>
See [architecture.md](architecture.md).
## Module Map
| Module | Purpose |
|---|---|
| `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.

5. Write architecture.md
`markdown
# 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`.
## System Diagram

flowchart TD User([User]) --> Entry[Entry Point] Entry --> Core[Core Engine] Core --> StorageA[(Database)] Core --> ExternalAPI{{External API}}

## 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/event

Cap at ~20 nodes per diagram. Split into sub-diagrams if larger.

6. Write per-module docs in 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).

`markdown
# Module: `<module>`
<1-2 sentence purpose.>
## Responsibilities
- <bullet>
- <bullet>
## Key Files
- `<module>/<file>` — <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>
7. Write diagrams/class-diagram.md

Pick the 5–10 most important classes/types. read_file them, then write:

`markdown
# Class Diagram
## Core Types

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.

8. Write diagrams/sequences.md

Pick 2–4 of the most important workflows. Trace each call path through the code (read entry point, follow function calls), then:

`markdown
# Sequence Diagrams
## Workflow: <Name>
<1 sentence describing what this does and when it runs.>

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

Don't invent participants. Every box must correspond to a real component the reader can find in the code.

9. Write getting-started.md
`markdown
# Getting Started
## Prerequisites
<From manifest files + README. Be specific — versions if pinned.>
## Installation

<exact commands>

## First Run

<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)
10. Write api.md (skip if not applicable)

Only write this if the project is a library or API server. If it is:

  • Find the public API surface (__init__.py exports, OpenAPI specs, route handlers, exported types)
  • Document each public entry with signature, parameters, return type, one-line description
  • Group by category
11. Write the state file
bash
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": "code-wiki skill v0.1.0",
"modules_documented": []
}
EOF
12. Report to user

State exactly what was generated and where:

Generated wiki at .code-wiki/<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.

Scope Control

Generating a full wiki for a 500K-LOC monorepo is wildly token-expensive. Default to bounded scope:

  • Initial scan: max depth 3 directories
  • Per-module docs: cap at 10 modules unless user expands scope
  • Per-file reads: prefer search_files for symbols + read_file with offset/limit over full reads
  • Skip vendored code (vendor/, third_party/, generated code, _pb2.py, .min.js)

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
1
7-day trend score
3

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/nafisrayan/100x-agent-toolkit/code-wiki/badge)](https://verified-skill.com/skills/nafisrayan/100x-agent-toolkit/code-wiki)

Something wrong with this skill or its page? Tell us.