folder-org
11
总安装量
11
周安装量
#28094
全站排名
安装命令
npx skills add https://github.com/tartinerlabs/skills --skill folder-org
Agent 安装分布
github-copilot
11
opencode
4
antigravity
4
claude-code
4
codex
4
gemini-cli
4
Skill 文档
Folder Structure
Core Principle: Colocation
Place code as close to where it’s relevant as possible. Things that change together should be located together.
Organization Approaches
Feature-Based (Recommended for Frontend)
Group by domain – all related code in one place:
src/features/
âââ auth/
â âââ components/
â âââ hooks/
â âââ auth.service.ts
â âââ auth.test.ts
âââ users/
âââ products/
Layer-Based (Common for Backend)
Group by technical layer:
src/
âââ controllers/
âââ services/
âââ models/
âââ routes/
âââ middleware/
Monorepo
apps/ # Applications
âââ web/
âââ api/
packages/ # Shared libraries (by domain, not language)
âââ types/
âââ utils/
âââ ui/
Where to Put Things
| Type | Location |
|---|---|
| Shared types | types/ or packages/types/ |
| Utilities | lib/ or utils/ (split by domain) |
| Config | config/ or root |
| Unit tests | Colocate: foo.test.ts next to foo.ts |
| E2E tests | e2e/ or tests/e2e/ |
| Mocks/fixtures | __mocks__/ or test/mocks/ |
Naming Conventions
| Type | Convention |
|---|---|
| Files | kebab-case.ts |
| Unit tests | *.test.ts |
| E2E tests | *.e2e.ts |
| Schemas | *.schema.ts |
Anti-Patterns
- Catch-all files: Avoid
utils.ts,helpers.ts– split by domain - Deep nesting: Keep < 4 levels, use descriptive names instead
- Separated unit tests: Don’t put all in
__tests__/– colocate instead - Language grouping: In monorepos, group by domain not language
- Bloated barrels: Avoid
index.tswith 50+ re-exports