@chenguangyao/devflow-kit 0.1.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. package/CHANGELOG.md +232 -0
  2. package/LICENSE +21 -0
  3. package/README.md +539 -0
  4. package/bin/devflow.js +9 -0
  5. package/docs/RFC-001-devflow-kit.md +617 -0
  6. package/docs/RFC-002-workflow-kernel.md +134 -0
  7. package/docs/enterprise-integration-supplement.md +274 -0
  8. package/docs/internal-gitlab-setup.md +426 -0
  9. package/docs/marketplace-skills.md +231 -0
  10. package/docs/migration-from-arb.md +232 -0
  11. package/docs/tooling-overview.md +774 -0
  12. package/docs/workflow-orchestration.md +695 -0
  13. package/docs/workflow-ui-prototype.html +271 -0
  14. package/package.json +52 -0
  15. package/schemas/config.schema.json +51 -0
  16. package/schemas/delta.schema.json +22 -0
  17. package/schemas/state.schema.json +130 -0
  18. package/schemas/status-surface.schema.json +197 -0
  19. package/schemas/workflow-confirmation-surface.schema.json +70 -0
  20. package/schemas/workflow-picker.schema.json +94 -0
  21. package/scripts/postinstall.js +101 -0
  22. package/scripts/render-workflow-ui-prototype.js +271 -0
  23. package/skills/apply/SKILL.md +313 -0
  24. package/skills/apply/references/discipline-checklist.md +145 -0
  25. package/skills/apply/references/subagent-implementer-prompt.md +113 -0
  26. package/skills/apply/references/subagent-orchestration.md +150 -0
  27. package/skills/apply/references/subagent-reviewer-prompt.md +180 -0
  28. package/skills/apply/references/tdd-loop.md +287 -0
  29. package/skills/apply/references/when-plan-is-wrong.md +279 -0
  30. package/skills/apply/references/worktree-swarm.md +292 -0
  31. package/skills/archive/SKILL.md +229 -0
  32. package/skills/archive/references/conflict-resolution.md +336 -0
  33. package/skills/archive/references/knowledge-deposit.md +381 -0
  34. package/skills/archive/references/spec-merge.md +365 -0
  35. package/skills/brainstorm/SKILL.md +123 -0
  36. package/skills/brainstorm/references/proposal-template.md +244 -0
  37. package/skills/brainstorm/references/question-catalog.md +168 -0
  38. package/skills/brainstorm/references/session-template.md +184 -0
  39. package/skills/ci-fix/SKILL.md +63 -0
  40. package/skills/ci-fix/references/loop.md +25 -0
  41. package/skills/code-review/SKILL.md +279 -0
  42. package/skills/code-review/references/escalation-playbook.md +192 -0
  43. package/skills/code-review/references/language-cheatsheets/go.md +175 -0
  44. package/skills/code-review/references/language-cheatsheets/java-spring-mybatis.md +246 -0
  45. package/skills/code-review/references/language-cheatsheets/python.md +170 -0
  46. package/skills/code-review/references/language-cheatsheets/vue.md +199 -0
  47. package/skills/code-review/references/output-template.md +275 -0
  48. package/skills/code-review/references/review-checklist.md +251 -0
  49. package/skills/complexity-grading/SKILL.md +259 -0
  50. package/skills/deliver/SKILL.md +271 -0
  51. package/skills/deliver/references/delivery-modes.md +299 -0
  52. package/skills/deliver/references/notify.md +359 -0
  53. package/skills/deliver/references/pr-description.md +319 -0
  54. package/skills/dependency-upgrade/SKILL.md +57 -0
  55. package/skills/dependency-upgrade/references/risk-matrix.md +38 -0
  56. package/skills/df-orchestrator/SKILL.md +407 -0
  57. package/skills/df-orchestrator/references/complexity-grading.md +177 -0
  58. package/skills/df-orchestrator/references/escalation-matrix.md +191 -0
  59. package/skills/df-orchestrator/references/routing-rules.md +290 -0
  60. package/skills/df-orchestrator/references/workflow-state-machine.md +208 -0
  61. package/skills/frontend-quality/SKILL.md +61 -0
  62. package/skills/frontend-quality/references/checklist.md +35 -0
  63. package/skills/handoff-resume/SKILL.md +59 -0
  64. package/skills/handoff-resume/references/handoff-template.md +54 -0
  65. package/skills/plan/SKILL.md +166 -0
  66. package/skills/plan/references/task-breakdown.md +207 -0
  67. package/skills/plan/references/task-sequencing.md +143 -0
  68. package/skills/plan/references/task-template.md +248 -0
  69. package/skills/requirement-analysis/SKILL.md +499 -0
  70. package/skills/requirement-analysis/references/acceptance-criteria.md +183 -0
  71. package/skills/requirement-analysis/references/code-recon.md +151 -0
  72. package/skills/requirement-analysis/references/edge-case-catalog.md +164 -0
  73. package/skills/requirement-analysis/references/requirement-template.md +339 -0
  74. package/skills/requirement-analysis/references/scope-negotiation.md +162 -0
  75. package/skills/security-hardening/SKILL.md +60 -0
  76. package/skills/security-hardening/references/checklist.md +42 -0
  77. package/skills/tech-spec/SKILL.md +388 -0
  78. package/skills/tech-spec/references/api-contract-design.md +172 -0
  79. package/skills/tech-spec/references/decision-records.md +110 -0
  80. package/skills/tech-spec/references/design-template.md +301 -0
  81. package/skills/tech-spec/references/rollout-and-rollback.md +203 -0
  82. package/skills/tech-spec/references/spec-delta-conventions.md +250 -0
  83. package/skills/tech-spec/references/transaction-patterns.md +212 -0
  84. package/skills/test-spec/SKILL.md +219 -0
  85. package/skills/test-spec/references/coverage-strategy.md +218 -0
  86. package/skills/test-spec/references/edge-case-to-test.md +143 -0
  87. package/skills/test-spec/references/test-case-template.md +276 -0
  88. package/skills/verify/SKILL.md +232 -0
  89. package/skills/verify/references/nfr-verification.md +292 -0
  90. package/skills/verify/references/report-templates.md +510 -0
  91. package/skills/verify/references/self-test-guide.md +240 -0
  92. package/skills/verify/references/verify-rollback-map.md +247 -0
  93. package/src/cli/commands/_helpers.js +108 -0
  94. package/src/cli/commands/_submit.js +718 -0
  95. package/src/cli/commands/apply.js +198 -0
  96. package/src/cli/commands/archive.js +180 -0
  97. package/src/cli/commands/checkpoint.js +113 -0
  98. package/src/cli/commands/deliver.js +377 -0
  99. package/src/cli/commands/deploy.js +504 -0
  100. package/src/cli/commands/design.js +158 -0
  101. package/src/cli/commands/disable.js +21 -0
  102. package/src/cli/commands/doctor.js +178 -0
  103. package/src/cli/commands/enable.js +21 -0
  104. package/src/cli/commands/flow.js +645 -0
  105. package/src/cli/commands/help.js +93 -0
  106. package/src/cli/commands/ingest.js +602 -0
  107. package/src/cli/commands/init.js +341 -0
  108. package/src/cli/commands/knowledge.js +523 -0
  109. package/src/cli/commands/logs.js +43 -0
  110. package/src/cli/commands/new.js +202 -0
  111. package/src/cli/commands/plan.js +49 -0
  112. package/src/cli/commands/propose.js +27 -0
  113. package/src/cli/commands/provider.js +698 -0
  114. package/src/cli/commands/report.js +143 -0
  115. package/src/cli/commands/requirement.js +227 -0
  116. package/src/cli/commands/review.js +301 -0
  117. package/src/cli/commands/skills.js +457 -0
  118. package/src/cli/commands/status.js +925 -0
  119. package/src/cli/commands/switch.js +27 -0
  120. package/src/cli/commands/sync.js +47 -0
  121. package/src/cli/commands/test.js +366 -0
  122. package/src/cli/commands/uninstall.js +32 -0
  123. package/src/cli/commands/update.js +74 -0
  124. package/src/cli/commands/verify.js +354 -0
  125. package/src/cli/commands/worktree.js +78 -0
  126. package/src/cli/index.js +72 -0
  127. package/src/cli/parse-args.js +102 -0
  128. package/src/core/autodetect.js +271 -0
  129. package/src/core/change.js +208 -0
  130. package/src/core/checkpoint.js +217 -0
  131. package/src/core/config.js +60 -0
  132. package/src/core/delta.js +290 -0
  133. package/src/core/markers.js +59 -0
  134. package/src/core/paths.js +173 -0
  135. package/src/core/plan-tasks.js +36 -0
  136. package/src/core/project-routing.js +285 -0
  137. package/src/core/projects.js +200 -0
  138. package/src/core/state.js +200 -0
  139. package/src/core/workflow-check.js +177 -0
  140. package/src/core/workflow-init.js +34 -0
  141. package/src/core/workflow-picker.js +154 -0
  142. package/src/core/workflow-policy.js +119 -0
  143. package/src/core/workflow-suggest.js +181 -0
  144. package/src/core/workflow-verify.js +88 -0
  145. package/src/core/workflow.js +433 -0
  146. package/src/core/worktree.js +241 -0
  147. package/src/knowledge/categories.js +107 -0
  148. package/src/knowledge/classify.js +125 -0
  149. package/src/knowledge/deposit.js +414 -0
  150. package/src/knowledge/migrate.js +149 -0
  151. package/src/knowledge/mr.js +219 -0
  152. package/src/knowledge/query.js +131 -0
  153. package/src/knowledge/registry.js +151 -0
  154. package/src/knowledge/sync.js +179 -0
  155. package/src/providers/base.js +74 -0
  156. package/src/providers/drivers/api-yapi.js +78 -0
  157. package/src/providers/drivers/ci-jenkins.js +109 -0
  158. package/src/providers/drivers/intake-confluence.js +544 -0
  159. package/src/providers/drivers/kb-git.js +549 -0
  160. package/src/providers/drivers/kb-weknora.js +472 -0
  161. package/src/providers/drivers/notify-smtp.js +515 -0
  162. package/src/providers/drivers/observability-oss.js +43 -0
  163. package/src/providers/drivers/observability-sls.js +50 -0
  164. package/src/providers/lifecycle.js +135 -0
  165. package/src/providers/loader.js +132 -0
  166. package/src/providers/local.js +190 -0
  167. package/src/providers/userconfig.js +283 -0
  168. package/src/reports/aggregate.js +185 -0
  169. package/src/reports/coverage.js +163 -0
  170. package/src/reports/detect.js +143 -0
  171. package/src/reports/parse.js +236 -0
  172. package/src/templates/files/ci/github.yml +38 -0
  173. package/src/templates/files/ci/gitlab.yml +27 -0
  174. package/src/templates/files/design.md +63 -0
  175. package/src/templates/files/ide/devflow-workflow.md +58 -0
  176. package/src/templates/files/ide/project-overview-reference.md +1 -0
  177. package/src/templates/files/ide/project-overview.md +27 -0
  178. package/src/templates/files/knowledge-index.json +17 -0
  179. package/src/templates/files/knowledge.md +28 -0
  180. package/src/templates/files/meta.json +8 -0
  181. package/src/templates/files/plan.md +38 -0
  182. package/src/templates/files/proposal.md +33 -0
  183. package/src/templates/files/reports/contract-test.md +40 -0
  184. package/src/templates/files/reports/e2e-test.md +30 -0
  185. package/src/templates/files/reports/integration-test.md +36 -0
  186. package/src/templates/files/reports/joint-test.md +58 -0
  187. package/src/templates/files/reports/perf.md +24 -0
  188. package/src/templates/files/reports/regression.md +20 -0
  189. package/src/templates/files/reports/remote-test.md +55 -0
  190. package/src/templates/files/reports/self-test.md +43 -0
  191. package/src/templates/files/reports/smoke-test.md +22 -0
  192. package/src/templates/files/reports/unit-test.md +36 -0
  193. package/src/templates/files/requirement.md +51 -0
  194. package/src/templates/files/review.md +38 -0
  195. package/src/templates/files/tests.md +36 -0
  196. package/src/templates/files/verify.md +32 -0
  197. package/src/templates/index.js +21 -0
  198. package/src/utils/log.js +37 -0
