Claude Skill

vite

Operate Vite projects: inspect versions and configuration, run bounded development and production builds, diagnose dependency and asset failures, and configure environment-aware frontend delivery. Use when a task names Vite, vite.config, Vite plugins, import.meta.env, dev-server

LLM Mart · 0 points · 12 views 0 listing impressions 0 install-command copies
Download magnus919-agent-skills-vite-d0edebb.zip · 12 KB

Install

skills CLI npx skills add https://github.com/magnus919/agent-skills/tree/main/vite
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install magnus919-agent-skills@llmmart
Git git clone https://github.com/magnus919/agent-skills.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole magnus919/agent-skills collection as a plugin from our marketplace. Git is the plain clone.

README

Vite Skill - Operate Vite projects safely

Why Install This Skill

Vite is fast, but small configuration mistakes can produce broken asset URLs, leaked client variables, inaccessible dev servers, or builds that only work from the repository root. This skill gives your agent a practical inspect, change, build, and verify workflow for Vite projects.

After installation, your agent can identify the real Vite and Node toolchain, reason about modes and import.meta.env, diagnose plugins and module resolution, validate base paths and output directories, and check the built artifact instead of treating an exit code as the whole result.

What You Get

Path Purpose
SKILL.md Vite operating contract, boundaries, workflow, and routing
references/config-and-environments.md Config, plugins, modes, env files, aliases, and public assets
references/build-and-deploy.md Production builds, asset paths, SPA hosting, and dependency failures
references/dev-server-and-diagnostics.md Dev server, proxy, preview, host safety, and troubleshooting
scripts/vite-doctor Bounded JSON diagnostic for Node, package manager, Vite, config, and env names
scripts/test_vite_doctor.py Deterministic tests for the diagnostic script
evals/evals.json Five output-quality evaluation cases

Quick Start

From a Vite project, run the diagnostic without exposing environment values:

/path/to/vite/scripts/vite-doctor --project . --json

Then use the package manager script already declared by the project:

npm run build
npm run preview

Triggers

Load this skill when a task involves:

  • vite, vite.config.*, Vite plugins, or a Vite migration
  • import.meta.env, modes, .env loading, or public assets
  • Vite dev server, proxy, preview, or host/port behavior
  • Production build failures, chunk output, base, or static deployment
  • Checking the installed Node, package manager, or Vite version

Requirements

  • Python 3.8+ for scripts/vite-doctor
  • Node.js and the project's package manager for Vite commands
  • A supported Vite version and framework plugin as declared by the project
  • Network access only when installing approved dependencies or consulting documentation

Skill manifest

Vite Operations

Use this skill for the Vite toolchain itself: project discovery, config and plugin behavior, environment loading, dev-server diagnostics, production builds, and asset/deployment boundaries. Keep application architecture and UI implementation with frontend-engineering, infrastructure and CI design with platform-engineering, browser tests with playwright, and accessibility implementation/review with web-accessibility.

Operating contract

  1. Discover before changing. Read package.json, lockfile, vite.config.*, tsconfig*.json, scripts, framework plugin, and deployment assumptions. Identify the package manager from the lockfile; do not invent a command.
  2. Check the actual toolchain. Run scripts/vite-doctor --json from this skill or the project root to capture Node, package-manager, Vite package, config, and environment evidence. A Vite version in documentation is not proof of the installed version.
  3. Keep configuration explicit. Review root, base, resolve.alias, plugins, server.host/port, preview, build.outDir, build.rollupOptions, and define. Treat define and import.meta.env as compile-time/public data; never place secrets in VITE_* variables or client bundles.
  4. Build before claiming success. Use the project's existing script (normally npm run build, pnpm build, yarn build, or bun run build) with a bounded timeout. Inspect output files and warnings, then exercise the built app at its deployed base path when possible.
  5. Treat mutations as gated. Read-only discovery may proceed. Before installing packages, editing config, deleting output, starting a server, or changing deployment settings, confirm the target, scope, and rollback path. Prefer a new output directory or version-controlled change and never overwrite a user's uncommitted work.
  6. Keep evidence bounded. Summarize logs and errors; do not paste .env contents, tokens, full bundles, or generated dependency trees.

Common workflow

  • New project or migration: verify Node and package manager, inspect the existing app entry point, choose the framework plugin, preserve the lockfile, and use the official Vite scaffold only when the target directory is empty or explicitly approved.
  • Config change: make the smallest change, explain why base and asset paths remain correct, and run a production build. Config files are executable code; do not load arbitrary config values into define.
  • Environment issue: distinguish .env, .env.local, mode-specific files, and process environment. Only variables prefixed VITE_ are exposed by default; restart the dev server after changes. Validate required values without printing their values.
  • Dev-server issue: check port/host/proxy and whether the request is same-origin. A server reachable from another device may require an explicit host and network policy review; do not expose it casually.
  • Build issue: capture the first actionable error, check plugin and Node/Vite compatibility, clear only reproducible caches after approval, and rerun the smallest failing command. Do not paper over a module-resolution failure with broad alias changes.
  • Deployment issue: confirm base, SPA fallback, static asset caching, and the hosting platform's output directory. A successful build does not prove deep links or client routing work.

