Chuyển đến nội dung
Skillpedia
Lập trình chung260k · #570

code-wiki

Skill này làm gì

Skill này để AI của bạn đọc một dự án phần mềm và viết tài liệu có tổ chức về cách nó hoạt động. Phù hợp với lập trình viên cần học một codebase lạ hoặc cần một tài liệu tham khảo ổn định.

Khi nào nên dùng

  • ✓Khi bạn muốn tài liệu cho một dự án code mà bạn chưa từng làm việc trước đây.
  • ✓Khi bạn muốn sơ đồ kiến trúc và trang module được viết cho một repository.
  • ✓Khi bạn chia sẻ một liên kết GitHub và yêu cầu một wiki tài liệu hóa của dự án.

Liên kết skill

https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/software-development/code-wiki/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/software-development/code-wiki/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tạo một wiki cho repository này gồm tổng quan, các module chính và sơ đồ cho thấy chúng kết nối với nhau thế nào.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Skill để AI của bạn đọc các file dự án, rồi viết các trang Markdown có sơ đồ Mermaid. Nó chỉ dùng các công cụ đã có sẵn trong phiên làm việc và không cần dịch vụ bổ sung.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Code Wiki Skill

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).

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. Default output location is ~/.hermes/wikis/<repo-name>/. Only write into the repo (docs/wiki/) when the user explicitly requests it.

Quick Reference

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

Procedure

1. Resolve the target

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"

2. Scan repo structure

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.

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 on big repos — gives them a chance to redirect.

4. Write README.md

read_file the actual project README plus the top 2–3 en

Câu hỏi thường gặp

Nó có tốt cho một hàm đơn lẻ không?

Không. Skill nói một file hoặc hàm đơn lẻ thì nên trả lời trực tiếp.

Nó có giải thích vì sao code tồn tại không?

Không. Skill nói nó viết tài liệu tham khảo về việc code làm gì và làm thế nào, chứ không phải lý do đằng sau.

Nó có cần Docker không?

Không. Skill nói nó không cần Docker hay dịch vụ bên ngoài, dù git hữu ích để theo dõi repository.

Chi tiết

Mô tả gốc của tác giả

Generate wiki docs + Mermaid diagrams for any codebase.

repo: NousResearch/hermes-agent

Độ phổ biến

Sao GitHub
260k
Vị trí xếp hạng
#570
Giấy phép
MIT
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự