mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-04-05 00:33:27 +08:00
feat: add Chinese (zh-CN) translation for rules/common
- Add rules/zh/ directory with complete Chinese translations - Translate all 10 common rule files: - coding-style.md - security.md - testing.md - git-workflow.md - performance.md - patterns.md - hooks.md - agents.md - development-workflow.md - code-review.md - Add README.md for the zh directory explaining structure and installation - Maintain consistent formatting with original English versions - Keep technical terms and code examples in English where appropriate
This commit is contained in:
31
rules/zh/patterns.md
Normal file
31
rules/zh/patterns.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# 常用模式
|
||||
|
||||
## 骨架项目
|
||||
|
||||
实现新功能时:
|
||||
1. 搜索久经考验的骨架项目
|
||||
2. 使用并行代理评估选项:
|
||||
- 安全性评估
|
||||
- 可扩展性分析
|
||||
- 相关性评分
|
||||
- 实现规划
|
||||
3. 克隆最佳匹配作为基础
|
||||
4. 在经验证的结构内迭代
|
||||
|
||||
## 设计模式
|
||||
|
||||
### 仓储模式
|
||||
|
||||
将数据访问封装在一致的接口后面:
|
||||
- 定义标准操作:findAll、findById、create、update、delete
|
||||
- 具体实现处理存储细节(数据库、API、文件等)
|
||||
- 业务逻辑依赖抽象接口,而非存储机制
|
||||
- 便于轻松切换数据源,并简化使用模拟的测试
|
||||
|
||||
### API 响应格式
|
||||
|
||||
对所有 API 响应使用一致的信封:
|
||||
- 包含成功/状态指示器
|
||||
- 包含数据负载(错误时可为空)
|
||||
- 包含错误消息字段(成功时可为空)
|
||||
- 包含分页响应的元数据(total、page、limit)
|
||||
Reference in New Issue
Block a user