mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-03-30 21:53:28 +08:00
- Add missing code-review.md and development-workflow.md to zh/README.md directory listing - Add mkdir -p command before copy in manual install instructions - Fix TypeScript test command path in SKILL-DEVELOPMENT-GUIDE.md - Add Anti-Patterns section to SKILL.md template - Add Template category to Skill Categories table in CONTRIBUTING.md - Add Pre-Review Requirements section to code-review.md (both en and zh) - Add Pre-Review Checks step to development-workflow.md (both en and zh) - Add trailing newlines to all files that were missing them
32 lines
872 B
Markdown
32 lines
872 B
Markdown
# 常用模式
|
||
|
||
## 骨架项目
|
||
|
||
实现新功能时:
|
||
1. 搜索久经考验的骨架项目
|
||
2. 使用并行代理评估选项:
|
||
- 安全性评估
|
||
- 可扩展性分析
|
||
- 相关性评分
|
||
- 实现规划
|
||
3. 克隆最佳匹配作为基础
|
||
4. 在经验证的结构内迭代
|
||
|
||
## 设计模式
|
||
|
||
### 仓储模式
|
||
|
||
将数据访问封装在一致的接口后面:
|
||
- 定义标准操作:findAll、findById、create、update、delete
|
||
- 具体实现处理存储细节(数据库、API、文件等)
|
||
- 业务逻辑依赖抽象接口,而非存储机制
|
||
- 便于轻松切换数据源,并简化使用模拟的测试
|
||
|
||
### API 响应格式
|
||
|
||
对所有 API 响应使用一致的信封:
|
||
- 包含成功/状态指示器
|
||
- 包含数据负载(错误时可为空)
|
||
- 包含错误消息字段(成功时可为空)
|
||
- 包含分页响应的元数据(total、page、limit)
|