skills/vitepress/SKILL.md
Generate VitePress documentation sites for source code learning and analysis. Use when creating tutorials that explain how a codebase is implemented internally.
npx skillsauth add howell5/willhong-skills vitepress-tutorialInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generate VitePress documentation sites for source code learning and analysis.
This skill creates standalone VitePress tutorial sites that teach developers how a codebase works internally. Unlike user documentation that explains "how to use", these tutorials explain "how it's implemented".
/vitepress-tutorial [task-description]
Examples:
/vitepress-tutorial 帮我解析这个仓库的架构/vitepress-tutorial explain the agent system in detailpackage.json with Mermaid plugin.vitepress/config.tspnpm-workspace.yaml (if inside another workspace)pnpm installALWAYS use AskUserQuestion to confirm output location AND content language before creating any files.
Use two questions in one AskUserQuestion call:
Question 1: "Where should I create the VitePress tutorial site?"
Options:
- "./docs" (project docs folder)
- "./tutorials/{project-name}" (dedicated tutorials folder)
- Custom path...
Question 2: "What language(s) should the tutorial content be written in? (Max 2)"
multiSelect: true
Options:
- "中文 (Chinese)" - Content in Chinese, code comments in English
- "English" - Content and code comments in English
- "日本語 (Japanese)" - Content in Japanese, code comments in English
- "한국어 (Korean)" - Content in Korean, code comments in English
docs/ with no locale prefix. Set lang in config accordingly./ (default locale)/{locale-code}/ prefixlocales in .vitepress/config.ts with proper labels and nav/sidebar for each localezh-CN (Chinese), en-US (English), ja (Japanese), ko (Korean)When creating inside an existing pnpm workspace, ALWAYS create these files to make it independent:
pnpm-workspace.yaml (in tutorial root):
# Independent workspace - prevents inheriting parent config
packages: []
package.json (MUST include):
{
"name": "{tutorial-name}",
"version": "1.0.0",
"type": "module",
"scripts": {
"dev": "vitepress dev docs",
"build": "vitepress build docs",
"preview": "vitepress preview docs"
},
"devDependencies": {
"mermaid": "^11.4.0",
"vitepress": "^1.6.3",
"vitepress-plugin-mermaid": "^2.0.17"
},
"pnpm": {
"onlyBuiltDependencies": ["esbuild"]
}
}
docs/.vitepress/config.ts (MUST use withMermaid wrapper):
import { defineConfig } from 'vitepress'
import { withMermaid } from 'vitepress-plugin-mermaid'
export default withMermaid(defineConfig({
// CRITICAL: Fix Mermaid's dayjs ESM compatibility issue
vite: {
optimizeDeps: {
include: ['mermaid', 'dayjs']
}
},
// ... rest of config
mermaid: {
theme: 'default'
}
}))
Why vite.optimizeDeps? Mermaid depends on dayjs which is a CommonJS module. Without this config, Vite dev server will throw "does not provide an export named 'default'" error.
After creating project files, ALWAYS run:
cd {output-path} && pnpm install
{output-path}/
├── package.json # With mermaid plugin
├── pnpm-workspace.yaml # If inside another workspace
├── README.md
└── docs/
├── .vitepress/
│ └── config.ts # With withMermaid wrapper
├── index.md # Homepage
├── introduction/
│ ├── overview.md # Project overview
│ └── architecture.md # Architecture diagram
└── {modules}/ # One directory per module
├── index.md
└── {topics}.md
{output-path}/
├── package.json
├── pnpm-workspace.yaml
├── README.md
└── docs/
├── .vitepress/
│ └── config.ts # With locales config + withMermaid
├── index.md # Default locale homepage
├── introduction/ # Default locale content
│ ├── overview.md
│ └── architecture.md
├── {modules}/
│ ├── index.md
│ └── {topics}.md
└── {locale}/ # e.g. "en" or "zh"
├── index.md # Second locale homepage
├── introduction/
│ ├── overview.md
│ └── architecture.md
└── {modules}/
├── index.md
└── {topics}.md
Source: path/to/file.go:123 annotationstesting
从核心观点生成优质社媒长文。运用 4D 框架深度分析选题,去除 AI 味,6 维度评审确保质量。
development
Use when exploring unfamiliar codebases, before searching for code, or after editing files. Builds a structural AST index (classes, functions, imports, call graph) from 12 languages via tree-sitter. Trigger: /graphify
development
End-to-end i18n orchestration for frontend repositories. Use when a user wants to internationalize React/Vue/Next/Nuxt/Vite projects with minimal questions: auto-detect stack and current i18n state, ask only unresolved business decisions, migrate hardcoded strings to locale keys, localize formatting and routing/SEO, and enforce CI quality gates.
testing
检查本次对话的改动是否需要更新项目 CLAUDE.md。分析代码变更,识别新模式和约定,建议更新内容。