@gumpwang/agent-workflow 0.3.0 → 0.4.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/README.md +6 -13
- package/dist/agent-workflow.js +55 -294
- package/docs/contract.md +25 -26
- package/package.json +1 -1
- package/templates/handlers/workspace-provision.sh +24 -6
- package/templates/projects/your-repo/project.yaml +21 -23
- package/templates/prompts/fix.md +1 -1
- package/templates/prompts/implement.md +3 -3
- package/templates/prompts/merge-resume.md +1 -0
- package/templates/prompts/merge.md +10 -0
- package/templates/prompts/review-resume.md +1 -1
- package/templates/prompts/review.md +1 -1
- package/templates/workflows/implement.yaml +1 -1
- package/templates/workflows/merge.yaml +40 -22
- package/templates/workflows/review-loop.yaml +3 -3
- package/templates/handlers/agent-merge.sh +0 -128
- package/templates/prompts/triage-resume.md +0 -1
- package/templates/prompts/triage.md +0 -66
- package/templates/workflows/triage.yaml +0 -44
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
你是一个无人值守的 triage session,负责 ${{ project.tracker }} 上的新工单 **${{ ticket.identifier }}**:${{ ticket.title }}(${{ ticket.url }})。
|
|
2
|
-
|
|
3
|
-
### 工单描述
|
|
4
|
-
|
|
5
|
-
${{ ticket.description }}
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
判断这张工单能不能进入开发:它是否成立、是否重复、实现者能否不提问就开工,以及它是哪类工作。只读工单、代码和其他工单;不改代码,不改工单状态,状态由引擎按你的结论转。工单相关的读写都通过 `agent-workflow ticket ${{ ticket.identifier }} …` 完成。
|
|
10
|
-
|
|
11
|
-
## 1. 读工单
|
|
12
|
-
|
|
13
|
-
用 `get` 读工单(含 label 和阻塞关系 `blocked_by`),用 `comments` 读全部评论。后面的评论可能回答了描述里没说清的问题,或者改了需求,以最新达成一致的版本为准。读不到工单时,用 verdict `needs-info` 交付并说明原因,不要只凭标题判断。
|
|
14
|
-
|
|
15
|
-
评论、问题和理由都用工单的语言写。
|
|
16
|
-
|
|
17
|
-
## 2. 对照仓库核实
|
|
18
|
-
|
|
19
|
-
cwd 是工单的工作区,以默认分支为准:
|
|
20
|
-
|
|
21
|
-
- **缺陷**:找到它描述的代码路径,确认问题现在还在。它可能已经修好,或者说的代码已经不存在。能低成本复现就复现(现有测试、一条命令),否则写明读了什么。
|
|
22
|
-
- **改动或新功能**:找到它该落在哪,确认它还不存在,也不违背已生效的决策(ADR、文档里的不做清单、明确的非目标)。
|
|
23
|
-
- **依赖的文档**:工单引用的术语、ADR、设计说明必须已经在默认分支上。如果链接的是未合并的 PR 或本地路径,就说明还没进默认分支。
|
|
24
|
-
|
|
25
|
-
每条发现都写明出处:文件和符号、命令和输出,或者文档。
|
|
26
|
-
|
|
27
|
-
## 3. 查重
|
|
28
|
-
|
|
29
|
-
用标题和现象里的关键词,搜索同一项目的 open 和 closed 工单(GitHub 上用 `gh issue list --state all --search "<关键词>"`,Linear 上用你能用的 Linear 工具)。只有要的是同一个结果才算重复,同一块代码不算。记下那张工单,以及它是未完成、已完成还是已拒绝。
|
|
30
|
-
|
|
31
|
-
## 4. 下结论
|
|
32
|
-
|
|
33
|
-
从上往下,取第一条符合的:
|
|
34
|
-
|
|
35
|
-
| verdict | 什么时候 |
|
|
36
|
-
| --- | --- |
|
|
37
|
-
| `close` | 重复:已有工单要的是同一个结果。无效:不是对这个仓库的请求(垃圾、别的产品的支持问题),或者描述的缺陷在默认分支上不存在,或者要的东西已经全部交付。不做:要的东西被已生效的决策排除,必须引用那条决策,引用不出来就不是不做 |
|
|
38
|
-
| `needs-info` | 实现者开工前必须先提问:期望行为、复现步骤、范围或验收标准缺失或互相矛盾,代码和文档也定不下来 |
|
|
39
|
-
| `backlog` | 成立也清楚,但还不能开工:它是带子工单的 spec,要先做子工单;它太大,一次改动做不完,要先拆分;或者它依赖的文档、决策还没进默认分支 |
|
|
40
|
-
| `ready` | 成立、不重复,实现者不用提问就能开工 |
|
|
41
|
-
|
|
42
|
-
被其他未关闭的工单阻塞不影响 `ready`:阻塞只决定什么时候开工,开工会等阻塞工单关闭。
|
|
43
|
-
|
|
44
|
-
证据不足、两边都说得通时,选 `needs-info`,不要关闭:提一个问题只需要作者回一句话,错关一张工单会把需求丢掉。
|
|
45
|
-
|
|
46
|
-
## 5. 打标签和指派
|
|
47
|
-
|
|
48
|
-
用 `label add` 打标签:
|
|
49
|
-
|
|
50
|
-
- **类型**,结论是无效时不打。`bug`:现有行为不对;`enhancement`:新行为,或者改变按设计工作的行为;`documentation`:只改文档;`question`:问东西怎么工作,而不是要求改动。
|
|
51
|
-
- **`help wanted`**:工单成立,但需要实现者没有的判断或权限,比如产品决策、凭证、硬件或第三方。
|
|
52
|
-
- **`close` 时**按原因打 `duplicate`、`invalid` 或 `wontfix`。
|
|
53
|
-
|
|
54
|
-
结论不是 `close` 时,用 `assign ${{ inputs.assignee }}` 指派。
|
|
55
|
-
|
|
56
|
-
## 6. 评论并交付
|
|
57
|
-
|
|
58
|
-
用 `comment -` 在工单上发一条评论:
|
|
59
|
-
|
|
60
|
-
- 标题 `## Triage`,接着写结论、类型和理由,理由都带出处。
|
|
61
|
-
- `needs-info`:给作者的问题逐条编号,每条一句话能答。
|
|
62
|
-
- 重复:链接原工单。
|
|
63
|
-
- `backlog`:写明在等什么。
|
|
64
|
-
- 最后一行落款 `— triager: ${{ roles.triager.agent }}`。
|
|
65
|
-
|
|
66
|
-
然后按 prompt 末尾的 Completion 段交付:`## Verdict` 写结论,`## Labels` 写打上的标签,`## Reasons` 写理由。
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
# triage — a new ticket, one without a state yet, is checked by an agent
|
|
2
|
-
# against the repository and other tickets (prompts/triage.md holds the method).
|
|
3
|
-
# The agent labels it, assigns it and comments the result;
|
|
4
|
-
# the engine then moves it into the workflow by the verdict:
|
|
5
|
-
# ready Todo; implement starts once no open ticket blocks it
|
|
6
|
-
# backlog Backlog: a spec, or work that waits on something other than a ticket
|
|
7
|
-
# needs-info Needs Info, with the open questions in the comment; once they are
|
|
8
|
-
# answered, take the state off again (GitHub: remove the label;
|
|
9
|
-
# Linear: move it back to Triage) and it is triaged again
|
|
10
|
-
# close closed as not planned: a duplicate, invalid, or will not be done
|
|
11
|
-
# It runs whoever the ticket is assigned to (on.any_assignee). On GitHub an open
|
|
12
|
-
# issue without a state label is in Open; Linear projects trigger it on their
|
|
13
|
-
# Triage state with `states: { triage: [Triage] }` in project.yaml.
|
|
14
|
-
# Paths are relative to the rule set root.
|
|
15
|
-
name: triage
|
|
16
|
-
description: Check a new ticket, label and assign it, and move it into the workflow
|
|
17
|
-
on:
|
|
18
|
-
states: [Open]
|
|
19
|
-
any_assignee: true
|
|
20
|
-
inputs:
|
|
21
|
-
assignee: { type: string, default: me, description: Who a ticket that stays open is assigned to }
|
|
22
|
-
roles:
|
|
23
|
-
triager:
|
|
24
|
-
max_attempts: 2
|
|
25
|
-
steps:
|
|
26
|
-
- id: triage
|
|
27
|
-
launch: triager
|
|
28
|
-
prompt_file: prompts/triage.md
|
|
29
|
-
resume_prompt_file: prompts/triage-resume.md
|
|
30
|
-
expect:
|
|
31
|
-
delivery: triage
|
|
32
|
-
sections: ["## Verdict", "## Labels", "## Reasons"]
|
|
33
|
-
verdicts: [ready, backlog, needs-info, close]
|
|
34
|
-
- if: steps.triage.outcome == 'ready'
|
|
35
|
-
tracker: { state: Todo }
|
|
36
|
-
- if: steps.triage.outcome == 'backlog'
|
|
37
|
-
tracker: { state: Backlog }
|
|
38
|
-
- if: steps.triage.outcome == 'needs-info'
|
|
39
|
-
tracker: { state: Needs Info }
|
|
40
|
-
- if: steps.triage.outcome == 'close'
|
|
41
|
-
tracker:
|
|
42
|
-
# GitHub has no Canceled state: a dropped ticket's issue is closed.
|
|
43
|
-
state: "${{ project.tracker == 'github' && 'Closed' || 'Canceled' }}"
|
|
44
|
-
reason: not_planned
|