AgentSkillsCN

backend-commenting

在后端和数据层添加注释,用于阐明设计意图、不变量、权限控制、事务处理以及失败应对策略。在编辑路由处理器、服务器操作、领域用例、仓储层或 Prisma 数据模型时使用。

SKILL.md
--- frontmatter
name: backend-commenting
description: Apply backend and data-layer comments that explain intent, invariants, authorization, transactions, and failure strategy. Use when editing Route Handlers, Server Actions, domain use-cases, repositories, or Prisma schema.

Backend Commenting

  • Explain intent and invariants, not line-by-line mechanics.
  • Document input expectations, auth rules, and error strategy at each write endpoint.
  • Document transaction boundaries and why atomicity is required.
  • Add Prisma model comments for relationships and constraints.
  • Keep comments short, accurate, and updated with code changes.