用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Dev-Toolbelt/dev-team-agents --skill naming-conventions命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | naming-conventions |
| description | Naming and file structure — framework-agnostic with per-framework notes. |
| Thing | Convention | Example |
|---|---|---|
| Component | PascalCase | UserCard, OrderSummary |
| Hook / Composable | camelCase, prefixed use | useOrders, useAuthState |
| Service / class | PascalCase | OrderService, AuthClient |
| Utility function | camelCase, verb-first | formatDate, parseAmount |
| Constant | SCREAMING_SNAKE_CASE | MAX_RETRIES, API_BASE_URL |
| CSS class (BEM) | kebab-case | order-card__title--active |
| CSS custom property | kebab-case, prefixed | --color-primary, --spacing-md |
| Event handler prop | camelCase, prefixed on | onSubmit, onItemSelect |
| Internal handler | camelCase, prefixed handle | handleSubmit, handleItemSelect |
| Boolean prop/var | prefixed is, has, can, should | isLoading, hasError, canEdit |
| Enum / union literal | PascalCase (type) + SCREAMING (value) | Status.PENDING |
| File type | Convention | Example |
|---|---|---|
| Component file | PascalCase | UserCard.tsx, UserCard.vue |
| Hook file | camelCase | useOrders.ts |
| Service file | camelCase or PascalCase (match class) | orderService.ts |
| Test file | same name + .test / .spec | UserCard.test.tsx |
| Style module | same name + .module.css | UserCard.module.css |
| Index barrel | index.ts | only at feature boundary |
Barrel files (index.ts): use only at the public boundary of a feature folder. Never create barrels inside a feature just to shorten import paths — they prevent tree-shaking and obscure where code lives.
Prefer feature-based over type-based once the project exceeds ~5 components.
src/
├── features/
│ └── orders/
│ ├── components/ ← UI components scoped to this feature
│ ├── hooks/ ← composables / hooks scoped to this feature
│ ├── services/ ← API calls, business logic
│ ├── types.ts ← feature-local types
│ └── index.ts ← public API of the feature
├── shared/
│ ├── components/ ← reusable across features
│ ├── hooks/
│ └── utils/
└── app/ ← routing, providers, global layout
Rules:
features/orders must not import directly from features/users — go through shared/shared/ components must have zero feature-specific knowledgeshared/ when a second feature needs it (YAGNI).tsx for components, .ts for everything elsePascalCase.vueUserCard, not Card)composables/ folder for use* files; stores/ for Pinia storesfeature-name.component.ts, feature-name.service.ts, feature-name.module.tsComponent, Service, Pipe, Directive, Guard, ResolverUserCard.sveltestores/ folder; suffix with Store if ambiguous (cartStore.ts)| Anti-Pattern | Problem |
|---|---|
data, info, util, helper as names | Too generic — describe what it does, not that it exists |
handleClick on every button | Describe the intent: handleAddToCart, handleDeleteUser |
isLoading2, newValue, temp | Temporary names that survive into production |
| Abbreviations beyond 3 letters | usr, ord, cfg — spell it out |
| Inconsistent casing in the same codebase | Pick a convention and enforce it via linter |
Deep nesting: components/ui/base/atoms/Button | Flatten — depth signals over-engineering |