/frontend:frontend-clean-architecturefrom frontend
Enforces domain/infrastructure layered architecture in frontend projects with features/{name}/domain + infrastructure structure. Covers strict dependency direction, domain models, repositories, services, mappers, and hooks as orchestrators.
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.
None: SKILL.md is the whole skill.
Apply only on projects that already have a features/<feature>/domain/ + infrastructure/ structure. If the project does not use this architecture, ask the user before applying these patterns.
src/
├── features/
│ └── <feature>/
│ ├── domain/ ← PURE: no React/Astro/fetch imports
│ │ ├── <feature>.model.ts types/interfaces for the domain
│ │ ├── <feature>.repository.ts SPI (interface) for data access
│ │ ├── <feature>.service.ts pure business logic (validation, calculations)
│ │ └── referentials/ constants and option lists
│ └── infrastructure/ ← IMPURE: external dependencies
│ ├── api/ repository implementations (fetch)
│ ├── mappers/ API ↔ domain transformations
│ ├── hooks/ React orchestration (state + side-effects)
│ └── components/ React components (Container + Presentation)
├── shared/
│ ├── domain/ cross-cutting types and errors (ApiError)
│ └── infrastructure/
│ └── components/ reusable UI components (Button, Input, Select)
├── pages/ Astro pages
├── layouts/ Astro layouts
└── styles/ global CSS + tokens
The domain layer stays testable without mocks and portable across frameworks only if it never depends on how data is fetched or rendered. So the dependency arrow points one way:
domain/ never imports from infrastructure/, React, Astro, or any external library — importing any of them would make domain logic depend on a rendering or fetching concern it doesn't need to know aboutinfrastructure/ can import from domain/ — it implements the interfaces and consumes the pure logic the domain definesshared/domain/ never imports from infrastructure/, for the same reason as domain/domain/)<feature>.model.ts): TypeScript types and interfaces describing domain concepts. No classes, no decorators, no framework types.<feature>.repository.ts): SPI (Service Provider Interface) — the domain defines WHAT data access it needs, not HOW. Uses Promise (standard JS, not a framework dependency).<feature>.service.ts): Pure functions only. No fetch, no useState, no side-effects. Input → output. Testable without mocks.referentials/*.referentials.ts): Constants and generator functions for option lists. A hardcoded list like YEARS = [2026, 2025, 2024] goes stale the day it ships; a generator function like getYearOptions() derives it from the current date instead.infrastructure/)api/<feature>.api-repository.ts): Implements the repository interface from domain. Contains fetch calls, error handling, HTTP concerns.mappers/<feature>.mapper.ts): The ONLY place where API types ↔ domain types transformation happens. Never transform inline in components or hooks.hooks/use<Feature>.ts): Orchestrate React state + domain services + repository calls. This is the "glue" between pure domain and impure React.components/): Follow Container/Presentation pattern (see frontend-component-patterns skill).| File | Pattern | Example |
|---|---|---|
| Model | <feature>.model.ts | receipt-form.model.ts |
| Repository interface | <feature>.repository.ts | receipt.repository.ts |
| Service | <concern>.service.ts | period.service.ts |
| Referential | <concern>.referentials.ts | payment.referentials.ts |
| API repository | <feature>.api-repository.ts | receipt.api-repository.ts |
| Mapper | <feature>.mapper.ts | receipt.mapper.ts |
| Hook | use<Feature>.ts | useReceiptForm.ts |
fetch() in a component → move to api/ repositoryparseFloat() or formatting logic inline in JSX → move to domain serviceYEARS = [2026, 2025, 2024] → use getYearOptions() generatorWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub fabiensalles/claude-marketplace --plugin frontend3 skills in this plugin
/frontend-best-practicesACTIVATE when modifying existing frontend components/styles (CSS/SCSS, Twig, HTML, React, Vue), when encountering visual bugs, or when the user describes multiple constraints that may conflict. ACTIVATE for 'modify existing', 'side effect', 'régression', 'existing component', 'composant existant', 'bug visuel', 'visual bug', 'devtools', 'inspection', 'contraintes Figma', 'too small', 'misaligned', 'pixel-perfect'. Covers: avoiding side effects on existing UI by adding-not-modifying, lifting incompatible constraints to the user before coding, autonomous visual debugging via Chrome DevTools MCP (never ask for inspectable sizes/colors/positions). DO NOT use for: clean-architecture decisions (see frontend-clean-architecture), Container/Presentation split (see frontend-component-patterns), Twig component rules (see symfony:twig-conventions), where JS/CSS/Twig live in Symfony (see symfony:symfony-frontend), or non-visual bug root-cause (see superpowers:systematic-debugging)./frontend-component-patternsACTIVATE when creating or refactoring React components, splitting large components, extracting hooks, or deciding Container vs Presentation. ACTIVATE for 'component split', 'Container/Presentation', 'extract hook', 'god component', 'prop drilling'. Covers: Container vs Presentation criteria, when to extract custom hooks (3+ related states), when to split markup (150+ lines), when to move logic to domain service, form section props convention, spotlight/opacity pattern. DO NOT use for: projects not using Container/Presentation (ask first), general React hooks API.Other plugins' skills for the same job