@boyingliu01/xp-gate 0.19.2 → 0.19.3
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/hooks/pre-commit +24 -5
- package/lib/mattpocock-license-verdict.json +1 -1
- package/mock-policy/AGENTS.md +3 -3
- package/mutation/AGENTS.md +3 -3
- package/package.json +1 -1
- package/plugins/claude-code/.claude-plugin/plugin.json +2 -2
- package/plugins/claude-code/skills/delphi-review/AGENTS.md +3 -3
- package/plugins/claude-code/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +3 -3
- package/plugins/dsh/package.json +1 -1
- package/plugins/dsh/skills/delphi-review/AGENTS.md +3 -3
- package/plugins/dsh/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/dsh/skills/test-specification-alignment/AGENTS.md +3 -3
- package/plugins/opencode/package.json +1 -1
- package/plugins/opencode/skills/delphi-review/AGENTS.md +3 -3
- package/plugins/opencode/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +3 -3
- package/plugins/qoder/plugin.json +2 -2
- package/plugins/qoder/skills/admin-template-guidelines/SKILL.md +6 -797
- package/plugins/qoder/skills/admin-template-guidelines/references/rule-1.md +91 -0
- package/plugins/qoder/skills/admin-template-guidelines/references/rule-2.md +155 -0
- package/plugins/qoder/skills/admin-template-guidelines/references/rule-3.md +70 -0
- package/plugins/qoder/skills/admin-template-guidelines/references/rule-4.md +154 -0
- package/plugins/qoder/skills/admin-template-guidelines/references/rule-5.md +126 -0
- package/plugins/qoder/skills/admin-template-guidelines/references/rule-6.md +180 -0
- package/plugins/qoder/skills/batch-grill-me/SKILL.md +15 -0
- package/plugins/qoder/skills/clipboard-vision/describe-clipboard.ps1 +115 -0
- package/plugins/qoder/skills/clipboard-vision/describe-clipboard.sh +161 -0
- package/plugins/qoder/skills/delphi-review/.delphi-config.json.example +61 -28
- package/plugins/qoder/skills/delphi-review/AGENTS.md +3 -3
- package/plugins/qoder/skills/delphi-review/INSTALL.md +97 -98
- package/plugins/qoder/skills/delphi-review/SKILL.md +77 -54
- package/plugins/qoder/skills/delphi-review/hooks.md +19 -0
- package/plugins/qoder/skills/delphi-review/opencode.json.delphi.example +6 -10
- package/plugins/qoder/skills/delphi-review/references/orchestrator-dispatch.md +64 -0
- package/plugins/qoder/skills/delphi-review/references/requirements.md +402 -0
- package/plugins/qoder/skills/delphi-review/references/round-templates.md +134 -0
- package/plugins/qoder/skills/delphi-review/scripts/verify-consensus.sh +43 -0
- package/plugins/qoder/skills/delphi-review/tools.md +29 -0
- package/plugins/qoder/skills/domain-modeling/ADR-FORMAT.md +64 -0
- package/plugins/qoder/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
- package/plugins/qoder/skills/domain-modeling/SKILL.md +74 -0
- package/plugins/qoder/skills/grill-with-docs/SKILL.md +7 -0
- package/plugins/qoder/skills/grilling/SKILL.md +12 -0
- package/plugins/qoder/skills/ralph-loop/SKILL.md +87 -428
- package/plugins/qoder/skills/ralph-loop/references/components.md +113 -0
- package/plugins/qoder/skills/ralph-loop/references/workflow-details.md +99 -0
- package/plugins/qoder/skills/sprint-flow/AGENTS.md +4 -4
- package/plugins/qoder/skills/sprint-flow/SKILL.md +255 -454
- package/plugins/qoder/skills/sprint-flow/__tests__/sprint-flow.test.cjs +457 -0
- package/plugins/qoder/skills/sprint-flow/hooks.md +18 -0
- package/plugins/qoder/skills/sprint-flow/references/components/memory.md +1 -1
- package/plugins/qoder/skills/sprint-flow/references/components/middleware.md +1 -1
- package/plugins/qoder/skills/sprint-flow/references/components/skill-invocations.md +21 -20
- package/plugins/qoder/skills/sprint-flow/references/components/tool-descriptions.md +22 -23
- package/plugins/qoder/skills/sprint-flow/references/force-levels.md +0 -1
- package/plugins/qoder/skills/sprint-flow/references/orchestration-rules.md +34 -27
- package/plugins/qoder/skills/sprint-flow/references/phase-1-prep.md +1 -1
- package/plugins/qoder/skills/sprint-flow/references/phase-2-design.md +157 -120
- package/plugins/qoder/skills/sprint-flow/references/phase-3-build.md +203 -2
- package/plugins/qoder/skills/sprint-flow/references/phase-4-verify.md +107 -34
- package/plugins/qoder/skills/sprint-flow/references/phase-5-ship.md +194 -12
- package/plugins/qoder/skills/sprint-flow/references/phase-6-close.md +139 -7
- package/plugins/qoder/skills/sprint-flow/references/phase-overview.md +486 -0
- package/plugins/qoder/skills/sprint-flow/scripts/verify-sprint-state.sh +38 -0
- package/plugins/qoder/skills/sprint-flow/tools.md +29 -0
- package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +3 -3
- package/plugins/qoder/skills/test-specification-alignment/SKILL.md +104 -601
- package/plugins/qoder/skills/to-issues/SKILL.md +1 -1
- package/principles/AGENTS.md +3 -3
- package/skills/delphi-review/AGENTS.md +3 -3
- package/skills/sprint-flow/AGENTS.md +3 -3
- package/skills/test-specification-alignment/AGENTS.md +3 -3
- package/plugins/qoder/skills/ralph-loop/references/components/memory.md +0 -55
- package/plugins/qoder/skills/ralph-loop/references/components/middleware.md +0 -54
- package/plugins/qoder/skills/ralph-loop/references/components/skill-invocations.md +0 -39
- package/plugins/qoder/skills/ralph-loop/references/components/system-prompt.md +0 -24
- package/plugins/qoder/skills/ralph-loop/references/components/tool-descriptions.md +0 -32
|
@@ -3,38 +3,220 @@
|
|
|
3
3
|
**执行时机**: Phase 4/6 VERIFY 完成后、Phase 6/6 CLOSE 之前。
|
|
4
4
|
**对应旧模型**: Phase 5 SHIP + Phase 6 LAND
|
|
5
5
|
|
|
6
|
-
**摘要**:
|
|
6
|
+
**摘要**: 结构化分支完成决策(原生 4 选项), 创建 PR(原生步骤), 合并部署(原生步骤), 监控. 生成 Sprint Summary.
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
## Part A: SHIP(发布准备)
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
**Orchestrator 直接执行**: 分支完成决策和 PR 创建均为交互式步骤(4 选项菜单 + PR 确认),**必须由 orchestrator 直接执行**。
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
**关键链**: PHASE4-GATE → verification → finishing-a-development-branch(4选项) → ship
|
|
14
|
+
**关键链**: VERSION-GATE(MANDATORY) → 分支完成决策(4选项) → push PR
|
|
17
15
|
|
|
18
16
|
**HARD-GATE**: Phase 4/6 VERIFY 未完成 → BLOCK。验证 `feedback-log.md` 存在。
|
|
19
17
|
|
|
20
18
|
**GITHOOKS-GATE**: 验证 hooks 完整性,缺失则 `githooks/install.sh`
|
|
21
19
|
|
|
22
|
-
**
|
|
20
|
+
**NETWORK-RESILIENCE**: GitHub API 在大中华区存在间歇性 TLS/超时问题。所有 `gh` CLI 调用应容忍偶尔失败:
|
|
21
|
+
- `gh` 命令失败时等待 2-5 秒后重试(最多 3 次)
|
|
22
|
+
- 优先使用 REST API (`gh api /repos/...`) 而非 GraphQL (`gh pr view --json ...`),REST 更轻量更可靠
|
|
23
|
+
- 验证 CI 状态时使用 `gh run list --branch ... --limit 1 --json status,conclusion` 代替 `gh pr view --json statusCheckRollup`
|
|
24
|
+
- 如果 `gh` 持续超时,fallback 到 `curl + token`:
|
|
25
|
+
```
|
|
26
|
+
curl -s -H "Authorization: token $(gh auth token)" \
|
|
27
|
+
"https://api.github.com/repos/OWNER/REPO/commits/HEAD/status"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Step 0: VERSION-GATE(MANDATORY — 在分支完成决策之前执行)
|
|
31
|
+
|
|
32
|
+
**Purpose**: Ensure version bump, changelog update, and sync before creating PR. This MUST run BEFORE the branch completion decision — the "Create PR" option creates the PR immediately, so version changes must be committed first.
|
|
33
|
+
|
|
34
|
+
**Execution**:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
1. 根据变更类型决定 bump 级别:
|
|
38
|
+
- PATCH (0.14.0 → 0.14.1): bug fixes, docs, minor enhancements
|
|
39
|
+
- MINOR (0.14.0 → 0.15.0): new features, significant enhancements
|
|
40
|
+
- MAJOR (0.14.0 → 1.0.0): breaking changes
|
|
41
|
+
|
|
42
|
+
2. 更新 VERSION 文件 (MAJOR.MINOR.PATCH.MICRO 格式)
|
|
43
|
+
|
|
44
|
+
3. 更新 CHANGELOG.md:
|
|
45
|
+
- 添加新版本条目 (## [X.Y.Z.W] - YYYY-MM-DD)
|
|
46
|
+
- 按 ### Added / ### Fixed / ### Changed 分类
|
|
47
|
+
|
|
48
|
+
4. 运行 sync-version.sh:
|
|
49
|
+
bash scripts/sync-version.sh
|
|
50
|
+
|
|
51
|
+
5. 验证:
|
|
52
|
+
git diff VERSION # 确认版本号变更
|
|
53
|
+
git diff CHANGELOG.md # 确认 changelog 变更
|
|
54
|
+
git diff --stat # 确认 package.json 版本同步
|
|
55
|
+
|
|
56
|
+
6. 提交版本变更:
|
|
57
|
+
git add VERSION CHANGELOG.md && git commit -m "release: bump version to X.Y.Z.W"
|
|
58
|
+
|
|
59
|
+
7. 推送到远程分支:
|
|
60
|
+
git push
|
|
61
|
+
|
|
62
|
+
8. 验证 CI 流程触发:
|
|
63
|
+
gh pr view <PR_NUMBER> --json state # 确认 CI 已开始
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**GATE CHECK** (BEFORE proceeding to branch completion decision):
|
|
67
|
+
```
|
|
68
|
+
[VERSION-GATE] VERSION bump ✓ # VERSION 文件已更新
|
|
69
|
+
[VERSION-GATE] CHANGELOG ✓ # 新版本条目已添加
|
|
70
|
+
[VERSION-GATE] sync-version ✓ # 所有 package.json 已同步
|
|
71
|
+
[VERSION-GATE] committed ✓ # 版本变更已提交并推送
|
|
72
|
+
[VERSION-GATE] PR updated ✓ # PR 已包含版本变更 commit
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**⚠️ ANTI-PATTERN**: 先创建 PR 再 bump VERSION 会导致 PR 不含版本变更 → CI 不触发 release workflow → 无新版本发布。
|
|
76
|
+
|
|
77
|
+
**输出**: 版本变更 commit 包含在 PR 中
|
|
78
|
+
|
|
79
|
+
### Step 1: 分支完成决策(原生 4 选项 — AskUserQuestion)
|
|
80
|
+
|
|
81
|
+
VERSION-GATE 通过后,orchestrator 向用户展示 4 选项菜单:
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
⚠️ Phase 5/6 SHIP: 分支完成决策
|
|
85
|
+
|
|
86
|
+
Sprint 分支已准备就绪。请选择操作:
|
|
87
|
+
|
|
88
|
+
1. **Merge to main** — 直接合并到主分支(适用于个人项目或已确认无需 PR 审查)
|
|
89
|
+
2. **Push and create a Pull Request** — 推送并创建 PR(推荐,含 CI 验证)
|
|
90
|
+
3. **Keep branch** — 保留分支,稍后处理
|
|
91
|
+
4. **Discard** — 丢弃分支(⚠️ 需要输入确认)
|
|
92
|
+
|
|
93
|
+
请选择 (1-4):
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**Option 4 (Discard) 安全确认**: 要求用户输入分支名确认,防止误删。
|
|
97
|
+
|
|
98
|
+
**默认推荐**: Option 2(Push and create a Pull Request)。
|
|
99
|
+
|
|
100
|
+
### Step 2: 原生 Ship 步骤序列(选择 Option 2 时执行)
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
1. 运行测试:
|
|
104
|
+
npm test # 或项目特定测试命令
|
|
105
|
+
|
|
106
|
+
2. VERSION-GATE 已通过(Step 0)
|
|
107
|
+
|
|
108
|
+
3. 提交所有变更:
|
|
109
|
+
git add -A && git commit -m "feat: <sprint-description>"
|
|
23
110
|
|
|
24
|
-
|
|
111
|
+
4. 推送到远程:
|
|
112
|
+
git push -u origin <sprint-branch>
|
|
113
|
+
|
|
114
|
+
5. 创建 PR:
|
|
115
|
+
gh pr create --title "feat: <description>" --body "<sprint-summary>"
|
|
116
|
+
|
|
117
|
+
6. 输出 PR URL
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**输出**: PR URL (含版本变更 commit)
|
|
25
121
|
|
|
26
122
|
---
|
|
27
123
|
|
|
28
|
-
## Part B: LAND(合并 +
|
|
124
|
+
## Part B: LAND(合并 + 部署 — 原生步骤)
|
|
29
125
|
|
|
30
|
-
**Orchestrator 直接执行**:
|
|
126
|
+
**Orchestrator 直接执行**: 合并确认和 rollback 决策均为用户交互点,**必须由 orchestrator 直接执行**。
|
|
31
127
|
|
|
32
128
|
**输入**: PR URL → 输出: 部署状态 + Canary 报告
|
|
33
129
|
|
|
34
|
-
|
|
130
|
+
### Step 1: Merge 确认
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
⚠️ 确认合并 PR #<number> 到 main?
|
|
134
|
+
|
|
135
|
+
PR: <PR URL>
|
|
136
|
+
变更: <files changed> 个文件, +<additions>/-<deletions>
|
|
137
|
+
|
|
138
|
+
确认合并? (yes/no):
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Step 2: 等待 CI
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
# 等待 CI 完成(最多 10 分钟)
|
|
145
|
+
gh run list --branch main --limit 1 --json status,conclusion
|
|
146
|
+
|
|
147
|
+
# 轮询直到完成
|
|
148
|
+
WHILE status != "completed":
|
|
149
|
+
等待 30 秒
|
|
150
|
+
重新查询
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Step 3: 等待 Deploy(如适用)
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
# 等待部署完成(最多 10 分钟)
|
|
157
|
+
# 检测部署平台(Fly.io/Render/Vercel/Netlify/Heroku/GitHub Actions)
|
|
158
|
+
# 查询部署状态
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
**条件跳过**: 无部署配置时仅 merge + CI。
|
|
162
|
+
|
|
163
|
+
### Step 4: Canary Health Check(如适用,最多 5 分钟)
|
|
164
|
+
|
|
165
|
+
```
|
|
166
|
+
# 健康检查端点
|
|
167
|
+
curl -s <health-check-url>
|
|
168
|
+
# 验证返回 200 + 预期响应
|
|
169
|
+
```
|
|
35
170
|
|
|
36
|
-
|
|
171
|
+
### Step 5: 失败回滚
|
|
37
172
|
|
|
38
|
-
|
|
173
|
+
```
|
|
174
|
+
IF CI 失败 OR 部署失败 OR canary 异常:
|
|
175
|
+
git revert <merge-commit-sha>
|
|
176
|
+
git push
|
|
177
|
+
输出 "[ROLLBACK] 已回滚 merge commit"
|
|
178
|
+
```
|
|
39
179
|
|
|
40
180
|
**输出**: 部署状态 (success/failure/skipped), Canary 报告
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## SHIP COMPLETION GATE (MANDATORY — v0.14.3+)
|
|
185
|
+
|
|
186
|
+
**Purpose**: Ensure merge to main + release is complete before Phase 6/6 CLOSE. Without this gate, worktree cleanup fails (uncommitted changes + unmerged branch) and UAT happens on the wrong version (PR branch, not main).
|
|
187
|
+
|
|
188
|
+
**Execution** (BEFORE transitioning to Phase 6/6):
|
|
189
|
+
|
|
190
|
+
```
|
|
191
|
+
1. Verify PR is merged:
|
|
192
|
+
gh pr list --head <sprint-branch> --state merged --json number
|
|
193
|
+
→ If no merged PR: BLOCK. Do NOT proceed to Phase 6/6.
|
|
194
|
+
|
|
195
|
+
2. Verify current branch is main:
|
|
196
|
+
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
|
197
|
+
→ If not main/master: BLOCK. Switch to main first.
|
|
198
|
+
|
|
199
|
+
3. Verify git status is clean:
|
|
200
|
+
git status --porcelain
|
|
201
|
+
→ If not empty: BLOCK. Stash or commit changes first.
|
|
202
|
+
|
|
203
|
+
4. Verify release exists:
|
|
204
|
+
gh release view v<X.Y.Z> --json tagName
|
|
205
|
+
→ If not found: WARNING (manual release may have failed). Ask user.
|
|
206
|
+
|
|
207
|
+
5. Pull latest main:
|
|
208
|
+
git checkout main && git pull
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
**GATE CHECK** (BEFORE Phase 6/6 CLOSE):
|
|
212
|
+
```
|
|
213
|
+
[SHIP→CLOSE GATE] PR merged ✓ # PR is in merged state
|
|
214
|
+
[SHIP→CLOSE GATE] on main branch ✓ # Current branch is main/master
|
|
215
|
+
[SHIP→CLOSE GATE] clean status ✓ # No uncommitted changes
|
|
216
|
+
[SHIP→CLOSE GATE] release exists ✓ # GitHub Release created
|
|
217
|
+
[SHIP→CLOSE GATE] main up-to-date ✓ # Pulled latest
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
**IF GATE FAILS**: Orchestrator MUST complete the merge/release steps BEFORE proceeding to Phase 6/6. Do NOT skip to CLOSE.
|
|
221
|
+
|
|
222
|
+
**Output**: SHIP completion confirmation, ready for Phase 6/6.
|
|
@@ -1,8 +1,51 @@
|
|
|
1
1
|
# Phase 6/6: CLOSE(收尾 — ⚠️ 人工验收 + 清理)
|
|
2
2
|
|
|
3
|
-
**执行时机**: Phase 5/6 SHIP
|
|
3
|
+
**执行时机**: Phase 5/6 SHIP 完成后(merge to main + release 已完成)。
|
|
4
4
|
**对应旧模型**: Phase 7 USER ACCEPTANCE + Phase 8 CLEANUP
|
|
5
5
|
|
|
6
|
+
**NETWORK-RESILIENCE**: 与 Phase 5/6 相同,GitHub API 在大中华区存在间歇性超时。CLEANUP 中的 `gh pr list` 和 `git push --delete` 需容忍重试。详见 `phase-5-ship.md` NETWORK-RESILIENCE 指南。
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## ⚠️ HARD-GATE: SHIP→CLOSE GATE (MANDATORY — v0.14.3+)
|
|
11
|
+
|
|
12
|
+
**Purpose**: Verify that Phase 5/6 SHIP fully completed (merge to main + release) before entering Phase 6/6 CLOSE. This gate prevents:
|
|
13
|
+
- Worktree cleanup failure (uncommitted changes prevent `git worktree remove`)
|
|
14
|
+
- UAT on wrong version (PR branch instead of merged main)
|
|
15
|
+
|
|
16
|
+
**Execution**: Before ANY Phase 6/6 step, run the SHIP→CLOSE GATE checks defined in `phase-5-ship.md#ship-completion-gate`.
|
|
17
|
+
|
|
18
|
+
**If gate fails**: Return to Phase 5/6 SHIP to complete merge/release. Do NOT proceed with CLOSE.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Backup Sprint State (MANDATORY — v0.14.3+)
|
|
23
|
+
|
|
24
|
+
**Purpose**: `.sprint-state/` is gitignored and lives inside the worktree. When the worktree is removed during CLEANUP, all sprint state is lost. This step copies it into the main repository before cleanup.
|
|
25
|
+
|
|
26
|
+
**Execution** (immediately after SHIP→CLOSE GATE passes):
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# 1. Read sprint ID
|
|
30
|
+
SPRINT_ID=$(cat .sprint-state/sprint-state.json | grep '"id"' | head -1 | sed 's/.*"id": *"\([^"]*\)".*/\1/')
|
|
31
|
+
|
|
32
|
+
# 2. Backup to repo-tracked path (.sprint-history is NOT in .gitignore)
|
|
33
|
+
BACKUP_DIR=".sprint-history/${SPRINT_ID}"
|
|
34
|
+
mkdir -p "$BACKUP_DIR"
|
|
35
|
+
cp -r .sprint-state/* "$BACKUP_DIR/"
|
|
36
|
+
|
|
37
|
+
# 3. Verify backup
|
|
38
|
+
ls "$BACKUP_DIR/sprint-state.json" && echo "✅ Sprint state backed up to $BACKUP_DIR"
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**GATE CHECK**:
|
|
42
|
+
```
|
|
43
|
+
[BACKUP] sprint-state.json copied ✓
|
|
44
|
+
[BACKUP] phase-outputs/ preserved ✓
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Output**: `.sprint-history/<sprint-id>/` contains full sprint state, safely outside the worktree.
|
|
48
|
+
|
|
6
49
|
---
|
|
7
50
|
|
|
8
51
|
## Part A: USER ACCEPTANCE(⚠️ 人工验收)
|
|
@@ -100,13 +143,101 @@ Phase 6/6 CLOSE 完成时:
|
|
|
100
143
|
### 输出
|
|
101
144
|
|
|
102
145
|
- Emergent Issues List (`emergent-issues.md`)
|
|
103
|
-
- 进入 Part
|
|
146
|
+
- 进入 Part A.5 ARCHIVE 自动执行(如果用户确认验收)
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Part A.5: ARCHIVE(归档 — v0.14.0+ Issue #308)
|
|
151
|
+
|
|
152
|
+
**Purpose**: Preserve sprint decision records before cleanup. `.sprint-state/` is gitignored and deleted during CLEANUP; this step copies structured outputs to `.sprint-history/` which is tracked by git.
|
|
153
|
+
|
|
154
|
+
**Execution**: After USER ACCEPTANCE (Part A) confirms continuation, BEFORE CLEANUP (Part B).
|
|
155
|
+
|
|
156
|
+
### Step 1: Read Sprint ID
|
|
157
|
+
|
|
158
|
+
Read `sprint-state.json` → `id` field (e.g., `sprint-2026-07-09-01`).
|
|
159
|
+
|
|
160
|
+
### Step 2: Check for Conflicts
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
IF .sprint-history/<sprint-id>/ already exists:
|
|
164
|
+
→ Append timestamp suffix: <sprint-id>-20260709T120000
|
|
165
|
+
→ Log warning: "Sprint archive conflict, using timestamp suffix"
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Step 3: Archive Files
|
|
169
|
+
|
|
170
|
+
Copy from `.sprint-state/` to `.sprint-history/<sprint-id>/`:
|
|
171
|
+
|
|
172
|
+
**Included** (all `.yaml`, `.json`, `.md` files under `.sprint-state/`):
|
|
173
|
+
- `specification.yaml` (if in phase-outputs/)
|
|
174
|
+
- `delphi-reviewed.json`
|
|
175
|
+
- `sprint-state.json`
|
|
176
|
+
- `phase-outputs/*.yaml`, `phase-outputs/*.json`, `phase-outputs/*.md`
|
|
177
|
+
- `tdd-gate-log.json`, `uncommitted-gate-log.json`
|
|
178
|
+
|
|
179
|
+
**Excluded** (temporary/cache):
|
|
180
|
+
- `*.tmp`, `*.cache` files
|
|
181
|
+
- `sprint.lock` (session lock file)
|
|
182
|
+
|
|
183
|
+
### Step 4: Verify Git Tracking
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
# .sprint-history/ is NOT in .gitignore (verified — no change needed)
|
|
187
|
+
# Verify files are trackable:
|
|
188
|
+
git status .sprint-history/
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
**No `.gitignore` change needed**: `.sprint-history/` is NOT currently listed in `.gitignore`. The `.sprint-state/` ignore (line 59) only matches `.sprint-state/` exactly — it does NOT match `.sprint-history/`.
|
|
192
|
+
|
|
193
|
+
### Step 5: Commit Archive (Optional)
|
|
194
|
+
|
|
195
|
+
The orchestrator MAY commit the archive:
|
|
196
|
+
```
|
|
197
|
+
git add .sprint-history/<sprint-id>/ && git commit -m "archive: sprint <sprint-id>"
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### Output
|
|
201
|
+
|
|
202
|
+
- `.sprint-history/<sprint-id>/` directory with archived sprint state
|
|
203
|
+
- Git-tracked sprint decision records for future retro/review
|
|
104
204
|
|
|
105
205
|
---
|
|
106
206
|
|
|
107
|
-
## Part B: CLEANUP(清理 +
|
|
207
|
+
## Part B: CLEANUP(清理 + 总结 + 返工追踪)
|
|
208
|
+
|
|
209
|
+
**摘要**: 写入 #369 返工指标, 自动清理 worktree, 更新 sprint-state.json, 输出 Sprint Summary, 处理 emergent issues.
|
|
210
|
+
|
|
211
|
+
### Step 0: #369 返工追踪指标写入(v0.18.0+)
|
|
212
|
+
|
|
213
|
+
**Purpose**: Sprint 完成后追踪返工率,暴露"门禁全过但仍返工"的质量问题。
|
|
214
|
+
|
|
215
|
+
**Execution** (CLEANUP 开始时,worktree 清理前):
|
|
216
|
+
|
|
217
|
+
```
|
|
218
|
+
1. 写入 metrics.completed_at:
|
|
219
|
+
ISO 8601 时间戳 → sprint-state.json metrics.completed_at
|
|
220
|
+
|
|
221
|
+
2. 计算 metrics.total_sprint_commits:
|
|
222
|
+
精确定义: sprint 分支 base(merge-base)到 sprint 合并点的提交数
|
|
223
|
+
CLOSE 时由 CLI 计算写入:
|
|
224
|
+
npx xp-gate sprint-status --rework-check
|
|
225
|
+
|
|
226
|
+
3. 写入 metrics.merge_base_sha:
|
|
227
|
+
merge-base SHA → sprint-state.json metrics.merge_base_sha
|
|
228
|
+
(SHIP 阶段存入,供删分支后 rework-check 使用 — C5 澄清)
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
**返工率计算** (`xp-gate sprint-status --rework-check [--window-days N]`):
|
|
232
|
+
- 默认窗口: 7 天(可配置)
|
|
233
|
+
- 扫描范围: **仓库范围**(不限同一分支 — 主工作流"合并 PR + 删除分支"下同分支判定恒为 0)
|
|
234
|
+
- fix 提交匹配: conventional commits 优先 `^fix(\(.+\))?:`,辅以词边界关键词 `\b(fix|bugfix|hotfix|patch|修复)\b`
|
|
235
|
+
- 计算: `rework_rate = fix_commits_in_window / total_sprint_commits`
|
|
236
|
+
- 写回 `metrics.rework_rate`
|
|
237
|
+
|
|
238
|
+
**告警**: `rework_rate > 30%` → 告警输出(并纳入 `xp-gate retro` 报告区块)
|
|
108
239
|
|
|
109
|
-
|
|
240
|
+
**注意**: "重新打开的 issue 数"指标已删除(Round 1 修订:零依赖原则下无可靠数据源)。
|
|
110
241
|
|
|
111
242
|
### 执行步骤
|
|
112
243
|
|
|
@@ -117,10 +248,11 @@ Phase 6/6 CLOSE 完成时:
|
|
|
117
248
|
3. **删除本地分支**: `git branch -D sprint/YYYY-MM-DD-NN`
|
|
118
249
|
4. **删除远程分支**: `git push origin --delete sprint/YYYY-MM-DD-NN`
|
|
119
250
|
5. **关闭遗留 OPEN PR**: `gh pr list --head sprint/YYYY-MM-DD-NN --state open`
|
|
120
|
-
6. **更新 sprint-state.json**: 设置 `phase: 6`, `status: "completed"`
|
|
251
|
+
6. **更新 sprint-state.json**: 设置 `phase: 6`, `status: "completed"`, 写入 `metrics.completed_at` + `metrics.total_sprint_commits`(#369)
|
|
121
252
|
7. **释放 Sprint Lock** (Issue #144): 删除 `.sprint-state/sprint.lock`
|
|
122
|
-
8. **Sprint
|
|
123
|
-
9.
|
|
253
|
+
8. **Learnings 写入**(原生): 将 Sprint 中发现的模式/教训追加到 `.sprint-history/learnings.md`
|
|
254
|
+
9. **Sprint Summary**: 使用 `templates/sprint-summary-template.md` 生成总结
|
|
255
|
+
10. **处理 Emergent Issues**: 如 Part A 发现 emergent issues → 触发 Sprint 2 逻辑
|
|
124
256
|
|
|
125
257
|
### 输出
|
|
126
258
|
|