Files
ning-inspire dc2f329258 feat: 引入 docs/architecture 高阶意图与 arch skills
项目准备阶段落地 C4/ADR 一句话表/术语与核心领域模型;glossary 与 ADR 迁入 architecture,domain-model 区分 Core 与 as-built;新增 tl-arch-plan、tl-arch-sync-back、ba-arch-sync-back,并同步 harness 与团队指南。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-17 18:02:38 +08:00

27 lines
1.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 代码规范(事实)
本目录是 **代码层面的硬约束**,写明"必须怎么做"。改动规范时要同步改本目录,并通知全队。
## 规范清单
| 文件 | 规范内容 |
|---|---|
| `architecture.md` | 整体架构、模块边界、依赖方向 |
| `layers.md` | 分层职责:每层允许做什么、禁止做什么 |
| `naming.md` | 命名约定:包、类、方法、字段、REST 路径 |
| `api-design.md` | API 设计:路径、版本、请求响应、分页、状态码 |
| `db.md` | 数据库规范:建表、命名、索引、迁移脚本 |
| `error.md` | 错误处理:错误码、异常类型、统一响应体 |
| `security.md` | 安全规范:认证、密码、敏感信息、上传 |
| `test.md` | 测试规范:分层、命名、覆盖要求、数据准备 |
| `business-rule.md` | 业务规则规范:规则 ID、定义位置、配置方式 |
| `data-dictionary.md` | 数据字典规范:枚举定义、注册方式、取值含义 |
| `adr.md` | 架构决策记录(ADR)写法;正文落在 `docs/architecture/tech/adr.md` |
| `templates/` | 代码模版 / snippet / ADR 模板,供复制 |
## 使用方式
- 写新代码前先读对应规范文件。
- 实现与规范冲突时:要么改代码,要么改规范并说明理由,不允许默默违反。
- 跨迭代技术取舍按 [`adr.md`](./adr.md) 写决策,接受后落到 `docs/architecture/tech/adr.md`。