Frontend Conventions

Document SvelteKit and Svelte 5 frontend development conventions.

1|Updated Mar 9, 2026
One-click install
npx skills add https://github.com/Emmanuelkwaa/NetRockTemplate --skill frontend-conventions-emmanuelkwaa
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Frontend Conventions
Source: https://github.com/Emmanuelkwaa/NetRockTemplate/tree/main/.claude/skills/frontend-conventions
Command: npx skills add https://github.com/Emmanuelkwaa/NetRockTemplate --skill frontend-conventions-emmanuelkwaa

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a standardized set of conventions and best practices for building SvelteKit/Svelte 5 frontends, ensuring consistency, maintainability, and developer efficiency.

Core Features & Use Cases

  • Project Structure Guidance: Defines a clear and organized directory layout for components, utilities, state management, and API interactions.
  • API Client & Auth Handling: Outlines patterns for creating a typed API client, managing authentication tokens, and handling errors gracefully.
  • Component Best Practices: Enforces rules for props, component organization, and integration with UI libraries like shadcn.
  • Styling & Theming: Mandates the use of logical CSS properties, mobile-first responsive design, and consistent theming.
  • Routing & Permissions: Details the flow for routing, server-side data loading, and implementing permission-based access control.
  • i18n & State Management: Provides guidelines for internationalization and managing reactive state.
  • Security: Specifies essential security headers and Content Security Policy (CSP) configurations.

Quick Start

Consult the frontend conventions skill for guidance on structuring your SvelteKit project and implementing its API client.

Frequently Asked Questions about Frontend Conventions

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

FAQPage Schema
How do I structure a SvelteKit project for maintainability?

SvelteKit project structure conventions define clear directory layouts separating components, utilities, state management, and API interactions. This ensures maintainability and developer efficiency by enforcing consistent frontend conventions across the application.

What's the best way to implement an API client in SvelteKit with TypeScript?

Implementing an API client in SvelteKit requires creating a strictly typed client that manages authentication tokens and handles errors gracefully. This enforces strict TypeScript configurations and prevents common API integration anti-patterns.

How do I manage authentication and permission guards in Svelte 5?

Authentication and permission guards in Svelte 5 are managed through routing middleware and server-side data loading flows. This approach implements permission-based access control while securely handling authentication tokens.

Does this frontend conventions skill cover responsive design and theming?

Yes, frontend conventions cover responsive design by mandating mobile-first principles and logical CSS properties. Theming is standardized to ensure consistent visual integration across components and UI libraries.

What security configurations should I apply to a SvelteKit application?

SvelteKit security configurations should specify essential security headers and Content Security Policy (CSP) settings. These conventions prevent vulnerabilities and ensure the frontend application adheres to strict security best practices.

Can I use shadcn UI components with these Svelte 5 best practices?

Yes, component best practices include integration rules for UI libraries like shadcn. The conventions enforce specific props handling and component organization to ensure smooth integration within Svelte 5 projects.