frontend-architecture
Skill1 starsChanged 6 days agoMITView on GitHub
Design frontend architecture — React component hierarchy, state management, design tokens, data fetching, routing, error boundaries, code organization. Triggers: component architecture, state management, design system, design tokens, component library, React structure, folder structure, Zustand vs Redux, React Query, code splitting, error boundary, compound component.
15 other projects use a version of this.
Adopted by
Most recently taken up by
- veegres/ivorytheir own version, first seen Nov 9, 2026
- harshitsinghbhandari/domain-expansiontheir own version, first seen Nov 8, 2026
- DnsQueen/orcinus-skillstheir own version, first seen Nov 8, 2026
- ErikaAX08/erikas-skillstheir own version, first seen Nov 8, 2026
- hushh-labs/hushh-researchtheir own version, first seen Nov 1, 2026
- nimadorostkar/Claude-Skills-collectiontheir own version, first seen Oct 13, 2026
Used with
Projects with it also use backend-architecture, mobile-design and 6 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
GoldenWing-360Skillbackend-architecture
Design backends that survive redeploys, server reboots, and modest scaling. Covers stateless application servers, state placement (object storage, managed databases, Redis), immutable deploy artifacts, health checks, graceful shutdown, database migrations that don't lock the world, and the twelve-factor baseline. Invoke when designing a new backend, when uploads disappear after a redeploy, or when productionizing a vibe-coded prototype.
Also in 3 projects that use this
xenitV1Skillmobile-design
Mobile-first design thinking and decision-making for iOS and Android apps. Touch interaction, performance patterns, platform conventions. Teaches principles, not fixed values. Use when building React Native, Flutter, or native mobile apps.
Also in 3 projects that use this
harrissohail6Skilldatabase-design
Database schema design and SQL best practices. Use when designing tables, writing queries, or optimizing database performance.
Also in 3 projects that use this
xenitV1Skillclean-code
Pragmatic coding standards - concise, direct, no over-engineering, no unnecessary comments
Also in 3 projects that use this
AnthropicSkillarchitecture
Create or evaluate an architecture decision record (ADR). Use when choosing between technologies (e.g., Kafka vs SQS), documenting a design decision with trade-offs and consequences, reviewing a system design proposal, or designing a new component from requirements and constraints.
Also in 3 projects that use this
JetBrainsSkillwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
Also in 3 projects that use this
Other versions15 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 15
- vudovn/ag-kit★ 8.2ksame name
- vudovn/antigravity-kit★ 8.2ksame name
- veegres/ivory★ 282same name
- hushh-labs/hushh-research★ 40same name
- nimadorostkar/Claude-Skills-collection★ 33same name
- microsoft/FSQ★ 23same name
- stareezy-1/frontend-architecture-skill★ 10same name
- ErikaAX08/erikas-skills★ 6same name
- harshitsinghbhandari/domain-expansion★ 2same name
- we-are-singular/skills★ 2same name
5 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository68 other files it gives its agents.
- AGENTS.mdAGENTS.md
- accessibility-designSkill
- ai-evaluationSkill
- api-designSkill
- architecture-designSkill
- architecture-documentationSkill
- brainstormingSkill
- browser-verificationSkill
- bug-investigatingSkill
- build-vs-buySkill
- cicd-pipelineSkill
- code-archaeologySkill
- code-reviewingSkill
- code-slop-cleanupSkill
- compliance-privacySkill
- configuration-strategySkill
- containerizationSkill
- data-modelingSkill
- data-pipeline-designSkill
- data-qualitySkill
- dependency-impact-analysisSkill
- dependency-managementSkill
- deployment-checklistSkill
- deployment-repoSkill
- dx-auditSkill
- effort-estimationSkill
- exploratory-data-analysisSkill
- feature-planningSkill
- finops-cost-optimizationSkill
- gitops-deliverySkill
- git-workflowSkill
- incident-responseSkill
- infrastructure-as-codeSkill
- llm-app-engineeringSkill
- metrics-and-okrsSkill
- ml-experiment-trackingSkill
- ml-model-deploymentSkill
- ml-pipeline-designSkill
- mobile-architectureSkill
- mobile-releaseSkill
- notebook-to-productionSkill
- observability-designSkill
- performance-optimizationSkill
- plan-executionSkill
- prd-writingSkill
- project-documentationSkill
- project-proposalSkill
- project-reviewSkill
- refactoringSkill
- release-managementSkill
- research-methodologySkill
- resilience-engineeringSkill
- retrospectiveSkill
- rollback-strategySkill
- security-auditSkill
- skill-routerSkill
- statistical-analysisSkill
- strategic-reviewSkill
- subagent-orchestrationSkill
- tdd-workflowSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. 0 are common, 7 are distinctive, and 6 are very specific to this project.
0
Common
Most of the 13 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Colocation over separation: Keep related things together.
- Very specific: line 47
Start from the UI design (or the screen spec from ui-ux-design) and decompose into components:
- Very specific: line 77
If it's only used in one component → useState
- Distinctive: line 78
If shared between parent/child → lift state up
- Distinctive: line 79
If shared across distant components but rarely changes → Context
- Distinctive: line 80
If it comes from the server → React Query / SWR / TanStack Query (NOT global store)
- Distinctive: line 81
If it's complex client state updated from many places → Zustand or Redux Toolkit
- Distinctive: line 82
If it should survive a page refresh → URL params or localStorage
- Very specific: line 110
Use tokens everywhere — never hardcode #3b82f6 or 16px in a component.
- Distinctive: line 126
Fetch at the route level: when possible. Components receive data as props, not fetch their own.
- Very specific: line 164
Use templates/folder-structure.md as a starting point — includes the full src/ layout, a co-located component template, design tokens, and …
- Very specific: line 178
KISS: Use useState until you need something more.
- Distinctive: line 181
YAGNI: Don't abstract until you have 2+ consumers.
“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Frontend Architecture
Design the technical structure of frontend applications — component hierarchy, state management, data fetching, and code organization. Good frontend architecture makes features easy to build, bugs easy to find, and the codebase easy to onboard into.
Core Principle
Colocation over separation. Keep related things together. A component's styles, tests, types, and stories should live next to the component, not in separate /styles, /tests, /types directories. Separation by file type creates coupling across the filesystem; separation by feature creates independence.
Workflow
Step 0: Inventory What Already Exists
In an existing codebase, establish what the app already provides before adding a
new component, hook, store, or token. Search the shared surfaces directly —
components/, hooks/, lib/, the token file, and each feature's public
index.ts — rather than inferring from the design or from memory.
Cover both:
- Artifacts — existing components, hooks, stores, and tokens that already cover, or nearly cover, the need. Search by behavior, not just by name: the component you want often exists under a different label.
- Written decisions — established conventions, the design system's rules, and prior audit findings.
Exit condition — one line, then keep going in the same response:
"<existing component/hook> already covers <behavior>; it does / does not
serve this because <reason>."
This step is not a gate on delivering. Greenfield — a new app, or a codebase you can't reach — closes it in one line: say so and go straight to Step 1. When you can't inspect, name what you would check and continue under stated assumptions. Never answer with inventory and questions alone; produce the architecture in the same reply.
This constrains the input, not the choice. A new component is a fine outcome; an unexamined one isn't — a near-duplicate of an existing one is how design systems rot.
Step 1: Design the Component Hierarchy
Start from the UI design (or the screen spec from ui-ux-design) and decompose into components:
- Identify the visual boundaries — Draw boxes around distinct UI regions
- Apply the single-responsibility principle — Each component does one thing
- Identify reusability — Which components appear in multiple places?
- Define the tree — Parent → child relationships
Component classification:
- Page components: Route-level, fetch data, compose layout
- Feature components: Implement a business feature (UserProfile, OrderSummary)
- UI components: Reusable, no business logic (Button, Card, Modal, Input)
- Layout components: Structure only (Sidebar, Grid, Stack, Container)
See references/component-patterns.md for design patterns.
Step 2: Plan State Management
State management is the most impactful architectural decision in a React app. Apply the state placement ladder — use the simplest option that works:
1. Local state (useState) → Simplest. Use for UI state within a component.
2. Lifted state (parent useState) → Share between siblings via parent.
3. Composition (children prop) → Avoid prop drilling with component composition.
4. Context → Share across distant components (theme, auth, locale).
5. URL state (query params) → Shareable, bookmarkable state (filters, pagination).
6. Server state (React Query / SWR) → Data from API with caching + refetching.
7. Global store (Zustand / Redux) → Client state shared across many unrelated components.Decision rules:
- If it's only used in one component →
useState - If shared between parent/child → lift state up
- If shared across distant components but rarely changes → Context
- If it comes from the server → React Query / SWR / TanStack Query (NOT global store)
- If it's complex client state updated from many places → Zustand or Redux Toolkit
- If it should survive a page refresh → URL params or localStorage
See references/component-patterns.md for detailed guidance.
Step 3: Define Design Tokens
Design tokens are the foundation of visual consistency. Define tokens before building components:
// tokens.ts
export const tokens = {
color: {
primary: { 50: '#eff6ff', 500: '#3b82f6', 700: '#1d4ed8' },
neutral: { 50: '#f9fafb', 200: '#e5e7eb', 800: '#1f2937' },
success: '#10b981',
warning: '#f59e0b',
error: '#ef4444',
},
spacing: { xs: '0.25rem', sm: '0.5rem', md: '1rem', lg: '1.5rem', xl: '2rem' },
radius: { sm: '0.25rem', md: '0.5rem', lg: '1rem', full: '9999px' },
fontSize: { sm: '0.875rem', base: '1rem', lg: '1.125rem', xl: '1.25rem' },
shadow: {
sm: '0 1px 2px rgba(0,0,0,0.05)',
md: '0 4px 6px rgba(0,0,0,0.1)',
},
};Use tokens everywhere — never hardcode #3b82f6 or 16px in a component.
Step 4: Design the Data Fetching Strategy
Choose patterns based on the data's nature:
| Data Pattern | Approach | When |
| Server data (read) | TanStack Query / SWR | Lists, details, dashboards |
| Server data (mutate) | TanStack Query mutations | Create, update, delete |
| Real-time data | WebSocket + state sync | Chat, notifications, live dashboards |
| Form data | React Hook Form / Formik | Any form |
| Static data | Build-time fetch (SSG) | Blog posts, docs, marketing pages |
Key rules:
- Separate server state from client state. Server state lives in the query cache, not in Redux.
- Fetch at the route level when possible. Components receive data as props, not fetch their own.
- Handle loading, error, and empty at every fetch boundary. Use error boundaries for unexpected errors.
Step 5: Organize the Codebase
Recommended structure — feature-based with shared library:
src/
├── app/ # App-level: providers, routing, global config
│ ├── providers.tsx # All context providers composed
│ ├── router.tsx # Route definitions
│ └── layout.tsx # Root layout
├── features/ # Feature modules (the meat of the app)
│ ├── auth/
│ │ ├── components/ # Feature-specific components
│ │ ├── hooks/ # Feature-specific hooks
│ │ ├── api.ts # API calls for this feature
│ │ ├── types.ts # Types for this feature
│ │ └── index.ts # Public API (barrel file)
│ ├── projects/
│ └── settings/
├── components/ # Shared UI components (Button, Modal, etc.)
│ ├── ui/ # Atomic UI primitives
│ └── layout/ # Layout components (Sidebar, Stack)
├── hooks/ # Shared hooks (useDebounce, useMediaQuery)
├── lib/ # Shared utilities, API client, tokens
│ ├── api-client.ts
│ ├── tokens.ts
│ └── utils.ts
└── types/ # Shared typesRules:
- Features import from
components/andlib/, never from other features - Features export a clean public API through their
index.ts - Circular imports between features means a responsibility boundary is wrong
Use templates/folder-structure.md as a starting point — includes the full src/ layout, a co-located component template, design tokens, and a custom hook pattern.
Step 6: Validate the Architecture
- Can a new engineer understand where to add a new feature?
- Can you delete a feature directory without breaking unrelated features?
- Is server state separate from client state?
- Are components reusable without bringing business logic along?
- Is there one clear way to do common tasks (fetching, forms, navigation)?
- Are design tokens used consistently (no hardcoded values)?
- Does every library this design adds (state, fetching, routing, UI kit) carry
dependency-management's Step 1 verdict: own module, adopt, or ask the user?
Principles Applied
- KISS: Use
useStateuntil you need something more. Don't reach for Redux on day one. - DRY: Shared UI components in
components/, shared hooks inhooks/. Feature-specific code in features. - Functional Independence: Features don't know about each other. Shared dependencies go in
lib/orcomponents/. - YAGNI: Don't abstract until you have 2+ consumers. A single-use component doesn't need to be in the shared library.
- Separation of Concerns: Components render UI. Hooks manage state and side effects. API modules handle HTTP. Types define shapes. Keep them apart.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

