跳到主要内容

仓库合同模板

适用场景:后端仓库还没有稳定 AGENTS.md,或需要把长期规则从聊天里回写成仓库真相。

## Backend Engineering Rules

- Keep API contracts explicit and versioned.
- Require schema or migration review for every persistent-data change.
- Do not merge new external integrations without timeout, retry, and idempotency rules.
- Treat lint, type-check, integration tests, and smoke paths as required release evidence.
- Use structured logs, request IDs, and traceable background-job identifiers.
- Document rollback conditions for migrations, config changes, and async consumers.

至少再补两件事

补什么为什么
目录边界不写清 controller / service / repository / job 的边界,agent 很快会越层改动
发布与回滚纪律不写清 smoke、告警和 rollback,PR 只会停在“测试通过”

配套页面