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

dao-best-practice

Used for standardizing DAO files to ensure adherence to Drizzle ORM best practices, including file structure, method naming, type safety, and performance optimization. To be used when refactoring or creating DAO files to meet project standards. After completion, a mandatory assessment is required to determine if a corresponding Repository layer needs to be created to encapsulate cross-table transactions.

personAuthor: jakexiaohubgithub

DAO规范化技能

使用说明

  1. 阅读 DAO最佳实践指南 了解规范
  2. 参考 代码模板
  3. 使用 检查清单 验证

⚠️ 强制后置步骤:Repository 评估

每次完成 DAO 写方法创建或修改后,强制评估:写操作是否涉及多张表?

  • 否(单表) → 流程结束,确保方法签名含可选 tx 参数即可
  • 是(跨表)必须触发 repository-best-practice 技能,为该写操作创建 Repository

此评估不可跳过