Defines a Clean Architecture and reusable component structures for frontend projects. Organizes pages, tables, lists, item cards, subpages, and modal dialogs in a predictable, maintainable way across React, Vue, Svelte, or similar frameworks.
Ships in frontend. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This skill establishes a standard architecture and a component pattern for frontend, based on Clean Architecture. Its goal is to guarantee consistency, maintainability, and separation of concerns in projects of any size.
The architecture is organized in concentric layers, where dependencies point inward:
presentation layer (UI)
↓
use cases layer (business logic)
↓
repositories layer (abstractions)
↓
entities layer (domain models)
Recommended folder structure (React example):
src/
├── domain/ # Innermost layer: entities
│ ├── entities/ # models (e.g.: Product, User)
│ └── repositories/ # repository interfaces (e.g.: IProductRepository)
├── application/ # use cases (grouped by module when many)
│ └── useCases/
│ ├── products/
│ │ ├── GetProductsUseCase.ts
│ │ ├── CreateProductUseCase.ts
│ │ └── DeleteProductUseCase.ts
│ └── users/
│ ├── GetUsersUseCase.ts
│ └── CreateUserUseCase.ts
├── infrastructure/ # concrete repository implementations
│ └── repositories/ # (e.g.: ApiProductRepository, LocalStorageRepository)
├── presentation/ # outer layer: modules organized by feature
│ ├── products/
│ │ ├── ProductsPage.tsx
│ │ └── components/
│ │ ├── ProductsTable.tsx
│ │ ├── ProductCard.tsx
│ │ └── CreateProductDialog.tsx
│ ├── users/
│ │ ├── UsersPage.tsx
│ │ └── components/
│ │ ├── UsersTable.tsx
│ │ └── CreateUserDialog.tsx
│ ├── components/ # UI library components (e.g.: shadcn/ui)
│ │ └── ui/ # shadcn generated components (button, dialog, table, ...)
│ ├── lib/ # UI library helpers (e.g.: shadcn's utils.ts -> cn())
│ │ └── utils.ts
│ ├── shared/ # shared components across modules
│ │ └── components/
│ ├── hooks/ # hooks grouped by module when many
│ │ ├── products/
│ │ │ └── useProducts.ts
│ │ └── users/
│ │ └── useUsers.ts
│ └── contexts/ # if applicable
└── config/ # global configurations
UI library rule (shadcn, etc.): Any UI/component library that scaffolds its own folders (such as shadcn/ui) must live inside
presentation/, never at the root ofsrc/. This includes its components (presentation/components/ui/), itslib/helpers (e.g.:presentation/lib/utils.tswith thecn()function), and any other generated assets (styles, providers, config helpers). The reason: these are pure presentation concerns and must not leak intodomain/,application/, orinfrastructure/. Configure the library so its aliases point intopresentation/(e.g.: incomponents.jsonset"aliases.components": "@/presentation/components"and"aliases.utils": "@/presentation/lib/utils").
Rule: When a module grows in complexity (many use cases, hooks, components, repositories, etc.), all related files must be grouped in their own subfolder named after the module. This applies to any layer:
useCases/products/,hooks/products/,repositories/products/, etc. Keep everything organized by module to maintain clarity at scale.
All pages and their subcomponents must follow this structure:
Every screen follows this strict composition order:
Page
└─ Main component (Table / List / Cards) ← the primary content of the route
└─ Action buttons ← buttons that trigger secondary UI
├─ open Dialogs (create / edit / confirm)
└─ navigate to / mount other modules
└─ Other components (Dialogs, panels, drawers, ...)
Rules of the hierarchy:
Dialog, navigate, or mount
another module's component.If a Dialog already exists for a given purpose (e.g.: a confirmation dialog, a generic form dialog, an entity create/edit dialog), reuse it instead of creating a new one.
components/ or in presentation/shared/components/.presentation/shared/components/ and import it from there.ConfirmDialog, FormDialog) must be parameterized
via props (title, fields, callbacks) so a single component covers every case instead
of duplicating near-identical dialogs.A page is a component that contains the complete structure of a route. It never contains domain logic, only use case orchestration and composition of child components.
React example:
// presentation/products/ProductsPage.tsx
import { useProducts } from "../hooks/products/useProducts";
import { ProductsTable } from "./components/ProductsTable";
import { CreateProductDialog } from "./components/CreateProductDialog";
import { useState } from "react";
export function ProductsPage() {
const { products, loading, addProduct, deleteProduct } = useProducts();
const [isDialogOpen, setIsDialogOpen] = useState(false);
return (
<div className="p-6">
<div className="flex justify-between items-center mb-4">
<h1 className="text-2xl font-bold">Products</h1>
<button
onClick={() => setIsDialogOpen(true)}
className="bg-blue-600 text-white px-4 py-2 rounded"
>
+ Add product
</button>
</div>
{loading ? (
<div>Loading...</div>
) : (
<ProductsTable products={products} onDelete={deleteProduct} />
)}
<CreateProductDialog
open={isDialogOpen}
onClose={() => setIsDialogOpen(false)}
onSave={addProduct}
/>
</div>
);
}
Every table or list must be an independent component. It receives data and callbacks as props. It never fetches directly.
Example:
// presentation/products/components/ProductsTable.tsx
interface Product {
id: string;
name: string;
price: number;
}
interface Props {
products: Product[];
onDelete: (id: string) => void;
}
export function ProductsTable({ products, onDelete }: Props) {
return (
<table className="w-full border">
<thead>
<tr>
<th>Name</th>
<th>Price</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{products.map((p) => (
<tr key={p.id}>
<td>{p.name}</td>
<td>{p.price}</td>
<td>
<button onClick={() => onDelete(p.id)}>Delete</button>
</td>
</tr>
))}
</tbody>
</table>
);
}
If a list with cards is used instead of a table, each item goes in its own component.
// presentation/products/components/ProductCard.tsx
export function ProductCard({ product, onDelete }: Props) {
return (
<div className="border rounded p-4 shadow">
<h3>{product.name}</h3>
<p>${product.price}</p>
<button onClick={() => onDelete(product.id)}>Delete</button>
</div>
);
}
If a page has a subpage (e.g.: ProductDetailPage inside the products module), it follows the same pattern: it's called Page, is composed of components (tables, cards, dialogs), and is placed inside its module folder.
Example:
// presentation/products/ProductDetailPage.tsx
export function ProductDetailPage() {
return (
<div>
<h1>Product Detail</h1>
<ProductInfo />
<RelatedProductsList />
</div>
);
}
Any creation or editing form must go inside a Dialog (modal). The dialog is an independent component that receives open, onClose, onSave.
Example:
// presentation/products/components/CreateProductDialog.tsx
interface Props {
open: boolean;
onClose: () => void;
onSave: (product: Omit<Product, "id">) => void;
}
export function CreateProductDialog({ open, onClose, onSave }: Props) {
const [name, setName] = useState("");
const [price, setPrice] = useState(0);
const handleSubmit = (e: React.FormEvent) => {
e.preventDefault();
onSave({ name, price });
onClose();
setName("");
setPrice(0);
};
if (!open) return null;
return (
<div className="fixed inset-0 bg-black/50 flex items-center justify-center">
<div className="bg-white p-6 rounded-lg w-96">
<h2>Create Product</h2>
<form onSubmit={handleSubmit}>
<input
type="text"
placeholder="Name"
value={name}
onChange={(e) => setName(e.target.value)}
className="w-full border p-2 mb-2"
/>
<input
type="number"
placeholder="Price"
value={price}
onChange={(e) => setPrice(Number(e.target.value))}
className="w-full border p-2 mb-4"
/>
<div className="flex justify-end gap-2">
<button type="button" onClick={onClose}>
Cancel
</button>
<button
type="submit"
className="bg-blue-600 text-white px-4 py-2 rounded"
>
Save
</button>
</div>
</form>
</div>
</div>
);
}
Hooks act as a bridge between the UI and use cases. They contain state and call use cases.
// presentation/hooks/products/useProducts.ts
import { useEffect, useState } from "react";
import { GetProductsUseCase } from "../../../application/useCases/products/GetProductsUseCase";
import { CreateProductUseCase } from "../../../application/useCases/products/CreateProductUseCase";
import { DeleteProductUseCase } from "../../../application/useCases/products/DeleteProductUseCase";
import { Product } from "../../domain/entities/Product";
export function useProducts() {
const [products, setProducts] = useState<Product[]>([]);
const [loading, setLoading] = useState(true);
const getProductsUseCase = new GetProductsUseCase(/* repository */);
const createProductUseCase = new CreateProductUseCase(/* repository */);
const deleteProductUseCase = new DeleteProductUseCase(/* repository */);
useEffect(() => {
getProductsUseCase
.execute()
.then(setProducts)
.finally(() => setLoading(false));
}, []);
const addProduct = async (product: Omit<Product, "id">) => {
const newProduct = await createProductUseCase.execute(product);
setProducts((prev) => [...prev, newProduct]);
};
const deleteProduct = async (id: string) => {
await deleteProductUseCase.execute(id);
setProducts((prev) => prev.filter((p) => p.id !== id));
};
return { products, loading, addProduct, deleteProduct };
}
Dialog.components/ subfolder.components/ui/), their lib/ helpers (utils.ts / cn()), styles and config helpers — always live inside presentation/, never at the root of src/ nor in domain/, application/, or infrastructure/.Page → main component (Table/List/Cards) + buttons → the Dialogs / modules those buttons open. Buttons only open Dialogs, navigate, or mount other modules; they hold no logic.presentation/shared/components/ and generic ones (ConfirmDialog, FormDialog) are parameterized via props.When the user asks to create a new page, automatically generate:
presentation/{module}/{Module}Page.tsx (with layout, title, add button, and hook usage)presentation/{module}/components/{Module}Table.tsx or {Module}List.tsxpresentation/{module}/components/{Module}Dialog.tsx (for create/edit)presentation/hooks/use{Module}.ts (with corresponding use cases)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
React, Vue, Svelte, TypeScript
3 skills in this plugin
/brand-guidelinesApplies brand colors and typography to any artifact requiring visual styling. Use it when brand colors, style guidelines, visual formatting, or design standards apply. Works with any brand palette, not just Anthropic's./frontend-designCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.Other plugins' skills for the same job
/frontend:frontend-architecturefrom frontend
npx claudepluginhub erikaax08/erikas-skills --plugin frontend