/add-protected-route
Create a protected Next.js route with authentication enforcement.
$ npx -y skills add LarouexNonprofitConsulting/larouex-fullstack-plugin --agent claude-codeShips with larouex-fullstack-builder. Installing the plugin gets this command.
How it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/add-protected-route
Context preview
What this command does when you run it.
Create a protected Next.js route with authentication enforcement.
Command definition
add-protected-route.mdCreate a protected Next.js route with authentication enforcement.
Generate:
- Protected page component with authentication check
- Middleware for route protection (middleware.ts pattern)
- Authentication state verification (server-side)
- Redirect logic to login page with return URL
- Loading state while checking authentication
- Unauthorized access handling
- TypeScript types for protected route props
- Higher-order component or wrapper for route protection
- API route protection with authentication middleware
- Role-based access control (RBAC) if needed
Implement both page-level protection (Server Components) and API route protection. Include proper error handling, loading states, and redirect logic. Ensure protected routes work with SSR and Client Components.
A comprehensive Claude Code plugin with 81 commands and 12 specialized AI agents for building modern, full-stack web applications with Next.js 15, Azure, Railway, Bootstrap, and TypeScript.
Repo: LarouexNonprofitConsulting/larouex-fullstack-plugin
Other commands on larouex-fullstack-builder.
- /add-admin-panel
Create basic admin dashboard with protected routes. Implement admin route protection with role-based access control. Create dashboard layout with sidebar navigation using Bootstrap. Add user management table with search and pagination. Implement CRUD operations for users:
Open command - /add-analytics-google
Integrate Google Analytics 4 for comprehensive tracking. Install gtag.js script in application layout. Create analytics wrapper hooks for type-safe event tracking. Implement automatic pageview tracking with Next.js router events. Add custom event tracking for business metrics:
Open command - /add-analytics-plausible
Integrate privacy-friendly Plausible Analytics for cookieless tracking. Add Plausible script to application layout with custom domain if configured. Implement automatic pageview tracking. Create custom event tracking hooks for user interactions. Set up goals in Plausible
Open command - /add-api-azure
Create a new Azure Function HTTP endpoint with full integration.
Open command - /add-api-railway
Create a new Express API endpoint with full integration.
Open command - /add-auth
Implement authentication system with comprehensive user management.
Open command

