@wichayutdew/pi-workflows 3.2.0 → 3.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/dist/index.js +7 -3
- package/examples/starter-kit/agents/reviewer.md +1 -1
- package/examples/starter-kit/settings.yaml +0 -1
- package/examples/starter-kit/steps/work/implement.md +1 -0
- package/examples/starter-kit/steps/work/intake.md +5 -0
- package/examples/starter-kit/steps/work/plan.md +17 -51
- package/examples/starter-kit/steps/work/prepare-workspace.md +8 -0
- package/examples/starter-kit/steps/work//363/260/215/224 publish-remote.md" +16 -0
- package/examples/starter-kit/work.workflow.yaml +60 -32
- package/package.json +1 -1
- package/src/harness/delegation-plan.ts +1 -0
- package/src/harness/status-actions.ts +3 -0
- package/src/harness/types.ts +1 -0
- package/src/workflow-status/format-status.ts +5 -1
- package/src/workflow-status/render-step-detail.ts +3 -0
- package/src/workflow-status/types.ts +1 -0
- package/examples/starter-kit/investigate.workflow.yaml +0 -84
- package/examples/starter-kit/jira.workflow.yaml +0 -75
- package/examples/starter-kit/mr-comment.workflow.yaml +0 -142
- package/examples/starter-kit/mr-review.workflow.yaml +0 -96
- package/examples/starter-kit/steps/investigate/investigate.md +0 -40
- package/examples/starter-kit/steps/investigate/retrieve.md +0 -28
- package/examples/starter-kit/steps/investigate/validate.md +0 -20
- package/examples/starter-kit/steps/jira/create.md +0 -25
- package/examples/starter-kit/steps/jira/draft.md +0 -18
- package/examples/starter-kit/steps/jira/plan.md +0 -30
- package/examples/starter-kit/steps/mr-comment/checkout-source.md +0 -14
- package/examples/starter-kit/steps/mr-comment/fetch.md +0 -16
- package/examples/starter-kit/steps/mr-comment/implement.md +0 -21
- package/examples/starter-kit/steps/mr-comment/plan.md +0 -61
- package/examples/starter-kit/steps/mr-comment/publish.md +0 -17
- package/examples/starter-kit/steps/mr-comment/verify.md +0 -16
- package/examples/starter-kit/steps/mr-review/fetch.md +0 -17
- package/examples/starter-kit/steps/mr-review/publish-approved.md +0 -18
- package/examples/starter-kit/steps/mr-review/review-for-approval.md +0 -53
- package/examples/starter-kit/steps/mr-review/verify-published.md +0 -16
- package/examples/starter-kit/steps/shared/prepare-workspace.md +0 -17
- package/examples/starter-kit/steps/shared/publish-remote.md +0 -16
- package/examples/starter-kit/steps/ticket/implement.md +0 -23
- package/examples/starter-kit/steps/ticket/plan.md +0 -60
- package/examples/starter-kit/steps/ticket/verify.md +0 -24
- package/examples/starter-kit/ticket.workflow.yaml +0 -108
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
version: 1
|
|
2
|
-
id: mr-comment
|
|
3
|
-
command: mr-comment
|
|
4
|
-
description: 'Fetch unresolved MR or PR comments, approve a fix plan, implement, verify, push, and reply. Example: /mr-comment https://gitlab.com/org/repo/-/merge_requests/123'
|
|
5
|
-
start: fetch
|
|
6
|
-
maxStepVisits: 10
|
|
7
|
-
summaryMaxChars: 30000
|
|
8
|
-
steps:
|
|
9
|
-
fetch:
|
|
10
|
-
title: Fetch merge-request or pull-request evidence
|
|
11
|
-
prompt:
|
|
12
|
-
file: steps/mr-comment/fetch.md
|
|
13
|
-
agent: scout
|
|
14
|
-
permissions:
|
|
15
|
-
tools: [read, ls, bash, mcp]
|
|
16
|
-
mcp: [gitlab, context7]
|
|
17
|
-
extensions: [/]
|
|
18
|
-
skills: [caveman]
|
|
19
|
-
bash:
|
|
20
|
-
mode: unrestricted
|
|
21
|
-
transitions:
|
|
22
|
-
ready: checkout-source
|
|
23
|
-
retry: fetch
|
|
24
|
-
blocked: $pause
|
|
25
|
-
checkout-source:
|
|
26
|
-
title: Check out the reviewed source branch
|
|
27
|
-
prompt:
|
|
28
|
-
file: steps/mr-comment/checkout-source.md
|
|
29
|
-
agent: worker
|
|
30
|
-
workspace:
|
|
31
|
-
bindOn:
|
|
32
|
-
- ready
|
|
33
|
-
allowedRoots:
|
|
34
|
-
- ~/repositories/worktrees
|
|
35
|
-
- .
|
|
36
|
-
permissions:
|
|
37
|
-
tools: [read, ls, bash]
|
|
38
|
-
mcp: []
|
|
39
|
-
extensions: [/]
|
|
40
|
-
skills: [using-git-worktrees, caveman]
|
|
41
|
-
bash:
|
|
42
|
-
mode: unrestricted
|
|
43
|
-
transitions:
|
|
44
|
-
ready: plan
|
|
45
|
-
retry: checkout-source
|
|
46
|
-
blocked: $pause
|
|
47
|
-
plan:
|
|
48
|
-
title: Propose a complete review-comment fix plan
|
|
49
|
-
prompt:
|
|
50
|
-
file: steps/mr-comment/plan.md
|
|
51
|
-
agent: planner
|
|
52
|
-
permissions:
|
|
53
|
-
tools: [read, ls, bash, mcp]
|
|
54
|
-
mcp: [gitlab, sourcegraph, context7]
|
|
55
|
-
extensions: [/]
|
|
56
|
-
skills:
|
|
57
|
-
[
|
|
58
|
-
coding-standards,
|
|
59
|
-
writing-plans,
|
|
60
|
-
receiving-code-review,
|
|
61
|
-
search-code-sourcegraph,
|
|
62
|
-
caveman,
|
|
63
|
-
]
|
|
64
|
-
bash:
|
|
65
|
-
mode: unrestricted
|
|
66
|
-
gate:
|
|
67
|
-
provider: plannotator
|
|
68
|
-
submitOutcome: submit
|
|
69
|
-
approvedOutcome: approved
|
|
70
|
-
rejectedOutcome: changes-requested
|
|
71
|
-
timeoutMs: 30000
|
|
72
|
-
artifactContract:
|
|
73
|
-
maxChars: 10000
|
|
74
|
-
requiredSubstrings:
|
|
75
|
-
- '## Review summary'
|
|
76
|
-
- '## Comment decisions'
|
|
77
|
-
- '## Implementation plan'
|
|
78
|
-
- '## Validation'
|
|
79
|
-
- '## Replies and remote actions'
|
|
80
|
-
- '## Risks'
|
|
81
|
-
- '## Execution appendix (machine-readable)'
|
|
82
|
-
forbiddenSubstrings:
|
|
83
|
-
- 'The complete gate artifact is the exact Markdown saved at'
|
|
84
|
-
onValidationFailure: retry
|
|
85
|
-
transitions:
|
|
86
|
-
approved: implement
|
|
87
|
-
changes-requested: plan
|
|
88
|
-
retry: plan
|
|
89
|
-
blocked: $pause
|
|
90
|
-
implement:
|
|
91
|
-
title: Implement approved review-comment fixes
|
|
92
|
-
prompt:
|
|
93
|
-
file: steps/mr-comment/implement.md
|
|
94
|
-
agent: worker
|
|
95
|
-
permissions:
|
|
96
|
-
tools: [read, ls, bash, edit, write, mcp]
|
|
97
|
-
mcp: [context7]
|
|
98
|
-
extensions: [/]
|
|
99
|
-
skills:
|
|
100
|
-
[coding-standards, test-driven-development, lint-commands, caveman]
|
|
101
|
-
bash:
|
|
102
|
-
mode: unrestricted
|
|
103
|
-
transitions:
|
|
104
|
-
ready: verify
|
|
105
|
-
retry: implement
|
|
106
|
-
blocked: $pause
|
|
107
|
-
verify:
|
|
108
|
-
title: Independently verify review-comment handling
|
|
109
|
-
prompt:
|
|
110
|
-
file: steps/mr-comment/verify.md
|
|
111
|
-
agent: reviewer
|
|
112
|
-
permissions:
|
|
113
|
-
tools: [read, ls, bash]
|
|
114
|
-
mcp: []
|
|
115
|
-
extensions: [/]
|
|
116
|
-
skills: [verification-before-completion, lint-commands, caveman]
|
|
117
|
-
bash:
|
|
118
|
-
mode: unrestricted
|
|
119
|
-
transitions:
|
|
120
|
-
ready: deliver
|
|
121
|
-
no-actions: $done
|
|
122
|
-
failed: implement
|
|
123
|
-
retry: verify
|
|
124
|
-
blocked: verify
|
|
125
|
-
deliver:
|
|
126
|
-
title: Push the verified commit and reply to review comments
|
|
127
|
-
prompt:
|
|
128
|
-
file: steps/mr-comment/publish.md
|
|
129
|
-
agent: worker
|
|
130
|
-
permissions:
|
|
131
|
-
tools: [read, ls, bash, mcp]
|
|
132
|
-
mcp: [gitlab]
|
|
133
|
-
extensions: [/]
|
|
134
|
-
skills: [commit-format, caveman]
|
|
135
|
-
bash:
|
|
136
|
-
mode: unrestricted
|
|
137
|
-
transitions:
|
|
138
|
-
published: $done
|
|
139
|
-
no-actions: $done
|
|
140
|
-
retry: deliver
|
|
141
|
-
superseded: $pause
|
|
142
|
-
blocked: $pause
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
version: 1
|
|
2
|
-
id: mr-review
|
|
3
|
-
command: mr-review
|
|
4
|
-
description: 'Fetch, approve, publish, and verify one hosted code review. Example: /mr-review https://gitlab.com/org/repo/-/merge_requests/123'
|
|
5
|
-
start: fetch
|
|
6
|
-
maxStepVisits: 10
|
|
7
|
-
summaryMaxChars: 50000
|
|
8
|
-
steps:
|
|
9
|
-
fetch:
|
|
10
|
-
title: Fetch complete hosted-review evidence
|
|
11
|
-
prompt:
|
|
12
|
-
file: steps/mr-review/fetch.md
|
|
13
|
-
agent: scout
|
|
14
|
-
permissions:
|
|
15
|
-
tools: [read, ls, bash, mcp]
|
|
16
|
-
mcp: [gitlab, context7]
|
|
17
|
-
extensions: [/]
|
|
18
|
-
skills: [caveman]
|
|
19
|
-
bash:
|
|
20
|
-
mode: unrestricted
|
|
21
|
-
transitions:
|
|
22
|
-
fetched: review
|
|
23
|
-
blocked: $pause
|
|
24
|
-
review:
|
|
25
|
-
title: Produce and approve the complete hosted review
|
|
26
|
-
prompt:
|
|
27
|
-
file: steps/mr-review/review-for-approval.md
|
|
28
|
-
agent: reviewer
|
|
29
|
-
permissions:
|
|
30
|
-
tools: [read, ls, bash, mcp]
|
|
31
|
-
mcp: [gitlab, sourcegraph, context7]
|
|
32
|
-
extensions: [/]
|
|
33
|
-
skills:
|
|
34
|
-
[
|
|
35
|
-
coding-standards,
|
|
36
|
-
requesting-code-review,
|
|
37
|
-
search-code-sourcegraph,
|
|
38
|
-
caveman,
|
|
39
|
-
]
|
|
40
|
-
bash:
|
|
41
|
-
mode: unrestricted
|
|
42
|
-
gate:
|
|
43
|
-
provider: plannotator
|
|
44
|
-
submitOutcome: submit
|
|
45
|
-
approvedOutcome: approved
|
|
46
|
-
rejectedOutcome: changes-requested
|
|
47
|
-
timeoutMs: 30000
|
|
48
|
-
artifactContract:
|
|
49
|
-
maxChars: 8000
|
|
50
|
-
requiredSubstrings:
|
|
51
|
-
- '# Review:'
|
|
52
|
-
- '## Verdict'
|
|
53
|
-
- '## Findings'
|
|
54
|
-
- '## Validation'
|
|
55
|
-
- '## Publication contract'
|
|
56
|
-
- '## Safety boundaries'
|
|
57
|
-
forbiddenSubstrings:
|
|
58
|
-
- 'The complete gate artifact is the exact Markdown saved at'
|
|
59
|
-
onValidationFailure: retry
|
|
60
|
-
transitions:
|
|
61
|
-
approved: publish
|
|
62
|
-
changes-requested: review
|
|
63
|
-
retry: review
|
|
64
|
-
blocked: $pause
|
|
65
|
-
publish:
|
|
66
|
-
title: Publish the approved hosted review
|
|
67
|
-
prompt:
|
|
68
|
-
file: steps/mr-review/publish-approved.md
|
|
69
|
-
agent: worker
|
|
70
|
-
permissions:
|
|
71
|
-
tools: [read, ls, bash, mcp]
|
|
72
|
-
mcp: [gitlab]
|
|
73
|
-
extensions: [/]
|
|
74
|
-
skills: [caveman]
|
|
75
|
-
bash:
|
|
76
|
-
mode: unrestricted
|
|
77
|
-
transitions:
|
|
78
|
-
published: verify
|
|
79
|
-
blocked: $pause
|
|
80
|
-
verify:
|
|
81
|
-
title: Verify or return the approved review for publication repair
|
|
82
|
-
prompt:
|
|
83
|
-
file: steps/mr-review/verify-published.md
|
|
84
|
-
agent: reviewer
|
|
85
|
-
permissions:
|
|
86
|
-
tools: [read, ls, bash, mcp]
|
|
87
|
-
mcp: [gitlab]
|
|
88
|
-
extensions: [/]
|
|
89
|
-
skills: [verification-before-completion, caveman]
|
|
90
|
-
bash:
|
|
91
|
-
mode: unrestricted
|
|
92
|
-
transitions:
|
|
93
|
-
verified: $done
|
|
94
|
-
failed: publish
|
|
95
|
-
retry: verify
|
|
96
|
-
blocked: verify
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
You are the evidence-collection and report-writing stage for an approved investigation. Do not launch subagents.
|
|
2
|
-
|
|
3
|
-
Original request:
|
|
4
|
-
{{workflow.input}}
|
|
5
|
-
|
|
6
|
-
Approved scope artifact:
|
|
7
|
-
{{reviewed.artifact}}
|
|
8
|
-
|
|
9
|
-
Plannotator feedback:
|
|
10
|
-
{{reviewed.feedback}}
|
|
11
|
-
|
|
12
|
-
## Report Template (`~/repositories/investigation-findings/<slug>.md`)
|
|
13
|
-
|
|
14
|
-
```markdown
|
|
15
|
-
# {Investigation Title}
|
|
16
|
-
|
|
17
|
-
> {Brief summary description}
|
|
18
|
-
|
|
19
|
-
# Goal of the investigation
|
|
20
|
-
1. {Goal 1}
|
|
21
|
-
2. {Goal 2}
|
|
22
|
-
|
|
23
|
-
# Investigation summary that satisfy the goal
|
|
24
|
-
{Evidence-backed findings, concise bullets, and Mermaid diagrams for flows}
|
|
25
|
-
|
|
26
|
-
# Supporting documents
|
|
27
|
-
{Exact file paths with line ranges, permanent links, and code citations}
|
|
28
|
-
|
|
29
|
-
# Risks
|
|
30
|
-
1. {Material risk 1 with safeguard}
|
|
31
|
-
2. {Open uncertainty or limitation}
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Rules & Boundaries
|
|
35
|
-
1. **Read-Only Inspection**: Gather evidence across code, docs, and search tools. Never edit repo code or mutate external systems.
|
|
36
|
-
2. **Single Output File**: Write/replace only the approved report file under `~/repositories/investigation-findings/`. Never stage or commit.
|
|
37
|
-
3. **Outcomes**:
|
|
38
|
-
- `ready`: Report written with structured claim ledger.
|
|
39
|
-
- `retry`: Transient tool or file-write issue.
|
|
40
|
-
- `blocked`: Inaccessible required evidence or unachievable scope.
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
You are the scope-retrieval stage for `/investigate`. Stay read-only in this delegated child; do not launch subagents.
|
|
2
|
-
|
|
3
|
-
Workflow input:
|
|
4
|
-
{{workflow.input}}
|
|
5
|
-
|
|
6
|
-
Previously rejected scope:
|
|
7
|
-
{{gate.artifact}}
|
|
8
|
-
|
|
9
|
-
Plannotator feedback:
|
|
10
|
-
{{gate.feedback}}
|
|
11
|
-
|
|
12
|
-
## Scope Artifact Structure
|
|
13
|
-
|
|
14
|
-
1. `# <Investigation title>`
|
|
15
|
-
2. `## Brief description`
|
|
16
|
-
3. `## Goals` (numbered list)
|
|
17
|
-
4. `## Boundaries` (in-scope systems & explicit exclusions)
|
|
18
|
-
5. `## Evidence & sources` (Jira, local files, documents, search tools)
|
|
19
|
-
6. `## Report destination` (`./investigation-findings/<slug>.md`)
|
|
20
|
-
7. `## Open evidence gaps`
|
|
21
|
-
|
|
22
|
-
## Artifact limit
|
|
23
|
-
Keep the submitted artifact concise and at most 6,000 characters. Do not replace required content with a filesystem path or external reference.
|
|
24
|
-
|
|
25
|
-
## Outcomes
|
|
26
|
-
- `submit`: Scope ready for Plannotator gate review.
|
|
27
|
-
- `retry`: Transient read-only API failure.
|
|
28
|
-
- `blocked`: Empty input or inaccessible required Jira data.
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
You are the independent validation stage for an investigation report. Stay read-only; do not edit the report or launch subagents.
|
|
2
|
-
|
|
3
|
-
Original request:
|
|
4
|
-
{{workflow.input}}
|
|
5
|
-
|
|
6
|
-
Approved scope artifact:
|
|
7
|
-
{{reviewed.artifact}}
|
|
8
|
-
|
|
9
|
-
Investigation ledger:
|
|
10
|
-
{{last.summary}}
|
|
11
|
-
|
|
12
|
-
## Validation Rules & Review Criteria
|
|
13
|
-
|
|
14
|
-
1. **Independent Verification**: Do not trust the prior claim ledger; verify citations, line numbers, and sources directly with read-only tools.
|
|
15
|
-
2. **Reader-Clarity Review**: Ensure prose is concise, scannable, and free of filler. Recommend Mermaid diagrams only where complex flows or relationships warrant visual representation.
|
|
16
|
-
3. **Outcomes**:
|
|
17
|
-
- `approved`: All material claims verified and clear.
|
|
18
|
-
- `gaps`: Actionable evidence gaps, contradictions, or clarity issues (returns to `investigate`).
|
|
19
|
-
- `retry`: Recoverable read-only tool failure.
|
|
20
|
-
- `blocked`: Irreconcilable evidence or missing sources after exhaustive attempts.
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
You are the Jira creation stage for an approved `/jira` plan. Do not launch subagents, write local files, or mutate unapproved Jira records.
|
|
2
|
-
|
|
3
|
-
Original input:
|
|
4
|
-
{{workflow.input}}
|
|
5
|
-
|
|
6
|
-
Approved Jira plan:
|
|
7
|
-
{{reviewed.artifact}}
|
|
8
|
-
|
|
9
|
-
Approval feedback:
|
|
10
|
-
{{reviewed.feedback}}
|
|
11
|
-
|
|
12
|
-
Previous creation ledger:
|
|
13
|
-
{{last.summary}}
|
|
14
|
-
|
|
15
|
-
## Guardrails & Output Contract
|
|
16
|
-
|
|
17
|
-
1. **Idempotence**: Check the creation ledger before every write; skip any issue or link already created and confirmed.
|
|
18
|
-
2. **Immediate Readback**: Always read back created issues to capture exact numeric IDs, keys, and URLs.
|
|
19
|
-
3. **Safety**: Never delete issues, guess custom fields, or retry ambiguous mutations. On any partial failure or timeout, return `blocked` with the confirmed ledger.
|
|
20
|
-
4. **Required Output Format**:
|
|
21
|
-
- `# Epic ID: <numeric ID>`
|
|
22
|
-
- `# Epic key: <key>`
|
|
23
|
-
- `# Epic URL: <URL>`
|
|
24
|
-
- `## Stories` (numbered list with IDs, keys, URLs, Epic membership, and link proofs)
|
|
25
|
-
- `## Creation ledger` (full preflight mapping and execution trace)
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
You are the input-normalization stage for `/jira`. Stay read-only; do not call Atlassian tools or write files.
|
|
2
|
-
|
|
3
|
-
Workflow input:
|
|
4
|
-
{{workflow.input}}
|
|
5
|
-
|
|
6
|
-
## Draft Artifact Structure
|
|
7
|
-
|
|
8
|
-
1. `# Jira draft`
|
|
9
|
-
2. `## Source` (`Markdown path: <path>` or `Quick summary`)
|
|
10
|
-
3. `## Project key` (explicit key or `Missing`)
|
|
11
|
-
4. `## Epic draft` (Name, goal, expected value, touched services)
|
|
12
|
-
5. `## Ordered Story draft` (numbered list with stable draft IDs, service, frontend/backend scope, implementation bullets, risks, dependencies)
|
|
13
|
-
6. `## Unknowns` (missing details needed before creation)
|
|
14
|
-
|
|
15
|
-
## Outcomes
|
|
16
|
-
- `ready`: Draft parsed and ready for planning.
|
|
17
|
-
- `retry`: Transient file read failure.
|
|
18
|
-
- `blocked`: Unreadable file path or empty input.
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
You are the Jira planning and approval stage for `/jira`. Stay read-only; do not create issues or launch subagents.
|
|
2
|
-
|
|
3
|
-
Original input:
|
|
4
|
-
{{workflow.input}}
|
|
5
|
-
|
|
6
|
-
Normalized draft:
|
|
7
|
-
{{last.summary}}
|
|
8
|
-
|
|
9
|
-
Previously rejected plan:
|
|
10
|
-
{{gate.artifact}}
|
|
11
|
-
|
|
12
|
-
Plannotator feedback:
|
|
13
|
-
{{gate.feedback}}
|
|
14
|
-
|
|
15
|
-
## Plan Artifact Structure
|
|
16
|
-
|
|
17
|
-
1. `# Create Jira Epic and Stories`
|
|
18
|
-
2. `## Jira field contract` — verified field IDs, link types, payload shapes, and representative keys.
|
|
19
|
-
3. `## Epic` — Name, quick summary, goal, **Feature diagram (Mermaid)**, expected value, timeline, touched services, references.
|
|
20
|
-
4. `## Ordered Stories` — Numbered stories with `<service> — <Frontend|Backend> — <outcome>`, background, implementation bullets, risks, acceptance criteria, Epic membership, dependencies.
|
|
21
|
-
5. `## Creation sequence` — Epic first, followed by stories in dependency order.
|
|
22
|
-
6. `## Safety limits` — Exact mapped fields only; no guessed IDs or unapproved objects.
|
|
23
|
-
|
|
24
|
-
## Artifact limit
|
|
25
|
-
Keep the submitted artifact concise and at most 16,000 characters. Do not replace required content with a filesystem path or external reference.
|
|
26
|
-
|
|
27
|
-
## Outcomes
|
|
28
|
-
- `submit`: Plan ready for Plannotator review.
|
|
29
|
-
- `retry`: Transient read-only Atlassian API failure.
|
|
30
|
-
- `blocked`: Inaccessible project, unverified field mappings, or missing project key.
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
You prepare the local checkout for resolving hosted MR comments. Do not delete worktrees, reset HEAD, or launch subagents.
|
|
2
|
-
|
|
3
|
-
Review input:
|
|
4
|
-
{{workflow.input}}
|
|
5
|
-
|
|
6
|
-
Fetched review evidence:
|
|
7
|
-
{{last.summary}}
|
|
8
|
-
|
|
9
|
-
## Guardrails
|
|
10
|
-
- **Preservation**: Never stash, reset, clean, or delete files.
|
|
11
|
-
- **Outcomes**:
|
|
12
|
-
- `ready`: Source branch checked out/bound safely. Include `workspace: {cwd: "<path>"}`.
|
|
13
|
-
- `retry`: Transient fetch error.
|
|
14
|
-
- `blocked`: Dirty unrelated checkout, divergent branch history, or missing remote.
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
You are the read-only evidence-fetch stage for `/mr-comment`. Do not modify local/remote state or launch subagents.
|
|
2
|
-
|
|
3
|
-
Review input:
|
|
4
|
-
{{workflow.input}}
|
|
5
|
-
|
|
6
|
-
## Evidence Packet Structure
|
|
7
|
-
- Canonical URL, host, project/repo, review number.
|
|
8
|
-
- Source/target branches and remote SHAs.
|
|
9
|
-
- Matching local remote name and local Git status.
|
|
10
|
-
- Changed file list and diff context.
|
|
11
|
-
- Unresolved discussion comments with IDs, authors, anchors (path/line), and text.
|
|
12
|
-
|
|
13
|
-
## Outcomes
|
|
14
|
-
- `ready`: Evidence gathered successfully.
|
|
15
|
-
- `retry`: Transient network/read failure.
|
|
16
|
-
- `blocked`: Authentication failure, invalid URL, or missing permissions.
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
You are the implementation stage for the approved review-comment plan. Stay in this delegated child; do not launch subagents.
|
|
2
|
-
|
|
3
|
-
Review input:
|
|
4
|
-
{{workflow.input}}
|
|
5
|
-
|
|
6
|
-
Approved plan:
|
|
7
|
-
{{reviewed.artifact}}
|
|
8
|
-
|
|
9
|
-
Approval feedback:
|
|
10
|
-
{{reviewed.feedback}}
|
|
11
|
-
|
|
12
|
-
Previous ledger:
|
|
13
|
-
{{last.summary}}
|
|
14
|
-
|
|
15
|
-
## Rules & Invariants
|
|
16
|
-
- Execute only approved `workerCommands`.
|
|
17
|
-
- For reply-only plans (no code changes needed), verify code without creating commits.
|
|
18
|
-
- Outcomes:
|
|
19
|
-
- `ready`: Implementation complete and committed. Pass full JSON contract to reviewer.
|
|
20
|
-
- `retry`: Transient tool failure.
|
|
21
|
-
- `blocked`: Unapproved command required or unrecoverable error.
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
You are the planning stage for resolving hosted MR comments. Stay read-only on the bound checkout; do not launch subagents.
|
|
2
|
-
|
|
3
|
-
Review input:
|
|
4
|
-
{{workflow.input}}
|
|
5
|
-
|
|
6
|
-
Fetched evidence:
|
|
7
|
-
{{last.summary}}
|
|
8
|
-
|
|
9
|
-
Previously rejected artifact:
|
|
10
|
-
{{gate.artifact}}
|
|
11
|
-
|
|
12
|
-
Plannotator feedback:
|
|
13
|
-
{{gate.feedback}}
|
|
14
|
-
|
|
15
|
-
## Plan Artifact Structure
|
|
16
|
-
|
|
17
|
-
1. `# <Outcome-oriented title>`
|
|
18
|
-
2. `## Review summary`
|
|
19
|
-
3. `## Comment decisions` (per-comment classification and evidence)
|
|
20
|
-
4. `## Implementation plan` (scoped files, observable changes)
|
|
21
|
-
5. `## Validation` (tests, lint, format)
|
|
22
|
-
6. `## Replies and remote actions` (exact reply text per comment)
|
|
23
|
-
7. `## Risks`
|
|
24
|
-
8. `## Execution appendix (machine-readable)` (fenced JSON with `repository`, `workerCommands`, `reviewerCommands`, `remoteActions`)
|
|
25
|
-
|
|
26
|
-
```json
|
|
27
|
-
{
|
|
28
|
-
"repository": {
|
|
29
|
-
"cwd": "<bound-path>",
|
|
30
|
-
"branch": "<source-branch>",
|
|
31
|
-
"commitTitle": "fix(scope): address review comments",
|
|
32
|
-
"scopedFiles": ["src/a.ts"]
|
|
33
|
-
},
|
|
34
|
-
"workerCommands": [
|
|
35
|
-
{"id": "test-red", "command": "..."},
|
|
36
|
-
{"id": "test-green", "command": "..."}
|
|
37
|
-
],
|
|
38
|
-
"reviewerCommands": [
|
|
39
|
-
{"id": "full-tests", "command": "..."},
|
|
40
|
-
{"id": "lint", "command": "..."}
|
|
41
|
-
],
|
|
42
|
-
"remoteActions": [
|
|
43
|
-
{
|
|
44
|
-
"toolName": "bash",
|
|
45
|
-
"input": {"command": "git push origin HEAD:<source-branch>"}
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"toolName": "bash",
|
|
49
|
-
"input": {"command": "glab api projects/<id>/merge_requests/<iid>/discussions/<disc_id>/notes -f body='...'"}
|
|
50
|
-
}
|
|
51
|
-
]
|
|
52
|
-
}
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
## Artifact limit
|
|
56
|
-
Keep the submitted artifact concise and at most 10,000 characters. Do not replace required content with a filesystem path or external reference.
|
|
57
|
-
|
|
58
|
-
## Outcomes
|
|
59
|
-
- `submit`: Complete plan ready for Plannotator gate.
|
|
60
|
-
- `retry`: Transient API failure.
|
|
61
|
-
- `blocked`: Unsafe anchors, ambiguous comment context, or missing permissions.
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
You are the publication stage for an approved review-comment plan. Do not broaden scope or launch subagents.
|
|
2
|
-
|
|
3
|
-
Review input:
|
|
4
|
-
{{workflow.input}}
|
|
5
|
-
|
|
6
|
-
Approved plan:
|
|
7
|
-
{{reviewed.artifact}}
|
|
8
|
-
|
|
9
|
-
Verification ledger:
|
|
10
|
-
{{last.summary}}
|
|
11
|
-
|
|
12
|
-
## Guardrails
|
|
13
|
-
- Run only approved `remoteActions` (`git push`, `glab api`, `gh api`).
|
|
14
|
-
- Never force-push, resolve threads, approve, or merge MRs.
|
|
15
|
-
- Outcomes:
|
|
16
|
-
- `published`: All remote actions executed and confirmed.
|
|
17
|
-
- `blocked`: Remote failure or ambiguous state.
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
You are the independent verification stage for the approved review-comment fixes. Stay read-only for code; do not modify files or launch subagents.
|
|
2
|
-
|
|
3
|
-
Review input:
|
|
4
|
-
{{workflow.input}}
|
|
5
|
-
|
|
6
|
-
Approved plan:
|
|
7
|
-
{{reviewed.artifact}}
|
|
8
|
-
|
|
9
|
-
Implementation ledger:
|
|
10
|
-
{{last.summary}}
|
|
11
|
-
|
|
12
|
-
## Outcomes
|
|
13
|
-
- `passed`: All acceptance criteria, tests, and linters pass. Hands off approved `remoteActions` to publication stage.
|
|
14
|
-
- `failed`: Local test failure or regression (returns to `implement`).
|
|
15
|
-
- `retry`: Recoverable read-only environment failure.
|
|
16
|
-
- `blocked`: Corrupted workspace or missing authority.
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
You are the read-only evidence-fetch stage for `/mr-review`. Do not mutate state or launch subagents.
|
|
2
|
-
|
|
3
|
-
Hosted review URL & context:
|
|
4
|
-
{{workflow.input}}
|
|
5
|
-
|
|
6
|
-
## Evidence Bundle Structure
|
|
7
|
-
1. `# Hosted review evidence`
|
|
8
|
-
2. `## Identity and immutable coordinates` (URL, host, project, MR/PR number, source/target branch, head SHA)
|
|
9
|
-
3. `## Description and commits`
|
|
10
|
-
4. `## Change manifest and diff evidence`
|
|
11
|
-
5. `## Pipelines or checks`
|
|
12
|
-
6. `## Existing review state`
|
|
13
|
-
7. `## Repository context`
|
|
14
|
-
|
|
15
|
-
## Outcomes
|
|
16
|
-
- `fetched`: Evidence gathering complete.
|
|
17
|
-
- `blocked`: Inaccessible review, invalid URL, or missing permissions.
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
You are the publication stage for an approved hosted code review. Do not rewrite approved content or launch subagents.
|
|
2
|
-
|
|
3
|
-
Original input:
|
|
4
|
-
{{workflow.input}}
|
|
5
|
-
|
|
6
|
-
Approved review artifact:
|
|
7
|
-
{{reviewed.artifact}}
|
|
8
|
-
|
|
9
|
-
Approval feedback:
|
|
10
|
-
{{reviewed.feedback}}
|
|
11
|
-
|
|
12
|
-
Previous step handoff:
|
|
13
|
-
{{last.summary}}
|
|
14
|
-
|
|
15
|
-
## Guardrails
|
|
16
|
-
- Execute only literal commands approved in `actions`.
|
|
17
|
-
- Never force-push, approve, merge, resolve, or close reviews.
|
|
18
|
-
- Outcome `published` requires all actions either executed or verified already existing. Outcome `blocked` on ambiguity or error.
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
You are the independent reviewer for a hosted MR/PR. This is the sole review artifact submitted to Plannotator. Do not mutate state or launch subagents.
|
|
2
|
-
|
|
3
|
-
Original input:
|
|
4
|
-
{{workflow.input}}
|
|
5
|
-
|
|
6
|
-
Fetched evidence bundle:
|
|
7
|
-
{{last.summary}}
|
|
8
|
-
|
|
9
|
-
Previously rejected artifact:
|
|
10
|
-
{{gate.artifact}}
|
|
11
|
-
|
|
12
|
-
Plannotator feedback:
|
|
13
|
-
{{gate.feedback}}
|
|
14
|
-
|
|
15
|
-
## Review Artifact Structure
|
|
16
|
-
|
|
17
|
-
1. `# Review: <Short verdict>`
|
|
18
|
-
2. `## Verdict` — URL, host, current head SHA, concise outcome.
|
|
19
|
-
3. `## Findings` — Ordered by severity: path, line, problem, impact, evidence, fix. (Or `No actionable findings.`).
|
|
20
|
-
4. `## Validation` — Refreshed diff, checks, and false-positive checks.
|
|
21
|
-
5. `## Publication contract` — Fenced JSON with `actions` array.
|
|
22
|
-
6. `## Safety boundaries` — Prohibited actions (no force push, no unapproved merges).
|
|
23
|
-
|
|
24
|
-
```json
|
|
25
|
-
{
|
|
26
|
-
"actions": [
|
|
27
|
-
{
|
|
28
|
-
"toolName": "bash",
|
|
29
|
-
"input": {
|
|
30
|
-
"command": "glab api projects/<id>/merge_requests/<iid>/discussions ..."
|
|
31
|
-
},
|
|
32
|
-
"effect": {
|
|
33
|
-
"kind": "inline-comment",
|
|
34
|
-
"host": "gitlab.com",
|
|
35
|
-
"reviewUrl": "https://...",
|
|
36
|
-
"headSha": "<current-sha>",
|
|
37
|
-
"path": "src/file.ts",
|
|
38
|
-
"line": 42,
|
|
39
|
-
"body": "Exact feedback...",
|
|
40
|
-
"marker": "<unique-marker>"
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
]
|
|
44
|
-
}
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## Artifact limit
|
|
48
|
-
Keep the submitted artifact concise and at most 8,000 characters. Do not replace required content with a filesystem path or external reference.
|
|
49
|
-
|
|
50
|
-
## Outcomes
|
|
51
|
-
- `submit`: Review artifact ready for Plannotator gate.
|
|
52
|
-
- `retry`: Transient read-only API failure.
|
|
53
|
-
- `blocked`: Stale review head or inaccessible discussion API.
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
You are the read-only verification stage for an approved hosted review. Do not mutate state or execute publication commands.
|
|
2
|
-
|
|
3
|
-
Original input:
|
|
4
|
-
{{workflow.input}}
|
|
5
|
-
|
|
6
|
-
Approved review artifact:
|
|
7
|
-
{{reviewed.artifact}}
|
|
8
|
-
|
|
9
|
-
Publication ledger:
|
|
10
|
-
{{last.summary}}
|
|
11
|
-
|
|
12
|
-
## Reviewer Invariants & Outcomes
|
|
13
|
-
- `verified`: Every approved inline comment or summary note is observable on the host with its exact marker.
|
|
14
|
-
- `failed`: An actionable missing comment or mismatch is detected; returns to `publish-approved` stage for correction.
|
|
15
|
-
- `retry`: Recoverable read-only API failure.
|
|
16
|
-
- `blocked`: Stale review or corrupted state.
|