Skip to content
/

vitepress-plugin-openspec

vitepress-plugin-openspec · stritti/vitepress-plugin-openspec · ★ 0 · last commit 2026-05-12

Render an OpenSpec directory as structured VitePress documentation pages with auto-generated sidebar and nav.

Best whenOpenSpec documentation should integrate seamlessly into existing VitePress sites via a single withOpenSpec() wrapper.
vs seeds
openspeccontent to VitePress pages. The nearest conceptual…
Primitive shape
No installable primitives
00

Summary

vitepress-plugin-openspec — Summary

@stritti/vitepress-plugin-openspec is a VitePress plugin that renders an OpenSpec directory as structured documentation pages — specs, changes, and artifacts — integrated into a VitePress site with auto-generated sidebar navigation and nav entries. It ships a withOpenSpec higher-order config wrapper that handles page generation, the Vite live-reload plugin, nav injection, and sidebar injection in a single call. The plugin reads the openspec/ directory, generates Markdown pages (one per spec, one per change, one per archive), and emits them to disk before VitePress scans for routes. It supports both simple withOpenSpec({}) wrapping and advanced manual setup with lower-level generateOpenSpecPages, generateOpenSpecSidebar, and openspecNav APIs. There are no prompts, skills, hooks, or agent orchestration — this is a documentation pipeline plugin.

differs_from_seeds: No seed framework integrates OpenSpec content into a VitePress documentation site. The closest seed is agent-os which manages markdown documents, but agent-os targets Claude Code context injection, not public documentation generation. This plugin is exclusively a build-time documentation tool with no LLM interaction surface.

01

Overview

vitepress-plugin-openspec — Overview

Origin

Published by Stephan Strittmatter (stritti) under MIT license. Version 0.3.1 as of analysis date. Uses semantic-release for automated publishing. Actively maintained (last commit 2026-05-12).

Philosophy

From the README: "A VitePress plugin that renders your project's OpenSpec folder as structured documentation pages — specs, changes, and artifacts — with sidebar and nav integration."

The design principle is zero-friction integration via the withOpenSpec wrapper: "withOpenSpec handles everything in one call: page generation, the Vite plugin for live reload, the nav entry, and the sidebar section. All fields are optional — it works with an empty config object and sensible defaults."

The plugin takes a "progressive enhancement" approach — if the openspec/ directory doesn't exist, it emits a warning and skips silently without breaking the VitePress build.

Manifesto-style statements

  • "Missing directory — if specDir does not exist the plugin emits a console.warn and skips page generation, nav, and sidebar. No error is thrown and your VitePress build continues normally."
  • "Other Vite plugins go into vite.plugins as usual — withOpenSpec appends to the array without replacing it."

Target user

Teams that use VitePress for project documentation and want to include their OpenSpec specs and changes as browsable documentation pages, automatically generated from the openspec/ directory.

02

Architecture

vitepress-plugin-openspec — Architecture

Distribution

  • npm package: @stritti/vitepress-plugin-openspec (v0.3.1)
  • ESM + CJS dual output via tsup

Install methods

npm install @stritti/vitepress-plugin-openspec
# or
bun add @stritti/vitepress-plugin-openspec

Tech stack

  • Language: TypeScript (compiled to ESM + CJS via tsup)
  • Dependencies: js-yaml, picocolors
  • Peer dependencies: vite>=5.0.0, vitepress>=1.0.0
  • Build: tsup (dual output)
  • Tests: vitest
  • Release: semantic-release with GitHub + npm plugins

Directory structure

vitepress-plugin-openspec/
├── src/
│   ├── index.ts       # Public exports
│   ├── plugin.ts      # Vite plugin + withOpenSpec + generateOpenSpecPages
│   ├── utils.ts       # generateOpenSpecSidebar, openspecNav, page generators
│   ├── types.ts       # TypeScript types
│   └── __tests__/
├── dist/              # Compiled output
├── docs/              # VitePress docs site (uses itself)
├── openspec/          # OpenSpec directory (dogfood)
└── tsup.config.ts

API surface

// Simple (recommended)
import { withOpenSpec } from '@stritti/vitepress-plugin-openspec'
export default defineConfig(withOpenSpec({ /* vitepress config */ }))

