nuxt

A set of coding rules for Nuxt 3, a framework for building Vue web applications. It covers automatic imports, page routing, server endpoints, data loading, and shared state.

In plain words
What is it for?
Organizing Nuxt pages and server routes, writing reusable composables, fetching data with server-side rendering, managing shared state, and validating request input.
Why use it?
It gives an agent project-specific conventions so Nuxt code follows the expected structure and avoids common server-rendering problems.

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/cursorrules-collection/nuxt
Clone the repo
git clone --depth 1 https://github.com/nedcodes-ok/cursorrules-collection
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 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 $0.00424 $0.00424
Opus 5 $0.00212 $0.00212
Sonnet 5 $0.00085 $0.00085
Haiku 4.5 $0.00042 $0.00042

Measured yesterday 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 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

  • nuxt — 100% identical, 0 lines differ
rules-mdc/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. yesterday 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/cursorrules-collection (37 stars, last pushed 6mo 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. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.