npx skills add https://github.com/akillness/oh-my-gods --skill file-organizationsrc/
├── app/ # Next.js 13+ App Router
│ ├── (auth)/ # 路由分组
│ │ ├── login/
│ │ └── signup/
│ ├── (dashboard)/
│ │ ├── layout.tsx
│ │ ├── page.tsx
│ │ └── settings/
│ ├── api/ # API 路由
│ │ ├── auth/
│ │ └── users/
│ └── layout.tsx
│
├── components/ # UI 组件
│ ├── ui/ # 可复用的 UI (Button, Input)
│ │ ├── Button/
│ │ │ ├── Button.tsx
│ │ │ ├── Button.test.tsx
│ │ │ └── index.ts
│ │ └── Input/
│ ├── layout/ # 布局组件 (Header, Footer)
│ ├── features/ # 特定功能组件
│ │ ├── auth/
│ │ └── dashboard/
│ └── shared/ # 跨功能共享
│
├── lib/ # 工具函数和辅助函数
│ ├── utils.ts
│ ├── hooks/
│ │ ├── useAuth.ts
│ │ └── useLocalStorage.ts
│ └── api/
│ └── client.ts
│
├── store/ # 状态管理
│ ├── slices/
│ │ ├── authSlice.ts
│ │ └── userSlice.ts
│ └── index.ts
│
├── types/ # TypeScript 类型定义
│ ├── api.ts
│ ├── models.ts
│ └── index.ts
│
├── config/ # 配置
│ ├── env.ts
│ └── constants.ts
│
└── styles/ # 全局样式
├── globals.css
└── theme.ts
src/
├── app/ # Next.js 13+ App Router
│ ├── (auth)/ # Route groups
│ │ ├── login/
│ │ └── signup/
│ ├── (dashboard)/
│ │ ├── layout.tsx
│ │ ├── page.tsx
│ │ └── settings/
│ ├── api/ # API routes
│ │ ├── auth/
│ │ └── users/
│ └── layout.tsx
│
├── components/ # UI Components
│ ├── ui/ # Reusable UI (Button, Input)
│ │ ├── Button/
│ │ │ ├── Button.tsx
│ │ │ ├── Button.test.tsx
│ │ │ └── index.ts
│ │ └── Input/
│ ├── layout/ # Layout components (Header, Footer)
│ ├── features/ # Feature-specific components
│ │ ├── auth/
│ │ └── dashboard/
│ └── shared/ # Shared across features
│
├── lib/ # Utilities & helpers
│ ├── utils.ts
│ ├── hooks/
│ │ ├── useAuth.ts
│ │ └── useLocalStorage.ts
│ └── api/
│ └── client.ts
│
├── store/ # State management
│ ├── slices/
│ │ ├── authSlice.ts
│ │ └── userSlice.ts
│ └── index.ts
│
├── types/ # TypeScript types
│ ├── api.ts
│ ├── models.ts
│ └── index.ts
│
├── config/ # Configuration
│ ├── env.ts
│ └── constants.ts
│
└── styles/ # Global styles
├── globals.css
└── theme.ts
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
src/
├── api/ # API 层
│ ├── routes/
│ │ ├── auth.routes.ts
│ │ ├── user.routes.ts
│ │ └── index.ts
│ ├── controllers/
│ │ ├── auth.controller.ts
│ │ └── user.controller.ts
│ └── middlewares/
│ ├── auth.middleware.ts
│ ├── errorHandler.ts
│ └── validation.ts
│
├── services/ # 业务逻辑层
│ ├── auth.service.ts
│ ├── user.service.ts
│ └── email.service.ts
│
├── repositories/ # 数据访问层
│ ├── user.repository.ts
│ └── session.repository.ts
│
├── models/ # 数据库模型
│ ├── User.ts
│ └── Session.ts
│
├── database/ # 数据库设置
│ ├── connection.ts
│ ├── migrations/
│ └── seeds/
│
├── utils/ # 工具函数
│ ├── logger.ts
│ ├── crypto.ts
│ └── validators.ts
│
├── config/ # 配置
│ ├── index.ts
│ ├── database.ts
│ └── env.ts
│
├── types/ # TypeScript 类型定义
│ ├── express.d.ts
│ └── models.ts
│
├── __tests__/ # 测试
│ ├── unit/
│ ├── integration/
│ └── e2e/
│
└── index.ts # 入口文件
src/
├── features/
│ ├── auth/
│ │ ├── components/
│ │ │ ├── LoginForm.tsx
│ │ │ └── SignupForm.tsx
│ │ ├── hooks/
│ │ │ └── useAuth.ts
│ │ ├── api/
│ │ │ └── authApi.ts
│ │ ├── store/
│ │ │ └── authSlice.ts
│ │ ├── types/
│ │ │ └── auth.types.ts
│ │ └── index.ts
│ │
│ ├── products/
│ │ ├── components/
│ │ ├── hooks/
│ │ ├── api/
│ │ └── types/
│ │
│ └── orders/
│
├── shared/ # 跨功能共享
│ ├── components/
│ ├── hooks/
│ ├── utils/
│ └── types/
│
└── core/ # 应用核心
├── store/
├── router/
└── config/
文件名 :
Components: PascalCase.tsx
Hooks: camelCase.ts (useAuth.ts)
Utils: camelCase.ts (formatDate.ts)
Constants: UPPER_SNAKE_CASE.ts (API_ENDPOINTS.ts)
Types: camelCase.types.ts (user.types.ts)
Tests: *.test.ts, *.spec.ts
文件夹名 :
kebab-case: user-profile/
camelCase: userProfile/ (可选: hooks/, utils/)
PascalCase: UserProfile/ (可选: components/)
✅ 一致性是关键 (整个团队使用相同的规则)
变量/函数名 :
// Components: PascalCase
const UserProfile = () => {};
// Functions: camelCase
function getUserById() {}
// Constants: UPPER_SNAKE_CASE
const API_BASE_URL = 'https://api.example.com';
// Private: _prefix (可选)
class User {
private _id: string;
private _hashPassword() {}
}
// Booleans: is/has/can 前缀
const isAuthenticated = true;
const hasPermission = false;
const canEdit = true;
components/ui/index.ts :
// ✅ 好的示例: 重新导出命名导出
export { Button } from './Button/Button';
export { Input } from './Input/Input';
export { Modal } from './Modal/Modal';
// 用法:
import { Button, Input } from '@/components/ui';
❌ 不好的示例 :
// 重新导出所有内容 (影响 tree-shaking)
export * from './Button';
export * from './Input';
my-app/
├── .github/
│ └── workflows/
├── public/
├── src/
│ ├── app/
│ ├── components/
│ ├── lib/
│ ├── types/
│ └── config/
├── tests/
├── docs/
├── scripts/
├── .env.example
├── .gitignore
├── .eslintrc.json
├── .prettierrc
├── tsconfig.json
├── package.json
└── README.md
@/ 简化导入tsconfig.json :
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"],
"@/components/*": ["./src/components/*"],
"@/lib/*": ["./src/lib/*"]
}
}
}
用法 :
// ❌ 不好的示例
import { Button } from '../../../components/ui/Button';
// ✅ 好的示例
import { Button } from '@/components/ui';
#file-organization #project-structure #folder-structure #naming-conventions #utilities
每周安装次数
1
代码仓库
首次出现
1 天前
安全审计
安装于
mcpjam1
claude-code1
replit1
junie1
windsurf1
zencoder1
src/
├── api/ # API layer
│ ├── routes/
│ │ ├── auth.routes.ts
│ │ ├── user.routes.ts
│ │ └── index.ts
│ ├── controllers/
│ │ ├── auth.controller.ts
│ │ └── user.controller.ts
│ └── middlewares/
│ ├── auth.middleware.ts
│ ├── errorHandler.ts
│ └── validation.ts
│
├── services/ # Business logic
│ ├── auth.service.ts
│ ├── user.service.ts
│ └── email.service.ts
│
├── repositories/ # Data access layer
│ ├── user.repository.ts
│ └── session.repository.ts
│
├── models/ # Database models
│ ├── User.ts
│ └── Session.ts
│
├── database/ # Database setup
│ ├── connection.ts
│ ├── migrations/
│ └── seeds/
│
├── utils/ # Utilities
│ ├── logger.ts
│ ├── crypto.ts
│ └── validators.ts
│
├── config/ # Configuration
│ ├── index.ts
│ ├── database.ts
│ └── env.ts
│
├── types/ # TypeScript types
│ ├── express.d.ts
│ └── models.ts
│
├── __tests__/ # Tests
│ ├── unit/
│ ├── integration/
│ └── e2e/
│
└── index.ts # Entry point
src/
├── features/
│ ├── auth/
│ │ ├── components/
│ │ │ ├── LoginForm.tsx
│ │ │ └── SignupForm.tsx
│ │ ├── hooks/
│ │ │ └── useAuth.ts
│ │ ├── api/
│ │ │ └── authApi.ts
│ │ ├── store/
│ │ │ └── authSlice.ts
│ │ ├── types/
│ │ │ └── auth.types.ts
│ │ └── index.ts
│ │
│ ├── products/
│ │ ├── components/
│ │ ├── hooks/
│ │ ├── api/
│ │ └── types/
│ │
│ └── orders/
│
├── shared/ # Shared across features
│ ├── components/
│ ├── hooks/
│ ├── utils/
│ └── types/
│
└── core/ # App-wide
├── store/
├── router/
└── config/
File Names :
Components: PascalCase.tsx
Hooks: camelCase.ts (useAuth.ts)
Utils: camelCase.ts (formatDate.ts)
Constants: UPPER_SNAKE_CASE.ts (API_ENDPOINTS.ts)
Types: camelCase.types.ts (user.types.ts)
Tests: *.test.ts, *.spec.ts
Folder Names :
kebab-case: user-profile/
camelCase: userProfile/ (optional: hooks/, utils/)
PascalCase: UserProfile/ (optional: components/)
✅ Consistency is key (entire team uses the same rules)
Variable/Function Names :
// Components: PascalCase
const UserProfile = () => {};
// Functions: camelCase
function getUserById() {}
// Constants: UPPER_SNAKE_CASE
const API_BASE_URL = 'https://api.example.com';
// Private: _prefix (optional)
class User {
private _id: string;
private _hashPassword() {}
}
// Booleans: is/has/can prefix
const isAuthenticated = true;
const hasPermission = false;
const canEdit = true;
components/ui/index.ts :
// ✅ Good example: Re-export named exports
export { Button } from './Button/Button';
export { Input } from './Input/Input';
export { Modal } from './Modal/Modal';
// Usage:
import { Button, Input } from '@/components/ui';
❌ Bad example :
// Re-export everything (impairs tree-shaking)
export * from './Button';
export * from './Input';
my-app/
├── .github/
│ └── workflows/
├── public/
├── src/
│ ├── app/
│ ├── components/
│ ├── lib/
│ ├── types/
│ └── config/
├── tests/
├── docs/
├── scripts/
├── .env.example
├── .gitignore
├── .eslintrc.json
├── .prettierrc
├── tsconfig.json
├── package.json
└── README.md
@/tsconfig.json :
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"],
"@/components/*": ["./src/components/*"],
"@/lib/*": ["./src/lib/*"]
}
}
}
Usage :
// ❌ Bad example
import { Button } from '../../../components/ui/Button';
// ✅ Good example
import { Button } from '@/components/ui';
#file-organization #project-structure #folder-structure #naming-conventions #utilities
Weekly Installs
1
Repository
First Seen
1 day ago
Security Audits
Installed on
mcpjam1
claude-code1
replit1
junie1
windsurf1
zencoder1
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
111,800 周安装
Canvas Design 技能:AI驱动视觉哲学创作与画布设计工具 | 艺术生成与美学设计
1,200 周安装
agent-memory 技能 - AI 助手记忆管理工具 | 提升开发效率与代码协作
1,100 周安装
AI技能开发:session-wrap与multi-agent分析实战指南 | 技能创建与验证流程
1,100 周安装
持续代理循环 (continuous-agent-loop) - Claude AI 自动化开发工作流与代理循环管理
1,200 周安装
Flutter布局指南:构建响应式UI的约束规则与自适应设计模式
1,200 周安装
CTF Web漏洞利用速查手册 - SQL注入、SSTI、XXE、反序列化、XSS等攻防技术大全
1,200 周安装