Reference routing

Load when Reference
Config, plugins, modes, env variables, aliases, or public assets references/config-and-environments.md
Build output, dependency failures, performance, or deployment references/build-and-deploy.md
Dev server, proxy, preview, diagnostics, or safe operations references/dev-server-and-diagnostics.md

Verification boundary

A Vite task is complete when the requested config or artifact exists, the relevant command exits successfully, and the boundary is checked: build output for builds, a reachable route and assets for deployment, and user-visible browser behavior through playwright for E2E claims. State any untested browser, host, mode, or deployment assumption explicitly.

When not to use

  • Frontend component architecture, state, responsive UI, or general web implementation: frontend-engineering.
  • Infrastructure, CI runners, containers, hosting topology, or release policy: platform-engineering.
  • Authoring or operating browser automation: playwright.
  • WCAG audits, accessible interaction design, or semantic accessibility remediation: web-accessibility.
  • Rollup internals or a non-Vite bundler migration: use the relevant tool or methodology skill; Vite-specific behavior may still be consulted for an existing Vite project.
Files (agent-skills)
  • evals
    • evals.json 4.9 KB
      Loading…
  • references
    • build-and-deploy.md 2.4 KB
      Loading…
    • config-and-environments.md 2.8 KB
      Loading…
    • dev-server-and-diagnostics.md 1.8 KB
      Loading…
  • scripts
    • test_vite_doctor.py 3.9 KB
      Loading…
    • vite-doctor 4.8 KB · in bundle
  • README.md 2.2 KB
    # Vite Skill - Operate Vite projects safely
    
    ## Why Install This Skill
    
    Vite is fast, but small configuration mistakes can produce broken asset URLs, leaked client variables, inaccessible dev servers, or builds that only work from the repository root. This skill gives your agent a practical inspect, change, build, and verify workflow for Vite projects.
    
    After installation, your agent can identify the real Vite and Node toolchain, reason about modes and `import.meta.env`, diagnose plugins and module resolution, validate `base` paths and output directories, and check the built artifact instead of treating an exit code as the whole result.
    
    ## What You Get
    
    | Path | Purpose |
    |---|---|
    | `SKILL.md` | Vite operating contract, boundaries, workflow, and routing |
    | `references/config-and-environments.md` | Config, plugins, modes, env files, aliases, and public assets |
    | `references/build-and-deploy.md` | Production builds, asset paths, SPA hosting, and dependency failures |
    | `references/dev-server-and-diagnostics.md` | Dev server, proxy, preview, host safety, and troubleshooting |
    | `scripts/vite-doctor` | Bounded JSON diagnostic for Node, package manager, Vite, config, and env names |
    | `scripts/test_vite_doctor.py` | Deterministic tests for the diagnostic script |
    | `evals/evals.json` | Five output-quality evaluation cases |
    
    ## Quick Start
    
    From a Vite project, run the diagnostic without exposing environment values:
    
    ```sh
    /path/to/vite/scripts/vite-doctor --project . --json
    ```
    
    Then use the package manager script already declared by the project:
    
    ```sh
    npm run build
    npm run preview
    ```
    
    ## Triggers
    
    Load this skill when a task involves:
    
    - `vite`, `vite.config.*`, Vite plugins, or a Vite migration
    - `import.meta.env`, modes, `.env` loading, or public assets
    - Vite dev server, proxy, preview, or host/port behavior
    - Production build failures, chunk output, `base`, or static deployment
    - Checking the installed Node, package manager, or Vite version
    
    ## Requirements
    
    - Python 3.8+ for `scripts/vite-doctor`
    - Node.js and the project's package manager for Vite commands
    - A supported Vite version and framework plugin as declared by the project
    - Network access only when installing approved dependencies or consulting documentation
    
  • SKILL.md 5.7 KB
    ---
    name: vite
    description: >-
      Operate Vite projects: inspect versions and configuration, run bounded development
      and production builds, diagnose dependency and asset failures, and configure
      environment-aware frontend delivery. Use when a task names Vite, vite.config,
      Vite plugins, import.meta.env, dev-server behavior, or Vite build output. Do not
      use for frontend architecture or visual implementation (route to frontend-engineering),
      CI/platform provisioning (route to platform-engineering), browser automation
      (route to playwright), or accessibility design (route to web-accessibility).
    license: MIT
    compatibility: Requires Python 3.8+ for the bundled diagnostic script; Node.js and the project's package manager are required for Vite commands.
    metadata:
      source: https://vite.dev/guide/
      spec: https://vite.dev/config/
    ---
    
    # Vite Operations
    
    Use this skill for the Vite toolchain itself: project discovery, config and plugin behavior, environment loading, dev-server diagnostics, production builds, and asset/deployment boundaries. Keep application architecture and UI implementation with [frontend-engineering](../frontend-engineering/SKILL.md), infrastructure and CI design with [platform-engineering](../platform-engineering/SKILL.md), browser tests with [playwright](../playwright/SKILL.md), and accessibility implementation/review with [web-accessibility](../web-accessibility/SKILL.md).
    
    ## Operating contract
    
    1. **Discover before changing.** Read `package.json`, lockfile, `vite.config.*`, `tsconfig*.json`, scripts, framework plugin, and deployment assumptions. Identify the package manager from the lockfile; do not invent a command.
    2. **Check the actual toolchain.** Run `scripts/vite-doctor --json` from this skill or the project root to capture Node, package-manager, Vite package, config, and environment evidence. A Vite version in documentation is not proof of the installed version.
    3. **Keep configuration explicit.** Review `root`, `base`, `resolve.alias`, plugins, `server.host/port`, `preview`, `build.outDir`, `build.rollupOptions`, and `define`. Treat `define` and `import.meta.env` as compile-time/public data; never place secrets in `VITE_*` variables or client bundles.
    4. **Build before claiming success.** Use the project's existing script (normally `npm run build`, `pnpm build`, `yarn build`, or `bun run build`) with a bounded timeout. Inspect output files and warnings, then exercise the built app at its deployed base path when possible.
    5. **Treat mutations as gated.** Read-only discovery may proceed. Before installing packages, editing config, deleting output, starting a server, or changing deployment settings, confirm the target, scope, and rollback path. Prefer a new output directory or version-controlled change and never overwrite a user's uncommitted work.
    6. **Keep evidence bounded.** Summarize logs and errors; do not paste `.env` contents, tokens, full bundles, or generated dependency trees.
    
    ## Common workflow
    
    - **New project or migration:** verify Node and package manager, inspect the existing app entry point, choose the framework plugin, preserve the lockfile, and use the official Vite scaffold only when the target directory is empty or explicitly approved.
    - **Config change:** make the smallest change, explain why `base` and asset paths remain correct, and run a production build. Config files are executable code; do not load arbitrary config values into `define`.
    - **Environment issue:** distinguish `.env`, `.env.local`, mode-specific files, and process environment. Only variables prefixed `VITE_` are exposed by default; restart the dev server after changes. Validate required values without printing their values.
    - **Dev-server issue:** check port/host/proxy and whether the request is same-origin. A server reachable from another device may require an explicit host and network policy review; do not expose it casually.
    - **Build issue:** capture the first actionable error, check plugin and Node/Vite compatibility, clear only reproducible caches after approval, and rerun the smallest failing command. Do not paper over a module-resolution failure with broad alias changes.
    - **Deployment issue:** confirm `base`, SPA fallback, static asset caching, and the hosting platform's output directory. A successful build does not prove deep links or client routing work.
    
    ## Reference routing
    
    | Load when | Reference |
    |---|---|
    | Config, plugins, modes, env variables, aliases, or public assets | `references/config-and-environments.md` |
    | Build output, dependency failures, performance, or deployment | `references/build-and-deploy.md` |
    | Dev server, proxy, preview, diagnostics, or safe operations | `references/dev-server-and-diagnostics.md` |
    
    ## Verification boundary
    
    A Vite task is complete when the requested config or artifact exists, the relevant command exits successfully, and the boundary is checked: build output for builds, a reachable route and assets for deployment, and user-visible browser behavior through [playwright](../playwright/SKILL.md) for E2E claims. State any untested browser, host, mode, or deployment assumption explicitly.
    
    ## When not to use
    
    - Frontend component architecture, state, responsive UI, or general web implementation: [frontend-engineering](../frontend-engineering/SKILL.md).
    - Infrastructure, CI runners, containers, hosting topology, or release policy: [platform-engineering](../platform-engineering/SKILL.md).
    - Authoring or operating browser automation: [playwright](../playwright/SKILL.md).
    - WCAG audits, accessible interaction design, or semantic accessibility remediation: [web-accessibility](../web-accessibility/SKILL.md).
    - Rollup internals or a non-Vite bundler migration: use the relevant tool or methodology skill; Vite-specific behavior may still be consulted for an existing Vite project.
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.