nuxt4

Enforce secure Nuxt 4 server routes, rendering, and configuration practices.

3|1|Updated Dec 3, 2025
One-click install
npx skills add https://github.com/Probably-Group/Dev-AID --skill nuxt4
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nuxt4
Source: https://github.com/Probably-Group/Dev-AID/tree/main/.dev-aid/skills/expert/nuxt4
Command: npx skills add https://github.com/Probably-Group/Dev-AID --skill nuxt4

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents common Nuxt 4 security and reliability mistakes by enforcing safe patterns for server routes, runtime config, rendering, and data fetching.

Core Features & Use Cases

  • Server route safety: Validates request inputs and applies CSRF protection for state-changing endpoints to reduce vulnerability risk.
  • Runtime config correctness: Keeps secrets out of runtimeConfig.public while exposing only client-safe values.
  • SSR/XSS-safe rendering: Avoids unsafe v-html usage with untrusted SSR content and recommends sanitization when HTML is required.
  • Nuxt 4 implementation patterns: Uses useFetch with typing and error handling, follows composables/ conventions, and applies Nuxt 4 directory structure and middleware best practices.
  • Use Case: You are implementing authentication-protected endpoints plus SSR pages in a Nuxt 4 app and want consistent validation, secure config handling, and robust fetching behavior without brittle ad-hoc code.

Quick Start

Ask your AI to generate Nuxt 4 server routes and page code that validate every input with Zod, keep secrets out of runtimeConfig.public, protect state-changing operations with CSRF, and fetch data using typed useFetch with proper loading and error handling.

Frequently Asked Questions about nuxt4

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate server route inputs in Nuxt 4?

Nuxt 4 server route validation uses Zod schemas to parse and verify request data before processing endpoints. This enforces safe server route handling by rejecting invalid payloads and reducing vulnerability risk across your SSR pages and API routes.

What is the best way to keep secrets out of public runtime config in Nuxt 4?

Nuxt 4 runtime config correctness requires placing secrets in the private runtimeConfig object rather than runtimeConfig.public. This restricts sensitive values to the server while exposing only client-safe configuration to the browser environment.

How do I add CSRF protection to state-changing server routes in Nuxt 4?

CSRF protection for Nuxt 4 server routes requires applying CSRF checks to state-changing endpoints like POST or PUT requests. This server route safety measure validates request origins to prevent cross-site request forgery vulnerabilities on mutating operations.

Does Nuxt 4 SSR need sanitized HTML to prevent XSS vulnerabilities?

Nuxt 4 SSR requires XSS-safe rendering by avoiding unsafe v-html usage with untrusted server-side rendered content. To prevent XSS vulnerabilities, you must sanitize HTML inputs before rendering them or avoid injecting untrusted data into the DOM.

How do I implement typed useFetch data fetching in Nuxt 4?

Typed useFetch data fetching in Nuxt 4 follows composables conventions with TypeScript typing and proper error handling. This pattern ensures robust fetching behavior across SSR pages and hybrid rendering setups without relying on brittle ad-hoc code.