cc-devflow 4.2.0 → 4.3.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.
Files changed (119) hide show
  1. package/.claude/commands/flow/CLAUDE.md +0 -4
  2. package/.claude/docs/examples/design-inspiration-pool.md +59 -0
  3. package/.claude/docs/examples/ui-prototype-constitution-checklist.md +75 -0
  4. package/.claude/docs/implementation-summary-v7.md +449 -0
  5. package/.claude/docs/spec-format-guide.md +349 -0
  6. package/.claude/docs/state-consolidation-design.md +323 -0
  7. package/.claude/docs/templates/ARCHITECTURE_TEMPLATE.md +85 -386
  8. package/.claude/docs/templates/DESIGN_TEMPLATE.md +157 -0
  9. package/.claude/docs/templates/PROPOSAL_TEMPLATE.md +91 -0
  10. package/.claude/docs/templates/SPEC_TEMPLATE_DELTA.md +139 -0
  11. package/.claude/docs/templates/SPEC_TEMPLATE_PROJECT.md +93 -0
  12. package/.claude/docs/templates/STYLE_TEMPLATE.md +114 -901
  13. package/.claude/docs/templates/UI_PROTOTYPE_TEMPLATE.md +143 -1205
  14. package/.claude/hooks/inject-agent-context.ts +9 -9
  15. package/.claude/scripts/.claude/commands/flow/export-openspec.md +221 -0
  16. package/.claude/scripts/.claude/commands/flow/import-openspec.md +171 -0
  17. package/.claude/scripts/__tests__/openspec.test.js +212 -0
  18. package/.claude/scripts/delta-parser.ts +112 -2
  19. package/.claude/scripts/export-openspec.js +222 -0
  20. package/.claude/scripts/import-openspec.js +272 -0
  21. package/.claude/scripts/validate-scope.sh +200 -0
  22. package/.claude/skills/{workflow/flow-init → flow-init}/SKILL.md +25 -4
  23. package/.claude/skills/{workflow/flow-release → flow-release}/SKILL.md +14 -3
  24. package/.claude/skills/{workflow/flow-spec → flow-spec}/SKILL.md +30 -2
  25. package/.claude/skills/utility/npm-release/CLAUDE.md +55 -0
  26. package/.claude/skills/utility/npm-release/SKILL.md +111 -46
  27. package/.claude/skills/utility/npm-release/references/version-decision-guide.md +134 -0
  28. package/.claude/skills/utility/npm-release/scripts/atomic-version-bump.sh +95 -0
  29. package/.claude/skills/utility/npm-release/scripts/validate-version-sync.sh +82 -0
  30. package/.claude/skills/utility/npm-release/scripts/version-decision-tree.sh +44 -0
  31. package/.claude/tsc-cache/70d2fc6d-2936-429b-b529-429f1aae8c88/affected-repos.txt +1 -0
  32. package/.claude/tsc-cache/70d2fc6d-2936-429b-b529-429f1aae8c88/edited-files.log +2 -0
  33. package/CHANGELOG.md +40 -0
  34. package/README.md +2 -1
  35. package/README.zh-CN.md +2 -1
  36. package/docs/v4.3.0-migration-guide.md +276 -0
  37. package/lib/harness/CLAUDE.md +5 -4
  38. package/lib/harness/__tests__/planner.tdd.test.js +125 -0
  39. package/lib/harness/index.js +4 -2
  40. package/lib/harness/operations/dispatch.js +13 -0
  41. package/lib/harness/operations/plan.js +55 -1
  42. package/lib/harness/operations/release.js +87 -0
  43. package/lib/harness/operations/verify.js +14 -0
  44. package/lib/harness/planner.js +131 -0
  45. package/lib/harness/query.js +126 -0
  46. package/lib/harness/schemas.js +22 -1
  47. package/package.json +1 -1
  48. package/.claude/commands/flow/checklist.md +0 -18
  49. package/.claude/commands/flow/clarify.md +0 -18
  50. package/.claude/commands/flow/new.md +0 -23
  51. package/.claude/commands/flow/quality.md +0 -21
  52. package/.claude/docs/templates/EPIC_TEMPLATE.md +0 -805
  53. package/.claude/docs/templates/PRD_TEMPLATE.md +0 -562
  54. package/.claude/docs/templates/TASKS_TEMPLATE.md +0 -523
  55. package/.claude/docs/templates/TECH_DESIGN_TEMPLATE.md +0 -1019
  56. package/.claude/skills/workflow/CLAUDE.md +0 -24
  57. /package/.claude/skills/{domain/attention-refresh → attention-refresh}/SKILL.md +0 -0
  58. /package/.claude/skills/{domain/brainstorming → brainstorming}/SKILL.md +0 -0
  59. /package/.claude/skills/{guardrail/constitution-guardian → constitution-guardian}/SKILL.md +0 -0
  60. /package/.claude/skills/{utility/constitution-quick-ref → constitution-quick-ref}/SKILL.md +0 -0
  61. /package/.claude/skills/{domain/debugging → debugging}/SKILL.md +0 -0
  62. /package/.claude/skills/{utility/file-standards → file-standards}/SKILL.md +0 -0
  63. /package/.claude/skills/{domain/finishing-branch → finishing-branch}/SKILL.md +0 -0
  64. /package/.claude/skills/{workflow/flow-dev → flow-dev}/CLAUDE.md +0 -0
  65. /package/.claude/skills/{workflow/flow-dev → flow-dev}/SKILL.md +0 -0
  66. /package/.claude/skills/{workflow/flow-dev → flow-dev}/assets/IMPLEMENTATION_PLAN_TEMPLATE.md +0 -0
  67. /package/.claude/skills/{workflow/flow-dev → flow-dev}/context.jsonl +0 -0
  68. /package/.claude/skills/{workflow/flow-dev → flow-dev}/dev-implementer.jsonl +0 -0
  69. /package/.claude/skills/{workflow/flow-dev → flow-dev}/scripts/entry-gate.sh +0 -0
  70. /package/.claude/skills/{workflow/flow-dev → flow-dev}/scripts/exit-gate.sh +0 -0
  71. /package/.claude/skills/{workflow/flow-dev → flow-dev}/scripts/task-orchestrator.sh +0 -0
  72. /package/.claude/skills/{workflow/flow-fix → flow-fix}/SKILL.md +0 -0
  73. /package/.claude/skills/{workflow/flow-fix → flow-fix}/context.jsonl +0 -0
  74. /package/.claude/skills/{workflow/flow-fix → flow-fix}/references/bug-analyzer.md +0 -0
  75. /package/.claude/skills/{workflow/flow-init → flow-init}/assets/BRAINSTORM_TEMPLATE.md +0 -0
  76. /package/.claude/skills/{workflow/flow-init → flow-init}/assets/INIT_FLOW_TEMPLATE.md +0 -0
  77. /package/.claude/skills/{workflow/flow-init → flow-init}/assets/RESEARCH_TEMPLATE.md +0 -0
  78. /package/.claude/skills/{workflow/flow-init → flow-init}/context.jsonl +0 -0
  79. /package/.claude/skills/{workflow/flow-init → flow-init}/references/flow-researcher.md +0 -0
  80. /package/.claude/skills/{workflow/flow-init → flow-init}/scripts/check-prerequisites.sh +0 -0
  81. /package/.claude/skills/{workflow/flow-init → flow-init}/scripts/consolidate-research.sh +0 -0
  82. /package/.claude/skills/{workflow/flow-init → flow-init}/scripts/create-requirement.sh +0 -0
  83. /package/.claude/skills/{workflow/flow-init → flow-init}/scripts/generate-research-tasks.sh +0 -0
  84. /package/.claude/skills/{workflow/flow-init → flow-init}/scripts/populate-research-tasks.sh +0 -0
  85. /package/.claude/skills/{workflow/flow-init → flow-init}/scripts/validate-research.sh +0 -0
  86. /package/.claude/skills/{workflow/flow-quality → flow-quality}/SKILL.md +0 -0
  87. /package/.claude/skills/{workflow/flow-quality → flow-quality}/context.jsonl +0 -0
  88. /package/.claude/skills/{workflow/flow-quality → flow-quality}/references/code-quality-reviewer.md +0 -0
  89. /package/.claude/skills/{workflow/flow-quality → flow-quality}/references/qa-tester.md +0 -0
  90. /package/.claude/skills/{workflow/flow-quality → flow-quality}/references/security-reviewer.md +0 -0
  91. /package/.claude/skills/{workflow/flow-quality → flow-quality}/references/spec-reviewer.md +0 -0
  92. /package/.claude/skills/{workflow/flow-release → flow-release}/context.jsonl +0 -0
  93. /package/.claude/skills/{workflow/flow-release → flow-release}/references/release-manager.md +0 -0
  94. /package/.claude/skills/{workflow/flow-spec → flow-spec}/CLAUDE.md +0 -0
  95. /package/.claude/skills/{workflow/flow-spec → flow-spec}/context.jsonl +0 -0
  96. /package/.claude/skills/{workflow/flow-spec → flow-spec}/scripts/entry-gate.sh +0 -0
  97. /package/.claude/skills/{workflow/flow-spec → flow-spec}/scripts/exit-gate.sh +0 -0
  98. /package/.claude/skills/{workflow/flow-spec → flow-spec}/scripts/parallel-orchestrator.sh +0 -0
  99. /package/.claude/skills/{workflow/flow-spec → flow-spec}/scripts/team-communication.sh +0 -0
  100. /package/.claude/skills/{workflow/flow-spec → flow-spec}/scripts/team-init.sh +0 -0
  101. /package/.claude/skills/{workflow/flow-spec → flow-spec}/scripts/test-team-mode.sh +0 -0
  102. /package/.claude/skills/{workflow/flow-spec → flow-spec}/team-config.json +0 -0
  103. /package/.claude/skills/{workflow/flow-verify → flow-verify}/CLAUDE.md +0 -0
  104. /package/.claude/skills/{workflow/flow-verify → flow-verify}/SKILL.md +0 -0
  105. /package/.claude/skills/{workflow/flow-verify → flow-verify}/context.jsonl +0 -0
  106. /package/.claude/skills/{utility/fractal-docs → fractal-docs}/SKILL.md +0 -0
  107. /package/.claude/skills/{utility/journey-checker → journey-checker}/SKILL.md +0 -0
  108. /package/.claude/skills/{utility/journey-checker → journey-checker}/pressure-scenarios.md +0 -0
  109. /package/.claude/skills/{domain/receiving-review → receiving-review}/SKILL.md +0 -0
  110. /package/.claude/skills/{utility/skill-creator → skill-creator}/LICENSE.txt +0 -0
  111. /package/.claude/skills/{utility/skill-creator → skill-creator}/SKILL.md +0 -0
  112. /package/.claude/skills/{utility/skill-creator → skill-creator}/references/output-patterns.md +0 -0
  113. /package/.claude/skills/{utility/skill-creator → skill-creator}/references/workflows.md +0 -0
  114. /package/.claude/skills/{utility/skill-creator → skill-creator}/scripts/init_skill.py +0 -0
  115. /package/.claude/skills/{utility/skill-creator → skill-creator}/scripts/package_skill.py +0 -0
  116. /package/.claude/skills/{utility/skill-creator → skill-creator}/scripts/quick_validate.py +0 -0
  117. /package/.claude/skills/{domain/tdd → tdd}/SKILL.md +0 -0
  118. /package/.claude/skills/{guardrail/tdd-enforcer → tdd-enforcer}/SKILL.md +0 -0
  119. /package/.claude/skills/{domain/verification → verification}/SKILL.md +0 -0
