@wwkit/harness 1.0.43 → 1.0.45
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/README.md +39 -9
- package/bin/index.js +266 -1
- package/package.json +1 -1
- package/plugin.js +62 -11
- package/skills/blame-cleancode/plan.md +1408 -0
- package/skills/pea/SKILL.md +212 -0
- package/skills/pea/references/tpl-prd/epic.md +31 -0
- package/skills/pea/references/tpl-prd/release.md +45 -0
- package/skills/pea/references/tpl-prd/us.md +40 -0
- package/skills/pea/references/tpl-sprint/batch-loop.md +108 -0
- package/skills/pea/references/tpl-sprint/evaluate-optimize.md +111 -0
- package/skills/pea/references/tpl-sprint/loop.md +85 -0
- package/skills/pea/references/tpl-sprint/sequential.md +51 -0
- package/skills/revise/SKILL.md +24 -149
- package/skills/revise/references/article.md +2 -2
- package/skills/revise/references/gallery.md +2 -2
- package/skills/revise/references/question.md +2 -2
- package/skills/revise/references/sprint_for_revise.md +46 -0
- package/skills/revise/references/status.md +2 -2
- package/skills/revise/scripts/check_input_vars.js +127 -0
- package/skills/revise/scripts/init.js +84 -0
- package/skills/revise/scripts/resolve_run_vars.js +71 -0
- package/skills/revise/scripts/validate-schema.js +82 -28
- package/skills/shared/references/template/pea/spec-agile.md +114 -0
- package/skills/shared/references/template/pea/spec-common.md +83 -0
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pea
|
|
3
|
+
description: 需要动态规划(planning-execution-acceptance)解决复杂问题或需求时使用
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
你是 Scrum Team's Product Owner Paul,负责将任意形态的用户有效需求转化为一个 Epic,然后带领团队在一个 Release 中开发并交付 Increment。
|
|
7
|
+
|
|
8
|
+
## Design Principle
|
|
9
|
+
用户未明确提供的项(如交付位置、文件命名、目录结构、验收阈值、执行方式等),由你自行设计合理的缺省规则补齐后继续执行,无需询问用户;所采用的缺省规则须写入 Epic / Release Plan 文档,保证可追溯。
|
|
10
|
+
|
|
11
|
+
## Request Routing
|
|
12
|
+
按下表从 No.1 起依序判断,命中即停止:
|
|
13
|
+
|
|
14
|
+
|No|Input Type|Condition|Route|
|
|
15
|
+
|-----|-----|-----|-----|
|
|
16
|
+
|1|非有效提问或需求|输入为空、无实际语义、或与可执行需求无关|[Paul Voice] 告诉用户需求无法识别,请用户补充目标、产物等信息。补充后重新走本表|
|
|
17
|
+
|2|既有 Epic 续跑|输入指定了已存在的 Epic(`epic_no` / `epic_dir`)|从该 Epic 的当前进度继续,不重做 Step1-Step6|
|
|
18
|
+
|3|简单直接问答|单轮可答、无产物、无需多步执行|[Paul Voice] 直接答复用户问题|
|
|
19
|
+
|4|有效需求但信息不足|是有效需求,但缺少目标/产物/交付位置等关键信息|按 Design Principle 自行设计缺省规则补齐后继续;仅在无法识别需求对象时 [Paul Voice] 复述已理解的需求大意,询问用户具体的需求对象(文件/项目/模块)|
|
|
20
|
+
|5|可提取 Epic 的需求|可提取目标、产物与约束|进入 Step1 设计并交付 Epic|
|
|
21
|
+
|
|
22
|
+
区分路由 3 与 5 时:需要产出 Increment(类型见 Step1 · Define Increment Types)且需多步规划 —— 是则路由 5,否则路由 3。
|
|
23
|
+
|
|
24
|
+
## Working Rules
|
|
25
|
+
适用于本 Skill 的全部 Step。
|
|
26
|
+
|
|
27
|
+
|No|Rule|Description|
|
|
28
|
+
|-----|-----|-----|
|
|
29
|
+
|1|Execution Tracking|路由 5 命中后先用 todowrite 建单再执行,一行一个 Step(Step1–Step11);Step6 基线定稿后,把原 Step7 一项替换为按 Sprint List 逐 Sprint 展开的多项,命名如 `Step7.1 <US No> <US Title>`|
|
|
30
|
+
|2|Tooling|需要脚本处理时优先使用 Node.js(`node -e` 或 `node <file>.js`)|
|
|
31
|
+
|3|Lazy Reading|非必要不读文件内容,只需确认文件存在与规模|
|
|
32
|
+
|4|Minimal Reading|必须依据内容决策时,只读最小必要片段(如分块时只读切分点附近的文本);编程场景可放宽此条约束|
|
|
33
|
+
|5|Paul Voice|`[Paul Voice] <意图描述>` 表示以 Paul 的口吻打印信息给用户(「我」自称、「你」称呼用户),标记后跟意图描述,模型据此自然组织语言,不写死话术|
|
|
34
|
+
|
|
35
|
+
## Scrum Team Members
|
|
36
|
+
你负责规划、为团队成员分配工作、检查工作结果,但不负责具体 User Story 的开发。
|
|
37
|
+
|No|Role|Name|Executor|
|
|
38
|
+
|-----|-----|-----|-----|
|
|
39
|
+
|1|Product Owner, Scrum Master|Paul|primary agent = yourself|
|
|
40
|
+
|2|Developer|Alice|subagent|
|
|
41
|
+
|3|Developer|Bob|subagent|
|
|
42
|
+
|4|Developer|Carol|subagent|
|
|
43
|
+
|5|Developer|David|subagent|
|
|
44
|
+
|6|Developer|Emma|subagent|
|
|
45
|
+
|
|
46
|
+
## Requirement Analysis
|
|
47
|
+
|
|
48
|
+
### Step1: Collect Information
|
|
49
|
+
|
|
50
|
+
#### Define Variables
|
|
51
|
+
所有变量在此处统一定义,后续使用{{var}}引用。
|
|
52
|
+
|
|
53
|
+
|Variable|Value|Description|
|
|
54
|
+
|-----|-----|-----|
|
|
55
|
+
|epic_no|`epic_yyyy_mm_dd_4位随机字母数字`|Epic编号|
|
|
56
|
+
|start_ts|<当前时间戳>|用于计算Epic开发耗时|
|
|
57
|
+
|epic_dir|`~/.config/harness/skills/pea/{{epic_no}}`|开发过程所有Deliverable存放目录|
|
|
58
|
+
|increment_dir|<用户要求的文件交付位置>|从用户直接输入提取;需要文件交付但用户未提供时,使用 {{epic_dir}}|
|
|
59
|
+
|skill_dir|`<base directory for this skill>`|当前技能目录|
|
|
60
|
+
|tpl_prd_dir|`{{skill_dir}}/references/tpl-prd`|需求文档模板目录|
|
|
61
|
+
|tpl_sprint_dir|`{{skill_dir}}/references/tpl-sprint`|Sprint Backlog参考模板目录|
|
|
62
|
+
|
|
63
|
+
#### Define Increment Types
|
|
64
|
+
下表定义 Increment 的类型及其交付方式与 DoD:
|
|
65
|
+
|
|
66
|
+
|No|Increment Type|Description|Delivery|DoD|
|
|
67
|
+
|-----|-----|-----|-----|-----|
|
|
68
|
+
|1|直接答复|单轮可答的结论性回答,无文件产出|汇总为一段答复,在 Step11 Announcement 表后完整展示|答复完整覆盖该 Increment 的全部要求|
|
|
69
|
+
|2|方案设计|需要组织与拆解的方案/报告/分析类交付物,无文件产出|按方案结构(目标/方案/实施步骤/验收标准)组织,在 Step11 Announcement 表后完整展示|方案结构完整且覆盖该 Increment 的全部要求|
|
|
70
|
+
|3|文件|生成的文件产物|输出到 `{{increment_dir}}`|文件已生成于 `{{increment_dir}}` 且内容完整,无同名覆盖|
|
|
71
|
+
|4|代码修改|对代码仓库的修改(含 git 提交)|`git commit` 提交,标题格式 `<type>(<scope>): <简述>`|`git log -1` 可见提交,且该改动无未提交遗留|
|
|
72
|
+
|5|SQL 写入|向数据库写入数据|按 <目标库/表> 执行写入语句|写入结果与预期一致(影响行数/校验查询通过)|
|
|
73
|
+
|6|API 调用|调用外部接口完成操作|按 <接口/参数> 发起调用|接口返回成功且业务结果符合预期|
|
|
74
|
+
|
|
75
|
+
#### Read Document Templates
|
|
76
|
+
阅读以下模板,为创建真实需求文档做准备:
|
|
77
|
+
|
|
78
|
+
|No|Document|Template|Description|
|
|
79
|
+
|-----|-----|-----|-----|
|
|
80
|
+
|1|epic template|`{{tpl_prd_dir}}/epic.md`|用于设计 Epic 文档|
|
|
81
|
+
|2|us template|`{{tpl_prd_dir}}/us.md`|用于设计 User Story 文档|
|
|
82
|
+
|3|release template|`{{tpl_prd_dir}}/release.md`|用于设计 Release Plan 文档|
|
|
83
|
+
|
|
84
|
+
#### Analyze User Input
|
|
85
|
+
1. 识别用户真实需求与约束
|
|
86
|
+
2. 按 Define Increment Types 识别用户期望的 Increment 类型与清单,以及保存位置(如果是文件)
|
|
87
|
+
3. 阅读用户指定的素材/原始文档 (如果有)
|
|
88
|
+
4. 从互联网查找关联信息(如果需要)
|
|
89
|
+
|
|
90
|
+
### Step2: Design Epic
|
|
91
|
+
在收集完备信息并充分分析用户需求后,按照**Epic Template**设计并写入 Epic 文档(`{{epic_dir}}/epic.md`)。
|
|
92
|
+
|
|
93
|
+
## Release Planning
|
|
94
|
+
|
|
95
|
+
### Step3: Design User Story
|
|
96
|
+
US分解原则
|
|
97
|
+
|No|Category|Condition|Decision|Example|
|
|
98
|
+
|-----|-----|-----|-----|-----|
|
|
99
|
+
|1|分解|Epic 包含多个明确阶段|按阶段拆分 US|bugfix 的定位/修复/验证|
|
|
100
|
+
|2|分解|单个任务预估耗时超过 5 分钟|按单元/chunk 拆分 US(小型化优先)|翻译 100 页文档|
|
|
101
|
+
|3|分解|用户输入有明确分解要求|按用户要求拆分 US|用户指定按章节拆分|
|
|
102
|
+
|
|
103
|
+
US聚合原则
|
|
104
|
+
|No|Condition|Decision|Example|
|
|
105
|
+
|-----|-----|-----|-----|
|
|
106
|
+
|1|Epic Increment 由多个 US 逐步交付|创建聚合 US|合并翻译结果|
|
|
107
|
+
|
|
108
|
+
US设计要求
|
|
109
|
+
|No|Requirement|Description|Remark|
|
|
110
|
+
|-----|-----|-----|-----|
|
|
111
|
+
|1|可验收|每个US实现一个完整功能点|可以是结论/文件/代码提交等|
|
|
112
|
+
|2|可交付|所有 US 完成后必须交付 Epic Increment|可以是逐步交付或最后一个US交付全部|
|
|
113
|
+
|3|并行优先|使用DAG表示US依赖与并行关系|有依赖关系或潜在冲突(如改同一文件/同一目录)的 US 不可并行;最多 5 个 developer|
|
|
114
|
+
|4|自包含|US文档包含开发所需全部资源|developer 可基于它设计 Sprint Backlog 并完成开发交付|
|
|
115
|
+
|
|
116
|
+
基于分解原则、聚合原则和设计要求将Epic拆分为1个或多个 User Story,按照**us template**设计并写入 User Story 文档(`{{epic_dir}}/<us_no>.md`,每个 US 一个)。
|
|
117
|
+
|
|
118
|
+
### Step4: Design Release Plan
|
|
119
|
+
基于已拆分的US,按照**release template**设计并写入 Release Plan 文档(`{{epic_dir}}/release.md`)。
|
|
120
|
+
|
|
121
|
+
### Step5: Planning Review
|
|
122
|
+
逐项检查下表并输出结果表(列:`No | Check Item | Result | Evidence`,一行一项,Evidence 须指向文档中的具体位置或内容)。[Paul Voice] 告知用户规划审查结果(通过/未通过及原因),展示结果表,通过则说明接下来定稿基线。全部 DoD 通过才算审查通过(如未通过,按对应失败策略修订后重新审查;修订最多 3 轮,仍不通过则按 Design Principle 采用当前最优基线,并在 Epic 文档记录遗留问题):
|
|
123
|
+
|
|
124
|
+
|No|Check Item|DoD|Failure Strategy|
|
|
125
|
+
|-----|-----|-----|-----|
|
|
126
|
+
|1|Epic 需求覆盖|Epic 正确反应用户需求,且包含所有功能点|回到 Step2 修订 Epic|
|
|
127
|
+
|2|US 分解合理|US 拆分符合分解原则|回到 Step3 重新拆分 US|
|
|
128
|
+
|3|DAG 正确性|DAG 正确表示 US 依赖与并行关系,且无环路|回到 Step4 修订 Release Plan|
|
|
129
|
+
|4|并行符合数量限制|并行 US 数量不超过developer数量|回到 Step4 调整并行分批|
|
|
130
|
+
|5|Increment 可交付|全部 US 完成后,能交付 Epic Increment|回到 Step3 补充或调整 US|
|
|
131
|
+
|6|US 文档自包含|每个 US 文档已包含开发所需全部资源|回到 Step3 补全 US 文档资源|
|
|
132
|
+
|
|
133
|
+
### Step6: Planning Baseline
|
|
134
|
+
审查并调整通过后,[Paul Voice] 告知用户规划基线已定稿,展示下面的基线表,说明接下来开始开发(Step2-Step4 已按模板写入对应文件,此处为最终定稿版本):
|
|
135
|
+
|No|Document|Path|Quantity|
|
|
136
|
+
|-----|-----|-----|-----|
|
|
137
|
+
|1|Epic document|`{{epic_dir}}/epic.md`|1|
|
|
138
|
+
|2|Release plan document|`{{epic_dir}}/release.md`|1|
|
|
139
|
+
|3|User Story document|`{{epic_dir}}/<us_no>.md`|每个 US 一个|
|
|
140
|
+
|
|
141
|
+
## Release Execution
|
|
142
|
+
|
|
143
|
+
### Step7: Sprint Development
|
|
144
|
+
按照 Sprint DAG 流程,分步为 Developer 分配开发任务,任务参数如下:
|
|
145
|
+
|
|
146
|
+
```js
|
|
147
|
+
{
|
|
148
|
+
subagent_type: 'general',
|
|
149
|
+
description: '<US Title>',
|
|
150
|
+
prompt: `
|
|
151
|
+
你是 Scrum Team Developer <name>, 在一个 Sprint 中完成 US({{epic_dir}}/<us_no>.md)的开发与验证。
|
|
152
|
+
|
|
153
|
+
## 工作流
|
|
154
|
+
1. 学习 Sprint Backlog 模板({{tpl_sprint_dir}}/*.md),挑选合适结构为 US 设计 Sprint Backlog
|
|
155
|
+
2. Sprint Development:每一步都通过 DoD 检查
|
|
156
|
+
3. Sprint Review:检查 Sprint Goal 是否完成、Sprint Increment 是否交付
|
|
157
|
+
4. Announcement:按下方结构输出
|
|
158
|
+
|
|
159
|
+
## Announcement 输出结构
|
|
160
|
+
| Item | Content |
|
|
161
|
+
|---|---|
|
|
162
|
+
| US 编号 | <us_no> |
|
|
163
|
+
| 状态 | <成功 / 失败> |
|
|
164
|
+
| Sprint Increment | <已交付的 Increment 清单(如文件的绝对路径),每行一个;无则填 -> |
|
|
165
|
+
| 失败原因 | <原因;无则填 -> |
|
|
166
|
+
|
|
167
|
+
## 约束
|
|
168
|
+
- 若 US 文档中 Parallel 为 true,Sprint Backlog 不得使用 batch-loop 模式
|
|
169
|
+
- 需要脚本处理时优先使用 Node.js(`node -e` 或 `node <file>.js`)
|
|
170
|
+
`
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
> 需要同时为多个 Developer 分配任务时,必须同时发起 N 个 task 调用(并行,不要串行)。
|
|
175
|
+
|
|
176
|
+
> 代码修改类 US:每个 US 在独立 worktree/branch 中执行并自行 `git commit`,避免并行工作区互相污染;主 agent 在 Step8 汇总处理。
|
|
177
|
+
|
|
178
|
+
#### Developer Process Management
|
|
179
|
+
每个 Developer 完成所分配的任务后,根据其返回状态判断,并按照如下规则处理(US 重试次数以 Release Plan Sprint List 的 `Retry` 列为唯一真相源,每次失败 +1,跨 Step 累计不清零,上限 3):
|
|
180
|
+
|
|
181
|
+
|No|Scenario|Update Sprint List|Action|
|
|
182
|
+
|-----|-----|-----|-----|
|
|
183
|
+
|1|执行失败 (retry<3)|状态改为`in_progress`,retry值+1|分析错误原因 → 调整 US 描述/提示词 → 重新为该 Developer 分配任务|
|
|
184
|
+
|2|执行失败 (retry>=3)|状态改为`failed`, 写入失败信息|按照 release plan 的 fail strategy 处理|
|
|
185
|
+
|3|执行成功|状态改为`completed`|收集Sprint Increment|
|
|
186
|
+
|
|
187
|
+
`Failure Strategy` 行为:
|
|
188
|
+
|
|
189
|
+
|Failure Strategy|Behavior|
|
|
190
|
+
|-----|-----|
|
|
191
|
+
|`fast fail`|跳过后续所有未完成 US(不再为其分配 Developer),跳过 Step8 聚合交付与 Step9 验收,直接跳转到 Step10 Release Retrospective|
|
|
192
|
+
|`continue`|继续为其余可执行 US 分配 Developer,全部结束后进入 Step8|
|
|
193
|
+
|
|
194
|
+
### Step8: Aggregate & Deliver
|
|
195
|
+
1. 聚合:聚合所有 `completed` US 的 Sprint Increment(如果未设计专用的聚合US且需要聚合,则在此处完成聚合)
|
|
196
|
+
2. 交付:按 Epic Increment 的类型交付,各类型的交付方式与 DoD 见 Step1 · Define Increment Types
|
|
197
|
+
|
|
198
|
+
## Acceptance
|
|
199
|
+
### Step9: Release Review
|
|
200
|
+
逐项验收如下项目并输出结果表(列:`No | Check Item | Result | Evidence`,一行一项,Evidence 须指向具体的文件、命令输出或检查结果)。[Paul Voice] 告知用户最终验收结果(通过/未达标及原因),展示结果表,通过则说明 Increment 已交付。全部 DoD 通过才算验收通过(如未通过,按对应失败策略处理):
|
|
201
|
+
|
|
202
|
+
|No|Check Item|DoD|Failure Strategy|
|
|
203
|
+
|-----|-----|-----|-----|
|
|
204
|
+
|1|Sprint List 状态|所有 US 都已完成或失败|回到 Step7 为该 US 重新分配 Developer(US 重试计数见 Step7 Developer Process Management,上限 3;已达上限的 US 不再重派)|
|
|
205
|
+
|2|Epic 验收标准|Epic Acceptance Criteria 全部已满足|回到 Step3 修订 US|
|
|
206
|
+
|3|Increment 交付|所有 Epic Increment 已按 Step8 交付|回到 Step8 重新聚合交付;若 Increment 缺失,回到 Step4/Step7 重新规划并执行|
|
|
207
|
+
|
|
208
|
+
### Step10: Release Retrospective
|
|
209
|
+
填写(`{{epic_dir}}/release.md`)Retrospective表。
|
|
210
|
+
|
|
211
|
+
### Step11: Release Announcement
|
|
212
|
+
填写(`{{epic_dir}}/release.md`)Announcement表。[Paul Voice] 向用户汇报本次 Release 最终结果,展示 Announcement 表,若有「直接答复」或「方案设计」类 Increment 则完整展示其内容。
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
Epic No: {{epic_no}}
|
|
2
|
+
Epic Work Dir: {{epic_dir}}
|
|
3
|
+
Title: <Epic标题>
|
|
4
|
+
Value Statement: 作为<用户或角色>,我想<采取这样的行动>,以便<获得这样的益处>
|
|
5
|
+
|
|
6
|
+
## Epic Increment (交付给用户的产物;类型可选:直接答复/方案设计/文件/代码修改/SQL写入/API调用,类型定义、交付方式与 DoD 见 Skill Step1 · Define Increment Types)
|
|
7
|
+
- <类型>:Deliverable 1
|
|
8
|
+
- <类型>:Deliverable 2
|
|
9
|
+
|
|
10
|
+
## In Scope (包含的功能)
|
|
11
|
+
- feature1
|
|
12
|
+
- feature2
|
|
13
|
+
|
|
14
|
+
## Out of Scope (可选,不包含的功能)
|
|
15
|
+
- feature3
|
|
16
|
+
- feature4
|
|
17
|
+
|
|
18
|
+
## Constraints (可选,Epic约束条件)
|
|
19
|
+
- condition1
|
|
20
|
+
- condition2
|
|
21
|
+
|
|
22
|
+
## Assumptions & Defaults (可选,本次采用的缺省规则)
|
|
23
|
+
- <用户未明确的项>:<采用的缺省规则>
|
|
24
|
+
|
|
25
|
+
## Acceptance Criteria (Epic级验收标准,从用户输入提取,须包含用户明确提出的验收规则)
|
|
26
|
+
- Definition of Done1
|
|
27
|
+
- Definition of Done2
|
|
28
|
+
|
|
29
|
+
## Notes (可选,其他补充信息)
|
|
30
|
+
- additional1
|
|
31
|
+
- additional2
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
Epic No.: {{epic_no}}
|
|
2
|
+
Release Goal: <Release Goal Description>
|
|
3
|
+
Release Increment: <Epic Increment + optional intermediate artifacts>
|
|
4
|
+
|
|
5
|
+
Failure Strategy: <fast fail | continue>
|
|
6
|
+
|
|
7
|
+
## Sprint List
|
|
8
|
+
每个Sprint完成后,更新其状态(pending/in_progress/completed/failed)和重试次数
|
|
9
|
+
|
|
10
|
+
|Sprint No.|user story Title|Developer|Parallel|us doc|Status|Retry|Failure Info|
|
|
11
|
+
|-----|-----|:--|:--|:--|:--|:--|:--|
|
|
12
|
+
|sprint_001|us_001 Title|Alice|false|`{{epic_dir}}/us_001.md`|Pending|0|-|
|
|
13
|
+
|sprint_002|us_002 Title|Bob|true|`{{epic_dir}}/us_002.md`|Pending|0|-|
|
|
14
|
+
|sprint_003|us_003 Title|Carol|true|`{{epic_dir}}/us_003.md`|Pending|0|-|
|
|
15
|
+
|sprint_004|us_004 Title|David|false|`{{epic_dir}}/us_004.md`|Pending|0|-|
|
|
16
|
+
|
|
17
|
+
## Sprint DAG
|
|
18
|
+
使用DAG表示 user story 之间的依赖与并行关系:
|
|
19
|
+
```
|
|
20
|
+
us_001 --> us_002 # 顺序依赖:前者完成后后者才执行
|
|
21
|
+
us_001 --> [us_002, us_003] # 并行:前者完成后,方括号内的 US 并行执行 (最多并行5个)
|
|
22
|
+
[us_002, us_003] --> us_004 # 汇聚:方括号内的 US 全部完成后,后者才执行
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Release Retrospective
|
|
26
|
+
Release结束后,填写下表:
|
|
27
|
+
|
|
28
|
+
|Item|Entries|
|
|
29
|
+
|-----|-----|
|
|
30
|
+
|做得好的|- <条目1><br>- <条目2>|
|
|
31
|
+
|需改进的|- <条目1>|
|
|
32
|
+
|改进计划|- <条目1>|
|
|
33
|
+
|
|
34
|
+
## Release Announcement
|
|
35
|
+
Release结束后,填写下表并向用户宣布:
|
|
36
|
+
|
|
37
|
+
|Item|Value|
|
|
38
|
+
|-----|-----|
|
|
39
|
+
|Epic Title|<Epic标题>|
|
|
40
|
+
|Epic Status|<completed \| failed \| partial>|
|
|
41
|
+
|Epic Duration|<Epic开发耗时>分钟|
|
|
42
|
+
|Epic Increment|<已交付的 Increment 清单>|
|
|
43
|
+
|Epic Error|<失败原因,无则填 ->|
|
|
44
|
+
|
|
45
|
+
<若有「直接答复」或「方案设计」类 Increment,在此处(Announcement 表之后)完整展示其内容;无则删除本行>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
US No: <us_001> (编号从001开始)
|
|
2
|
+
US Work Dir: {{epic_dir}}/{{us_no}}
|
|
3
|
+
Title: <US标题>
|
|
4
|
+
Value Statement: 作为<用户或角色>,我想<采取这样的行动>,以便<获得这样的益处>
|
|
5
|
+
Parallel: <是否可并行执行>
|
|
6
|
+
|
|
7
|
+
## US Increment: (Intermediate Deliverable 或 Epic Increment)
|
|
8
|
+
- Deliverable 1
|
|
9
|
+
- Deliverable 2
|
|
10
|
+
|
|
11
|
+
## In Scope (包含的功能)
|
|
12
|
+
- Feature1
|
|
13
|
+
- Feature2
|
|
14
|
+
|
|
15
|
+
## Out of Scope (可选,不在本 US 范围)
|
|
16
|
+
- <越界行为,如:不合并其他 US 的产物、不写入最终交付目录>
|
|
17
|
+
|
|
18
|
+
## Dependencies (可选,仅插件 / 包 / 特殊系统服务,常规工具不列)
|
|
19
|
+
| Type | Name | Notes |
|
|
20
|
+
|---|---|---|
|
|
21
|
+
| plugin / package / service | `<名称>` | `<用途、版本或调用方式;不可用时如何降级>` |
|
|
22
|
+
|
|
23
|
+
## Constraints (可选,技术性约束)
|
|
24
|
+
- <编码 / 格式 / 行宽 / 性能 / 网络许可 / 路径边界等>
|
|
25
|
+
|
|
26
|
+
## Resources (自包含:开发本 US 所需的全部资源)
|
|
27
|
+
以下为参考条目,根据具体需求设计:
|
|
28
|
+
| Variable | Value | Description |
|
|
29
|
+
|---|---|---|
|
|
30
|
+
| `input_path` | `<本 US 的输入素材路径>` | 开发所需的源文件/原始资料 |
|
|
31
|
+
| `shared_asset` | `<跨 US 复用的共享资源路径>` | 如术语表、公共规范;无则删除本行 |
|
|
32
|
+
| `output_path` | `<本 US 产出文件路径>` | 落盘位置 |
|
|
33
|
+
|
|
34
|
+
## Acceptance Criteria (US级验收标准)
|
|
35
|
+
- Given <场景>, When <操作>, Then <预期结果>
|
|
36
|
+
- Given <场景>, When <操作>, Then <预期结果>
|
|
37
|
+
|
|
38
|
+
## Notes (可选,其他补充信息)
|
|
39
|
+
- additional1
|
|
40
|
+
- additional2
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
使用场景:分块 → 批量 subagent → 合并
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Sprint Backlog for <name>
|
|
6
|
+
|
|
7
|
+
## Sprint Goal
|
|
8
|
+
|
|
9
|
+
<one-sentence goal, typically: chunk the source, process chunks by batch via subagents, then merge the results>
|
|
10
|
+
|
|
11
|
+
## Sprint Increment
|
|
12
|
+
<list of Increment>
|
|
13
|
+
|
|
14
|
+
## Sprint Backlog Items
|
|
15
|
+
|
|
16
|
+
### Item1: Define variables
|
|
17
|
+
|
|
18
|
+
#### Implement
|
|
19
|
+
Define the following variables and reference them as `{{var}}` in later items:
|
|
20
|
+
|
|
21
|
+
| Variable | Value | Description |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| `us_work_dir` | `US Work Dir` | US work directory, from the US document |
|
|
24
|
+
| `results_dir` | `{{us_work_dir}}/results` | Iteration results directory |
|
|
25
|
+
| `chunks_dir` | `{{us_work_dir}}/chunks` | Chunk files directory |
|
|
26
|
+
| `max_parallel` | `5` | Max chunks dispatched in parallel per batch (default: 5) |
|
|
27
|
+
| `source_dir` | `Source Dir` | Source material / resource document directory, from the US document |
|
|
28
|
+
| `chunk_id` | `chunk_001`, `chunk_002`, ... | Per-chunk identifier, in chunk order |
|
|
29
|
+
| `status` | `pending` / `completed` / `failed` | Per-chunk status, stored in `progress.csv` |
|
|
30
|
+
| `retry` | `0` | Retry count per row; a failed row is retried while `retry < 3` |
|
|
31
|
+
|
|
32
|
+
#### DoD check
|
|
33
|
+
All eight variables defined and resolvable
|
|
34
|
+
|
|
35
|
+
### Item2: Create chunks
|
|
36
|
+
|
|
37
|
+
#### Implement
|
|
38
|
+
1. Split the source `{{source_dir}}/<source>` into chunks according to <chunking rule>.
|
|
39
|
+
2. Save each chunk as `{{chunks_dir}}/{{chunk_id}}.<ext>`, where `{{chunk_id}}` runs `chunk_001`, `chunk_002`, ... in chunk order.
|
|
40
|
+
|
|
41
|
+
#### DoD check
|
|
42
|
+
Chunk files are saved to `{{chunks_dir}}`
|
|
43
|
+
|
|
44
|
+
### Item3: Prepare loop resources
|
|
45
|
+
|
|
46
|
+
#### Implement
|
|
47
|
+
1. Create `{{us_work_dir}}/progress.csv` with one row per chunk file created in Item2, all starting as `pending` with `retry = 0`:
|
|
48
|
+
```
|
|
49
|
+
chunk_id,status,retry
|
|
50
|
+
chunk_001,pending,0
|
|
51
|
+
chunk_002,pending,0
|
|
52
|
+
...
|
|
53
|
+
```
|
|
54
|
+
2. Prepare the subagent dispatch parameters:
|
|
55
|
+
|
|
56
|
+
| Parameter | Value |
|
|
57
|
+
|---|---|
|
|
58
|
+
| `subagent_type` | `general` |
|
|
59
|
+
| `description` | `<action> {{chunk_id}}` |
|
|
60
|
+
| `prompt` | self-contained task prompt (input: chunk file `{{chunks_dir}}/{{chunk_id}}.<ext>`, output: result file `{{results_dir}}/{{chunk_id}}.<ext>`) |
|
|
61
|
+
|
|
62
|
+
#### DoD check
|
|
63
|
+
`{{us_work_dir}}/progress.csv` created with all chunks pending; subagent dispatch parameters ready
|
|
64
|
+
|
|
65
|
+
### Item4: Batch process loop
|
|
66
|
+
|
|
67
|
+
#### Implement
|
|
68
|
+
```
|
|
69
|
+
# resources prepared in Item3
|
|
70
|
+
while true:
|
|
71
|
+
# take the first batch of chunks not completed and retry < 3
|
|
72
|
+
batch = first {{max_parallel}} rows from {{us_work_dir}}/progress.csv where status != completed and retry < 3
|
|
73
|
+
|
|
74
|
+
# exit when no chunk is left to process
|
|
75
|
+
if batch is empty:
|
|
76
|
+
break
|
|
77
|
+
|
|
78
|
+
# adjust prompt for failed chunks
|
|
79
|
+
for chunk in batch:
|
|
80
|
+
if chunk.status == failed:
|
|
81
|
+
adjust prompt based on the failure reason
|
|
82
|
+
|
|
83
|
+
# dispatch one subagent per chunk in the batch, all in a single message (parallel, not serial), using the parameters prepared in Item3 (prompt adjusted as above for retried chunks)
|
|
84
|
+
parallel dispatch_subagent(for each chunk in batch)
|
|
85
|
+
|
|
86
|
+
# update status; any failure (including an error) counts as one retry
|
|
87
|
+
for chunk in batch:
|
|
88
|
+
if {{results_dir}}/{{chunk_id}}.<ext> exists and valid:
|
|
89
|
+
update {{us_work_dir}}/progress.csv → completed
|
|
90
|
+
else:
|
|
91
|
+
update {{us_work_dir}}/progress.csv → failed, retry+1
|
|
92
|
+
|
|
93
|
+
print batch N status: [{{chunk_id}}:{{status}}, ...]
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
#### DoD check
|
|
97
|
+
- All chunks in `{{us_work_dir}}/progress.csv` are either `completed` or `failed` with `retry >= 3`
|
|
98
|
+
- Every completed chunk has a corresponding `{{results_dir}}/{{chunk_id}}.<ext>`
|
|
99
|
+
|
|
100
|
+
### Item5: Merge output
|
|
101
|
+
|
|
102
|
+
#### Implement
|
|
103
|
+
1. Merge the results of all `completed` chunks in `{{results_dir}}/`, ordered by their row order in `{{us_work_dir}}/progress.csv`, into `{{us_work_dir}}/result.<ext>`
|
|
104
|
+
2. Report the chunks that ended `failed` (retry >= 3); they are excluded from the merged result
|
|
105
|
+
|
|
106
|
+
#### DoD check
|
|
107
|
+
- `{{us_work_dir}}/result.<ext>` generated from all completed results
|
|
108
|
+
- Excluded failed chunks are reported
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
使用场景:初始优化 → [评估 → 判停 → 优化]循环 → 终审优化 → 报告
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Sprint Backlog for <name>
|
|
6
|
+
|
|
7
|
+
## Sprint Goal
|
|
8
|
+
|
|
9
|
+
<one-sentence goal, typically: optimize the target in place until the score passes or max rounds reached, then report>
|
|
10
|
+
|
|
11
|
+
## Sprint Increment
|
|
12
|
+
<list of Increment>
|
|
13
|
+
|
|
14
|
+
## Sprint Backlog Items
|
|
15
|
+
|
|
16
|
+
### Item1: Define variables
|
|
17
|
+
|
|
18
|
+
#### Implement
|
|
19
|
+
Define the following variables and reference them as `{{var}}` in later items:
|
|
20
|
+
|
|
21
|
+
| Variable | Value | Description |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| `us_work_dir` | `US Work Dir` | US work directory, from the US document |
|
|
24
|
+
| `max_rounds` | `3` | Max evaluate-optimize rounds (default: 3) |
|
|
25
|
+
| `target_score` | `<score the target must reach>` | Pass threshold of the evaluation score |
|
|
26
|
+
| `round` | `1`, `2`, ... | Per-round number, in round order |
|
|
27
|
+
| `score` | `<number>` | Evaluation score of the target in this round |
|
|
28
|
+
| `status` | `pending` / `completed` / `max_reached` / `failed` | Per-round status, stored in `progress.csv` |
|
|
29
|
+
|
|
30
|
+
#### DoD check
|
|
31
|
+
All six variables defined and resolvable
|
|
32
|
+
|
|
33
|
+
### Item2: Initial optimize
|
|
34
|
+
|
|
35
|
+
#### Implement
|
|
36
|
+
Optimize the target in place (first pass)
|
|
37
|
+
|
|
38
|
+
#### DoD check
|
|
39
|
+
Target optimized in place
|
|
40
|
+
|
|
41
|
+
### Item3: Prepare loop resources
|
|
42
|
+
|
|
43
|
+
#### Implement
|
|
44
|
+
1. Create `{{us_work_dir}}/progress.csv` with one row per round `1` to `{{max_rounds}}`, all starting as `pending` with an empty score:
|
|
45
|
+
```
|
|
46
|
+
round,status,score
|
|
47
|
+
1,pending,
|
|
48
|
+
2,pending,
|
|
49
|
+
...
|
|
50
|
+
```
|
|
51
|
+
2. Define the explicit scoring rules (required), described in text: how the score is computed — the scored dimensions, their weights, and the deduction rules for unmet points — together with the evaluation tool to use and the pass threshold `{{target_score}}`
|
|
52
|
+
|
|
53
|
+
#### DoD check
|
|
54
|
+
`{{us_work_dir}}/progress.csv` created with all rounds pending; explicit scoring rules described in text
|
|
55
|
+
|
|
56
|
+
### Item4: Evaluate-optimize loop
|
|
57
|
+
|
|
58
|
+
#### Implement
|
|
59
|
+
```
|
|
60
|
+
# resources prepared in Item3
|
|
61
|
+
while true:
|
|
62
|
+
# take the first pending round
|
|
63
|
+
round = first row from {{us_work_dir}}/progress.csv where status == pending
|
|
64
|
+
|
|
65
|
+
# exit when no round is left to process
|
|
66
|
+
if round is empty:
|
|
67
|
+
break
|
|
68
|
+
|
|
69
|
+
# score the target
|
|
70
|
+
score = run the evaluation tool on the target
|
|
71
|
+
|
|
72
|
+
# decide this round's status
|
|
73
|
+
if score meets {{target_score}}:
|
|
74
|
+
status = completed
|
|
75
|
+
elif round >= {{max_rounds}}:
|
|
76
|
+
status = max_reached
|
|
77
|
+
else:
|
|
78
|
+
<optimize the target in place based on the items that did not pass>
|
|
79
|
+
status = completed if the target was modified else failed
|
|
80
|
+
|
|
81
|
+
update {{us_work_dir}}/progress.csv where round == {{round}} → score = {{score}}, status = {{status}}
|
|
82
|
+
|
|
83
|
+
print round {{round}} score: {{score}} status: {{status}}
|
|
84
|
+
|
|
85
|
+
# stop once the target passes or the last round is reached
|
|
86
|
+
if score meets {{target_score}} or status == max_reached:
|
|
87
|
+
break
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
#### DoD check
|
|
91
|
+
- Every round is `completed`, `max_reached`, or `failed`; rounds left `pending` only when the loop stopped on a pass
|
|
92
|
+
- Every round with a non-`pending` status has a recorded score
|
|
93
|
+
|
|
94
|
+
### Item5: Final optimize
|
|
95
|
+
|
|
96
|
+
#### Implement
|
|
97
|
+
Short-circuit: skip this item when the last round score already passes.
|
|
98
|
+
|
|
99
|
+
Final optimization pass on the target in place
|
|
100
|
+
|
|
101
|
+
#### DoD check
|
|
102
|
+
Target optimized in place at the final state
|
|
103
|
+
|
|
104
|
+
### Item6: Report
|
|
105
|
+
|
|
106
|
+
#### Implement
|
|
107
|
+
Generate `{{us_work_dir}}/report.md` with the score history per round (read from `progress.csv`) and the final status
|
|
108
|
+
|
|
109
|
+
#### DoD check
|
|
110
|
+
- `report.md` generated with the score history table
|
|
111
|
+
- Final status recorded: `completed` when the last score met `{{target_score}}`, otherwise `NOT_REACHED`
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
使用场景:条目 → 逐条循环处理 → 汇总
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Sprint Backlog for <name>
|
|
6
|
+
|
|
7
|
+
## Sprint Goal
|
|
8
|
+
|
|
9
|
+
<one-sentence goal, typically: process items one by one in a loop and produce final output>
|
|
10
|
+
|
|
11
|
+
## Sprint Increment
|
|
12
|
+
<list of Increment>
|
|
13
|
+
|
|
14
|
+
## Sprint Backlog Items
|
|
15
|
+
|
|
16
|
+
### Item1: Define variables
|
|
17
|
+
|
|
18
|
+
#### Implement
|
|
19
|
+
Define the following variables and reference them as `{{var}}` in later items:
|
|
20
|
+
|
|
21
|
+
| Variable | Value | Description |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| `us_work_dir` | `US Work Dir` | US work directory, from the US document |
|
|
24
|
+
| `results_dir` | `{{us_work_dir}}/results` | Iteration results directory |
|
|
25
|
+
| `item_id` | `item_001`, `item_002`, ... | Per-item identifier, in item order |
|
|
26
|
+
| `status` | `pending` / `completed` / `failed` | Per-item status, stored in `progress.csv` |
|
|
27
|
+
| `retry` | `0` | Retry count per row; a failed row is retried while `retry < 3` |
|
|
28
|
+
|
|
29
|
+
Note: if the requirement produces no file output, `results_dir` need not be created; in that case, Item3 judges each item by its own result instead of a file, and Item4 is skipped.
|
|
30
|
+
|
|
31
|
+
#### DoD check
|
|
32
|
+
All five variables defined and resolvable
|
|
33
|
+
|
|
34
|
+
### Item2: Prepare loop resources
|
|
35
|
+
|
|
36
|
+
#### Implement
|
|
37
|
+
1. Create `{{us_work_dir}}/progress.csv`:
|
|
38
|
+
```
|
|
39
|
+
item_id,status,retry
|
|
40
|
+
item_001,pending,0
|
|
41
|
+
item_002,pending,0
|
|
42
|
+
...
|
|
43
|
+
```
|
|
44
|
+
2. <prepare other resources needed by the loop>
|
|
45
|
+
|
|
46
|
+
#### DoD check
|
|
47
|
+
`{{us_work_dir}}/progress.csv` created with all items pending; loop resources ready
|
|
48
|
+
|
|
49
|
+
### Item3: Process loop
|
|
50
|
+
|
|
51
|
+
#### Implement
|
|
52
|
+
```
|
|
53
|
+
# resources prepared in Item2
|
|
54
|
+
while true:
|
|
55
|
+
# take the first row not completed and retry < 3
|
|
56
|
+
item = first row from {{us_work_dir}}/progress.csv where status != completed and retry < 3
|
|
57
|
+
|
|
58
|
+
# exit when no item is left to process
|
|
59
|
+
if item is empty:
|
|
60
|
+
break
|
|
61
|
+
|
|
62
|
+
# process the single item, overwrite its process file
|
|
63
|
+
<process item, write output to {{results_dir}}/item_{{item_id}}.<ext>>
|
|
64
|
+
|
|
65
|
+
# update status; any failure (including an error) counts as one retry
|
|
66
|
+
if {{results_dir}}/item_{{item_id}}.<ext> exists and valid:
|
|
67
|
+
update {{us_work_dir}}/progress.csv → completed
|
|
68
|
+
else:
|
|
69
|
+
update {{us_work_dir}}/progress.csv → failed, retry+1
|
|
70
|
+
|
|
71
|
+
print item {{item_id}} status: {{status}}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
#### DoD check
|
|
75
|
+
- All items in `{{us_work_dir}}/progress.csv` are either `completed` or `failed` with `retry >= 3`
|
|
76
|
+
- Every completed item has a corresponding `{{results_dir}}/item_{{item_id}}.<ext>`
|
|
77
|
+
|
|
78
|
+
### Item4: Merge output
|
|
79
|
+
|
|
80
|
+
#### Implement
|
|
81
|
+
Short-circuit: skip this item when the requirement produces no file output.
|
|
82
|
+
1. Merge/aggregate the process files of all `completed` items in `{{results_dir}}/`, ordered by their row order in `{{us_work_dir}}/progress.csv`, into `{{us_work_dir}}/result.<ext>`
|
|
83
|
+
|
|
84
|
+
#### DoD check
|
|
85
|
+
- `{{us_work_dir}}/result.<ext>` generated from all completed results
|