From 36530b85119ca22788c942b93292d394bf2120cb Mon Sep 17 00:00:00 2001 From: empty Date: Tue, 16 Dec 2025 10:39:58 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E5=AE=8C=E5=96=84=20CLAUDE.md=20?= =?UTF-8?q?=E5=BC=80=E5=8F=91=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增: - Git 提交类型 (feat/fix/refactor/chore/docs) - 分支策略 (直接 main vs 新建分支) - 提交前检查清单 - 禁止事项清单 - 代码规范细则 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- CLAUDE.md | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 57c4b81..63b6227 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -24,9 +24,35 @@ xcodebuild -scheme to-live-photo -destination 'platform=iOS Simulator,name=iPhon xcodebuild -scheme to-live-photo -configuration Release -destination 'generic/platform=iOS' -archivePath build/to-live-photo.xcarchive archive ``` -## 规则 +## Git 规范 -- 提交信息使用中文 -- 设计遵循 `DesignSystem.swift` 中的令牌 -- 触控目标 ≥ 44pt +### 提交类型 +- `feat`: 新功能 +- `fix`: 修复已有功能的缺陷 +- `refactor`: 重构(行为不变) +- `chore`: 构建、依赖、工具 +- `docs`: 仅文档 + +### 分支策略 +- **直接 main**: 文档、注释、单文件小修复、配置微调 +- **新建分支**: 新功能、涉及 ≥3 文件的改动、实验性尝试 + +### 提交前检查 +1. `xcodebuild build` 无错误 +2. UI 改动需在模拟器运行验证 +3. 单次提交只做一件事 + +## 禁止事项 + +- 不修改: `Info.plist` 版本号、`Package.resolved` +- 不新增: 依赖库(需明确授权) +- 不创建: 仅用一次的工具类/文件 +- 不重构: 与当前任务无关的代码 + +## 代码规范 + +- 遵循 `DesignSystem.swift` 令牌,禁止硬编码颜色/间距 +- 新增 View 必须包含 `accessibilityLabel` - 新增 View 必须适配深色模式和 iPad +- 触控目标 ≥ 44pt +- 错误处理使用 `LivePhotoError` 枚举,禁止裸 `throw`