Appearance
AGENTS.md (repo-specific guidance)
This repository is a VitePress documentation site for UniAPI. Use this file as the canonical “how to work here” reference for agentic coding.
1) Build / Lint / Test commands
Prereqs
- Node.js: VitePress requires Node >= 18 (this repo currently builds on Node 22.x).
- Package manager: repo ships
package-lock.json→ prefer npm.
Install deps
bash
npm ciDev server (fast feedback)
bash
npm run docs:dev
# default: http://localhost:5173VitePress CLI flags (preferred for help/flags):
bash
npx vitepress dev --help
npx vitepress dev --port 5173
npx vitepress dev --hostProduction build (primary verification)
bash
npm run docs:build
# output: .vitepress/distPreview built site
bash
npm run docs:preview
# default: http://localhost:4173Lint / Format
- Not configured (no ESLint / Prettier / Biome / etc.).
- Don’t introduce a linter/formatter as drive-by cleanup.
Tests
- Not configured (no Jest/Vitest/Playwright/etc.).
Running a single test
- N/A (no test runner installed).
- Validation strategy instead:
- Markdown/content changes:
npm run docs:dev .vitepress/config/theme changes:npm run docs:build(must pass)
- Markdown/content changes:
2) Code style guidelines (repo conventions)
No enforced formatter: keep diffs minimal and follow the local file’s style.
JavaScript / TypeScript
Module system
package.jsonhas"type": "module"→ ESM only (import/export).
Indentation / formatting
- Prefer 2-space indentation where practical.
- Quotes / semicolons are mixed → follow the file you are editing.
- Avoid “format churn” (especially in
.vitepress/theme/index.ts).
Imports
- Order imports as:
- External packages
- Local relative imports
- Side-effect imports (CSS)
- Use
import type { ... }for type-only imports.
Types / safety
- Prefer explicit types when a value crosses module boundaries.
- Avoid type suppression (
@ts-ignore,@ts-expect-error) unless there is no alternative.
Naming
- Follow existing conventions in the file.
- Typical expectations:
camelCasevariables/functionsPascalCaseVue components- Constants only
SCREAMING_SNAKE_CASEif the file already uses it
Error handling
- Avoid empty
catchblocks. - If you intentionally ignore an error, add a short comment explaining why.
Dynamic operations pages
operations/[operationId].mdreadsoperationIdfrom route params and renders<OAOperation ... />.operations/[operationId].paths.jsgenerates routes from the spec.
Markdown content conventions
Frontmatter
Most pages use YAML frontmatter; keep it consistent:
title,description,keywordsas neededlayout: docoutline: deeplastUpdated: true
Language
- Documentation is primarily Simplified Chinese.
Code fences
- Always specify a fence language (
bash,json,ts,js, …). - Prefer
bashovercurlas a fence language (build may fall back totxt).
Project layout (what lives where)
docs/— main documentation pagesintegration/— integration guides.vitepress/config.mts— VitePress site config.vitepress/theme/— theme customization + CSS vars
Build artifacts (don’t hand-edit):
.vitepress/cache.vitepress/dist
Repo-specific gotchas
npm run docs:dev -- --helpmay start the dev server.- Prefer:
npx vitepress --help/npx vitepress dev --help.
- Prefer:
- Keep changes in
.vitepress/theme/index.tstightly scoped. - Production build may warn about large chunks or unknown highlight languages; treat as warnings unless it breaks the build.
Cursor / Copilot rules
No Cursor/Copilot instruction files were found:
.cursorrules: not found.cursor/rules/: not found.github/copilot-instructions.md: not found
If added later, treat them as higher-priority instructions than this file.