mirror of
https://github.com/ZSeven-W/openpencil.git
synced 2026-05-31 19:04:29 +07:00
docs: update CLAUDE.md with UI component design tokens and Git commit guidelines
Add section on using shadcn/ui design tokens for UI components and establish guidelines for Git commit messages following the Conventional Commits format. Include details on commit types, scopes, and rules for writing clear commit messages.
This commit is contained in:
parent
2dbfab49d3
commit
515801ce26
1 changed files with 32 additions and 0 deletions
32
CLAUDE.md
32
CLAUDE.md
|
|
@ -77,3 +77,35 @@ Tailwind CSS v4 imported via `src/styles.css`. Icons from `lucide-react`.
|
|||
- 单个文件不要超过 800 行。超出时应拆分为更小的模块。
|
||||
- 每个文件只导出一个组件,每个组件只承担单一职责。
|
||||
- `.ts` 和 `.tsx` 文件命名使用 kebab-case(烤肉串风格),例如 `canvas-store.ts`、`use-keyboard-shortcuts.ts`。
|
||||
- UI 组件统一使用 shadcn/ui 设计令牌(`bg-card`、`text-foreground`、`border-border` 等),禁止使用硬编码的 `gray-*`、`blue-*` 等 Tailwind 颜色。
|
||||
|
||||
## Git Commit 规范
|
||||
|
||||
使用 [Conventional Commits](https://www.conventionalcommits.org/) 格式:
|
||||
|
||||
```
|
||||
<type>(<scope>): <subject>
|
||||
|
||||
<body>
|
||||
```
|
||||
|
||||
### Type
|
||||
|
||||
- `feat` — 新功能
|
||||
- `fix` — Bug 修复
|
||||
- `refactor` — 重构(不改变行为)
|
||||
- `perf` — 性能优化
|
||||
- `style` — 代码格式(不影响逻辑)
|
||||
- `docs` — 文档
|
||||
- `test` — 测试
|
||||
- `chore` — 构建/工具/依赖变更
|
||||
|
||||
### Scope
|
||||
|
||||
按模块划分:`editor`、`canvas`、`panels`、`history`、`ai`、`codegen`、`store`、`types`。
|
||||
|
||||
### 规则
|
||||
|
||||
- subject 用英文,小写开头,不加句号,祈使语气(如 `add`、`fix`、`remove`)。
|
||||
- body 可选,解释 **why** 而非 what,可用中英文。
|
||||
- 一个 commit 只做一件事。不要把不相关的改动混在一起。
|
||||
|
|
|
|||
Loading…
Reference in a new issue