Vitepress skilld

From skilld-dev/vue-ecosystem-skills · View interactive version

Vitepress skilld is an AI agent skill from the GitHub repository skilld-dev/vue-ecosystem-skills. Use when writing, configuring, or debugging code that imports "vitepress", when running vitepress CLI commands, editing .vitepress/config or theme files, tuning markdown or default theme options, or migrating a VitePress site. Provides the vitepress@1.6.4 API surface, config reference, theme referen

How to use this skill

Skill file

vitepress@1.6.4

Vite & Vue powered static site generator (vuejs/vitepress). Source of truth in

this Skill is the prepared package source; line citations are relative to the

package root (for example dist/node/index.d.ts:2382).

Version facts

error and directs to VitePress v2 (dist/node/cli.js:438-444).

Entry points

Defined by the export map in package.json:18-37:

| Import | Types entry | Use for |

| ---------------------------- | ------------------------ | ---------------------------------------------- |

| vitepress | types/index.d.ts | Node + client + shared API, config helpers |

| vitepress/client | client.d.ts | Client composables (useData, useRouter, …) |

| vitepress/theme | theme.d.ts | Default theme, useSidebar, useLocalNav |

| vitepress/theme-without-fonts | theme-without-fonts.d.ts | Default theme without bundled font files |

CLI binary: vitepress → bin/vitepress.js.

Setup and commands

npm add -D vitepress
npx vitepress init
npx vitepress dev
npx vitepress build
npx vitepress preview

dev may be omitted when using the current directory (vitepress alone).

serve is an alias of preview. Full flags and dev shortcuts:

cli.md

Common tasks

Site config (`.vitepress/config.ts`)

import { defineConfig } from 'vitepress'

export default defineConfig({
  title: 'My App',
  description: 'A VitePress site',
  themeConfig: {
    nav: [{ text: 'Guide', link: '/guide/' }],
    sidebar: [{ text: 'Guide', items: [{ text: 'Intro', link: '/guide/intro' }] }]
  }
})

defineConfig is typed for the default theme; use

defineConfigWithTheme<CustomThemeConfig> for a custom theme

(dist/node/index.d.ts:2382-2386). Every option:

site-config.md

Client runtime API

<script setup>
import { useData, useRouter, withBase } from 'vitepress'
const { page, frontmatter, isDark, hash } = useData()
const router = useRouter()
</script>

Full export list and signatures: api.md

Build-time data loading

// posts.data.js
import { createContentLoader } from 'vitepress'
export default createContentLoader('posts/*.md', { excerpt: true })

Import as import { data } from './posts.data.js'. Runs in Node only; the

result ships as JSON in the client bundle.

Browser-only components

<script setup>
import { defineClientComponent } from 'vitepress'
const Chart = defineClientComponent(() => import('./Chart.vue'))
</script>

Prevents SSG build failures when a library touches window/document on

import (https://vitepress.dev/guide/ssr-compat).

Best practices

loaders; it caches by file mtime and keeps the client JSON small

(dist/node/index.d.ts:2466-2473, https://vitepress.dev/guide/data-loading).

(https://vitepress.dev/guide/ssr-compat).

them; use withBase() for dynamic paths in theme components

(https://vitepress.dev/guide/asset-handling).

(https://vitepress.dev/guide/routing#clean-urls).

the source file structure

(https://vitepress.dev/guide/routing#route-rewrites).

params, to keep client JS small

(https://vitepress.dev/guide/routing#dynamic-routes).

<script setup> is server-side templating only

(https://vitepress.dev/guide/mpa-mode).

(types/default-theme.d.ts:451-455).

Deeper references

vitepress/client, vitepress/theme, data loader types, theme interface.

hooks, SiteConfig, mergeConfig.

nav, sidebar, search (local and algolia), theme extension.

containers, math, createMarkdownRenderer.

deprecations still visible in 1.6.4.

Version-specific changes

Prioritize these when touching old configs; details and citations in

migration.md:

target="_self" or target="_blank"

(https://github.com/vuejs/vitepress/blob/main/CHANGELOG.md).

longer accept link

(https://vitepress.dev/guide/migration-from-vitepress-0).

(CHANGELOG).

PageData.headers is empty unless enabled (CHANGELOG).

(dist/node/index.d.ts:1769-1786).

(dist/client/index.d.ts:79-83).

(dist/client/index.d.ts:36-38).

(types/shared.d.ts:119-124).

(dist/client/index.d.ts:96-103), outlineTitle, lastUpdatedText,

algolia theme options (types/default-theme.d.ts:36-77,139-141).

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.