wiki-vitepress – skill Tài liệu & Office cho agent AI
Chuyển các file markdown wiki đã tạo thành trang tĩnh VitePress với giao diện tối và biểu đồ Mermaid tương tác. Dùng khi người dùng yêu cầu "build a site" hoặc "đóng gói thành VitePress", người dùng chạy /deep-wiki, hoặc muốn đầu ra HTML có thể duyệt.
Cài skill wiki-vitepress bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/wiki-vitepress-228cb.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /wiki-vitepress – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/wiki-vitepress-228cb.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $wiki-vitepress – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/wiki-vitepress-228cb.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /wiki-vitepress – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/wiki-vitepress-228cb.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /wiki-vitepress – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
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.
Skill liên quan
- wiki-yylo – Dùng YYLO Ledger wiki Records làm tri thức dự án bền vững. Tìm kiếm trước khi tạo, phân…
- word-count-structure-checker – Kiểm tra số từ và cấu trúc. Dùng khi làm việc với văn bản hoặc bài viết có cấu trúc.
- 3-statement-model – Xây dựng sổ tính toán tài chính tích hợp IS/BS/CF trong Excel.
- 2slides-ppt-generator – Tạo bản trình chiếu bằng AI qua API 2slides: tạo slide từ văn bản, khớp phong cách theo…
- antinet-doc-parse – Kỹ sư phát triển phần mềm và nhà khoa học dữ liệu khi xây dựng hệ thống RAG cần xử lý…
- baoyu-danger-x-to-markdown – Chuyển đổi tweet và bài viết trên X (Twitter) sang markdown với YAML front matter. Sử…
- baoyu-format-markdown – Định dạng file văn bản thuần hoặc markdown với frontmatter, tiêu đề, tóm tắt, heading…
- law-to-markdown – Dành cho trợ lý pháp lý khi xử lý nhiều điều luật: khi cần chuyển file quy phạm pháp…