refactor: feature 改为 JIRA 编码文件夹并同放 plan

规格改为 <CODE>-<slug>/spec.md,方案放 plan.md/_chores;同步 skill、安装器与工作流指南。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
ning-inspire
2026-11-17 10:53:28 +08:00
parent 02fbafe580
commit d243b53fe1
54 changed files with 286 additions and 124 deletions

View File

@@ -12,7 +12,7 @@ description: 从代码与设计文档生成或校准事实文档(API、库表
| | 过程文档 | 事实文档 |
|---|---|---|
| 位置 | `docs/features/`、`docs/plans/` | `docs/facts/` |
| 位置 | `docs/features/`(含 `spec.md` / `plan*.md`) | `docs/facts/` |
| 描述 | 需求与方案(会变) | 系统现状(跟着代码变) |
| 变更时机 | 迭代推进时 | **代码一变就变** |
| 写法 | 可以写"待定" | **不许写"待定"** |

View File

@@ -116,5 +116,5 @@ description: 拷问需求,把模糊的一句话需求逼成可验收的规格
## 交给下一步
澄清纪要完成后,用 `ba-write-spec` 把它落成 `docs/features/{模块}.md`。
澄清纪要完成后,用 `ba-write-spec` 把它落成 `docs/features/<迭代>/<CODE>-<slug>/spec.md`。
如果还有阻塞性待确认项,**不要**开始写规格。

View File

@@ -1,6 +1,6 @@
---
name: ba-write-spec
description: 编写需求规格说明书(字段表、业务规则、权限矩阵、验收标准)。当需求已澄清,需要把需求落成 docs/features/ 下的规格文档时使用。
description: 编写需求规格说明书(字段表、业务规则、权限矩阵、验收标准)。当需求已澄清,需要把需求落成 docs/features/<迭代>/<CODE>-<slug>/spec.md 时使用。
---
# BA:编写需求规格
@@ -10,16 +10,18 @@ description: 编写需求规格说明书(字段表、业务规则、权限矩
## 前置
- 需求已经过 `ba-grill-me` 澄清,阻塞项都有结论
- 已读过 `docs/features/_template.md`(规格模板)与 `AGENTS.md`
- 已读过 `docs/features/_template/spec.md`(规格模板)与 `AGENTS.md`
- 已查过 `docs/facts/` 下的事实文档,避免和现状冲突
## 输出位置
`docs/features/{模块}.md`
`docs/features/<迭代>/<CODE>-<slug>/spec.md`
- 命名用模块名(`auth.md`、`appointment.md`),不要用日期
- 一个模块一份,不要把多个模块塞进一个文件
- 更新已有模块时基于当前版本改,写明基线版本与目标版本
- 文件夹名用 **JIRA 风格大写编码** + slug(如 `ACC-account`、`BKG-booking`)
- 规格文件固定为目录内的 `spec.md`
- 从 `docs/features/_template/spec.md` 复制起步;同目录可放 `plan.md` / `plan-{slug}.md`
- 一个能力一个文件夹,不要把多个模块塞进一份 spec
- 更新已有模块时基于当前 `spec.md` 改,写明基线版本与目标版本
## 各章节怎么写

View File

@@ -99,7 +99,7 @@ glab mr create --target-branch main --title "feat(appointment): 支持取消预
## 关联
- 需求:`docs/features/appointment.md`
- 需求:`docs/features/iteration1/BKG-booking/spec.md`
- 规则:R-CANCEL-003
- 用例:TC-013

View File

@@ -1,15 +1,22 @@
---
name: dev-plan
description: 在编写任何代码之前在 docs/plans/ 中创建开发计划。当开始新功能、重构或任何非简单变更时使用。
description: 在编写任何代码之前为对应 feature 创建开发计划(plan.md)。当开始新功能、重构或任何非简单变更时使用。
---
# 开发:制定计划
在实现前在 `docs/plans/` 中创建计划。
在实现前为需求写技术方案,并与规格放在同一 feature 目录。
## 模板
## 输出位置
使用 `docs/plans/_template.md` 作为模板,包含以下核心章节:
| 场景 | 路径 |
|---|---|
| 有明确 feature | `docs/features/<迭代>/<CODE>-<slug>/plan.md`(首份)或 `plan-{slug}.md`(后续) |
| 无关联 feature 的横切改造 | `docs/features/_chores/plan-{slug}.md` |
模板:`docs/features/_template/plan.md`。
## 模板核心章节
1. 文档说明(背景、目标)
2. 领域模型(PlantUML)
@@ -24,7 +31,7 @@ description: 在编写任何代码之前在 docs/plans/ 中创建开发计划。
11. 修改清单(代码、接口、数据库变更)
12. 验证步骤
13. 风险与回滚
14. 实施后需更新的 design 文档
14. 实施后需更新的事实文档
## 规则
@@ -32,4 +39,4 @@ description: 在编写任何代码之前在 docs/plans/ 中创建开发计划。
- 包含每个需要变更的文件的路径
- 参考现有模式(assembler、converter、service)以保持一致性
- 考虑文档同步:本次变更是否会影响 `docs/facts/` 中的文件?
- **plan 一旦定稿就不修改**,同一资源的二次改造新建 `YYYYMMDD-{slug}.md`
- **plan 一旦定稿就不修改**;同一 feature 的二次改造新建 `plan-{slug}.md`

View File

@@ -35,7 +35,7 @@ QA 用例验证 **系统符合需求规格**,判定权归 QA。它是 **合并
**每个锚点至少一条用例。** 有锚点没用例 = 覆盖缺口,不能进验收。
规格位置:`docs/features/{模块}.md`。
规格位置:`docs/features/<迭代>/<CODE>-<slug>/spec.md`。
## 第二步:写文本用例

View File

@@ -4,7 +4,7 @@
#
# "跑哪些任务"不在这里 —— 队列定义在
# .overnight-runner/queue/<队列名>/queue.yaml
# 用 `overnight-runner --queue <名字> add docs/plans/xxx.md` 追加。
# 用 `overnight-runner --queue <名字> add docs/features/_chores/plan-xxx.md` 追加。
runner:
agent:
command: opencode

View File

@@ -1,9 +1,9 @@
queue:
- id: 20261106-20261106-businessrule-datadictionary-api-tests
plan: docs/plans/20261106-businessrule-datadictionary-api-tests.md
- id: 20261106-businessrule-datadictionary-api-tests
plan: docs/features/_chores/plan-20261106-businessrule-datadictionary-api-tests.md
priority: 10
role: DEV
- id: 20261106-20261106-fix-public-endpoints-and-error-doc
plan: docs/plans/20261106-fix-public-endpoints-and-error-doc.md
- id: 20261106-fix-public-endpoints-and-error-doc
plan: docs/features/_chores/plan-20261106-fix-public-endpoints-and-error-doc.md
priority: 10
role: DEV

View File

@@ -257,23 +257,21 @@ cd e2e && npm run test:dev # 只跑开发自测用例
```
docs/
├── features/ # 需求规格(过程文档)
│ ├── _template.md # 需求规格模板
│ └── iteration1/ # 咨询师预约平台样例(骨架)
│ ├── README.md # 迭代索引
│ ├── account.md
│ ├── consultant-discovery.md
│ ├── booking.md
│ ├── consultant-onboarding.md
│ ├── consultant-schedule.md
│ ├── consultant-fulfillment.md
│ ├── settlement.md
│ ├── admin-ops.md
│ ├── platform-capability.md
├── features/ # 需求规格 + 技术方案(过程文档)
│ ├── _template/ # spec.md + plan.md 模板
│ ├── _chores/ # 无关联 feature 的横切 plan
│ └── iteration1/ # 咨询师预约平台样例
│ ├── README.md
│ ├── ACC-account/spec.md
│ ├── BKG-booking/spec.md
│ ├── CDC-consultant-discovery/spec.md
│ ├── COB-consultant-onboarding/spec.md
│ ├── CSC-consultant-schedule/spec.md
│ ├── CFL-consultant-fulfillment/spec.md
│ ├── SET-settlement/spec.md
│ ├── ADM-admin-ops/spec.md
│ ├── PLT-platform-capability/spec.md
│ └── prototypes/ # 独立 Vite 原型 demo(Element Plus,:5174)
├── plans/ # 技术方案(过程文档)
│ ├── _template.md # 技术方案模板
│ └── 20260619-project-plan.md
├── facts/ # 事实文档
│ ├── api.yaml # API 接口定义
│ ├── db-schema.md # 数据库规格
@@ -345,7 +343,7 @@ docs/
每轮需求开发必须按以下顺序执行,严禁跳过或调换步骤:
1. **Plan 等待确认**:在 `docs/plans/` 下根据模版创建 Plan,包含技术方案与任务拆分,等待人工确认后再继续。
1. **Plan 等待确认**:在对应 feature 目录(`docs/features/<迭代>/<CODE>-<slug>/`)写 `plan.md`(或多份 `plan-{slug}.md`);无关联 feature 的横切方案放 `docs/features/_chores/`。等待人工确认后再继续。
2. **编写 QA 测试用例**:在 `docs/test-cases/e2e-cases/` 下编写本轮需求的 E2E 测试用例(文本格式,编号 `TC-xxx`),由 QA 主导判定。**先写文本用例,再写自动化**。
3. **编写开发自测(API 测试)**:根据 Plan 在 `apps/backend/src/test/` 中编写 RestAssured 集成测试(API 级别),运行成功但断言失败(TDD 红牌阶段)。
4. **编写实现**:编写单元测试 + 实现代码(后端 application/domain/adapter 层),通过 `mvn compile` 编译。

View File

@@ -106,8 +106,7 @@ Client → Vue 前端 (:5173) → /api 代理 → Spring Boot 后端 (:8080) →
详见 [`docs/`](docs/) 目录:
- **需求规格**:`docs/features/iteration1/` — 咨询师预约平台样例(v0.1;独立 Vite 原型:`prototypes/`,`npm run dev` :5174)
- **技术方案**:`docs/plans/` — 技术实现方案与任务拆分
- **设计文档**:`docs/facts/` — API 定义、数据库设计、领域模型、技术主题
- **需求与方案**:`docs/features/` — JIRA 风格 feature 文件夹(`spec.md` + `plan*.md`;横切见 `_chores/`)
- **事实文档**:`docs/facts/` — API 定义、数据库设计、领域模型、技术主题
- **代码规范**:`docs/standards/` — 架构、命名、安全、分层等规范及代码模板
- **测试用例**:`docs/test-cases/{e2e,manual,smoking,dev-self}-cases/`

View File

@@ -4,15 +4,16 @@
| 类别 | 目录 | 性质 | 生命周期 |
|---|---|---|---|
| 过程文档 | `features/`、`plans/` | 会随需求演进 | 随需求创建,**定稿后不再修改** |
| 过程文档 | `features/`(含 `spec.md` / `plan*.md`) | 会随需求演进 | 随需求创建,**定稿后不再修改** |
| 事实文档 | `facts/`、`standards/` | 描述系统当前真实状态 | 随代码同步更新 |
## 目录
| 目录 | 内容 | 谁来写 |
|---|---|---|
| `features/` | 需求规格说明书:背景、字段表、业务规则、权限、验收标准 | 产品 / BA |
| `plans/` | 技术方案:领域模型、DDL、API、时序图、任务拆分、风险 | 架构师 / 负责人 |
| `features/` | 每个能力一个 JIRA 风格文件夹:`spec.md` + `plan.md` / `plan-{slug}.md` | 产品 / BA / 开发 |
| `features/_chores/` | 无关联 feature 的横切技术方案 | 架构师 / 负责人 |
| `features/_template/` | `spec.md`、`plan.md` 模板 | 架构师 |
| `facts/` | 技术事实:API、库表、领域模型 | 全员,随代码同步 |
| `facts/business/` | 业务事实:流程等 | BA / 开发 |
| `facts/tech-topic/` | 技术专题 / ADR / 实现说明 | 需要时新建 |
@@ -34,9 +35,9 @@
## 写作约定
- 需求规格与 Plan **定稿后不改**;同一资源的二次改造新建文件(`YYYYMMDD-{slug}.md`)。
- 需求规格与 Plan **定稿后不改**;同一 feature 的二次改造新建 `plan-{slug}.md`。
- 事实文档必须与代码一致;改了代码就要改文档。
- 新建需求先复制 `_template.md` 再改,不要从零写。
- 新建需求:复制 `features/_template/` 为 `features/<迭代>/<CODE>-<slug>/`,再改 `spec.md` / `plan.md`。
## 同步检查点

View File

@@ -0,0 +1,29 @@
# 需求与方案(Features)
每个业务能力是一个 **JIRA 风格编码文件夹**,规格与技术方案放在一起:
```
docs/features/
├── _template/ # 模板:spec.md + plan.md
├── _chores/ # 无关联 feature 的横切 plan
│ └── plan-{slug}.md
└── iteration1/
├── README.md
├── ACC-account/
│ ├── spec.md # 业务规格
│ ├── plan.md # 主技术方案(可选)
│ └── plan-{slug}.md # 多份方案时
└── plan-{slug}.md # 迭代级方案(可选)
```
| 编码 | 文件夹 | 含义 |
|---|---|---|
| ACC | `ACC-account` | 账号 |
| BKG | `BKG-booking` | 预约下单 |
| CDC | `CDC-consultant-discovery` | 咨询师发现 |
| COB | `COB-consultant-onboarding` | 咨询师入驻 |
| CSC | `CSC-consultant-schedule` | 咨询师档期 |
| CFL | `CFL-consultant-fulfillment` | 咨询师履约 |
| SET | `SET-settlement` | 结算 |
| ADM | `ADM-admin-ops` | 管理运营 |
| PLT | `PLT-platform-capability` | 平台能力 |

View File

@@ -0,0 +1,7 @@
# `_chores` · 无关联 Feature 的 Plan
横切改造、基础设施、与具体业务 feature 无一一对应关系的技术方案放这里。
命名:`plan-{slug}.md`(可带日期前缀,如 `plan-20261106-fix-public-endpoints-and-error-doc.md`)。
有明确业务规格的方案应放在对应 feature 目录:`docs/features/<迭代>/<CODE>-<slug>/plan.md`(或多份时 `plan-{slug}.md`)。

View File

@@ -2,13 +2,13 @@
>日期: YYYY-MM-DD
>
>关联需求:docs/features/{file}.md
>关联需求:docs/features/<迭代>/<CODE>-<slug>/spec.md
>
>设计 design:docs/design/topics/{资源}-{操作}.md(实施后会写到原design文件)
>
>
>
>**plan一旦定稿就不修改。** 同一资源的二次改造新建 `YYYY-MM-DD-{slug}.md`,不修改原计划文件
>**plan一旦定稿就不修改。** 同一资源的二次改造新建 `plan-{slug}.md`(与 spec 同目录;横切放 `_chores/`),不修改原计划文件

View File

@@ -1,7 +1,7 @@
# 需求规格说明书:<需求名称>
> 文档类型:需求规格 / Feature Specification
> 适用目录:`docs/features/`
> 适用目录:`docs/features/<迭代>/<CODE>-<slug>/spec.md`
> 需求类型:NEW / UPDATE
> 版本:v0.1
> 作者:<BA/产品/负责人>

View File

@@ -13,19 +13,29 @@
## 2. 特性索引
| Spec | 覆盖源 REQ / 章节 | 角色 | 状态 |
|---|---|---|---|
| [account.md](./account.md) | §6.1 + REQ-006 | 三端 | v0.1 |
| [consultant-discovery.md](./consultant-discovery.md) | REQ-001、002 | 用户 | v0.1 |
| [booking.md](./booking.md) | REQ-003、004、005 | 用户 | v0.1 |
| [consultant-onboarding.md](./consultant-onboarding.md) | REQ-007、008 | 咨询师 | v0.1 |
| [consultant-schedule.md](./consultant-schedule.md) | REQ-009 | 咨询师 | v0.1 |
| [consultant-fulfillment.md](./consultant-fulfillment.md) | REQ-010、012 | 咨询师 | v0.1 |
| [settlement.md](./settlement.md) | REQ-011 | 咨询师 | v0.1 |
| [admin-ops.md](./admin-ops.md) | REQ-013~017 | 管理员 | v0.1 |
| [platform-capability.md](./platform-capability.md) | §6.2~6.6 | 横切 | v0.1 |
| Code | Spec | 覆盖源 REQ / 章节 | 角色 | 状态 |
|---|---|---|---|---|
| ACC | [ACC-account/spec.md](./ACC-account/spec.md) | §6.1 + REQ-006 | 三端 | v0.1 |
| CDC | [CDC-consultant-discovery/spec.md](./CDC-consultant-discovery/spec.md) | REQ-001、002 | 用户 | v0.1 |
| BKG | [BKG-booking/spec.md](./BKG-booking/spec.md) | REQ-003、004、005 | 用户 | v0.1 |
| COB | [COB-consultant-onboarding/spec.md](./COB-consultant-onboarding/spec.md) | REQ-007、008 | 咨询师 | v0.1 |
| CSC | [CSC-consultant-schedule/spec.md](./CSC-consultant-schedule/spec.md) | REQ-009 | 咨询师 | v0.1 |
| CFL | [CFL-consultant-fulfillment/spec.md](./CFL-consultant-fulfillment/spec.md) | REQ-010、012 | 咨询师 | v0.1 |
| SET | [SET-settlement/spec.md](./SET-settlement/spec.md) | REQ-011 | 咨询师 | v0.1 |
| ADM | [ADM-admin-ops/spec.md](./ADM-admin-ops/spec.md) | REQ-013~017 | 管理员 | v0.1 |
| PLT | [PLT-platform-capability/spec.md](./PLT-platform-capability/spec.md) | §6.2~6.6 | 横切 | v0.1 |
## 3. 里程碑(源 PRD)
## 3. 迭代级 Plan
| Plan | 说明 |
|---|---|
| [plan-20261116-iteration1-feature-skeletons.md](./plan-20261116-iteration1-feature-skeletons.md) | 特性骨架 |
| [plan-20261116-iteration1-prototypes-and-specs.md](./plan-20261116-iteration1-prototypes-and-specs.md) | 原型与规格 |
| [plan-20261116-iteration1-prototypes-vite.md](./plan-20261116-iteration1-prototypes-vite.md) | Vite 原型 |
横切 / 无 feature 归属的方案见 [`../_chores/`](../_chores/)。
## 4. 里程碑(源 PRD)
| 阶段 | 范围 |
|---|---|
@@ -34,19 +44,17 @@
| M3 | 管理端审核、分类与治理 |
| M4 | 结算、通知与上线准备 |
## 4. 原型约定
## 5. 原型约定
- 独立 Vite 工程:[`prototypes/`](./prototypes/)(`npm run dev` → http://127.0.0.1:5174/)
- 技术:Vue 3 + Vue Router + Element Plus(**不**并入业务 `apps/frontend/`)
- 路由:`/` 入口;`/user/*`、`/consultant/*`、`/admin/*`
- 规格与原型冲突时,以规格中的业务规则与验收标准为准
## 5. v0.1 完成清单
## 6. v0.1 完成清单
9 份 spec 已完成:
- [x] §5 完整字段表
- [x] §7 可测试业务规则(含规则 ID,覆盖 CREATE / QUERY / UPDATE / DELETE / COMMON)
- [x] §9 状态流转(若有)
- [x] §12 Given-When-Then 验收标准
- [x] §14 挂接独立 Vite 原型路由