docs: 完善 CLAUDE.md 开发规范
新增: - Git 提交类型 (feat/fix/refactor/chore/docs) - 分支策略 (直接 main vs 新建分支) - 提交前检查清单 - 禁止事项清单 - 代码规范细则 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
34
CLAUDE.md
34
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`
|
||||
|
||||
Reference in New Issue
Block a user