nuxt

A set of coding rules for Nuxt 3, a framework for building Vue web applications with server-side rendering and server routes. It covers automatic imports, pages, data loading, shared state, and server request handling.

In plain words
What is it for?
It is for creating Nuxt pages, API and server routes, composables, data-fetching logic, shared application state, input validation, cookies, and server errors.
Why use it?
It helps the coding agent use Nuxt 3's conventions consistently and avoid problems with server-rendered pages, shared state, and browser/server differences.

Cursor rule

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.

agentmods
npx agentmods add rules/nedcodes-ok/cursor-doctor/nuxt
Clone the repo
git clone --depth 1 https://github.com/nedcodes-ok/cursor-doctor
Per session 424 This file is loaded in full into every session.
When invoked 424 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod 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 $0.00424 $0.00424
Opus 5 $0.00212 $0.00212
Sonnet 5 $0.00085 $0.00085
Haiku 4.5 $0.00042 $0.00042

Measured 2d ago against content hash 5a7946ca4010, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

nuxt 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 2d ago.

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.

Origin

This is a copy

100% identical to nuxt — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

pro-kit/templates/frameworks/nuxt.mdc · 46 lines

What it actually says

Nuxt 3 Cursor Rules

You are an expert Nuxt 3 developer. Follow these rules:

Architecture

  • Auto-imports are on: dont manually import ref, computed, useState, useFetch
  • File-based routing in pages/. Use definePageMeta for middleware/layout
  • Server routes in server/api/ and server/routes/
  • Composables in composables/ are auto-imported — use them liberally

Data Fetching

  • useFetch for component-level data with SSR support
  • useAsyncData with custom fetch logic when useFetch is too simple
  • $fetch for client-only or server-side (event handlers, server routes)
  • Always provide a unique key to useAsyncData to avoid hydration mismatches
  • lazy: true for non-critical data, watch for reactive refetching

State

  • useState for SSR-safe shared state (replaces Vuex for simple cases)
  • Pinia for complex state management with devtools support
  • Never use ref() for shared state — it wont survive SSR hydration

Server

  • Server routes return data directly — Nuxt serializes automatically
  • Use defineEventHandler for all server routes
  • Validate input with getValidatedQuery/getValidatedBody + Zod
  • H3 utilities: getHeader, setCookie, createError for server logic
  • Throw createError({ statusCode: 404 }) — Nuxt shows error page

Performance

  • NuxtImg for optimized images with provider support
  • Route rules in nuxt.config for per-route caching/prerendering
  • useNuxtData for accessing cached data from other composables
  • Payload extraction for static sites — reduces JS bundle

Config

  • Runtime config (runtimeConfig) for env vars — never process.env in client
  • App config (app.config.ts) for build-time non-sensitive config
  • Layers for sharing config/components across projects
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. 2d ago First seen · 46 lines · 424 tokens per session scan A 5a7946ca4010

Subscribe to this mod's changes

nuxt is a cursor rule published in the GitHub repository nedcodes-ok/cursor-doctor (9 stars, last pushed 5mo ago), licensed MIT. It adds 424 tokens to every session, about $0.0021 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to nuxt, differing in 0 lines, and is treated as a copy.