AgentSkillsCN

deepwiki-docs

为任意公开的 GitHub 仓库从 DeepWiki(deepwiki.com)中抓取、浏览并索引相关文档。适用场景包括:(1) 查阅开源库、框架或工具的官方文档;(2) 深入了解某个 GitHub 仓库的架构、API 或代码结构;(3) 基于仓库文档构建知识索引或参考文档;(4) 当用户提及 DeepWiki、询问某 GitHub 项目文档,或需要了解某个依赖库/工具的工作原理时。触发词如:「查询 X 的文档」、「X 库是如何工作的」、「获取 owner/repo 的文档」、「构建知识索引」、「到 DeepWiki 查找 X」,或当编码任务需要参考上游库的文档时。

SKILL.md
--- frontmatter
name: deepwiki-docs
description: >
  Fetch, browse, and index documentation from DeepWiki (deepwiki.com) for any public GitHub repository.
  Use this skill when: (1) looking up documentation for an open-source library, framework, or tool,
  (2) needing to understand a GitHub repo's architecture, API, or code structure,
  (3) building a knowledge index/reference document from a repo's documentation,
  (4) the user mentions DeepWiki, asks about a GitHub project's docs, or needs to look up how a
  dependency/library works. Triggers on phrases like "look up docs for X", "how does X library work",
  "fetch documentation for owner/repo", "build a knowledge index", "check the DeepWiki for X",
  or when coding tasks would benefit from consulting upstream library documentation.

DeepWiki Docs

Fetch and index documentation from DeepWiki for any public GitHub repository. DeepWiki provides AI-generated, structured documentation for open-source projects including architecture diagrams, API references, and code explanations.

Quick Start

Method 1: Script (recommended for bulk operations)

bash
# Get wiki table of contents
python /path/to/scripts/deepwiki_fetch.py structure <owner/repo>

# Get a specific page
python /path/to/scripts/deepwiki_fetch.py content <owner/repo> <page-slug>

# Export TOC as markdown
python /path/to/scripts/deepwiki_fetch.py export <owner/repo> --output toc.md

# Build full knowledge index (all pages in one document)
python /path/to/scripts/deepwiki_fetch.py index <owner/repo> --output docs.md

Method 2: web_fetch (for quick lookups)

code
# Fetch repo overview + sidebar structure
web_fetch("https://deepwiki.com/{owner}/{repo}")

# Fetch a specific documentation page
web_fetch("https://deepwiki.com/{owner}/{repo}/{page-slug}")

Parse the returned HTML:

  • Sidebar <a> links matching /{owner}/{repo}/{slug} → table of contents
  • Main text content → documentation

Workflow

Step 1: Get Wiki Structure

Always start by fetching the repository's documentation structure to discover available pages.

Use the script:

bash
python scripts/deepwiki_fetch.py structure owner/repo

Or use web_fetch on https://deepwiki.com/{owner}/{repo} and parse sidebar links.

Step 2: Fetch Relevant Pages

Based on the user's question, select and fetch the most relevant page(s).

Page slugs follow the pattern: {N}-{title} or {N.M}-{title} (e.g., 4.1-fiber-architecture).

Step 3: Synthesize and Present

Summarize the fetched documentation content in context of the user's question. Always cite the DeepWiki source URL.

Building a Knowledge Index

For comprehensive documentation needs, use the index command to create a single markdown document containing all wiki pages. This is useful for:

  • Creating offline reference documents
  • Building LLM context for coding tasks
  • Generating documentation archives
bash
python scripts/deepwiki_fetch.py index owner/repo --output repo_docs.md

Page Slug Format

PatternExampleDescription
{N}-{title}1-overviewTop-level section
{N.M}-{title}4.1-fiber-architectureSub-section
{N.M.K}-{title}3.2.1-webpack-configDeep sub-section

Reference Files

Notes

  • Only public GitHub repositories are available without authentication
  • If a repo is not indexed, direct the user to https://deepwiki.com to request indexing
  • The script uses only Python stdlib (no pip installs needed)
  • For the DeepWiki MCP server (advanced): https://mcp.deepwiki.com/mcp (no auth, three tools: read_wiki_structure, read_wiki_contents, ask_question)