CLAUDE.md@website · git:20260213.23a148f · 2026-02-13 · sha256 35b69cdf509a0e9f

CLAUDE.md@website git:20260213.23a148fA

Immutable. This exact content is served forever at /api/v1/blob/35b69cdf509a0e9f.

# Website (VitePress Documentation Site)

## Commands

```bash
npm run docs:dev         # Dev server (auto-generates rule docs first)
npm run docs:build       # Production build
npm run docs:preview     # Preview production build locally
npm run docs:generate    # Regenerate rule docs from source metadata
```

## Auto-Generated Pages

**Do NOT hand-edit files in `website/rules/` — they are generated from rule metadata in `src/`.**

Run `npm run docs:generate` to regenerate. This creates:

- `rules/**/*.md` — one page per rule, from `rule.meta.docs`
- `rules/_sidebar.json` — sidebar nav structure
- `data/rule-stats.json` — rule counts used by `<RuleCount />` component

To change rule documentation, edit the rule's `meta.docs` fields in `src/rules/<category>/<rule-name>.ts`.

## Custom Vue Components

Available in `website/.vitepress/theme/components/`:

| Component | Purpose |
|-----------|---------|
| `<CodeTabs />` | Tabbed code examples |
| `<ConfigExample />` | Configuration file examples |
| `<FeatureGrid />` | Feature cards on landing page |
| `<RuleBadge />` | Severity/category badge for rules |
| `<RuleCard />` | Rule summary card |
| `<RuleCount />` | Dynamic rule count from `data/rule-stats.json` |
| `<RuleHeader />` | Standardized rule page header |
| `<TerminalDemo />` | Animated terminal on homepage |
| `<ValidatorDiagram />` | Validator architecture diagram |

Components are registered globally in `.vitepress/theme/index.ts`.

## Theme and Styling

- Config: `website/.vitepress/config.mts`
- Main CSS: `website/.vitepress/theme/style.css`
- Syntax themes: `claude-light.json`, `claude-dark.json`
- Design: warm Anthropic-inspired palette with terracotta accent
- Heading font: Source Serif 4 (loaded from Google Fonts)
- CSS custom properties override VitePress defaults (`--vp-c-brand-*`, `--vp-c-bg-*`, etc.)

## Linting

Website files have their own lint targets:

- **Vue**: `npm run lint:vue` (ESLint with vue-eslint-parser)
- **CSS**: `npm run lint:css` (Stylelint)
- **Markdown**: runs under the global `npm run lint:md`

## Frozen Legacy Docs

**NEVER edit files in `docs/`.** That directory is frozen legacy content scheduled for deletion. All documentation lives here in `website/`.