Back to skills
extension
Category: Development & EngineeringNo API key required

repository-best-practice

Create a Repository layer for cross-table transactional write operations, encapsulating the writing transactions of multiple tables to ensure atomicity and data consistency. Use this when you need to perform cross-table writes, transaction encapsulation, or create a Repository file that includes a business input schema. Trigger phrases: "create repository", "write repository".

personAuthor: jakexiaohubgithub

Repository 最佳实践

使用说明

  1. 阅读 最佳实践指南 了解架构定位与设计规则
  2. 参考 代码模板 了解标准写法
  3. 完成后使用 检查清单 逐项验证

重要: Repository 只负责跨表事务性写入,不构建业务视图;多表写入必须包裹在同一个 db.transaction()