organizing-project-files
8
总安装量
6
周安装量
#34272
全站排名
安装命令
npx skills add https://github.com/augmnt/webdev-skills --skill organizing-project-files
Agent 安装分布
opencode
5
claude-code
5
codex
5
gemini-cli
5
antigravity
4
cursor
3
Skill 文档
Organizing Project Files
Colocate by feature when possible. Group by type only for truly shared code.
Standard Layout
src/
âââ app/ # Next.js App Router (or pages/)
âââ components/
â âââ ui/ # Reusable primitives (Button, Modal)
â âââ [feature]/ # Feature-specific (auth/, dashboard/)
âââ hooks/ # Custom React hooks
âââ lib/ # Core utilities, clients, constants
âââ services/ # API calls, external integrations
âââ stores/ # State management
âââ types/ # TypeScript definitions
Placement Quick Reference
| “I need…” | Location |
|---|---|
| A button | components/ui/Button.tsx |
| A login form | components/auth/LoginForm.tsx |
| User data fetching | services/user.ts or hooks/queries/useUser.ts |
| Date formatter | lib/utils.ts |
| Auth state | stores/auth.ts |
| Supabase types | types/supabase.ts (generated) |
| Custom type | types/index.ts or colocate |
Naming
- Components:
PascalCase.tsx - Hooks:
useCamelCase.ts - Utilities:
camelCase.ts - Types:
camelCase.ts
Colocation Pattern
For complex features, keep related files together:
components/auth/
âââ LoginForm.tsx
âââ LoginForm.test.tsx
âââ useLoginForm.ts
âââ login-schema.ts
Advanced Patterns
For App Router specifics, barrel files, and monorepo structures, see PATTERNS.md.