// Advanced (manual control)
import openspec, {
  generateOpenSpecPages,
  generateOpenSpecSidebar,
  openspecNav,
} from '@stritti/vitepress-plugin-openspec'

Options

Option Type Default Description
specDir string './openspec' Path to OpenSpec directory
outDir string 'openspec' Output directory relative to VitePress srcDir
srcDir string process.cwd() VitePress source directory
nav boolean true Prepend nav entry
sidebar boolean true Inject sidebar section

Required runtime

  • node>=18.0.0
  • bun>=1.1.0 (optional, for dev)
  • vite>=5.0.0, vitepress>=1.0.0 (peer)
03

Components

vitepress-plugin-openspec — Components

Exported functions

withOpenSpec(config, options?) — primary API

  • Wraps a VitePress defineConfig call
  • Calls generateOpenSpecPages before VitePress route scanning
  • Appends openspec() Vite plugin to vite.plugins
  • Injects nav entry into themeConfig.nav
  • Injects sidebar section into themeConfig.sidebar

openspec(options?) — Vite plugin

  • Provides live-reload watching of the openspec/ directory
  • Triggers page regeneration when spec files change

generateOpenSpecPages(options?) — page generation

  • Reads openspec/ directory
  • Generates per-spec Markdown pages at outDir/specs/<name>/index.md
  • Generates specs index at outDir/specs/index.md
  • Generates per-change Markdown pages (active + archived)
  • Generates changes index at outDir/changes/index.md
  • Generates root index at outDir/index.md

generateOpenSpecSidebar(specDir, options?) — sidebar generation

  • Returns VitePress sidebar configuration object for the OpenSpec section

openspecNav(specDir, options?) — nav entry

  • Returns a single VitePress nav item pointing to the OpenSpec section

Key types

  • OpenSpecFolder — parsed representation of an openspec/ directory
  • Change, ChangeArtifact, CapabilitySpec — domain types
  • OpenSpecPluginOptions{specDir, outDir, srcDir, nav, sidebar}
  • WithOpenSpecOptions — extends OpenSpecPluginOptions with VitePress config fields

No AI-facing primitives

Zero commands, skills, hooks, subagents, or MCP servers.

05

Prompts

vitepress-plugin-openspec — Prompts

This plugin ships no prompt files. It is a documentation build plugin with no LLM interaction surface.

No AI interaction

The plugin reads OpenSpec Markdown files and transforms them into VitePress Markdown pages. No LLM is invoked at any point.

Verdict: Not applicable. No prompting occurs in this framework.

09

Uniqueness

vitepress-plugin-openspec — Uniqueness & Positioning

differs_from_seeds

No seed framework produces public documentation from OpenSpec content. This plugin targets the documentation publishing use case — turning openspec/ into a VitePress docs site — which none of the 11 seeds address. The closest seed in methodology is agent-os (manages structured markdown files), but agent-os targets Claude Code context injection (agent instructions), not published documentation. vitepress-plugin-openspec is entirely a build-time documentation tool with zero LLM interaction.

Positioning

  • Category: OpenSpec ecosystem — documentation publishing
  • User: Teams that maintain VitePress documentation sites and want to include their spec-driven development content as browsable, navigable pages
  • Integration: Drop-in VitePress plugin added to .vitepress/config.ts
  • Value: Zero-configuration OpenSpec → VitePress documentation pipeline with live reload

Observable failure modes

  1. Page generation must precede defineConfig: If generateOpenSpecPages is called inside defineConfig, VitePress may have already scanned routes, missing the generated pages
  2. specDir resolution: Relative paths resolved from process.cwd(), which may not match expectations when config.ts is in a subdirectory — README recommends path.resolve(__dirname, '../../openspec')
  3. Generated files may conflict: If the outDir overlaps with manually authored docs content, generated files will overwrite
  4. VitePress version sensitivity: Depends on vitepress>=1.0.0 API stability

Cross-references

  • Depends on: OpenSpec file structure
  • Complementary to: spek (which provides an interactive viewer), openspec-badge-action (which generates CI badges)
  • Same ecosystem niche as the GitHub Action variant of spek — both convert OpenSpec to static docs, but this plugin integrates with an existing VitePress site while spek's Action generates a standalone static site
