From 515801ce26217cb9d1d8e8822c0f02445f72f911 Mon Sep 17 00:00:00 2001 From: Kayshen-X Date: Wed, 18 Feb 2026 21:51:01 +0800 Subject: [PATCH] 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. --- CLAUDE.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index 10cbda99..9f81fce7 100644 --- a/CLAUDE.md +++ b/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 + +- `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 只做一件事。不要把不相关的改动混在一起。