wiki-vitepress – Documents & Office skill for AI agents
Transform generated wiki Markdown files into a polished VitePress static site with dark theme and interactive Mermaid diagrams. Use when user asks to \"build a site\" or \"package as VitePress\", user runs the /deep-wiki, or user wants a browsable HTML output from generated wiki pages.
Install the wiki-vitepress skill with one command
Pick the tool you use, copy the command and paste it in your terminal. The skill lands in that tool's skills folder and is ready in your next session.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/wiki-vitepress-228cb.tgz | tar xz -C ~/.claude/skills
Call it in Claude Code: /wiki-vitepress – then describe the task you want done.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/wiki-vitepress-228cb.tgz | tar xz -C ~/.codex/skills
Call it in Codex: $wiki-vitepress – then describe the task you want done.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/wiki-vitepress-228cb.tgz | tar xz -C ~/.hermes/skills
Call it in Hermes Agent: /wiki-vitepress – then describe the task you want done.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/wiki-vitepress-228cb.tgz | tar xz -C ~/.deepcode/skills
Call it in DeepSeek: /wiki-vitepress – then describe the task you want done.
SKILL.md content
Wiki VitePress Packager
Transform generated wiki Markdown files into a polished VitePress static site with dark theme and interactive Mermaid diagrams.
When to Use
- User asks to "build a site" or "package as VitePress"
- User runs the
/deep-wiki:buildcommand - User wants a browsable HTML output from generated wiki pages
VitePress Scaffolding
Generate the following structure in a wiki-site/ directory:
wiki-site/
├── .vitepress/
│ ├── config.mts
│ └── theme/
│ ├── index.ts
│ └── custom.css
├── public/
├── [generated .md pages]
├── package.json
└── index.mdConfig Requirements (config.mts)
- Use
withMermaidwrapper fromvitepress-plugin-mermaid - Set
appearance: 'dark'for dark-only theme - Configure
themeConfig.navandthemeConfig.sidebarfrom the catalogue structure - Mermaid config must set dark theme variables:
mermaid: {
theme: 'dark',
themeVariables: {
primaryColor: '#1e3a5f',
primaryTextColor: '#e0e0e0',
primaryBorderColor: '#4a9eed',
lineColor: '#4a9eed',
secondaryColor: '#2d4a3e',
tertiaryColor: '#2d2d3d',
background: '#1a1a2e',
mainBkg: '#1e3a5f',
nodeBorder: '#4a9eed',
clusterBkg: '#16213e',
titleColor: '#e0e0e0',
edgeLabelBackground: '#1a1a2e'
}
}Dark-Mode Mermaid: Three-Layer Fix
Layer 1: Theme Variables (in config.mts)
Set via mermaid.themeVariables as shown above.
Layer 2: CSS Overrides (custom.css)
Target Mermaid SVG elements with !important:
.mermaid .node rect,
.mermaid .node circle,
.mermaid .node polygon { fill: #1e3a5f !important; stroke: #4a9eed !important; }
.mermaid .edgeLabel { background-color: #1a1a2e !important; color: #e0e0e0 !important; }
.mermaid text { fill: #e0e0e0 !important; }
.mermaid .label { color: #e0e0e0 !important; }Layer 3: Inline Style Replacement (theme/index.ts)
Normal inline styles can be overridden by appropriate author !important rules. Prefer renderer theme configuration and scoped CSS; avoid rewriting every SVG fill/stroke because it destroys semantic colors. If a version-specific DOM workaround is necessary, use a bounded mounted hook and dispose timers/listeners on unmount and route change:
import { onMounted } from 'vue'
// In setup()
onMounted(() => {
let attempts = 0
const fix = setInterval(() => {
document.querySelectorAll('.mermaid svg [style]').forEach(el => {
const s = (el as HTMLElement).style
if (s.fill && !s.fill.includes('#1e3a5f')) s.fill = '#1e3a5f'
if (s.stroke && !s.stroke.includes('#4a9eed')) s.stroke = '#4a9eed'
if (s.color) s.color = '#e0e0e0'
})
if (++attempts >= 20) clearInterval(fix)
}, 500)
})Use setup() with onMounted, NOT enhanceApp() — DOM doesn't exist during SSR.
Click-to-Zoom for Mermaid Diagrams
Wrap each .mermaid container in a clickable wrapper that opens a fullscreen modal:
document.querySelectorAll('.mermaid').forEach(el => {
el.style.cursor = 'zoom-in'
el.addEventListener('click', () => {
const modal = document.createElement('div')
modal.className = 'mermaid-zoom-modal'
modal.appendChild(el.cloneNode(true))
modal.addEventListener('click', () => modal.remove())
document.body.appendChild(modal)
})
})Modal CSS:
.mermaid-zoom-modal {
position: fixed; inset: 0;
background: rgba(0,0,0,0.9);
display: flex; align-items: center; justify-content: center;
z-index: 9999; cursor: zoom-out;
}
.mermaid-zoom-modal .mermaid { transform: scale(1.5); }The modal sketch is incomplete: production UI needs an accessible button/dialog name, Escape handling, focus trapping/restoration and listener cleanup. Treat Markdown/diagram content as untrusted; preserve strict Mermaid security and do not enable arbitrary HTML/script execution for rendering convenience.
Post-Processing Rules
Before VitePress build, scan all .md files and fix:
- Preserve valid self-closing
<br/>/<br>markup unless an actual compiler error requires a scoped repair; do not rewrite text inside code fences - Wrap bare
<T>generic parameters in backticks outside code fences - Ensure every page has YAML frontmatter with
titleanddescription
Build
cd wiki-site && npm install && npm run docs:buildOutput goes to wiki-site/.vitepress/dist/.
Known Gotchas
- Mermaid renders async — SVGs don't exist when
onMountedfires. Must poll. isCustomElementcompiler option for bare<T>causes worse crashes — do NOT use it- Node text in Mermaid uses inline
stylewith highest specificity — CSS alone won't fix it enhanceApp()runs during SSR wheredocumentdoesn't exist — usesetup()only
When to Use
This skill is applicable to execute the workflow or actions described in the overview.
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Related skills
- wiki-yylo – Use YYLO Ledger wiki Records as durable project knowledge. Search before creating…
- word-count-structure-checker – Word Count & Structure Checker. Use when working with text or structured article.
- 3-statement-model – Build integrated IS/BS/CF financial workbooks in Excel.
- 2slides-ppt-generator – AI-powered presentation generation via the 2slides API — create slides from text, match…
- antinet-doc-parse – 软件开发工程师与数据科学家在构建RAG系统时,当需处理PDF/Word/Excel等多格式复杂文档,用此技能可自动触发三级解析降级,一键输出高置信度结构化Markdown与元数据…
- baoyu-danger-x-to-markdown – Converts X (Twitter) tweets and articles to markdown with YAML front matter. Uses…
- baoyu-format-markdown – Formats plain text or markdown files with frontmatter, titles, summaries, headings…
- law-to-markdown – 律师助理与法律助手在处理繁杂法条时,当需要将 PDF/Word/TXT 格式的法律规范文件转为结构化 Markdown 时适用。自动完成 OCR…