vite-doctor

vite-doctor is a cursor rule for Cursor from YuDefine/nuxt-supabase-starter. It costs 0 tokens per session (1,082 once invoked), scanned A, original, MIT.

A configuration rule for Vite Doctor, a scanner for Vue, Nuxt, Vite, and Nitro projects that checks for common issues such as routing and security problems.

In plain words
What is it for?
It helps install and enable the scanner, wire in shared checks, and require its diagnostic command to pass in continuous integration.
Why use it?
It prevents teams from believing the scanner uses their intended rules when the project module or configuration is not actually connected.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/. Also seen: mentions Codex.

Good fit It helps install and enable the scanner, wire in shared checks, and require its diagnostic command to pass in continuous integration.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/yudefine/nuxt-supabase-starter/vite-doctor
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/YuDefine/nuxt-supabase-starter

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for vite-doctor

README.md
[![agentmods](https://agentmods.dev/badge/rules/yudefine/nuxt-supabase-starter/vite-doctor/github.svg)](https://agentmods.dev/rules/yudefine/nuxt-supabase-starter/vite-doctor)
Your own site
<a href="https://agentmods.dev/rules/yudefine/nuxt-supabase-starter/vite-doctor"><img src="https://agentmods.dev/badge/rules/yudefine/nuxt-supabase-starter/vite-doctor/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for vite-doctor

Your own site · 80×15
<a href="https://agentmods.dev/rules/yudefine/nuxt-supabase-starter/vite-doctor"><img src="https://agentmods.dev/badge/rules/yudefine/nuxt-supabase-starter/vite-doctor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,082 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01082
Opus 5 $0.00000 $0.00541
Sonnet 5 $0.00000 $0.00216
Haiku 4.5 $0.00000 $0.00108

Measured yesterday against content hash d163ed8bb1e4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

vite-doctor scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

template/.cursor/rules/vite-doctor.mdc · 65 lines

How it starts

The opening of the file, as written. The whole thing — 65 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Vite Doctor(framework diagnostic scanner)

vite-doctor 掃描 Nuxt/Vue/Vite/Nitro 專案,在 review 前偵測 hydration、fetch、routing、security 等常見 bug。

MUST

  1. devDependency 必裝pnpm add -D vite-doctor/commit 0-C gate 會偵測 scripts.doctor 是否存在,缺裝直接 block commit,不是跳過)

  2. Nuxt consumer 必啟用 module:在 nuxt.config.ts 加入 vite-doctor/nuxt,使用 clade 共用 preset:

    import { doctorRules } from './vendor/doctor-shared/preset'
    
    export default defineNuxtConfig({
      modules: [
        ['vite-doctor/nuxt', { config: { rules: doctorRules } }],
      ],
    })
    

    import NEVER 帶 .ts 副檔名 —— nuxt.config.tsnuxi typecheck 的 program 內, 帶副檔名在 Nuxt 4.4.x 是 TS5097,會擋死所有 push(見 rules/core/code-style.md § 三條語法限制)。本行 2026-08-29 修正:原範例寫的是 preset.ts,與 preset 檔頭自己的 警告相反。

    接上 module 才算數,vendored 了 preset 不算。 Doctor CLI 只從 Nuxt manifest 的 doctorConfig 讀 rule 設定;module 沒接,那份 preset 就只是一個沒有人 import 的檔案,掃描跑的是 vite-doctor 內建預設。這個失敗靜默且反向:doctor 照跑、照打分、 照 exit 0/1,只是量的是別的規則集,而內建預設比 clade baseline 寬鬆的那幾格會讓分數更好看NEVER 從「doctor 有輸出」「分數很高」「CI 綠」推論 baseline 生效 —— 判定器是 scripts/audit-tooling-drift.ts 的 1c(doctorBaselineWiring)。

  3. CI gatepnpm run doctor 必須綠燈(--max-warnings 0)。MUSTrunNEVER 裸打 pnpm doctordoctor 撞 pnpm 內建子命令,裸打跑的是 pnpm 自家 doctor(檢查 pnpm 環境)並 silent exit 0,scripts.doctor 的掃描永遠不執行、errors 不被 enforce

  4. 覆寫規則須有理由:per-consumer override 只用於確實不適用的規則(如不使用 @nuxt/ui 時關閉 nuxt/ui/*

CLI

pnpm run doctor                        # 全掃 + CI gate(run 必要;裸 pnpm doctor 撞 pnpm 內建子命令)
pnpm run doctor --changed              # 只掃改動檔
pnpm run doctor --fix                  # 自動修 safe fixes
pnpm run doctor --rules "nuxt/hydration/*"  # 只跑特定規則

初始化的 scripts.doctor 使用 node vendor/doctor-shared/run.mjs。入口讀本專案已安裝 CLI 的 help,選擇舊版 scan 或新版 positional path,保留 --max-warnings 0 與附加參數。 缺少本地 binary 或無法辨識 CLI 時回非零;安裝檢查由 new-project-readiness gate 承接。

Read the full file on GitHub · 65 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday Changed · +5 lines d163ed8bb1e4
  2. 5d ago First seen · 60 lines · 0 tokens per session scan A 062c2a15e379

Subscribe to this mod's changes

vite-doctor is a cursor rule published in the GitHub repository YuDefine/nuxt-supabase-starter (45 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,082 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.