04

Workflow

vitepress-plugin-openspec — Workflow

Build-time workflow

Phase Actor Action Artifact
1 — Config load VitePress Loads docs/.vitepress/config.ts Plugin initialized
2 — Page generation Plugin generateOpenSpecPages writes .md files docs/openspec/**/*.md
3 — Route scan VitePress Scans srcDir for .md files Routes including generated OpenSpec pages
4 — Build VitePress/Vite Normal VitePress build Static site with OpenSpec documentation

Dev mode workflow

Phase Actor Action Artifact
1 — Start dev server VitePress vitepress dev docs/ Dev server running
2 — Vite plugin watches Plugin openspec() Watch openspec/ for changes File watcher active
3 — File change Developer Edit spec or change file Watch event fires
4 — Regenerate Plugin Re-run generateOpenSpecPages Updated .md files
5 — HMR Vite Hot module replacement Browser updates

Approval gates

None.

Phase-to-artifact map

Phase Artifact
Page generation outDir/specs/, outDir/changes/, outDir/index.md
Sidebar generation VitePress sidebar config object
Nav generation VitePress nav item
Build Static HTML site

Key constraint

generateOpenSpecPages must be called before defineConfig (i.e., at module evaluation time) so that the generated .md files exist before VitePress scans the srcDir for routes. The withOpenSpec wrapper handles this automatically.

06

Memory Context

vitepress-plugin-openspec — Memory & Context

State storage

None at runtime. The plugin reads openspec/ files and writes generated .md files at build time. No persistent state.

Persistence

Generated .md files in outDir/ are build artifacts that may be gitignored or committed depending on the project's choice.

Cross-session handoff

Not applicable. Each VitePress build is independent.

Context compaction

Not applicable. No LLM context involved.

07

Orchestration

vitepress-plugin-openspec — Orchestration

Multi-agent support

None.

Orchestration pattern

Sequential (Vite plugin lifecycle: config resolution → page generation → build → dev-server watch).

Isolation mechanism

None.

Multi-model support

None.

Execution mode

One-shot (build) or event-driven (dev mode file watcher).

Subagents

None.

Crash recovery

None needed. VitePress builds are idempotent.

08

Ui Cli Surface

vitepress-plugin-openspec — UI & CLI Surface

CLI binary

None. The plugin is consumed as an npm package integrated into VitePress configuration.

Local UI surface

None at the plugin level. The output is documentation pages rendered by VitePress — the plugin enables a documentation site that includes OpenSpec content.

VitePress integration surface

  • Nav integration: Automatic openspec nav entry added to themeConfig.nav
  • Sidebar integration: Automatic sidebar section for specs and changes
  • Live reload: Vite plugin watches openspec/ for changes in dev mode

Output site structure

<docs-site>/
  openspec/
    index.md          — root index
    specs/
      index.md        — specs listing
      <spec-name>/
        index.md      — per-spec page
    changes/
      index.md        — changes listing
      <change-name>/
        index.md      — per-change page (active)
      archive/
        <change-name>/
          index.md    — per-archived-change page

Observability

  • console.warn when specDir not found (non-fatal)
  • Standard VitePress build output / error reporting

IDE integration

None. Works with any editor that supports VitePress development.

Related frameworks

same archetype · same primary tool · same memory type

BMAD-METHOD ★ 48k

Provides a full agile delivery lifecycle with named expert-persona AI collaborators that elicit the human's best thinking rather…

Agent OS ★ 4.6k

Extracts implicit codebase conventions into token-efficient markdown standards files and injects them selectively into AI agent…

Claude Conductor ★ 367

Gives Claude Code a persistent, cross-linked, auto-analyzed documentation system so it retains codebase context across sessions.

Spec-Driver (Greenfield Spec-Driven Development) ★ 25

Prevents spec rot in AI-assisted development by making implementation changes flow back into evergreen, authoritative specs via…

Anthropic Knowledge Work Plugins ★ 16k

Role-specialized plugin bundles with live MCP connectors that turn Claude into a domain expert for enterprise knowledge workers.

Codex Integration for Claude Code (skill-codex) ★ 1.3k

Single Claude Code skill that handles Codex CLI invocation correctly (stdin blocking, thinking token suppression, session resume)…