@@ -0,0 +1,33 @@
1
+ ---
2
+ slug: ${slug}
3
+ title: ${title}
4
+ level: ${level}
5
+ source: ${source}
6
+ created: ${date}
7
+ status: draft
8
+ ---
9
+
10
+ # ${title}
11
+
12
+ ## 已知信息
13
+
14
+ - 来源类型:${sourceType}
15
+ - 来源引用:${sourceRef}
16
+ - 建议级别:${level}
17
+
18
+ ## 摘要
19
+
20
+ > 由 devflow ingest/new 生成的轻量问题卡。这里只保留已知信息,不预先塞空模板。
21
+
22
+ ${summary}
23
+
24
+ ## 待确认问题
25
+
26
+ - 范围边界是否已经明确?
27
+ - 验收口径是否能用可验证语言表达?
28
+ - 是否已确认涉及项目、接口、数据或配置变更?
29
+
30
+ ## 下一步
31
+
32
+ - 确认 problem_card checkpoint 后运行 \`devflow requirement\`
33
+ - 有历史背景时再运行 \`devflow knowledge query "<keywords>"\`
@@ -0,0 +1,40 @@
1
+ ---
2
+ slug: ${slug}
3
+ kind: contract
4
+ status: ${status}
5
+ failureType: ${failureType}
6
+ total: ${total}
7
+ passed: ${passed}
8
+ failed: ${failed}
9
+ coverage: ${coverage}
10
+ ts: ${date}
11
+ ---
12
+
13
+ # 调用链一致性验证报告
14
+
15
+ ## 环境信息
16
+
17
+ | 项 | 值 |
18
+ | --- | --- |
19
+ | API Base URL | ${apiBaseUrl} |
20
+ | 后端地址 | ${backendUrl} |
21
+ | 前端地址 | ${frontendUrl} |
22
+
23
+ ## 命令
24
+
25
+ ```bash
26
+ ${command}
27
+ ```
28
+
29
+ ## 验证重点
30
+
31
+ - 接口提供方与调用方字段、枚举、状态语义一致。
32
+ - returnUrl / callback / redirect / query 参数在链路中不丢失、不被错误复用。
33
+ - traceId / requestId 可贯穿入口、服务调用、异步回调和日志检索。
34
+ - YAPI / OpenAPI 契约与实现、测试用例保持一致。
35
+
36
+ ## 输出
37
+
38
+ ```text
39
+ ${output}
40
+ ```
@@ -0,0 +1,30 @@
1
+ ---
2
+ slug: ${slug}
3
+ kind: e2e
4
+ status: ${status}
5
+ failureType: ${failureType}
6
+ total: ${total}
7
+ passed: ${passed}
8
+ failed: ${failed}
9
+ ts: ${date}
10
+ ---
11
+
12
+ # 端到端测试报告
13
+
14
+ ## 场景
15
+
16
+ | ID | 场景 | 结果 | 截图 |
17
+ |----|------|------|------|
18
+ | E-1 | | 通过 / 失败 | screenshots/E-1.png |
19
+
20
+ ## 命令
21
+
22
+ ```
23
+ ${command}
24
+ ```
25
+
26
+ ## 输出
27
+
28
+ ```
29
+ ${output}
30
+ ```
@@ -0,0 +1,36 @@
1
+ ---
2
+ slug: ${slug}
3
+ kind: integration
4
+ status: ${status}
5
+ failureType: ${failureType}
6
+ total: ${total}
7
+ passed: ${passed}
8
+ failed: ${failed}
9
+ ts: ${date}
10
+ ---
11
+
12
+ # 集成测试报告
13
+
14
+ ## 环境
15
+
16
+ - 服务:
17
+ - 数据:
18
+ - 第三方:
19
+
20
+ ## 命令
21
+
22
+ ```
23
+ ${command}
24
+ ```
25
+
26
+ ## 摘要
27
+
28
+ - 用例:${total} 通过 ${passed} 失败 ${failed}
29
+
30
+ ## 输出
31
+
32
+ ```
33
+ ${output}
34
+ ```
35
+
36
+ ## 失败 / 抖动用例
@@ -0,0 +1,58 @@
1
+ ---
2
+ slug: ${slug}
3
+ kind: joint
4
+ status: ${status}
5
+ failureType: ${failureType}
6
+ total: ${total}
7
+ passed: ${passed}
8
+ failed: ${failed}
9
+ ts: ${date}
10
+ ---
11
+
12
+ # 联调测试报告
13
+
14
+ ## 环境信息
15
+
16
+ | 项目 | 值 |
17
+ |------|-----|
18
+ | 后端地址 | ${backendUrl} |
19
+ | 前端地址 | ${frontendUrl} |
20
+ | 数据库 / Mock | ${database} |
21
+ | 浏览器工具 | ${preflightTool} |
22
+ | 预检结果 | ${preflightStatus} |
23
+
24
+ ## 预检详情
25
+
26
+ ```
27
+ ${preflightDetail}
28
+ ```
29
+
30
+ ## 执行结果
31
+
32
+ | 指标 | 值 |
33
+ |------|-----|
34
+ | 总用例数 | ${total} |
35
+ | 通过 | ${passed} |
36
+ | 失败 | ${failed} |
37
+
38
+ ## 用例执行详情
39
+
40
+ | 测试用例 | 操作步骤 | 结果 | 截图 |
41
+ |----------|----------|------|------|
42
+ | TC-JOINT-1 | 打开页面 -> 操作 -> 验证结果 | 通过 / 失败 | screenshots/TC-JOINT-1.png |
43
+
44
+ ## 命令
45
+
46
+ ```
47
+ ${command}
48
+ ```
49
+
50
+ ## 输出
51
+
52
+ ```
53
+ ${output}
54
+ ```
55
+
56
+ ## 失败详情
57
+
58
+ (若 failed > 0,在此列出失败用例的页面截图、期望行为 vs 实际行为、后端日志定位线索)
@@ -0,0 +1,24 @@
1
+ ---
2
+ slug: ${slug}
3
+ kind: perf
4
+ status: ${status}
5
+ failureType: ${failureType}
6
+ ts: ${date}
7
+ ---
8
+
9
+ # 性能测试报告
10
+
11
+ ## 指标
12
+
13
+ | 指标 | 目标 | 实测 | 是否达标 |
14
+ |------|------|------|---------|
15
+ | QPS | | | |
16
+ | P99 | | | |
17
+ | 错误率 | | | |
18
+
19
+ ## 测试脚本 / 输出
20
+
21
+ ```
22
+ ${command}
23
+ ${output}
24
+ ```
@@ -0,0 +1,20 @@
1
+ ---
2
+ slug: ${slug}
3
+ kind: regression
4
+ status: ${status}
5
+ failureType: ${failureType}
6
+ ts: ${date}
7
+ ---
8
+
9
+ # 回归测试报告
10
+
11
+ ## 范围
12
+
13
+ - 受影响的旧功能:
14
+
15
+ ## 命令 / 输出
16
+
17
+ ```
18
+ ${command}
19
+ ${output}
20
+ ```
@@ -0,0 +1,55 @@
1
+ ---
2
+ slug: ${slug}
3
+ kind: remote
4
+ status: ${status}
5
+ failureType: ${failureType}
6
+ total: ${total}
7
+ passed: ${passed}
8
+ failed: ${failed}
9
+ ts: ${date}
10
+ ---
11
+
12
+ # 远程 API 测试报告
13
+
14
+ ## 环境信息
15
+
16
+ | 项目 | 值 |
17
+ |------|-----|
18
+ | 测试环境地址 | ${apiBaseUrl} |
19
+ | 预检结果 | ${preflightStatus} |
20
+
21
+ ## 预检详情
22
+
23
+ ```
24
+ ${preflightDetail}
25
+ ```
26
+
27
+ ## 执行结果
28
+
29
+ | 指标 | 值 |
30
+ |------|-----|
31
+ | 总用例数 | ${total} |
32
+ | 通过 | ${passed} |
33
+ | 失败 | ${failed} |
34
+
35
+ ## 用例执行详情
36
+
37
+ | 测试用例 | 接口 | 方法 | 结果 |
38
+ |----------|------|------|------|
39
+ | TC-REMOTE-1 | /api/example | GET / POST | 通过 / 失败 |
40
+
41
+ ## 命令
42
+
43
+ ```
44
+ ${command}
45
+ ```
46
+
47
+ ## 输出
48
+
49
+ ```
50
+ ${output}
51
+ ```
52
+
53
+ ## 失败详情
54
+
55
+ (若 failed > 0,在此列出失败用例的请求信息、响应状态码、响应体、期望值 vs 实际值)
@@ -0,0 +1,43 @@
1
+ ---
2
+ slug: ${slug}
3
+ kind: self-test
4
+ status: ${status}
5
+ ts: ${date}
6
+ acceptance_pass: ${acceptancePass}
7
+ acceptance_total: ${acceptanceTotal}
8
+ ---
9
+
10
+ # 提测自测报告 — ${title}
11
+
12
+ > 本文件由 \`devflow report self-test\` 生成,会被 \`devflow deliver\` 自动嵌入提测/PR 描述中。
13
+
14
+ ## 一、需求验收
15
+
16
+ | 验收项 | 结果 | 证据 |
17
+ |--------|------|------|
18
+ | (来自 requirement.md / proposal.md) | 通过 / 失败 | reports/xxx.md |
19
+
20
+ ## 二、测试覆盖
21
+
22
+ | 类型 | 报告 | 通过率 |
23
+ |------|------|--------|
24
+ | 单元测试 | reports/test-report.md#unit | ${unitPassRate} |
25
+ | 集成测试 | reports/test-report.md#integration | ${integrationPassRate} |
26
+ | 端到端测试 | reports/test-report.md#e2e | ${e2ePassRate} |
27
+ | 联调测试 | reports/test-report.md#joint | ${jointPassRate} |
28
+ | 远程 API | reports/test-report.md#remote | ${remotePassRate} |
29
+ | 冒烟测试 | reports/test-report.md#smoke | ${smokePassRate} |
30
+
31
+ ## 三、风险与遗留
32
+
33
+ - (已知问题、降级策略、回滚方案)
34
+
35
+ ## 四、配置 / DDL / 环境差异
36
+
37
+ - DDL:见 \`design.md#ddl\`
38
+ - 配置:列出新增配置项与默认值
39
+
40
+ ## 五、提测结论
41
+
42
+ - [ ] 通过自测,可提测
43
+ - [ ] 待修复后再次自测
@@ -0,0 +1,22 @@
1
+ ---
2
+ slug: ${slug}
3
+ kind: smoke
4
+ status: ${status}
5
+ failureType: ${failureType}
6
+ ts: ${date}
7
+ ---
8
+
9
+ # 冒烟测试报告
10
+
11
+ ## 检查项
12
+
13
+ - [ ] 服务可启动
14
+ - [ ] 关键路径可调通(列出具体接口)
15
+ - [ ] 健康检查 200
16
+
17
+ ## 命令 / 输出
18
+
19
+ ```
20
+ ${command}
21
+ ${output}
22
+ ```
@@ -0,0 +1,36 @@
1
+ ---
2
+ slug: ${slug}
3
+ kind: unit
4
+ status: ${status}
5
+ failureType: ${failureType}
6
+ total: ${total}
7
+ passed: ${passed}
8
+ failed: ${failed}
9
+ coverage: ${coverage}
10
+ ts: ${date}
11
+ ---
12
+
13
+ # 单元测试报告
14
+
15
+ ## 命令
16
+
17
+ ```
18
+ ${command}
19
+ ```
20
+
21
+ ## 摘要
22
+
23
+ - 用例总数:${total}
24
+ - 通过:${passed}
25
+ - 失败:${failed}
26
+ - 覆盖率:${coverage}
27
+
28
+ ## 输出
29
+
30
+ ```
31
+ ${output}
32
+ ```
33
+
34
+ ## 失败用例
35
+
36
+ (若 failed > 0,在此列出每个失败用例的名称、断言、根因)
@@ -0,0 +1,51 @@
1
+ ---
2
+ slug: ${slug}
3
+ phase: requirement
4
+ status: draft
5
+ ---
6
+
7
+ # 结构化需求 — ${title}
8
+
9
+ ## 1. 业务背景
10
+
11
+ (由 proposal 复用 + 双轮澄清补全)
12
+
13
+ ## 2. 用户故事 / 使用场景
14
+
15
+ - 作为 ___,我希望 ___,以便 ___
16
+
17
+ ## 3. 功能需求
18
+
19
+ | ID | 描述 | 优先级 | 验收标准 |
20
+ |----|------|--------|---------|
21
+ | F-1 | | P0 | |
22
+
23
+ ## 4. 非功能需求
24
+
25
+ - 性能:
26
+ - 安全:
27
+ - 可用性:
28
+ - 可观测:
29
+
30
+ ## 5. 数据/接口影响
31
+
32
+ - 数据库 DDL:[ ] 无 / [ ] 见 \`design.md#ddl\`
33
+ - 接口契约:[ ] 无 / [ ] 见 \`design.md#contracts\`
34
+
35
+ ## 6. 第一轮澄清(业务)
36
+
37
+ > 与产品/业务方对齐,Q&A 形式记录
38
+
39
+ - Q:
40
+ - A:
41
+
42
+ ## 7. 第二轮澄清(实现)
43
+
44
+ > 基于代码侦察后,与设计/开发方对齐
45
+
46
+ - Q:
47
+ - A:
48
+
49
+ ## 8. 风险与待决项
50
+
51
+ - [ ]
@@ -0,0 +1,38 @@
1
+ ---
2
+ slug: ${slug}
3
+ phase: review
4
+ status: draft
5
+ iteration: 0
6
+ ---
7
+
8
+ # 代码审查 — ${title}
9
+
10
+ ## 第 0 轮:初始提交
11
+
12
+ - commit: (待填)
13
+ - 摘要:
14
+
15
+ ## 审查发现
16
+
17
+ | ID | 等级 | 文件 | 描述 | 状态 |
18
+ |----|------|------|------|------|
19
+ | R-1 | 阻断 / 严重 / 轻微 | | | 未处理 / 已解决 |
20
+
21
+ ## 第 1~3 轮迭代
22
+
23
+ > 最多 3 轮 review-bugfix 闭环,超过即升级 design.md 重新评审
24
+
25
+ ### 第 1 轮
26
+
27
+ - 修复了:R-1, R-2
28
+ - 引入新发现:
29
+
30
+ ### 第 2 轮
31
+
32
+ ### 第 3 轮
33
+
34
+ ## 验收
35
+
36
+ - [ ] 所有阻断问题已修复
37
+ - [ ] 所有测试通过
38
+ - [ ] 无新增技术债
@@ -0,0 +1,36 @@
1
+ ---
2
+ slug: ${slug}
3
+ phase: tests
4
+ status: draft
5
+ ---
6
+
7
+ # 测试用例 — ${title}
8
+
9
+ ## 用例索引
10
+
11
+ | ID | 类型 | 名称 | 优先级 |
12
+ |----|------|------|--------|
13
+ | TC-001 | 单元测试 | | P0 |
14
+ | TC-002 | 集成测试 | | P0 |
15
+ | TC-003 | 端到端测试 | | P1 |
16
+
17
+ ## TC-001 (用例名)
18
+
19
+ - 类型:单元测试
20
+ - 前置条件:
21
+ - 步骤:
22
+ 1. ...
23
+ - 预期:
24
+ - 关联需求:F-1
25
+
26
+ ## TC-002
27
+
28
+ (同上)
29
+
30
+ ## 数据准备
31
+
32
+ - (sql/mock 数据描述)
33
+
34
+ ## 环境
35
+
36
+ - (依赖服务、版本)
@@ -0,0 +1,32 @@
1
+ ---
2
+ slug: ${slug}
3
+ phase: verify
4
+ status: draft
5
+ overall: pending
6
+ ---
7
+
8
+ # 验证报告 — ${title}
9
+
10
+ ## 总结
11
+
12
+ | 维度 | 状态 | 报告 |
13
+ |------|------|------|
14
+ | 单元测试 | – | reports/test-report.md#unit |
15
+ | 集成测试 | – | reports/test-report.md#integration |
16
+ | 端到端 | – | reports/test-report.md#e2e |
17
+ | 冒烟 | – | reports/test-report.md#smoke |
18
+ | 自测(提测) | – | reports/test-report.md#self-test |
19
+ | 回归 | – | reports/test-report.md#regression |
20
+ | 性能 | – | reports/test-report.md#perf |
21
+
22
+ ## 验收清单(对齐 requirement.md)
23
+
24
+ - [ ] F-1
25
+ - [ ] F-2
26
+
27
+ ## 风险与遗留
28
+
29
+ ## 结论
30
+
31
+ - [ ] 通过,可进入 \`devflow deliver\`
32
+ - [ ] 不通过,回退到:
@@ -0,0 +1,21 @@
1
+ 'use strict';
2
+ const fs = require('fs/promises');
3
+ const path = require('path');
4
+
5
+ const ROOT = __dirname;
6
+
7
+ function render(tpl, vars) {
8
+ return tpl.replace(/\$\{(\w+)\}/g, (m, k) => (vars && vars[k] !== undefined ? String(vars[k]) : ''));
9
+ }
10
+
11
+ async function load(name) {
12
+ const file = path.join(ROOT, 'files', name);
13
+ return fs.readFile(file, 'utf8');
14
+ }
15
+
16
+ async function renderFile(name, vars) {
17
+ const tpl = await load(name);
18
+ return render(tpl, vars || {});
19
+ }
20
+
21
+ module.exports = { render, load, renderFile, ROOT };
@@ -0,0 +1,37 @@
1
+ 'use strict';
2
+ // Minimal ANSI-colored logger. No external deps.
3
+
4
+ const isTTY = process.stdout && process.stdout.isTTY;
5
+ const NO_COLOR = process.env.NO_COLOR === '1' || process.env.NO_COLOR === 'true';
6
+ const useColor = isTTY && !NO_COLOR;
7
+
8
+ function paint(code, msg) {
9
+ if (!useColor) return msg;
10
+ return `\x1b[${code}m${msg}\x1b[0m`;
11
+ }
12
+
13
+ const colors = {
14
+ dim: (s) => paint('2', s),
15
+ red: (s) => paint('31', s),
16
+ green: (s) => paint('32', s),
17
+ yellow: (s) => paint('33', s),
18
+ blue: (s) => paint('34', s),
19
+ magenta: (s) => paint('35', s),
20
+ cyan: (s) => paint('36', s),
21
+ bold: (s) => paint('1', s),
22
+ };
23
+
24
+ function tag(label, color) {
25
+ return `[${colors[color](label)}]`;
26
+ }
27
+
28
+ module.exports = {
29
+ colors,
30
+ info: (msg) => console.log(`${tag('df', 'cyan')} ${msg}`),
31
+ ok: (msg) => console.log(`${tag('ok', 'green')} ${msg}`),
32
+ warn: (msg) => console.warn(`${tag('warn', 'yellow')} ${msg}`),
33
+ error: (msg) => console.error(`${tag('error', 'red')} ${msg}`),
34
+ step: (label, msg) => console.log(`${tag(label, 'magenta')} ${msg}`),
35
+ dim: (msg) => console.log(colors.dim(msg)),
36
+ raw: (msg) => console.log(msg),
37
+ };