universal-dev-standards 6.8.0 → 6.9.0
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.
- package/bin/uds.js +12 -2
- package/bundled/ai/standards/acceptance-criteria-traceability.ai.yaml +14 -2
- package/bundled/ai/standards/adr-standards.ai.yaml +14 -2
- package/bundled/ai/standards/code-review.ai.yaml +13 -3
- package/bundled/ai/standards/commit-message.ai.yaml +8 -4
- package/bundled/ai/standards/deferred-item-exit.ai.yaml +225 -0
- package/bundled/ai/standards/feature-discovery-standards.ai.yaml +14 -2
- package/bundled/ai/standards/governance-layer.ai.yaml +128 -2
- package/bundled/ai/standards/logging.ai.yaml +2 -2
- package/bundled/ai/standards/retrospective-standards.ai.yaml +14 -2
- package/bundled/ai/standards/reverse-engineering-standards.ai.yaml +73 -2
- package/bundled/ai/standards/security-standards.ai.yaml +2 -2
- package/bundled/ai/standards/spec-driven-development.ai.yaml +14 -2
- package/bundled/ai/standards/tech-debt-standards.ai.yaml +87 -3
- package/bundled/ai/standards/turn-completion-integrity.ai.yaml +131 -0
- package/bundled/core/acceptance-criteria-traceability.md +5 -2
- package/bundled/core/adr-standards.md +26 -2
- package/bundled/core/code-review-checklist.md +5 -2
- package/bundled/core/context-aware-loading.md +1 -1
- package/bundled/core/deferred-item-exit.md +254 -0
- package/bundled/core/feature-discovery-standards.md +5 -1
- package/bundled/core/governance-layer.md +114 -2
- package/bundled/core/retrospective-standards.md +4 -2
- package/bundled/core/reverse-engineering-standards.md +81 -2
- package/bundled/core/spec-driven-development.md +8 -2
- package/bundled/core/tech-debt-standards.md +67 -8
- package/bundled/core/turn-completion-integrity.md +196 -0
- package/bundled/hooks/check-dangerous-cmd.mjs +60 -0
- package/bundled/hooks/check-logging-standard.mjs +59 -0
- package/bundled/hooks/check-turn-completion.mjs +233 -0
- package/bundled/hooks/inject-standards.mjs +183 -0
- package/bundled/hooks/telemetry-wrapper.mjs +77 -0
- package/bundled/hooks/turn-completion/detect.mjs +99 -0
- package/bundled/hooks/turn-completion/locales/en.mjs +159 -0
- package/bundled/hooks/turn-completion/locales/zh-TW.mjs +166 -0
- package/bundled/hooks/validate-commit-msg.mjs +104 -0
- package/bundled/locales/zh-CN/CHANGELOG.md +47 -3
- package/bundled/locales/zh-CN/CLAUDE.md +1 -1
- package/bundled/locales/zh-CN/README.md +2 -2
- package/bundled/locales/zh-CN/SECURITY.md +1 -1
- package/bundled/locales/zh-CN/core/adr-standards.md +1 -1
- package/bundled/locales/zh-CN/core/governance-layer.md +118 -6
- package/bundled/locales/zh-CN/core/retrospective-standards.md +1 -1
- package/bundled/locales/zh-CN/core/tech-debt-standards.md +71 -4
- package/bundled/locales/zh-CN/core/turn-completion-integrity.md +190 -0
- package/bundled/locales/zh-CN/docs/CHEATSHEET.md +8 -1
- package/bundled/locales/zh-CN/docs/CLI-INIT-OPTIONS.md +29 -68
- package/bundled/locales/zh-CN/docs/FEATURE-REFERENCE.md +25 -15
- package/bundled/locales/zh-CN/docs/USAGE-MODES-COMPARISON.md +1 -2
- package/bundled/locales/zh-CN/integrations/google-antigravity/{INSTRUCTIONS.md → AGENTS.md} +1 -1
- package/bundled/locales/zh-CN/integrations/google-antigravity/README.md +3 -3
- package/bundled/locales/zh-CN/skills/atdd-assistant/SKILL.md +2 -0
- package/bundled/locales/zh-CN/skills/bdd-assistant/SKILL.md +2 -0
- package/bundled/locales/zh-CN/skills/brainstorm-assistant/SKILL.md +22 -12
- package/bundled/locales/zh-CN/skills/brainstorm-assistant/guide.md +12 -9
- package/bundled/locales/zh-CN/skills/code-review-assistant/SKILL.md +1 -0
- package/bundled/locales/zh-CN/skills/commands/brainstorm.md +17 -13
- package/bundled/locales/zh-CN/skills/commands/config.md +0 -1
- package/bundled/locales/zh-CN/skills/commands/init.md +1 -2
- package/bundled/locales/zh-CN/skills/commit-standards/SKILL.md +2 -0
- package/bundled/locales/zh-CN/skills/contract-test-assistant/SKILL.md +1 -0
- package/bundled/locales/zh-CN/skills/dev-methodology/SKILL.md +2 -0
- package/bundled/locales/zh-CN/skills/observability-assistant/SKILL.md +1 -0
- package/bundled/locales/zh-CN/skills/project-structure-guide/SKILL.md +1 -0
- package/bundled/locales/zh-CN/skills/release-standards/SKILL.md +3 -0
- package/bundled/locales/zh-CN/skills/requirement-assistant/SKILL.md +2 -0
- package/bundled/locales/zh-CN/skills/reverse-engineer/SKILL.md +3 -0
- package/bundled/locales/zh-CN/skills/runbook-assistant/SKILL.md +1 -0
- package/bundled/locales/zh-CN/skills/slo-assistant/SKILL.md +1 -0
- package/bundled/locales/zh-CN/skills/tdd-assistant/SKILL.md +2 -0
- package/bundled/locales/zh-TW/CHANGELOG.md +47 -3
- package/bundled/locales/zh-TW/CLAUDE.md +1 -1
- package/bundled/locales/zh-TW/README.md +2 -2
- package/bundled/locales/zh-TW/SECURITY.md +1 -1
- package/bundled/locales/zh-TW/core/acceptance-criteria-traceability.md +2 -0
- package/bundled/locales/zh-TW/core/adr-standards.md +26 -5
- package/bundled/locales/zh-TW/core/code-review-checklist.md +2 -0
- package/bundled/locales/zh-TW/core/container-image-standards.md +2 -2
- package/bundled/locales/zh-TW/core/contract-testing-standards.md +2 -2
- package/bundled/locales/zh-TW/core/cross-flow-regression.md +8 -7
- package/bundled/locales/zh-TW/core/data-contract.md +2 -2
- package/bundled/locales/zh-TW/core/data-migration-testing.md +2 -2
- package/bundled/locales/zh-TW/core/data-pipeline.md +2 -2
- package/bundled/locales/zh-TW/core/deferred-item-exit.md +251 -0
- package/bundled/locales/zh-TW/core/documentation-writing-standards.md +228 -3
- package/bundled/locales/zh-TW/core/full-coverage-testing.md +15 -2
- package/bundled/locales/zh-TW/core/governance-layer.md +118 -5
- package/bundled/locales/zh-TW/core/iac-design-principles.md +2 -2
- package/bundled/locales/zh-TW/core/incident-response.md +2 -2
- package/bundled/locales/zh-TW/core/model-provenance.md +4 -2
- package/bundled/locales/zh-TW/core/pii-classification.md +42 -6
- package/bundled/locales/zh-TW/core/prd-standards.md +4 -2
- package/bundled/locales/zh-TW/core/product-metrics-standards.md +4 -2
- package/bundled/locales/zh-TW/core/release-readiness-gate.md +2 -2
- package/bundled/locales/zh-TW/core/resource-cost-boundary.md +2 -2
- package/bundled/locales/zh-TW/core/retrospective-standards.md +5 -3
- package/bundled/locales/zh-TW/core/reverse-engineering-standards.md +83 -5
- package/bundled/locales/zh-TW/core/runbook.md +2 -2
- package/bundled/locales/zh-TW/core/schema-evolution.md +2 -2
- package/bundled/locales/zh-TW/core/secret-management-standards.md +2 -2
- package/bundled/locales/zh-TW/core/slo-sli.md +2 -2
- package/bundled/locales/zh-TW/core/spec-driven-development.md +2 -0
- package/bundled/locales/zh-TW/core/tech-debt-standards.md +71 -4
- package/bundled/locales/zh-TW/core/turn-completion-integrity.md +190 -0
- package/bundled/locales/zh-TW/core/user-journey-testing.md +2 -2
- package/bundled/locales/zh-TW/core/user-story-mapping.md +2 -2
- package/bundled/locales/zh-TW/core/verification-oracle.md +2 -2
- package/bundled/locales/zh-TW/docs/CHEATSHEET.md +8 -1
- package/bundled/locales/zh-TW/docs/CLI-INIT-OPTIONS.md +29 -68
- package/bundled/locales/zh-TW/docs/FEATURE-REFERENCE.md +25 -15
- package/bundled/locales/zh-TW/docs/USAGE-MODES-COMPARISON.md +1 -2
- package/bundled/locales/zh-TW/integrations/google-antigravity/{INSTRUCTIONS.md → AGENTS.md} +1 -1
- package/bundled/locales/zh-TW/integrations/google-antigravity/README.md +3 -3
- package/bundled/locales/zh-TW/skills/adr-assistant/SKILL.md +1 -1
- package/bundled/locales/zh-TW/skills/atdd-assistant/SKILL.md +2 -0
- package/bundled/locales/zh-TW/skills/bdd-assistant/SKILL.md +2 -0
- package/bundled/locales/zh-TW/skills/brainstorm-assistant/SKILL.md +22 -12
- package/bundled/locales/zh-TW/skills/brainstorm-assistant/guide.md +12 -9
- package/bundled/locales/zh-TW/skills/code-review-assistant/SKILL.md +1 -0
- package/bundled/locales/zh-TW/skills/commands/brainstorm.md +17 -13
- package/bundled/locales/zh-TW/skills/commands/config.md +0 -1
- package/bundled/locales/zh-TW/skills/commands/init.md +1 -2
- package/bundled/locales/zh-TW/skills/commit-standards/SKILL.md +2 -0
- package/bundled/locales/zh-TW/skills/contract-test-assistant/SKILL.md +2 -1
- package/bundled/locales/zh-TW/skills/dev-methodology/SKILL.md +2 -0
- package/bundled/locales/zh-TW/skills/dev-workflow-guide/SKILL.md +1 -1
- package/bundled/locales/zh-TW/skills/knowledge-graph/guide.md +2 -2
- package/bundled/locales/zh-TW/skills/migration-assistant/SKILL.md +1 -1
- package/bundled/locales/zh-TW/skills/observability-assistant/SKILL.md +1 -0
- package/bundled/locales/zh-TW/skills/project-discovery/SKILL.md +1 -0
- package/bundled/locales/zh-TW/skills/project-structure-guide/SKILL.md +1 -0
- package/bundled/locales/zh-TW/skills/release-standards/SKILL.md +3 -0
- package/bundled/locales/zh-TW/skills/requirement-assistant/SKILL.md +2 -0
- package/bundled/locales/zh-TW/skills/reverse-engineer/SKILL.md +3 -0
- package/bundled/locales/zh-TW/skills/runbook-assistant/SKILL.md +1 -0
- package/bundled/locales/zh-TW/skills/slo-assistant/SKILL.md +1 -0
- package/bundled/locales/zh-TW/skills/tdd-assistant/SKILL.md +2 -0
- package/bundled/skills/atdd-assistant/SKILL.md +2 -0
- package/bundled/skills/bdd-assistant/SKILL.md +2 -0
- package/bundled/skills/brainstorm-assistant/SKILL.md +31 -13
- package/bundled/skills/brainstorm-assistant/guide.md +9 -6
- package/bundled/skills/code-review-assistant/SKILL.md +1 -0
- package/bundled/skills/commands/brainstorm.md +12 -9
- package/bundled/skills/commands/config.md +0 -1
- package/bundled/skills/commands/init.md +2 -3
- package/bundled/skills/commit-standards/SKILL.md +2 -0
- package/bundled/skills/contract-test-assistant/SKILL.md +1 -0
- package/bundled/skills/dev-methodology/SKILL.md +4 -0
- package/bundled/skills/observability-assistant/SKILL.md +1 -0
- package/bundled/skills/project-discovery/SKILL.md +1 -0
- package/bundled/skills/project-structure-guide/SKILL.md +1 -0
- package/bundled/skills/release-standards/SKILL.md +3 -0
- package/bundled/skills/requirement-assistant/SKILL.md +2 -0
- package/bundled/skills/reverse-engineer/SKILL.md +3 -0
- package/bundled/skills/runbook-assistant/SKILL.md +1 -0
- package/bundled/skills/slo-assistant/SKILL.md +1 -0
- package/bundled/skills/tdd-assistant/SKILL.md +2 -0
- package/bundled/templates/.ai-context.yaml.template +194 -0
- package/bundled/templates/CLAUDE.md.template +145 -0
- package/bundled/templates/DESIGN.md +237 -0
- package/bundled/templates/SKILL-BRIEF-TEMPLATE.md +57 -0
- package/bundled/templates/SKILL-CANDIDATES.md +39 -0
- package/bundled/templates/gates/check-error-exit.mjs +309 -0
- package/bundled/templates/mcp-config.json +10 -0
- package/bundled/templates/methodology-template.yaml +209 -0
- package/bundled/templates/migration-template.md +408 -0
- package/bundled/templates/requirement-checklist.md +410 -0
- package/bundled/templates/requirement-document-template.md +591 -0
- package/bundled/templates/requirement-template.md +881 -0
- package/bundled/templates/reverse-spec-template.md +409 -0
- package/bundled/templates/test-case-template.md +74 -0
- package/bundled/templates/test-plan-template.md +74 -0
- package/package.json +7 -5
- package/src/commands/audit.js +82 -0
- package/src/commands/check.js +66 -10
- package/src/commands/init.js +161 -16
- package/src/commands/update.js +286 -14
- package/src/compilers/claude-code-compiler.js +4 -1
- package/src/config/ai-agent-paths.js +62 -17
- package/src/core/constants.js +42 -11
- package/src/core/manifest.js +201 -3
- package/src/core/paths.js +2 -2
- package/src/i18n/messages.js +6 -29
- package/src/installers/hooks-installer.js +167 -75
- package/src/installers/integration-installer.js +9 -5
- package/src/prompts/init.js +14 -14
- package/src/utils/detector.js +21 -1
- package/src/utils/effect-boundary.js +1093 -0
- package/src/utils/hasher.js +166 -1
- package/src/utils/hook-stats.js +1 -1
- package/src/utils/integration-generator.js +79 -1
- package/src/utils/reference-sync.js +4 -1
- package/src/utils/yaml-generator.js +51 -9
- package/standards-registry.json +31 -8
|
@@ -0,0 +1,591 @@
|
|
|
1
|
+
# 需求確認書格式規範
|
|
2
|
+
|
|
3
|
+
**版本**: 1.0.1
|
|
4
|
+
**建立日期**: 2025-01-13
|
|
5
|
+
**適用專案**: All software projects | 所有軟體專案
|
|
6
|
+
**文件類型**: 開發規範
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 一、文件目的
|
|
11
|
+
|
|
12
|
+
本規範定義軟體專案的**需求確認書標準格式**,確保:
|
|
13
|
+
|
|
14
|
+
1. **格式一致性** - 所有需求文件結構統一
|
|
15
|
+
2. **內容完整性** - 涵蓋所有必要資訊
|
|
16
|
+
3. **可執行性** - 包含足夠的實作細節
|
|
17
|
+
4. **可追蹤性** - 版本控制與變更歷史清晰
|
|
18
|
+
5. **客戶導向** - 便於客戶理解與確認
|
|
19
|
+
|
|
20
|
+
## 二、何時使用此範本
|
|
21
|
+
|
|
22
|
+
以下情況應建立需求確認書:
|
|
23
|
+
|
|
24
|
+
- ✅ **新增重大功能** (預估工時 > 16 小時)
|
|
25
|
+
- ✅ **架構變更** (影響多個模組或層級)
|
|
26
|
+
- ✅ **外部 API 整合** (第三方服務或新 API 端點)
|
|
27
|
+
- ✅ **效能優化專案** (需要演算法或架構調整)
|
|
28
|
+
- ✅ **客戶需求確認** (需要正式文件與簽核)
|
|
29
|
+
- ✅ **資料庫結構變更** (新增表、欄位或索引)
|
|
30
|
+
|
|
31
|
+
以下情況可使用簡化文件:
|
|
32
|
+
|
|
33
|
+
- ⚠️ **小型功能調整** (< 8 小時) - 可使用 Issue 或簡短技術文件
|
|
34
|
+
- ⚠️ **Bug 修復** - 使用 Bug Report 格式
|
|
35
|
+
- ⚠️ **文件更新** - 直接修改相關文件
|
|
36
|
+
|
|
37
|
+
## 三、標準文件結構
|
|
38
|
+
|
|
39
|
+
### 3.1 文件標頭 (必填)
|
|
40
|
+
|
|
41
|
+
```markdown
|
|
42
|
+
# [功能名稱] - 需求確認書
|
|
43
|
+
|
|
44
|
+
**文件版本**: 1.0
|
|
45
|
+
**建立日期**: YYYY-MM-DD
|
|
46
|
+
**最後更新**: YYYY-MM-DD
|
|
47
|
+
**專案名稱**: [YourProject]
|
|
48
|
+
**功能名稱**: [英文功能名稱]
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**說明**:
|
|
52
|
+
- 文件標題使用繁體中文
|
|
53
|
+
- 版本號遵循 SemVer (1.0 為初版)
|
|
54
|
+
- 日期格式: YYYY-MM-DD
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
### 3.2 核心章節 (14 章 - 必填)
|
|
59
|
+
|
|
60
|
+
#### 第一章: 功能概述
|
|
61
|
+
|
|
62
|
+
**用途**: 簡要說明「為什麼」需要此功能、「做什麼」
|
|
63
|
+
|
|
64
|
+
**必填內容**:
|
|
65
|
+
- 1-2 段功能說明
|
|
66
|
+
- 核心價值主張
|
|
67
|
+
- 與現有系統的關係
|
|
68
|
+
|
|
69
|
+
**範例**:
|
|
70
|
+
```markdown
|
|
71
|
+
## 一、功能概述
|
|
72
|
+
|
|
73
|
+
在現有的「白名單規則檢查」(Regex 模式匹配)之前,新增「白名單字串檢查」功能,
|
|
74
|
+
訊息必須包含白名單字串資料庫中的任一字串才能通過初步檢查。
|
|
75
|
+
|
|
76
|
+
此功能可快速過濾大量安全訊息,減少進入人工審核的訊息量,提升整體處理效率。
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
#### 第二章: 核心需求確認
|
|
82
|
+
|
|
83
|
+
**用途**: 詳細定義功能需求,避免需求模糊
|
|
84
|
+
|
|
85
|
+
**必填內容**:
|
|
86
|
+
- 功能需求清單 (FR1, FR2, ...)
|
|
87
|
+
- 非功能需求 (效能、安全、可用性)
|
|
88
|
+
- 使用者故事 (可選)
|
|
89
|
+
- 資料流程圖
|
|
90
|
+
|
|
91
|
+
**撰寫技巧**:
|
|
92
|
+
- 使用「必須」、「應該」、「可以」區分優先級
|
|
93
|
+
- 每個需求可驗證、可測試
|
|
94
|
+
- 包含具體數字 (如「支援 10,000+ 筆字串」)
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
#### 第三章: 技術方案概要
|
|
99
|
+
|
|
100
|
+
**用途**: 說明「如何」實現需求 (高層次設計)
|
|
101
|
+
|
|
102
|
+
**必填內容**:
|
|
103
|
+
- 核心技術選型 (演算法、框架、套件)
|
|
104
|
+
- 資料庫設計 (新增表、索引)
|
|
105
|
+
- 架構設計 (分層架構、元件關係)
|
|
106
|
+
- 資料流程圖
|
|
107
|
+
|
|
108
|
+
**範例結構**:
|
|
109
|
+
```markdown
|
|
110
|
+
### 3.1 資料庫設計
|
|
111
|
+
- WhitelistString 表
|
|
112
|
+
- WhitelistStringMatchLog 表
|
|
113
|
+
|
|
114
|
+
### 3.2 核心演算法
|
|
115
|
+
- Aho-Corasick 多模式字串匹配
|
|
116
|
+
|
|
117
|
+
### 3.3 資料流程
|
|
118
|
+
[流程圖]
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
#### 第四章: 新舊架構比較 (新功能必填)
|
|
124
|
+
|
|
125
|
+
**用途**: 清楚呈現變更影響範圍
|
|
126
|
+
|
|
127
|
+
**必填內容**:
|
|
128
|
+
- 4.1 現有架構 (舊版)
|
|
129
|
+
- 架構圖
|
|
130
|
+
- 元件清單
|
|
131
|
+
- 現有邏輯程式碼片段
|
|
132
|
+
- 4.2 新架構 (新版)
|
|
133
|
+
- 新架構圖
|
|
134
|
+
- 新增元件清單
|
|
135
|
+
- 新邏輯程式碼片段
|
|
136
|
+
- 4.3 新舊架構對比表
|
|
137
|
+
- 4.4 記憶體/效能影響對比
|
|
138
|
+
|
|
139
|
+
**撰寫技巧**:
|
|
140
|
+
- 使用表格呈現對比
|
|
141
|
+
- 標註 [NEW] / [MODIFIED] / [DEPRECATED]
|
|
142
|
+
- 量化影響 (如記憶體增加 12 MB)
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
#### 第五章: 新舊流程比較 (新功能必填)
|
|
147
|
+
|
|
148
|
+
**用途**: 說明業務流程變化
|
|
149
|
+
|
|
150
|
+
**必填內容**:
|
|
151
|
+
- 5.1 現有流程 (舊版) - 流程圖 + 時間點
|
|
152
|
+
- 5.2 新流程 (新版) - 流程圖 + 時間點
|
|
153
|
+
- 5.3 流程對比表
|
|
154
|
+
- 5.4 多種模式的流程比較 (如有)
|
|
155
|
+
- 5.5 效能影響分析
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
#### 第六章: API 介面
|
|
160
|
+
|
|
161
|
+
**用途**: 定義 API 規格 (如有 API 變更)
|
|
162
|
+
|
|
163
|
+
**必填內容**:
|
|
164
|
+
- 每個 API 端點的詳細定義:
|
|
165
|
+
- HTTP Method + Path
|
|
166
|
+
- 請求參數 / Body
|
|
167
|
+
- 回應格式 (JSON 範例)
|
|
168
|
+
- 錯誤代碼說明
|
|
169
|
+
- 權限要求
|
|
170
|
+
|
|
171
|
+
**範例**:
|
|
172
|
+
```markdown
|
|
173
|
+
### 6.1 查詢白名單字串
|
|
174
|
+
|
|
175
|
+
**端點**: `GET /WhitelistString/{dbName}/GetWhitelistStrings/{pageSize}`
|
|
176
|
+
|
|
177
|
+
**查詢參數**:
|
|
178
|
+
- `moreID` (optional): 分頁 cursor
|
|
179
|
+
|
|
180
|
+
**回應**:
|
|
181
|
+
\```json
|
|
182
|
+
{
|
|
183
|
+
"strings": [...],
|
|
184
|
+
"hasMore": true
|
|
185
|
+
}
|
|
186
|
+
\```
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
#### 第七章: 設定參數
|
|
192
|
+
|
|
193
|
+
**用途**: 定義新增的設定項目
|
|
194
|
+
|
|
195
|
+
**必填內容**:
|
|
196
|
+
- appsettings.json 新增項目
|
|
197
|
+
- 參數說明表 (名稱、可選值、預設值、說明)
|
|
198
|
+
- 設定模式說明 (如有多種模式)
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
#### 第八章: 實作範圍
|
|
203
|
+
|
|
204
|
+
**用途**: 明確列出所有程式碼變更
|
|
205
|
+
|
|
206
|
+
**必填內容**:
|
|
207
|
+
- 8.1 新增檔案清單 (依層級分類)
|
|
208
|
+
- 8.2 修改檔案清單 (說明修改內容)
|
|
209
|
+
- 8.3 依賴套件 (新增 NuGet/npm 套件)
|
|
210
|
+
|
|
211
|
+
**撰寫技巧**:
|
|
212
|
+
- 依照 Clean Architecture 分層
|
|
213
|
+
- 標註每個檔案的用途
|
|
214
|
+
- 列出套件版本與授權
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
#### 第九章: 測試計畫
|
|
219
|
+
|
|
220
|
+
**用途**: 定義測試策略與驗收標準
|
|
221
|
+
|
|
222
|
+
**必填內容**:
|
|
223
|
+
- 9.1 單元測試 (測試案例清單)
|
|
224
|
+
- 9.2 效能測試 (目標效能指標)
|
|
225
|
+
- 9.3 整合測試 (端到端流程)
|
|
226
|
+
- 9.4 壓力測試 (可選)
|
|
227
|
+
|
|
228
|
+
**撰寫技巧**:
|
|
229
|
+
- 使用表格呈現測試案例
|
|
230
|
+
- 明確定義「通過」標準
|
|
231
|
+
- 包含效能基準 (如「< 5ms」)
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
#### 第十章: 預期效益
|
|
236
|
+
|
|
237
|
+
**用途**: 說明投資報酬率 (ROI)
|
|
238
|
+
|
|
239
|
+
**必填內容**:
|
|
240
|
+
- 10.1 業務效益 (質化描述)
|
|
241
|
+
- 10.2 技術效益 (質化描述)
|
|
242
|
+
- 10.3 可量化指標 (量化數據)
|
|
243
|
+
|
|
244
|
+
**撰寫技巧**:
|
|
245
|
+
- 使用對比表呈現改善幅度
|
|
246
|
+
- 標註「預估值」vs「實際值」
|
|
247
|
+
- 包含假設條件
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
#### 第十一章: 風險與限制
|
|
252
|
+
|
|
253
|
+
**用途**: 誠實揭露技術限制與業務風險
|
|
254
|
+
|
|
255
|
+
**必填內容**:
|
|
256
|
+
- 11.1 技術限制 (5 項以內)
|
|
257
|
+
- 11.2 業務風險 (3 項以內)
|
|
258
|
+
- 11.3 緩解措施 (每個風險的對策)
|
|
259
|
+
|
|
260
|
+
**撰寫技巧**:
|
|
261
|
+
- 具體說明限制條件 (如「不支援正則表達式」)
|
|
262
|
+
- 提供可行的緩解方案
|
|
263
|
+
- 誠實面對技術債
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
#### 第十二章: 實作時程估算
|
|
268
|
+
|
|
269
|
+
**用途**: 提供工時估算與里程碑
|
|
270
|
+
|
|
271
|
+
**必填內容**:
|
|
272
|
+
- 12.1 分階段工時估算 (表格)
|
|
273
|
+
- 12.2 里程碑規劃 (完成標準 + 日期)
|
|
274
|
+
|
|
275
|
+
**撰寫技巧**:
|
|
276
|
+
- 依照開發階段分解工時
|
|
277
|
+
- 包含測試與文件時間
|
|
278
|
+
- 預留 buffer (建議 20%)
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
#### 第十三章: 待客戶確認事項
|
|
283
|
+
|
|
284
|
+
**用途**: 收集客戶決策與回饋
|
|
285
|
+
|
|
286
|
+
**必填內容**:
|
|
287
|
+
- 已確認需求勾選清單
|
|
288
|
+
- 待決策問題 (6-10 個)
|
|
289
|
+
- 其他建議或疑慮欄位
|
|
290
|
+
|
|
291
|
+
**撰寫技巧**:
|
|
292
|
+
- 使用 Checkbox `- [ ]` 格式
|
|
293
|
+
- 每個問題提供選項
|
|
294
|
+
- 預留客戶填寫空間
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
#### 第十四章: 客戶簽核
|
|
299
|
+
|
|
300
|
+
**用途**: 正式簽核欄位
|
|
301
|
+
|
|
302
|
+
**必填內容**:
|
|
303
|
+
- 需求確認聲明勾選清單
|
|
304
|
+
- 變更管理條款
|
|
305
|
+
- 簽核資訊 (簽核人、日期、公司)
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
### 3.3 附錄章節 (選填)
|
|
310
|
+
|
|
311
|
+
#### 附錄 A: 資料表結構
|
|
312
|
+
|
|
313
|
+
**條件**: 有新增或修改資料表時
|
|
314
|
+
|
|
315
|
+
**內容**: 完整的 DDL (CREATE TABLE 語法)
|
|
316
|
+
|
|
317
|
+
---
|
|
318
|
+
|
|
319
|
+
#### 附錄 B: DTO 定義
|
|
320
|
+
|
|
321
|
+
**條件**: 有新增 API 或資料傳輸物件時
|
|
322
|
+
|
|
323
|
+
**內容**: C# class 定義 (含 XML 註解)
|
|
324
|
+
|
|
325
|
+
---
|
|
326
|
+
|
|
327
|
+
#### 附錄 C: 列舉型別定義
|
|
328
|
+
|
|
329
|
+
**條件**: 有新增 enum 時
|
|
330
|
+
|
|
331
|
+
**內容**: C# enum 定義
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
#### 附錄 D: 演算法說明
|
|
336
|
+
|
|
337
|
+
**條件**: 使用複雜演算法時
|
|
338
|
+
|
|
339
|
+
**內容**: 演算法原理、時間複雜度、空間複雜度
|
|
340
|
+
|
|
341
|
+
---
|
|
342
|
+
|
|
343
|
+
## 四、Markdown 格式規範
|
|
344
|
+
|
|
345
|
+
### 4.1 標題層級
|
|
346
|
+
|
|
347
|
+
```markdown
|
|
348
|
+
# 文件標題 (H1 - 僅用於文件標題)
|
|
349
|
+
## 一、章節標題 (H2 - 用於章節)
|
|
350
|
+
### 1.1 小節標題 (H3 - 用於小節)
|
|
351
|
+
#### 細項標題 (H4 - 用於細項)
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
### 4.2 表格格式
|
|
355
|
+
|
|
356
|
+
```markdown
|
|
357
|
+
| 欄位名稱 | 資料類型 | 說明 |
|
|
358
|
+
|---------|---------|------|
|
|
359
|
+
| ID | INTEGER | 主鍵 |
|
|
360
|
+
| Name | TEXT | 名稱 |
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
**要求**:
|
|
364
|
+
- 表頭使用 `|---|` 分隔線
|
|
365
|
+
- 欄位對齊使用空格調整
|
|
366
|
+
- 中文表格使用全形標點
|
|
367
|
+
|
|
368
|
+
### 4.3 程式碼區塊
|
|
369
|
+
|
|
370
|
+
````markdown
|
|
371
|
+
```csharp
|
|
372
|
+
// C# 程式碼
|
|
373
|
+
public class Example {
|
|
374
|
+
// ...
|
|
375
|
+
}
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
```json
|
|
379
|
+
// JSON 範例
|
|
380
|
+
{
|
|
381
|
+
"key": "value"
|
|
382
|
+
}
|
|
383
|
+
```
|
|
384
|
+
````
|
|
385
|
+
|
|
386
|
+
**要求**:
|
|
387
|
+
- 指定語言類型 (csharp, json, sql, bash, etc.)
|
|
388
|
+
- 加入註解說明關鍵邏輯
|
|
389
|
+
- 縮排使用 4 個空格
|
|
390
|
+
|
|
391
|
+
### 4.4 清單格式
|
|
392
|
+
|
|
393
|
+
```markdown
|
|
394
|
+
- 無序清單項目 1
|
|
395
|
+
- 無序清單項目 2
|
|
396
|
+
- 子項目 2.1
|
|
397
|
+
- 子項目 2.2
|
|
398
|
+
|
|
399
|
+
1. 有序清單項目 1
|
|
400
|
+
2. 有序清單項目 2
|
|
401
|
+
|
|
402
|
+
- [ ] 待辦事項 (未完成)
|
|
403
|
+
- [x] 待辦事項 (已完成)
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
### 4.5 強調與標記
|
|
407
|
+
|
|
408
|
+
```markdown
|
|
409
|
+
**粗體** - 用於重要關鍵字
|
|
410
|
+
*斜體* - 用於強調
|
|
411
|
+
`程式碼` - 用於 inline code
|
|
412
|
+
[連結文字](URL) - 用於超連結
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
### 4.6 流程圖與架構圖
|
|
416
|
+
|
|
417
|
+
使用 ASCII 藝術圖:
|
|
418
|
+
|
|
419
|
+
```markdown
|
|
420
|
+
┌─────────────┐
|
|
421
|
+
│ Box 1 │
|
|
422
|
+
└──────┬──────┘
|
|
423
|
+
↓
|
|
424
|
+
┌─────────────┐
|
|
425
|
+
│ Box 2 │
|
|
426
|
+
└─────────────┘
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
**符號表**:
|
|
430
|
+
- `┌ └ ┐ ┘` - 方框角落
|
|
431
|
+
- `─ │` - 水平與垂直線
|
|
432
|
+
- `├ ┤ ┬ ┴ ┼` - 連接點
|
|
433
|
+
- `↓ ↑ → ←` - 箭頭
|
|
434
|
+
|
|
435
|
+
---
|
|
436
|
+
|
|
437
|
+
## 五、版本控制規範
|
|
438
|
+
|
|
439
|
+
### 5.1 版本號規則
|
|
440
|
+
|
|
441
|
+
- **v1.0** - 初版發行
|
|
442
|
+
- **v1.1** - 新增章節或大幅修改 (如新增「新舊架構比較」)
|
|
443
|
+
- **v1.0.1** - 小幅修正 (錯字、格式調整)
|
|
444
|
+
|
|
445
|
+
### 5.2 版本歷史格式
|
|
446
|
+
|
|
447
|
+
```markdown
|
|
448
|
+
**版本歷史**:
|
|
449
|
+
- v1.1 (2025-01-13): 新增「新舊架構比較」與「新舊流程比較」章節
|
|
450
|
+
- v1.0 (2025-01-12): 初版發行
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
### 5.3 文件更新流程
|
|
454
|
+
|
|
455
|
+
1. 修改文件內容
|
|
456
|
+
2. 更新文件標頭的「最後更新」日期
|
|
457
|
+
3. 更新版本號 (依修改程度)
|
|
458
|
+
4. 新增版本歷史記錄
|
|
459
|
+
5. Commit 時使用 `文件(需求): [修改說明]` 格式
|
|
460
|
+
|
|
461
|
+
---
|
|
462
|
+
|
|
463
|
+
## 六、撰寫技巧與最佳實踐
|
|
464
|
+
|
|
465
|
+
### 6.1 語言使用
|
|
466
|
+
|
|
467
|
+
- **文件內容**: 繁體中文 (遵循 [extensions/locales/zh-tw.md](../extensions/locales/zh-tw.md))
|
|
468
|
+
- **程式碼**: 英文命名
|
|
469
|
+
- **專有名詞**: 保留英文 (如 API, Regex, JSON)
|
|
470
|
+
- **混合使用**: 「白名單字串檢查(Whitelist String Check)」
|
|
471
|
+
|
|
472
|
+
### 6.2 數字與單位
|
|
473
|
+
|
|
474
|
+
- **時間**: 使用「秒」、「毫秒 (ms)」、「分鐘」
|
|
475
|
+
- **容量**: 使用「MB」、「GB」
|
|
476
|
+
- **數量**: 使用「筆」、「則」、「個」
|
|
477
|
+
- **百分比**: 使用「%」或「↓ 50%」
|
|
478
|
+
|
|
479
|
+
### 6.3 引用程式碼
|
|
480
|
+
|
|
481
|
+
使用檔名:行號格式:
|
|
482
|
+
|
|
483
|
+
```markdown
|
|
484
|
+
現有檢查邏輯位於 `PlatformContainer.cs:1307-1352`:
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
### 6.4 架構圖繪製原則
|
|
488
|
+
|
|
489
|
+
- 由上而下 (資料流向)
|
|
490
|
+
- 方框內包含元件名稱
|
|
491
|
+
- 箭頭表示資料流或呼叫關係
|
|
492
|
+
- 標註關鍵步驟說明
|
|
493
|
+
|
|
494
|
+
### 6.5 對比表撰寫原則
|
|
495
|
+
|
|
496
|
+
- 第一欄: 比較項目
|
|
497
|
+
- 第二欄: 舊版
|
|
498
|
+
- 第三欄: 新版
|
|
499
|
+
- 第四欄: 差異 (使用 ✅ ❌ ⚠️ 標記)
|
|
500
|
+
|
|
501
|
+
---
|
|
502
|
+
|
|
503
|
+
## 七、品質檢查清單
|
|
504
|
+
|
|
505
|
+
完成需求確認書後,使用以下檢查清單自我檢查:
|
|
506
|
+
|
|
507
|
+
### 7.1 完整性檢查
|
|
508
|
+
|
|
509
|
+
- [ ] 14 個核心章節全部完成
|
|
510
|
+
- [ ] 文件標頭資訊完整
|
|
511
|
+
- [ ] 版本歷史記錄正確
|
|
512
|
+
- [ ] 必要的附錄已加入
|
|
513
|
+
|
|
514
|
+
### 7.2 技術準確性檢查
|
|
515
|
+
|
|
516
|
+
- [ ] 架構圖與程式碼一致
|
|
517
|
+
- [ ] API 規格可實作
|
|
518
|
+
- [ ] 資料表結構完整
|
|
519
|
+
- [ ] 效能指標合理
|
|
520
|
+
- [ ] 工時估算有依據
|
|
521
|
+
|
|
522
|
+
### 7.3 客戶可讀性檢查
|
|
523
|
+
|
|
524
|
+
- [ ] 避免過度技術術語
|
|
525
|
+
- [ ] 關鍵概念有說明
|
|
526
|
+
- [ ] 流程圖易於理解
|
|
527
|
+
- [ ] 客戶確認事項明確
|
|
528
|
+
- [ ] 預期效益清楚
|
|
529
|
+
|
|
530
|
+
### 7.4 格式一致性檢查
|
|
531
|
+
|
|
532
|
+
- [ ] Markdown 格式正確
|
|
533
|
+
- [ ] 表格對齊美觀
|
|
534
|
+
- [ ] 程式碼區塊有語言標記
|
|
535
|
+
- [ ] 超連結有效
|
|
536
|
+
- [ ] 中英文標點符號正確
|
|
537
|
+
|
|
538
|
+
---
|
|
539
|
+
|
|
540
|
+
## 八、範本使用流程
|
|
541
|
+
|
|
542
|
+
### 步驟 1: 複製範本
|
|
543
|
+
|
|
544
|
+
```bash
|
|
545
|
+
cp .standards/templates/requirement-template.md docs/[feature-name]-requirement.md
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
### 步驟 2: 填寫文件標頭
|
|
549
|
+
|
|
550
|
+
更新版本、日期、功能名稱
|
|
551
|
+
|
|
552
|
+
### 步驟 3: 依序撰寫章節
|
|
553
|
+
|
|
554
|
+
按照本規範的章節說明逐一填寫
|
|
555
|
+
|
|
556
|
+
### 步驟 4: 自我檢查
|
|
557
|
+
|
|
558
|
+
使用 [requirement-checklist.md](requirement-checklist.md) 檢查
|
|
559
|
+
|
|
560
|
+
### 步驟 5: 版本控制
|
|
561
|
+
|
|
562
|
+
```bash
|
|
563
|
+
git add docs/[feature-name]-requirement.md
|
|
564
|
+
git commit -m "文件(需求): 新增 [功能名稱] 需求確認書 v1.0"
|
|
565
|
+
```
|
|
566
|
+
|
|
567
|
+
---
|
|
568
|
+
|
|
569
|
+
## 九、相關規範文件
|
|
570
|
+
|
|
571
|
+
- [Commit 訊息規範](../core/commit-message-guide.md) - 簽入需求文件時使用
|
|
572
|
+
- [繁體中文語言規範](../extensions/locales/zh-tw.md) - 文件撰寫語言指引
|
|
573
|
+
- [文件結構標準](../core/documentation-structure.md) - 整體文件組織
|
|
574
|
+
- [Code Review 檢查清單](../core/code-review-checklist.md) - 實作完成後使用
|
|
575
|
+
|
|
576
|
+
---
|
|
577
|
+
|
|
578
|
+
## 十、參考文件
|
|
579
|
+
|
|
580
|
+
本格式規範參考以下最佳實踐:
|
|
581
|
+
|
|
582
|
+
- **ISO/IEC/IEEE 29148:2018** - 系統與軟體需求工程
|
|
583
|
+
- **軟體需求規格書 (SRS)** - 業界標準結構
|
|
584
|
+
- **實用導向設計** - 強調可執行性與完整性
|
|
585
|
+
- **實務專案經驗** - 基於實際需求文件優化
|
|
586
|
+
|
|
587
|
+
---
|
|
588
|
+
|
|
589
|
+
**文件版本**: 1.0.1
|
|
590
|
+
**最後更新**: 2025-12-05
|
|
591
|
+
**維護者**: Universal Doc Standards Community
|