@@ -0,0 +1,157 @@
1
+ # design.md Template
2
+
3
+ > **Purpose**: 技术设计文档模板,描述怎么做
4
+ > **Location**: `devflow/requirements/${REQ_ID}/design.md`
5
+ > **Version**: v4.3.0
6
+
7
+ ---
8
+
9
+ ```markdown
10
+ ---
11
+ req_id: "${REQ_ID}"
12
+ title: "${TITLE}"
13
+ created_at: "${CREATED_AT}"
14
+ updated_at: "${UPDATED_AT}"
15
+ version: "1.0.0"
16
+ status: "draft"
17
+ ---
18
+
19
+ # ${TITLE} - Technical Design
20
+
21
+ ## How(怎么做)
22
+
23
+ [NEEDS CLARIFICATION: 技术方案是什么?如何实现?]
24
+
25
+ ### Architecture Overview
26
+
27
+ ${架构概述}
28
+
29
+ ### Technology Stack
30
+
31
+ - **Frontend**: ${前端技术栈}
32
+ - **Backend**: ${后端技术栈}
33
+ - **Database**: ${数据库选型}
34
+ - **Infrastructure**: ${基础设施}
35
+
36
+ ### Module Changes
37
+
38
+ ${受影响的模块列表}
39
+
40
+ - `${MODULE_1}`: ${变更说明}
41
+ - `${MODULE_2}`: ${变更说明}
42
+
43
+ ## Implementation(实现细节)
44
+
45
+ [NEEDS CLARIFICATION: 具体实现步骤是什么?]
46
+
47
+ ### API Design
48
+
49
+ #### Endpoints
50
+
51
+ - `${METHOD} ${PATH}` - ${描述}
52
+ - Request: `${REQUEST_SCHEMA}`
53
+ - Response: `${RESPONSE_SCHEMA}`
54
+
55
+ ### Data Model
56
+
57
+ ```sql
58
+ ${数据库 Schema 变更}
59
+ ```
60
+
61
+ ### File Structure
62
+
63
+ ```
64
+ ${受影响的文件列表}
65
+ ├── ${FILE_1} # ${说明}
66
+ ├── ${FILE_2} # ${说明}
67
+ └── ${FILE_3} # ${说明}
68
+ ```
69
+
70
+ ### Dependencies
71
+
72
+ ${新增或更新的依赖}
73
+
74
+ - `${PACKAGE_1}@${VERSION}` - ${用途}
75
+ - `${PACKAGE_2}@${VERSION}` - ${用途}
76
+
77
+ ## Testing Strategy
78
+
79
+ ### Test Coverage
80
+
81
+ - [ ] Unit Tests: ${覆盖范围}
82
+ - [ ] Integration Tests: ${覆盖范围}
83
+ - [ ] E2E Tests: ${覆盖范围}
84
+
85
+ ### Test Scenarios
86
+
87
+ 1. **${SCENARIO_1}**: ${测试描述}
88
+ 2. **${SCENARIO_2}**: ${测试描述}
89
+
90
+ ## Security Considerations
91
+
92
+ ${安全考虑}
93
+
94
+ - **Authentication**: ${认证方案}
95
+ - **Authorization**: ${授权方案}
96
+ - **Data Protection**: ${数据保护措施}
97
+
98
+ ## Performance Considerations
99
+
100
+ ${性能考虑}
101
+
102
+ - **Expected Load**: ${预期负载}
103
+ - **Optimization Strategy**: ${优化策略}
104
+ - **Caching**: ${缓存策略}
105
+
106
+ ## Rollout Plan
107
+
108
+ ### Phase 1: ${阶段 1 名称}
109
+ ${阶段 1 描述}
110
+
111
+ ### Phase 2: ${阶段 2 名称}
112
+ ${阶段 2 描述}
113
+
114
+ ## Risks & Mitigation
115
+
116
+ | Risk | Impact | Mitigation |
117
+ |------|--------|------------|
118
+ | ${风险 1} | ${影响} | ${缓解措施} |
119
+ | ${风险 2} | ${影响} | ${缓解措施} |
120
+
121
+ ---
122
+
123
+ ## Constitutional Constraints
124
+
125
+ - **Article I: Quality First** - 完整实现或不实现,禁止部分实现
126
+ - **Article VI: Test-First Development** - 测试必须在实现之前
127
+ - **Article X: Requirement Boundary** - 只实现明确请求的功能
128
+
129
+ 详见 `.claude/rules/project-constitution.md`
130
+ ```
131
+
132
+ ---
133
+
134
+ ## Field Descriptions
135
+
136
+ | Field | Description | Example |
137
+ |-------|-------------|---------|
138
+ | `req_id` | 需求 ID | "REQ-123" |
139
+ | `title` | 需求标题 | "添加用户认证" |
140
+ | `created_at` | 创建时间 (ISO 8601) | "2026-03-12T10:00:00Z" |
141
+ | `updated_at` | 更新时间 (ISO 8601) | "2026-03-12T15:30:00Z" |
142
+ | `version` | 文档版本 | "1.0.0" |
143
+ | `status` | 状态 | "draft", "approved", "implemented" |
144
+
145
+ ## How vs Implementation
146
+
147
+ - **How**: 回答"技术方案是什么",聚焦架构和选型
148
+ - **Implementation**: 回答"具体怎么实现",聚焦细节和步骤
149
+
150
+ ## [NEEDS CLARIFICATION] 标记
151
+
152
+ 所有模糊点必须标记为 `[NEEDS CLARIFICATION: 具体问题]`,等待用户澄清。
153
+
154
+ ---
155
+
156
+ **Version**: v4.3.0
157
+ **Related**: SPEC_TEMPLATE_DELTA.md(Delta specs 生成)
@@ -0,0 +1,91 @@
1
+ # proposal.md Template
2
+
3
+ > **Purpose**: 需求提议模板,描述为什么需要和要做什么
4
+ > **Location**: `devflow/requirements/${REQ_ID}/proposal.md`
5
+ > **Version**: v4.3.0
6
+
7
+ ---
8
+
9
+ ```markdown
10
+ ---
11
+ req_id: "${REQ_ID}"
12
+ title: "${TITLE}"
13
+ created_at: "${CREATED_AT}"
14
+ status: "draft"
15
+ ---
16
+
17
+ # ${TITLE}
18
+
19
+ ## Why(为什么需要)
20
+
21
+ [NEEDS CLARIFICATION: 为什么需要这个功能?解决什么问题?]
22
+
23
+ ### Background
24
+ ${背景描述}
25
+
26
+ ### Problem Statement
27
+ ${问题陈述}
28
+
29
+ ### Business Value
30
+ ${商业价值}
31
+
32
+ ## What(要做什么)
33
+
34
+ [NEEDS CLARIFICATION: 具体要做什么?核心功能是什么?]
35
+
36
+ ### Core Features
37
+ - ${核心功能 1}
38
+ - ${核心功能 2}
39
+ - ${核心功能 3}
40
+
41
+ ### Scope
42
+ **In Scope**:
43
+ - ${包含的功能}
44
+
45
+ **Out of Scope**:
46
+ - ${不包含的功能}
47
+
48
+ ### Success Criteria
49
+ - ${成功标准 1}
50
+ - ${成功标准 2}
51
+
52
+ ## References
53
+
54
+ ${如果有 PLAN_URLS,列在这里}
55
+ - [External Doc 1](${URL})
56
+ - [External Doc 2](${URL})
57
+
58
+ ---
59
+
60
+ ## Constitutional Constraints
61
+
62
+ - **Article X: Requirement Boundary** - 只实现明确请求的功能,不添加推测性特性
63
+ - **Article I: Quality First** - 完整实现或不实现,禁止部分实现
64
+
65
+ 详见 `.claude/rules/project-constitution.md`
66
+ ```
67
+
68
+ ---
69
+
70
+ ## Field Descriptions
71
+
72
+ | Field | Description | Example |
73
+ |-------|-------------|---------|
74
+ | `req_id` | 需求 ID | "REQ-123" |
75
+ | `title` | 需求标题 | "添加用户认证" |
76
+ | `created_at` | 创建时间 (ISO 8601) | "2026-03-12T10:00:00Z" |
77
+ | `status` | 状态 | "draft", "approved", "implemented" |
78
+
79
+ ## Why vs What
80
+
81
+ - **Why**: 回答"为什么需要",聚焦问题和价值
82
+ - **What**: 回答"要做什么",聚焦功能和范围
83
+
84
+ ## [NEEDS CLARIFICATION] 标记
85
+
86
+ 所有模糊点必须标记为 `[NEEDS CLARIFICATION: 具体问题]`,等待用户澄清。
87
+
88
+ ---
89
+
90
+ **Version**: v4.3.0
91
+ **Related**: SPEC_TEMPLATE_DELTA.md(下一阶段生成)
@@ -0,0 +1,139 @@
1
+ # spec.md Template - Delta (Requirement Level)
2
+
3
+ > **Purpose**: 需求级 Delta spec.md 模板,只包含变更
4
+ > **Location**: `devflow/requirements/${REQ_ID}/specs/{module}/spec.md`
5
+
6
+ ---
7
+
8
+ ```markdown
9
+ ---
10
+ delta_id: "${REQ_ID}"
11
+ module: "${MODULE_NAME}"
12
+ title: "${CHANGE_TITLE}"
13
+ created_at: "${CREATED_AT}"
14
+ status: "draft"
15
+ ---
16
+
17
+ # Delta: ${变更标题}
18
+
19
+ ## Summary
20
+ ${为什么需要这个变更?简短说明}
21
+
22
+ ## ADDED Requirements
23
+
24
+ ### Requirement: ${New Requirement Name}
25
+ The system ${SHALL|MUST|SHOULD|MAY} ${new behavior}.
26
+
27
+ #### Scenario: ${New Scenario}
28
+ - GIVEN ${precondition}
29
+ - WHEN ${action}
30
+ - THEN ${expected result}
31
+ - AND ${additional assertion}
32
+
33
+ ## MODIFIED Requirements
34
+
35
+ ### Requirement: ${Existing Requirement Name}
36
+ The system ${SHALL|MUST|SHOULD|MAY} ${modified behavior}.
37
+ (Previously: ${old behavior})
38
+
39
+ **Rationale**: ${说明为什么修改}
40
+
41
+ ## REMOVED Requirements
42
+
43
+ ### Requirement: ${Removed Requirement Name}
44
+ **Rationale**: ${说明为什么移除}
45
+
46
+ ## RENAMED Requirements
47
+
48
+ ### Requirement: ${Old Name} → ${New Name}
49
+ **Rationale**: ${说明为什么重命名}
50
+ ```
51
+
52
+ ---
53
+
54
+ ## Delta Operations
55
+
56
+ | Operation | Description | When to Use |
57
+ |-----------|-------------|-------------|
58
+ | **ADDED** | 新增需求 | 添加新功能、新场景 |
59
+ | **MODIFIED** | 修改现有需求 | 改变行为、更新约束 |
60
+ | **REMOVED** | 删除需求 | 废弃功能、移除特性 |
61
+ | **RENAMED** | 重命名需求 | 改进命名、统一术语 |
62
+
63
+ ## Status Values
64
+
65
+ - `draft` - 草稿状态,等待审批
66
+ - `approved` - 已审批,等待实施
67
+ - `applied` - 已应用到项目级 spec
68
+
69
+ ## Merge Rules
70
+
71
+ 归档时 (`/flow:release`),`delta-parser.ts` 自动执行:
72
+
73
+ 1. **ADDED**: 追加到项目级 spec.md 的 Requirements 章节
74
+ 2. **MODIFIED**: 替换项目级 spec.md 中对应的 Requirement
75
+ 3. **REMOVED**: 从项目级 spec.md 中删除对应的 Requirement
76
+ 4. **RENAMED**: 重命名项目级 spec.md 中的 Requirement 标题
77
+ 5. **Version Bump**: 更新项目级 spec.md 的 version 字段
78
+
79
+ ## Version Bump Strategy
80
+
81
+ - **ADDED** 新功能 → MINOR +1 (1.0.0 → 1.1.0)
82
+ - **MODIFIED** 现有功能 → PATCH +1 (1.0.0 → 1.0.1)
83
+ - **REMOVED** 功能 → MAJOR +1 (1.0.0 → 2.0.0) - 破坏性变更
84
+
85
+ ---
86
+
87
+ ## Example
88
+
89
+ ```markdown
90
+ ---
91
+ delta_id: "REQ-123"
92
+ module: "auth"
93
+ title: "添加 2FA 支持"
94
+ created_at: "2026-03-12T10:00:00Z"
95
+ status: "draft"
96
+ ---
97
+
98
+ # Delta: 添加 2FA 支持
99
+
100
+ ## Summary
101
+ 为提高安全性,添加两因素认证支持。用户可选择启用 2FA,登录时需要输入 OTP 验证码。
102
+
103
+ ## ADDED Requirements
104
+
105
+ ### Requirement: Two-Factor Authentication
106
+ The system MUST require a second factor during login for users with 2FA enabled.
107
+
108
+ #### Scenario: OTP required
109
+ - GIVEN a user with 2FA enabled
110
+ - WHEN the user submits valid credentials
111
+ - THEN an OTP challenge is presented
112
+ - AND the user must enter a valid OTP code
113
+
114
+ #### Scenario: OTP validation
115
+ - GIVEN a user has entered valid credentials
116
+ - WHEN the user submits a valid OTP code
117
+ - THEN a JWT token is issued
118
+ - AND the user is redirected to dashboard
119
+
120
+ ## MODIFIED Requirements
121
+
122
+ ### Requirement: Session Management
123
+ The system SHALL expire sessions after 30 minutes of inactivity.
124
+ (Previously: 60 minutes)
125
+
126
+ **Rationale**: 缩短超时时间以提高安全性,配合 2FA 使用。
127
+
128
+ ## REMOVED Requirements
129
+
130
+ None
131
+
132
+ ## RENAMED Requirements
133
+
134
+ None
135
+ ```
136
+
137
+ ---
138
+
139
+ **Version**: v4.3.0
@@ -0,0 +1,93 @@
1
+ # spec.md Template - Project Level
2
+
3
+ > **Purpose**: 项目级 spec.md 模板,描述当前系统状态
4
+ > **Location**: `devflow/specs/{module}/spec.md`
5
+
6
+ ---
7
+
8
+ ```markdown
9
+ ---
10
+ module: "${MODULE_NAME}"
11
+ created_at: "${CREATED_AT}"
12
+ updated_at: "${UPDATED_AT}"
13
+ version: "1.0.0"
14
+ ---
15
+
16
+ # ${Module Name}
17
+
18
+ ## Purpose
19
+ ${高层描述:这个模块是干什么的}
20
+
21
+ ## Requirements
22
+
23
+ ### Requirement: ${Requirement Name}
24
+ The system ${SHALL|MUST|SHOULD|MAY} ${behavior description}.
25
+
26
+ #### Scenario: ${Scenario Name}
27
+ - GIVEN ${precondition}
28
+ - WHEN ${action}
29
+ - THEN ${expected result}
30
+ - AND ${additional assertion}
31
+
32
+ ### Requirement: ${Another Requirement}
33
+ The system ${SHALL|MUST|SHOULD|MAY} ${behavior description}.
34
+
35
+ #### Scenario: ${Another Scenario}
36
+ - GIVEN ${precondition}
37
+ - WHEN ${action}
38
+ - THEN ${expected result}
39
+
40
+ ## Implementation
41
+
42
+ ### API Endpoints
43
+ - ${METHOD} ${PATH}
44
+ - ${METHOD} ${PATH}
45
+
46
+ ### Data Model
47
+ \`\`\`sql
48
+ CREATE TABLE ${table_name} (
49
+ id UUID PRIMARY KEY,
50
+ ${field_name} ${field_type} ${constraints}
51
+ );
52
+ \`\`\`
53
+
54
+ ### Files
55
+ - \`${file_path}\`
56
+ - \`${file_path}\`
57
+
58
+ ---
59
+
60
+ **Note**: This spec describes the current state of the system.
61
+ ```
62
+
63
+ ---
64
+
65
+ ## Field Descriptions
66
+
67
+ | Field | Description | Example |
68
+ |-------|-------------|---------|
69
+ | `module` | 模块名称 | "auth", "payments", "ui" |
70
+ | `created_at` | 创建时间 (ISO 8601) | "2026-01-01T10:00:00Z" |
71
+ | `updated_at` | 最后更新时间 | "2026-03-12T15:30:00Z" |
72
+ | `version` | 语义化版本号 | "2.1.0" |
73
+
74
+ ## RFC 2119 Keywords
75
+
76
+ - **SHALL**: 必须实现(核心功能)
77
+ - **MUST**: 强制要求(安全/合规)
78
+ - **SHOULD**: 推荐实现(最佳实践)
79
+ - **MAY**: 可选实现(增强功能)
80
+
81
+ ## BDD Scenario Format
82
+
83
+ ```
84
+ #### Scenario: {场景名称}
85
+ - GIVEN {前置条件}
86
+ - WHEN {触发动作}
87
+ - THEN {预期结果}
88
+ - AND {额外断言}
89
+ ```
90
+
91
+ ---
92
+
93
+ **Version**: v4.3.0