mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-02-17 11:43:26 +08:00
* docs(zh-CN): sync Chinese docs with latest upstream changes * docs: improve Chinese translation consistency in go-test.md * docs(zh-CN): update image paths to use shared assets directory - Update image references from ./assets/ to ../../assets/ - Remove zh-CN/assets directory to use shared assets --------- Co-authored-by: neo <neo.dowithless@gmail.com>
914 B
914 B
常见模式
骨架项目
当实现新功能时:
- 搜索经过实战检验的骨架项目
- 使用并行代理评估选项:
- 安全性评估
- 可扩展性分析
- 相关性评分
- 实施规划
- 克隆最佳匹配作为基础
- 在已验证的结构内迭代
设计模式
仓库模式
将数据访问封装在一个一致的接口之后:
- 定义标准操作:findAll, findById, create, update, delete
- 具体实现处理存储细节(数据库、API、文件等)
- 业务逻辑依赖于抽象接口,而非存储机制
- 便于轻松切换数据源,并使用模拟对象简化测试
API 响应格式
对所有 API 响应使用一致的信封格式:
- 包含一个成功/状态指示器
- 包含数据载荷(出错时可为空)
- 包含一个错误消息字段(成功时可为空)
- 为分页响应包含元数据(总数、页码、限制)