vue-router

Standardize Vue Router 4 routes, lazy loading, guards, and RouteMeta typing.

Updated Mar 1, 2026
One-click install
npx skills add https://github.com/CloudyWing/ai-dotfiles --skill vue-router-cloudywing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vue-router
Source: https://github.com/CloudyWing/ai-dotfiles/tree/main/skills/vue-router
Command: npx skills add https://github.com/CloudyWing/ai-dotfiles --skill vue-router-cloudywing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a clear, consistent set of rules and patterns for designing Vue Router 4 routes, navigation guards, lazy-loaded components, and type-safe route metadata so teams avoid oversized bundles, inconsistent navigation behavior, and runtime typing errors.

Core Features & Use Cases

  • Route design & naming conventions: Standardizes path kebab-case, PascalCase route names, and view filename conventions to keep route maps predictable and maintainable.
  • Lazy loading and module structure: Enforces dynamic imports for page components and suggests modular route files to enable code-splitting and easier scaling in large projects.
  • Navigation guards & auth patterns: Prescribes global, route-level, and in-component guard patterns including safe Pinia usage and redirect behaviors for auth and role-based access.
  • Type-safe RouteMeta & props handling: Recommends augmenting RouteMeta in a dedicated TypeScript file and using props function modes for correct parameter typing and conversion.

Quick Start

Apply the vue-router skill to review and refactor the project's router configuration to use dynamic imports, typed RouteMeta augmentation, consistent route naming, and appropriate navigation guards.

Frequently Asked Questions about vue-router

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

FAQPage Schema
How do I enforce Vue Router 4 lazy loading and navigation guards consistently?

To enforce Vue Router 4 lazy loading and navigation guards consistently, standardize route definitions using dynamic imports for page components and apply prescribed global, route-level, or in-component guard patterns for secure auth flows.

What is the best way to type Vue Router RouteMeta in TypeScript?

The best way to type Vue Router RouteMeta in TypeScript is by augmenting the RouteMeta interface in a dedicated TypeScript file, ensuring correct parameter typing and conversion across your application.

How do I structure large Vue 3 route modules for code-splitting?

Structure large Vue 3 route modules for code-splitting by enforcing dynamic imports for page components and organizing routes into modular files, ensuring predictable path kebab-case and PascalCase route names.

Can I use Pinia state management with Vue Router navigation guards?

Yes, you can use Pinia state management with Vue Router navigation guards by applying prescribed safe Pinia usage patterns within global, route-level, or in-component guards to handle redirects and role-based access.

Does Vue Router 4 props function mode work with dynamic route parameters?

Yes, Vue Router 4 props function mode works with dynamic route parameters by allowing correct parameter typing and conversion, passing them as props to components for predictable and type-safe navigation behavior.

How do I standardize Vue Router route naming conventions across a project?

Standardize Vue Router route naming conventions across a project by enforcing path kebab-case, PascalCase route names, and consistent view filename conventions to keep route maps predictable and maintainable.