react-folder-structure
3
总安装量
3
周安装量
#55931
全站排名
安装命令
npx skills add https://github.com/philipp-luchsinger/react-folder-structure --skill react-folder-structure
Agent 安装分布
amp
3
gemini-cli
3
github-copilot
3
codex
3
kimi-cli
3
cursor
3
Skill 文档
React Folder Structure & Conventions
Opinionated setup guide and coding conventions for React + Vite + TypeScript + shadcn/ui projects.
When to Apply
Reference these guidelines when:
- Bootstrapping a new project from scratch
- Creating a new feature inside
components/features/ - Adding a new API domain (TanStack Query + Axios)
- Creating or scoping a Zustand store
- Adding a shadcn/ui component
- Deciding where a file or hook belongs in the project
Rule Categories
| Category | Area | Prefix |
|---|---|---|
| Project Setup | Bootstrapping Vite + Tailwind + shadcn | setup- |
| Folder Structure | Top-level src/ layout |
structure- |
| Features | Self-contained feature architecture | feature- |
| API Layer | Axios + TanStack Query conventions | api- |
| State Management | Zustand (global & scoped) | store- |
| Styling | Tailwind v4 + CSS design tokens | style- |
| Naming | File, component & hook naming conventions | naming- |
Quick Reference
Setup
setup-viteâ Scaffold Vite + React + TypeScript + Tailwind v4 + path aliasessetup-shadcnâ Initialize shadcn/ui and never edit generated ui components
Features
feature-structureâ Self-contained feature directory layoutfeature-componentsâ What goes incomponents/vsshared/feature-boundariesâ Features may only import each other’s root export
API
api-clientâ Single Axios instance inapi/client.tsapi-endpointsâ Centralized endpoint constants, never hardcode URLsapi-query-hooksâ Query key factories + TanStack Query hook patternsapi-domain-folderâ One folder per domain withuse<Domain>Api.ts+types.ts
State
store-globalâsrc/stores/for app-wide state onlystore-scopedâ Context-scopedcreateStore()pattern for feature-local state
Styling
style-tokensâ Always use CSS variable tokens, never raw Tailwind color utilitiesstyle-dark-modeâ Dark mode via.darkclass +@custom-variant
Full Reference
For detailed explanations and Incorrect/Correct code examples for every rule: AGENTS.md
Individual rule files are in rules/.