[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7B3JP7RT6GDG6A4TQS3Q1QZ":3,"skill-same:01M7B3JP7RT6GDG6A4TQS3Q1QZ":83},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":42,"commitSha":43,"skillDirectory":44,"forksCount":45,"repositoryHtmlUrl":46,"repositoryHomepageUrl":47,"ownerHtmlUrl":48,"ownerBlogUrl":6,"ownerDescription":49,"updatedAt":50,"install":51,"resources":64},"01M7B3JP7RT6GDG6A4TQS3Q1QZ","code-wiki",null,"Generate wiki docs + Mermaid diagrams for any codebase.","merllinsbeard\u002Fmerlin-CTO","merllinsbeard","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F144795773?v=4","01M7B3C01C1PCBWFGB5T7YXSF8","merlin","01M7B3C023BBYDEPAPWBAGW9A7",1,"MIT","https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO\u002Fblob\u002Fmain\u002Fskills\u002Fsoftware-development\u002Fcode-wiki\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: code-wiki\ndescription: \"Generate wiki docs + Mermaid diagrams for any codebase.\"\nversion: 0.1.0\nauthor: Teknium (teknium1), Hermes Agent\nlicense: MIT\nplatforms: [linux, macos, windows]\nmetadata:\n  hermes:\n    tags: [Documentation, Mermaid, Architecture, Diagrams, Wiki, Code-Analysis]\n    related_skills: [codebase-inspection, github-repo-management]\n---\n\n# Code Wiki Skill\n\nGenerate 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.\n\nThis skill produces **reference documentation** (what\u002Fhow). It does not produce strategic narrative (why — that's a different skill).\n\n## When to Use\n\n- User says \"document this codebase\", \"generate a wiki\", \"make architecture diagrams\"\n- Onboarding to an unfamiliar repo and wants a structured reference\n- User points at a GitHub URL and asks for documentation\n- Need a stable artifact (markdown + Mermaid) that renders on GitHub\n\nDo NOT use this for:\n- Single-file or single-function documentation — just answer directly\n- API reference for one specific endpoint — use `read_file` and answer inline\n- Strategic \"why does this exist\" narrative — different skill, different purpose\n- Codebases the user is actively developing in this session — just answer questions as they come\n\n## Prerequisites\n\n- No env vars required.\n- `git` on PATH for repo SHA tracking and remote clones.\n- Optional: `pygount` for language-breakdown stats (see the `codebase-inspection` skill).\n\n## How to Run\n\nInvoke through the `terminal` tool from the target repo's root, then use `read_file` \u002F `search_files` \u002F `write_file` to produce the wiki. Default output location is `~\u002F.hermes\u002Fwikis\u002F\u003Crepo-name>\u002F`. Only write into the repo (`docs\u002Fwiki\u002F`) when the user explicitly requests it.\n\n## Quick Reference\n\n| Step | Action |\n|---|---|\n| 1 | Resolve target — local cwd, given path, or `git clone --depth 50 \u003Curl>` to a temp dir |\n| 2 | Scan structure — `ls`, `find -maxdepth 3`, manifest files, README |\n| 3 | Pick 8–10 modules to document |\n| 4 | Write `README.md` (overview + module map) |\n| 5 | Write `architecture.md` with Mermaid flowchart |\n| 6 | Write per-module docs in `modules\u002F` |\n| 7 | Write `diagrams\u002Fclass-diagram.md` (Mermaid classDiagram) |\n| 8 | Write `diagrams\u002Fsequences.md` (Mermaid sequenceDiagram, 2–4 workflows) |\n| 9 | Write `getting-started.md` |\n| 10 | Write `api.md` if applicable, else skip |\n| 11 | Write `.codewiki-state.json` |\n| 12 | Report paths to user |\n\n## Procedure\n\n### 1. Resolve the target\n\nFor a GitHub URL:\n\n```bash\nWIKI_TMP=$(mktemp -d)\ngit clone --depth 50 \u003Curl> \"$WIKI_TMP\u002Frepo\"\ncd \"$WIKI_TMP\u002Frepo\"\nREPO_SHA=$(git rev-parse HEAD)\nREPO_NAME=$(basename \u003Curl> .git)\n```\n\nFor a local path (or cwd if none given):\n\n```bash\ncd \u003Cpath>\nREPO_SHA=$(git rev-parse HEAD 2>\u002Fdev\u002Fnull || echo \"uncommitted\")\nREPO_NAME=$(basename \"$PWD\")\n```\n\nThen set the output dir:\n\n```bash\nOUTPUT_DIR=\"$HOME\u002F.hermes\u002Fwikis\u002F$REPO_NAME\"\nmkdir -p \"$OUTPUT_DIR\u002Fmodules\" \"$OUTPUT_DIR\u002Fdiagrams\"\n```\n\n### 2. Scan repo structure\n\nUse the `terminal` tool for the shell work, `read_file` for manifests:\n\n```bash\n# Shallow tree first\nls -la\n\n# Deeper tree, noise filtered\nfind . -type d \\\n  -not -path '*\u002F\\.*' \\\n  -not -path '*\u002Fnode_modules*' \\\n  -not -path '*\u002Fvenv*' \\\n  -not -path '*\u002F__pycache__*' \\\n  -not -path '*\u002Fdist*' \\\n  -not -path '*\u002Fbuild*' \\\n  -not -path '*\u002Ftarget*' \\\n  -maxdepth 3 | sort\n\n# Language breakdown (skip if pygount unavailable)\npygount --format=summary \\\n  --folders-to-skip=\".git,node_modules,venv,.venv,__pycache__,.cache,dist,build,target\" \\\n  . 2>\u002Fdev\u002Fnull || true\n```\n\nThen `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.\n\n### 3. Pick modules to document\n\nCap initial pass at **8–10 modules**. Heuristics by language:\n\n- Python: top-level packages (dirs with `__init__.py`), plus subsystem dirs\n- JS\u002FTS: `src\u002F\u003Csubdir>`, top-level workspace dirs\n- Rust: each crate in a workspace, or top-level `src\u002F\u003Cmodule>` dirs\n- Go: each top-level package directory\n- Mixed\u002Funfamiliar: top-level directories that contain source code (not config, not tests)\n\nFor very large repos, prioritize by:\n1. Imported-from count (a module imported by many is core)\n2. LOC (bigger modules usually warrant their own doc)\n3. Mentions in README \u002F top-level docs\n\nState the module list to the user before generating per-module docs on big repos — gives them a chance to redirect.\n\n### 4. Write `README.md`\n\n`read_file` the actual project README plus the top 2–3 entry-point files. Then `write_file`:\n\n````markdown\n# \u003CProject Name>\n\n\u003COne paragraph: what it is and what it's for. Self-contained — don't assume the\nreader has the source README.>\n\n## Key Concepts\n\n- **\u003CConcept 1>** — \u003Cone line>\n- **\u003CConcept 2>** — \u003Cone line>\n\n## Entry Points\n\n- [`path\u002Fto\u002Fmain.py`](\u003Clink>) — \u003Cwhat runs when you start it>\n- [`path\u002Fto\u002Fcli.py`](\u003Clink>) — \u003CCLI surface>\n\n## High-Level Architecture\n\n\u003C2-3 sentences. Detail goes in architecture.md.>\n\nSee [architecture.md](architecture.md).\n\n## Module Map\n\n| Module | Purpose |\n|---|---|\n| [`\u003Cmodule>`](modules\u002F\u003Cmodule>.md) | \u003Cone-line purpose> |\n\n## Getting Started\n\nSee [getting-started.md](getting-started.md).\n````\n\nFor link targets in local mode use relative paths. For cloned repos use `https:\u002F\u002Fgithub.com\u002F\u003Cowner>\u002F\u003Crepo>\u002Fblob\u002F\u003Csha>\u002F\u003Cpath>` so links survive future commits.\n\n### 5. Write `architecture.md`\n\n````markdown\n# Architecture\n\n\u003C2-3 paragraphs: shape of the system. What talks to what. Where data enters,\nwhere it exits, where state lives.>\n\n## Components\n\n- **\u003CComponent>** — \u003C1-2 sentences>. See [`modules\u002F\u003Cmodule>.md`](modules\u002F\u003Cmodule>.md).\n\n## System Diagram\n\n```mermaid\nflowchart TD\n    User([User]) --> Entry[Entry Point]\n    Entry --> Core[Core Engine]\n    Core --> StorageA[(Database)]\n    Core --> ExternalAPI{{External API}}\n```\n\n## Data Flow\n\n1. **\u003CStep>** — [`\u003Cfile>`](\u003Clink>)\n2. **\u003CStep>** — [`\u003Cfile>`](\u003Clink>)\n\n## Key Design Decisions\n\n- \u003CAnything load-bearing the reader should know>\n````\n\n**Mermaid shape semantics:**\n- `[]` = component\n- `[()]` = database \u002F storage\n- `{{}}` = external service\n- `(())` = entry point or terminal\n- `-->` = sync call, `-.->` = async\u002Fevent\n\nCap at ~20 nodes per diagram. Split into sub-diagrams if larger.\n\n### 6. Write per-module docs in `modules\u002F`\n\nFor each selected module, inspect its layout with `ls`, identify 3–5 most important files (by size, by being named `core.py` \u002F `main.py` \u002F `__init__.py`, by being imported a lot), then `read_file` those files (use `offset` \u002F `limit` to read only what you need; prefer `search_files` for specific symbols).\n\n````markdown\n# Module: `\u003Cmodule>`\n\n\u003C1-2 sentence purpose.>\n\n## Responsibilities\n\n- \u003Cbullet>\n- \u003Cbullet>\n\n## Key Files\n\n- [`\u003Cmodule>\u002F\u003Cfile>`](\u003Clink>) — \u003Cwhat it does>\n\n## Public API\n\n\u003CFunctions\u002Fclasses\u002Fconstants other code uses. Group related items. Show\nsignatures, not full implementations.>\n\n## Internal Structure\n\n\u003CHow the module is organized internally. State management.>\n\n## Dependencies\n\n- **Used by:** \u003Cother modules>\n- **Uses:** \u003Cother modules + external libs>\n\n## Notable Patterns \u002F Gotchas\n\n- \u003CAnything non-obvious>\n````\n\n### 7. Write `diagrams\u002Fclass-diagram.md`\n\nPick the 5–10 most important classes\u002Ftypes. `read_file` them, then write:\n\n````markdown\n# Class Diagram\n\n## Core Types\n\n```mermaid\nclassDiagram\n    class Agent {\n        +string name\n        +list~Tool~ tools\n        +chat(message) string\n    }\n    class Tool {\n        \u003C\u003Cinterface>>\n        +name string\n        +execute(args) any\n    }\n    Agent --> Tool : uses\n    Tool \u003C|-- TerminalTool\n    Tool \u003C|-- WebTool\n```\n\n## Notes\n\n\u003CAnything the diagram can't express — lifecycle, threading, etc.>\n````\n\nFor 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.\n\n### 8. Write `diagrams\u002Fsequences.md`\n\nPick 2–4 of the most important workflows. Trace each call path through the code (read entry point, follow function calls), then:\n\n````markdown\n# Sequence Diagrams\n\n## Workflow: \u003CName>\n\n\u003C1 sentence describing what this does and when it runs.>\n\n```mermaid\nsequenceDiagram\n    participant User\n    participant CLI\n    participant Agent\n    participant LLM\n    User->>CLI: types message\n    CLI->>Agent: chat(message)\n    Agent->>LLM: API call\n    LLM-->>Agent: response + tool_calls\n    Agent->>Agent: execute tools\n    Agent-->>CLI: final response\n```\n\n### Walkthrough\n\n1. **User input** — [`cli.py:HermesCLI.run_session`](\u003Clink>)\n2. **Message dispatch** — [`run_agent.py:AIAgent.chat`](\u003Clink>)\n````\n\nDon't invent participants. Every box must correspond to a real component the reader can find in the code.\n\n### 9. Write `getting-started.md`\n\n````markdown\n# Getting Started\n\n## Prerequisites\n\n\u003CFrom manifest files + README. Be specific — versions if pinned.>\n\n## Installation\n\n```bash\n\u003Cexact commands>\n```\n\n## First Run\n\n```bash\n\u003Cminimum command to see the system do something useful>\n```\n\n## Common Workflows\n\n### \u003CWorkflow 1>\n\u003Ccommands>\n\n## Configuration\n\n- `\u003Cconfig-file>` — \u003Cwhat it controls>\n- Env var `\u003CVAR>` — \u003Cwhat it controls>\n\n## Where to Go Next\n\n- Architecture: [architecture.md](architecture.md)\n- Module reference: [README.md#module-map](README.md#module-map)\n````\n\n### 10. Write `api.md` (skip if not applicable)\n\nOnly write this if the project is a library or API server. If it is:\n\n- Find the public API surface (`__init__.py` exports, OpenAPI specs, route handlers, exported types)\n- Document each public entry with signature, parameters, return type, one-line description\n- Group by category\n\n### 11. Write the state file\n\n```bash\ncat > \"$OUTPUT_DIR\u002F.codewiki-state.json\" \u003C\u003CEOF\n{\n  \"repo_name\": \"$REPO_NAME\",\n  \"source_path\": \"$PWD\",\n  \"source_sha\": \"$REPO_SHA\",\n  \"generated_at\": \"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",\n  \"generator\": \"hermes-agent code-wiki skill v0.1.0\",\n  \"modules_documented\": []\n}\nEOF\n```\n\n### 12. Report to user\n\nState exactly what was generated and where:\n\n```\nGenerated wiki at ~\u002F.hermes\u002Fwikis\u002F\u003Crepo-name>\u002F:\n  README.md                   project overview, module map\n  architecture.md             system architecture + flowchart\n  getting-started.md          setup, first run, workflows\n  modules\u002F\u003CN files>           per-module deep-dives\n  diagrams\u002Farchitecture.md    Mermaid flowchart\n  diagrams\u002Fclass-diagram.md   Mermaid class diagram\n  diagrams\u002Fsequences.md       Mermaid sequence diagrams\n```\n\nIf you cloned to a temp dir, remind the user it can be removed (`rm -rf \"$WIKI_TMP\"`) after they've reviewed the wiki.\n\n## Scope Control\n\nGenerating a full wiki for a 500K-LOC monorepo is wildly token-expensive. Default to bounded scope:\n\n- Initial scan: max depth 3 directories\n- Per-module docs: cap at 10 modules unless user expands scope\n- Per-file reads: prefer `search_files` for symbols + `read_file` with `offset`\u002F`limit` over full reads\n- Skip vendored code (`vendor\u002F`, `third_party\u002F`, generated code, `_pb2.py`, `.min.js`)\n\nIf 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?\"\n\n## Re-Run \u002F Update\n\nIf `.codewiki-state.json` already exists at the target path:\n\n- Read it for previous SHA and module list\n- If source SHA matches: ask user if they want to regenerate or skip\n- If SHA differs: offer to regenerate only modules with changed files (`git diff --name-only \u003Cold-sha> HEAD`)\n\nFull incremental-regeneration is a future enhancement — for now, regenerating the whole thing is acceptable.\n\n## Pitfalls\n\n- **Fabricating components.** Every diagram node and claimed function call must be in the source. `read_file` before writing. The single biggest failure mode for auto-generated docs is plausible-sounding fabrication.\n- **Generic AI prose.** \"This module is responsible for...\" is content-free. Say what the module actually does in domain-specific terms.\n- **Restating code as prose.** A module doc that says \"the `process` function processes things by calling `process_item` on each item\" is worse than just linking to the function.\n- **Mermaid > 50 nodes.** They don't render legibly. Split them.\n- **Documenting tests, generated code, or vendored deps as if they were product code.** Skip them.\n- **In-repo output without asking.** Default is `~\u002F.hermes\u002Fwikis\u002F`. Only write into the repo when the user explicitly requests it.\n- **Mermaid special chars need quotes:** `A[\"Tool \u002F Agent\"]` not `A[Tool \u002F Agent]`. `\u003Cbr>` for line breaks inside a node.\n- **Nested code fences in SKILL.md.** When writing a markdown example that contains a Mermaid block, use 4-backtick outer fences so the 3-backtick inner ` ```mermaid ` doesn't close the outer. (This SKILL.md does it.)\n- **classDiagram generics** render as `~T~` (e.g. `List~Tool~`), not `\u003CT>`.\n- **GitHub Mermaid theme is fixed** — don't include `%%{init: ...}%%` blocks; they're stripped on render.\n\n## Verification\n\nAfter writing, verify:\n\n1. **Mermaid blocks balance** — opens equal closes per file:\n   ```bash\n   for f in \"$OUTPUT_DIR\"\u002Fdiagrams\u002F*.md \"$OUTPUT_DIR\"\u002Farchitecture.md; do\n     opens=$(grep -c '^```mermaid' \"$f\")\n     total=$(grep -c '^```' \"$f\")\n     echo \"$f: $opens mermaid blocks, $total total fences (expect total = opens*2)\"\n   done\n   ```\n2. **All expected files exist** —\n   ```bash\n   ls \"$OUTPUT_DIR\"\u002F{README.md,architecture.md,getting-started.md,.codewiki-state.json} \\\n      \"$OUTPUT_DIR\"\u002Fmodules\u002F \"$OUTPUT_DIR\"\u002Fdiagrams\u002F\n   ```\n3. **Module count matches what you intended** — `ls \"$OUTPUT_DIR\u002Fmodules\" | wc -l` should equal the number of modules you committed to in Step 3.\n4. **No fabricated paths** — sanity-check 2–3 source links resolve to real files.\n","# Code Wiki Skill\n\nGenerate 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.\n\nThis skill produces **reference documentation** (what\u002Fhow). It does not produce strategic narrative (why — that's a different skill).\n\n## When to Use\n\n- User says \"document this codebase\", \"generate a wiki\", \"make architecture diagrams\"\n- Onboarding to an unfamiliar repo and wants a structured reference\n- User points at a GitHub URL and asks for documentation\n- Need a stable artifact (markdown + Mermaid) that renders on GitHub\n\nDo NOT use this for:\n- Single-file or single-function documentation — just answer directly\n- API reference for one specific endpoint — use `read_file` and answer inline\n- Strategic \"why does this exist\" narrative — different skill, different purpose\n- Codebases the user is actively developing in this session — just answer questions as they come\n\n## Prerequisites\n\n- No env vars required.\n- `git` on PATH for repo SHA tracking and remote clones.\n- Optional: `pygount` for language-breakdown stats (see the `codebase-inspection` skill).\n\n## How to Run\n\nInvoke through the `terminal` tool from the target repo's root, then use `read_file` \u002F `search_files` \u002F `write_file` to produce the wiki. Default output location is `~\u002F.hermes\u002Fwikis\u002F\u003Crepo-name>\u002F`. Only write into the repo (`docs\u002Fwiki\u002F`) when the user explicitly requests it.\n\n## Quick Reference\n\n| Step | Action |\n|---|---|\n| 1 | Resolve target — local cwd, given path, or `git clone --depth 50 \u003Curl>` to a temp dir |\n| 2 | Scan structure — `ls`, `find -maxdepth 3`, manifest files, README |\n| 3 | Pick 8–10 modules to document |\n| 4 | Write `README.md` (overview + module map) |\n| 5 | Write `architecture.md` with Mermaid flowchart |\n| 6 | Write per-module docs in `modules\u002F` |\n| 7 | Write `diagrams\u002Fclass-diagram.md` (Mermaid classDiagram) |\n| 8 | Write `diagrams\u002Fsequences.md` (Mermaid sequenceDiagram, 2–4 workflows) |\n| 9 | Write `getting-started.md` |\n| 10 | Write `api.md` if applicable, else skip |\n| 11 | Write `.codewiki-state.json` |\n| 12 | Report paths to user |\n\n## Procedure\n\n### 1. Resolve the target\n\nFor a GitHub URL:\n\n```bash\nWIKI_TMP=$(mktemp -d)\ngit clone --depth 50 \u003Curl> \"$WIKI_TMP\u002Frepo\"\ncd \"$WIKI_TMP\u002Frepo\"\nREPO_SHA=$(git rev-parse HEAD)\nREPO_NAME=$(basename \u003Curl> .git)\n```\n\nFor a local path (or cwd if none given):\n\n```bash\ncd \u003Cpath>\nREPO_SHA=$(git rev-parse HEAD 2>\u002Fdev\u002Fnull || echo \"uncommitted\")\nREPO_NAME=$(basename \"$PWD\")\n```\n\nThen set the output dir:\n\n```bash\nOUTPUT_DIR=\"$HOME\u002F.hermes\u002Fwikis\u002F$REPO_NAME\"\nmkdir -p \"$OUTPUT_DIR\u002Fmodules\" \"$OUTPUT_DIR\u002Fdiagrams\"\n```\n\n### 2. Scan repo structure\n\nUse the `terminal` tool for the shell work, `read_file` for manifests:\n\n```bash\n# Shallow tree first\nls -la\n\n# Deeper tree, noise filtered\nfind . -type d \\\n  -not -path '*\u002F\\.*' \\\n  -not -path '*\u002Fnode_modules*' \\\n  -not -path '*\u002Fvenv*' \\\n  -not -path '*\u002F__pycache__*' \\\n  -not -path '*\u002Fdist*' \\\n  -not -path '*\u002Fbuild*' \\\n  -not -path '*\u002Ftarget*' \\\n  -maxdepth 3 | sort\n\n# Language breakdown (skip if pygount unavailable)\npygount --format=summary \\\n  --folders-to-skip=\".git,node_modules,venv,.venv,__pycache__,.cache,dist,build,target\" \\\n  . 2>\u002Fdev\u002Fnull || true\n```\n\nThen `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.\n\n### 3. Pick modules to document\n\nCap initial pass at **8–10 modules**. Heuristics by language:\n\n- Python: top-level packages (dirs with `__init__.py`), plus subsystem dirs\n- JS\u002FTS: `src\u002F\u003Csubdir>`, top-level workspace dirs\n- Rust: each crate in a workspace, or top-level `src\u002F\u003Cmodule>` dirs\n- Go: each top-level package directory\n- Mixed\u002Funfamiliar: top-level directories that contain source code (not config, not tests)\n\nFor very large repos, prioritize by:\n1. Imported-from count (a module imported by many is core)\n2. LOC (bigger modules usually warrant their own doc)\n3. Mentions in README \u002F top-level docs\n\nState the module list to the user before generating per-module docs on big repos — gives them a chance to redirect.\n\n### 4. Write `README.md`\n\n`read_file` the actual project README plus the top 2–3 entry-point files. Then `write_file`:\n\n````markdown\n# \u003CProject Name>\n\n\u003COne paragraph: what it is and what it's for. Self-contained — don't assume the\nreader has the source README.>\n\n## Key Concepts\n\n- **\u003CConcept 1>** — \u003Cone line>\n- **\u003CConcept 2>** — \u003Cone line>\n\n## Entry Points\n\n- [`path\u002Fto\u002Fmain.py`](\u003Clink>) — \u003Cwhat runs when you start it>\n- [`path\u002Fto\u002Fcli.py`](\u003Clink>) — \u003CCLI surface>\n\n## High-Level Architecture\n\n\u003C2-3 sentences. Detail goes in architecture.md.>\n\nSee [architecture.md](architecture.md).\n\n## Module Map\n\n| Module | Purpose |\n|---|---|\n| [`\u003Cmodule>`](modules\u002F\u003Cmodule>.md) | \u003Cone-line purpose> |\n\n## Getting Started\n\nSee [getting-started.md](getting-started.md).\n````\n\nFor link targets in local mode use relative paths. For cloned repos use `https:\u002F\u002Fgithub.com\u002F\u003Cowner>\u002F\u003Crepo>\u002Fblob\u002F\u003Csha>\u002F\u003Cpath>` so links survive future commits.\n\n### 5. Write `architecture.md`\n\n````markdown\n# Architecture\n\n\u003C2-3 paragraphs: shape of the system. What talks to what. Where data enters,\nwhere it exits, where state lives.>\n\n## Components\n\n- **\u003CComponent>** — \u003C1-2 sentences>. See [`modules\u002F\u003Cmodule>.md`](modules\u002F\u003Cmodule>.md).\n\n## System Diagram\n\n```mermaid\nflowchart TD\n    User([User]) --> Entry[Entry Point]\n    Entry --> Core[Core Engine]\n    Core --> StorageA[(Database)]\n    Core --> ExternalAPI{{External API}}\n```\n\n## Data Flow\n\n1. **\u003CStep>** — [`\u003Cfile>`](\u003Clink>)\n2. **\u003CStep>** — [`\u003Cfile>`](\u003Clink>)\n\n## Key Design Decisions\n\n- \u003CAnything load-bearing the reader should know>\n````\n\n**Mermaid shape semantics:**\n- `[]` = component\n- `[()]` = database \u002F storage\n- `{{}}` = external service\n- `(())` = entry point or terminal\n- `-->` = sync call, `-.->` = async\u002Fevent\n\nCap at ~20 nodes per diagram. Split into sub-diagrams if larger.\n\n### 6. Write per-module docs in `modules\u002F`\n\nFor each selected module, inspect its layout with `ls`, identify 3–5 most important files (by size, by being named `core.py` \u002F `main.py` \u002F `__init__.py`, by being imported a lot), then `read_file` those files (use `offset` \u002F `limit` to read only what you need; prefer `search_files` for specific symbols).\n\n````markdown\n# Module: `\u003Cmodule>`\n\n\u003C1-2 sentence purpose.>\n\n## Responsibilities\n\n- \u003Cbullet>\n- \u003Cbullet>\n\n## Key Files\n\n- [`\u003Cmodule>\u002F\u003Cfile>`](\u003Clink>) — \u003Cwhat it does>\n\n## Public API\n\n\u003CFunctions\u002Fclasses\u002Fconstants other code uses. Group related items. Show\nsignatures, not full implementations.>\n\n## Internal Structure\n\n\u003CHow the module is organized internally. State management.>\n\n## Dependencies\n\n- **Used by:** \u003Cother modules>\n- **Uses:** \u003Cother modules + external libs>\n\n## Notable Patterns \u002F Gotchas\n\n- \u003CAnything non-obvious>\n````\n\n### 7. Write `diagrams\u002Fclass-diagram.md`\n\nPick the 5–10 most important classes\u002Ftypes. `read_file` them, then write:\n\n````markdown\n# Class Diagram\n\n## Core Types\n\n```mermaid\nclassDiagram\n    class Agent {\n        +string name\n        +list~Tool~ tools\n        +chat(message) string\n    }\n    class Tool {\n        \u003C\u003Cinterface>>\n        +name string\n        +execute(args) any\n    }\n    Agent --> Tool : uses\n    Tool \u003C|-- TerminalTool\n    Tool \u003C|-- WebTool\n```\n\n## Notes\n\n\u003CAnything the diagram can't express — lifecycle, threading, etc.>\n````\n\nFor 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.\n\n### 8. Write `diagrams\u002Fsequences.md`\n\nPick 2–4 of the most important workflows. Trace each call path through the code (read entry point, follow function calls), then:\n\n````markdown\n# Sequence Diagrams\n\n## Workflow: \u003CName>\n\n\u003C1 sentence describing what this does and when it runs.>\n\n```mermaid\nsequenceDiagram\n    participant User\n    participant CLI\n    participant Agent\n    participant LLM\n    User->>CLI: types message\n    CLI->>Agent: chat(message)\n    Agent->>LLM: API call\n    LLM-->>Agent: response + tool_calls\n    Agent->>Agent: execute tools\n    Agent-->>CLI: final response\n```\n\n### Walkthrough\n\n1. **User input** — [`cli.py:HermesCLI.run_session`](\u003Clink>)\n2. **Message dispatch** — [`run_agent.py:AIAgent.chat`](\u003Clink>)\n````\n\nDon't invent participants. Every box must correspond to a real component the reader can find in the code.\n\n### 9. Write `getting-started.md`\n\n````markdown\n# Getting Started\n\n## Prerequisites\n\n\u003CFrom manifest files + README. Be specific — versions if pinned.>\n\n## Installation\n\n```bash\n\u003Cexact commands>\n```\n\n## First Run\n\n```bash\n\u003Cminimum command to see the system do something useful>\n```\n\n## Common Workflows\n\n### \u003CWorkflow 1>\n\u003Ccommands>\n\n## Configuration\n\n- `\u003Cconfig-file>` — \u003Cwhat it controls>\n- Env var `\u003CVAR>` — \u003Cwhat it controls>\n\n## Where to Go Next\n\n- Architecture: [architecture.md](architecture.md)\n- Module reference: [README.md#module-map](README.md#module-map)\n````\n\n### 10. Write `api.md` (skip if not applicable)\n\nOnly write this if the project is a library or API server. If it is:\n\n- Find the public API surface (`__init__.py` exports, OpenAPI specs, route handlers, exported types)\n- Document each public entry with signature, parameters, return type, one-line description\n- Group by category\n\n### 11. Write the state file\n\n```bash\ncat > \"$OUTPUT_DIR\u002F.codewiki-state.json\" \u003C\u003CEOF\n{\n  \"repo_name\": \"$REPO_NAME\",\n  \"source_path\": \"$PWD\",\n  \"source_sha\": \"$REPO_SHA\",\n  \"generated_at\": \"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",\n  \"generator\": \"hermes-agent code-wiki skill v0.1.0\",\n  \"modules_documented\": []\n}\nEOF\n```\n\n### 12. Report to user\n\nState exactly what was generated and where:\n\n```\nGenerated wiki at ~\u002F.hermes\u002Fwikis\u002F\u003Crepo-name>\u002F:\n  README.md                   project overview, module map\n  architecture.md             system architecture + flowchart\n  getting-started.md          setup, first run, workflows\n  modules\u002F\u003CN files>           per-module deep-dives\n  diagrams\u002Farchitecture.md    Mermaid flowchart\n  diagrams\u002Fclass-diagram.md   Mermaid class diagram\n  diagrams\u002Fsequences.md       Mermaid sequence diagrams\n```\n\nIf you cloned to a temp dir, remind the user it can be removed (`rm -rf \"$WIKI_TMP\"`) after they've reviewed the wiki.\n\n## Scope Control\n\nGenerating a full wiki for a 500K-LOC monorepo is wildly token-expensive. Default to bounded scope:\n\n- Initial scan: max depth 3 directories\n- Per-module docs: cap at 10 modules unless user expands scope\n- Per-file reads: prefer `search_files` for symbols + `read_file` with `offset`\u002F`limit` over full reads\n- Skip vendored code (`vendor\u002F`, `third_party\u002F`, generated code, `_pb2.py`, `.min.js`)\n\nIf 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?\"\n\n## Re-Run \u002F Update\n\nIf `.codewiki-state.json` already exists at the target path:\n\n- Read it for previous SHA and module list\n- If source SHA matches: ask user if they want to regenerate or skip\n- If SHA differs: offer to regenerate only modules with changed files (`git diff --name-only \u003Cold-sha> HEAD`)\n\nFull incremental-regeneration is a future enhancement — for now, regenerating the whole thing is acceptable.\n\n## Pitfalls\n\n- **Fabricating components.** Every diagram node and claimed function call must be in the source. `read_file` before writing. The single biggest failure mode for auto-generated docs is plausible-sounding fabrication.\n- **Generic AI prose.** \"This module is responsible for...\" is content-free. Say what the module actually does in domain-specific terms.\n- **Restating code as prose.** A module doc that says \"the `process` function processes things by calling `process_item` on each item\" is worse than just linking to the function.\n- **Mermaid > 50 nodes.** They don't render legibly. Split them.\n- **Documenting tests, generated code, or vendored deps as if they were product code.** Skip them.\n- **In-repo output without asking.** Default is `~\u002F.hermes\u002Fwikis\u002F`. Only write into the repo when the user explicitly requests it.\n- **Mermaid special chars need quotes:** `A[\"Tool \u002F Agent\"]` not `A[Tool \u002F Agent]`. `\u003Cbr>` for line breaks inside a node.\n- **Nested code fences in SKILL.md.** When writing a markdown example that contains a Mermaid block, use 4-backtick outer fences so the 3-backtick inner ` ```mermaid ` doesn't close the outer. (This SKILL.md does it.)\n- **classDiagram generics** render as `~T~` (e.g. `List~Tool~`), not `\u003CT>`.\n- **GitHub Mermaid theme is fixed** — don't include `%%{init: ...}%%` blocks; they're stripped on render.\n\n## Verification\n\nAfter writing, verify:\n\n1. **Mermaid blocks balance** — opens equal closes per file:\n   ```bash\n   for f in \"$OUTPUT_DIR\"\u002Fdiagrams\u002F*.md \"$OUTPUT_DIR\"\u002Farchitecture.md; do\n     opens=$(grep -c '^```mermaid' \"$f\")\n     total=$(grep -c '^```' \"$f\")\n     echo \"$f: $opens mermaid blocks, $total total fences (expect total = opens*2)\"\n   done\n   ```\n2. **All expected files exist** —\n   ```bash\n   ls \"$OUTPUT_DIR\"\u002F{README.md,architecture.md,getting-started.md,.codewiki-state.json} \\\n      \"$OUTPUT_DIR\"\u002Fmodules\u002F \"$OUTPUT_DIR\"\u002Fdiagrams\u002F\n   ```\n3. **Module count matches what you intended** — `ls \"$OUTPUT_DIR\u002Fmodules\" | wc -l` should equal the number of modules you committed to in Step 3.\n4. **No fabricated paths** — sanity-check 2–3 source links resolve to real files.\n",{"name":5,"author":24,"license":15,"version":25,"metadata":26,"platforms":38,"description":7},"Teknium (teknium1), Hermes Agent","0.1.0",{"hermes":27},{"tags":28,"related_skills":35},[29,30,31,32,33,34],"Documentation","Mermaid","Architecture","Diagrams","Wiki","Code-Analysis",[36,37],"codebase-inspection","github-repo-management",[39,40,41],"linux","macos","windows","main","116bb09f1369e85cd8a54fec4135e218dca4a061","skills\u002Fsoftware-development\u002Fcode-wiki",0,"https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO","https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO\u002Freleases\u002Flatest","https:\u002F\u002Fgithub.com\u002Fmerllinsbeard","ai","2026-08-25 21:36:43",{"source":8,"skillName":5,"commands":52,"prompt":62,"zipAvailable":63},[53,56,59],{"tool":54,"command":55},"npx","npx skills add merllinsbeard\u002Fmerlin-CTO --skill code-wiki",{"tool":57,"command":58},"bunx","bunx skills add merllinsbeard\u002Fmerlin-CTO --skill code-wiki",{"tool":60,"command":61},"pnpm","pnpm dlx skills add merllinsbeard\u002Fmerlin-CTO --skill code-wiki","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO\u002Fblob\u002Fmain\u002Fskills\u002Fsoftware-development\u002Fcode-wiki\u002FSKILL.md",true,[65,71,75,79],{"path":66,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":69,"sourceHtmlUrl":70},"templates\u002Farchitecture.md","REFERENCE","参考文档",654,"https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO\u002Fblob\u002Fmain\u002Fskills\u002Fsoftware-development\u002Fcode-wiki\u002Ftemplates\u002Farchitecture.md",{"path":72,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":73,"sourceHtmlUrl":74},"templates\u002Fgetting-started.md",658,"https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO\u002Fblob\u002Fmain\u002Fskills\u002Fsoftware-development\u002Fcode-wiki\u002Ftemplates\u002Fgetting-started.md",{"path":76,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":77,"sourceHtmlUrl":78},"templates\u002Fmodule.md",634,"https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO\u002Fblob\u002Fmain\u002Fskills\u002Fsoftware-development\u002Fcode-wiki\u002Ftemplates\u002Fmodule.md",{"path":80,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":81,"sourceHtmlUrl":82},"templates\u002FREADME.md",667,"https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO\u002Fblob\u002Fmain\u002Fskills\u002Fsoftware-development\u002Fcode-wiki\u002Ftemplates\u002FREADME.md",[84,91,98,105,112,119],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7B3SK15WA8JW4G6RBKZR3ME","writing-for-agents","Use for delegate_task, Kanban, and all agent-facing text.","https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-for-agents\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":19},"01M7B3SD78DTTXFVXGDPRK7249","why","Use for 'why does X work this way', 'why we picked Y', design rationale, regressions, postmortems, or data-backed thresholds. Discovers available MCPs and queries each evidence category (source control, issue tracker, long-form docs, real-time chat, infrastructure observability, error tracking, product analytics warehouse) in parallel, then returns a cited read on decisions and tradeoffs. Use how for runtime behavior.","https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO\u002Fblob\u002Fmain\u002Fskills\u002Fwhy\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":19},"01M7B3S8ENS1XQ7YV3N5GV1PCF","vue-best-practices","Use for Vue 3, .vue files, Vue Router, or Pinia. Skip when the repo has no Vue.","https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO\u002Fblob\u002Fmain\u002Fskills\u002Fweb-development\u002Fvue-best-practices\u002FSKILL.md",[],[],{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":19},"01M7B3S2DPXMQN0EFFE8FTF03R","vercel-react-best-practices","React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React\u002FNext.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.","https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO\u002Fblob\u002Fmain\u002Fskills\u002Fweb-development\u002Fvercel-react-best-practices\u002FSKILL.md",[],[],{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":19},"01M7B3S06K4AGG5X59TCX900R6","tailwind-v4","Use when writing or reviewing Tailwind CSS v4 classes or migrating v3 syntax.","https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO\u002Fblob\u002Fmain\u002Fskills\u002Fweb-development\u002Ftailwind-v4\u002FSKILL.md",[],[],{"skillNo":120,"name":121,"nameZh":6,"description":122,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":123,"categories":124,"keywords":125,"publishedAt":19},"01M7B3RXNDDCPJ7K5303BXXDTV","react-best-practices","Mastra React subset only. Generic React or Next uses vercel-react-best-practices.","https:\u002F\u002Fgithub.com\u002Fmerllinsbeard\u002Fmerlin-CTO\u002Fblob\u002Fmain\u002Fskills\u002Fweb-development\u002Freact-best-practices\u002FSKILL.md",[],[]]