@wichayutdew/pi-workflows 2.5.1 → 2.6.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 (95) hide show
  1. package/README.md +4 -1
  2. package/dist/index.js +1133 -2409
  3. package/examples/starter-kit/agents/planner.md +7 -0
  4. package/examples/starter-kit/agents/reviewer.md +6 -0
  5. package/examples/starter-kit/agents/scout.md +6 -0
  6. package/examples/starter-kit/agents/worker.md +7 -0
  7. package/examples/starter-kit/agents/workspace-preparer.md +6 -0
  8. package/examples/starter-kit/investigate.workflow.yaml +114 -0
  9. package/examples/starter-kit/mr-comment.workflow.yaml +114 -54
  10. package/examples/starter-kit/mr-review.workflow.yaml +77 -56
  11. package/examples/starter-kit/settings.yaml +3 -0
  12. package/examples/starter-kit/steps/investigate/investigate.md +77 -0
  13. package/examples/starter-kit/steps/investigate/retrieve.md +63 -0
  14. package/examples/starter-kit/steps/investigate/validate.md +46 -0
  15. package/examples/starter-kit/steps/mr-comment/checkout-source.md +67 -0
  16. package/examples/starter-kit/steps/mr-comment/fetch.md +34 -26
  17. package/examples/starter-kit/steps/mr-comment/implement.md +34 -27
  18. package/examples/starter-kit/steps/mr-comment/plan.md +54 -40
  19. package/examples/starter-kit/steps/mr-comment/publish.md +28 -27
  20. package/examples/starter-kit/steps/mr-comment/verify.md +42 -35
  21. package/examples/starter-kit/steps/mr-review/fetch.md +52 -22
  22. package/examples/starter-kit/steps/mr-review/publish-approved.md +49 -0
  23. package/examples/starter-kit/steps/mr-review/review-for-approval.md +142 -0
  24. package/examples/starter-kit/steps/mr-review/verify-published.md +37 -0
  25. package/examples/starter-kit/steps/shared/prepare-workspace.md +91 -73
  26. package/examples/starter-kit/steps/shared/publish-remote.md +45 -0
  27. package/examples/starter-kit/steps/ticket/implement.md +59 -25
  28. package/examples/starter-kit/steps/ticket/plan.md +145 -72
  29. package/examples/starter-kit/steps/ticket/verify.md +80 -45
  30. package/examples/starter-kit/steps/work/implement.md +60 -24
  31. package/examples/starter-kit/steps/work/plan.md +129 -57
  32. package/examples/starter-kit/steps/work/verify.md +58 -22
  33. package/examples/starter-kit/ticket.workflow.yaml +75 -36
  34. package/examples/starter-kit/work.workflow.yaml +63 -33
  35. package/package.json +3 -16
  36. package/schemas/workflow.schema.json +2 -15
  37. package/src/agents/profile.ts +98 -0
  38. package/src/config/ceiling.ts +0 -82
  39. package/src/config/types.ts +6 -53
  40. package/src/config/validation/settings.ts +2 -14
  41. package/src/config/validation/step.ts +12 -8
  42. package/src/config/validation/workflow.ts +1 -10
  43. package/src/engine/run-workflow-validation.ts +0 -3
  44. package/src/engine/state-types.ts +1 -1
  45. package/src/harness/action-context.ts +1 -13
  46. package/src/harness/delegation-control-actions.ts +4 -63
  47. package/src/harness/delegation-plan.ts +26 -80
  48. package/src/harness/delegation-response-actions.ts +22 -135
  49. package/src/harness/dependencies.ts +1 -12
  50. package/src/harness/status-actions.ts +1 -0
  51. package/src/harness/step-execution-actions.ts +2 -9
  52. package/src/harness/types.ts +2 -40
  53. package/src/harness.ts +2 -17
  54. package/src/index.ts +4 -9
  55. package/src/integrations/subagents/child-policy-validation.ts +6 -7
  56. package/src/integrations/subagents/child-runtime-dependencies.ts +1 -1
  57. package/src/integrations/subagents/child-runtime-policy.ts +1 -7
  58. package/src/integrations/subagents/child-runtime.ts +18 -9
  59. package/src/integrations/subagents/client.ts +240 -98
  60. package/src/integrations/subagents/protocol-events.ts +32 -15
  61. package/src/integrations/subagents/protocol.ts +1 -1
  62. package/src/preflight.ts +0 -8
  63. package/src/prompt/main-workflow-notice.ts +8 -15
  64. package/src/prompt/step-task.ts +7 -6
  65. package/src/workflow-status/format-status.ts +5 -1
  66. package/src/workflow-status/render-step-detail.ts +94 -0
  67. package/src/workflow-status/types.ts +1 -0
  68. package/src/workflow-status/view.ts +49 -14
  69. package/agents/step.md +0 -32
  70. package/examples/mr-comments.workflow.yaml +0 -125
  71. package/examples/prompts/mr-comments/implement.md +0 -17
  72. package/examples/prompts/mr-comments/inspect.md +0 -5
  73. package/examples/prompts/mr-comments/plan.md +0 -54
  74. package/examples/prompts/mr-comments/verify.md +0 -9
  75. package/examples/settings.yaml +0 -27
  76. package/examples/starter-kit/steps/mr-review/publish.md +0 -48
  77. package/examples/starter-kit/steps/mr-review/review.md +0 -76
  78. package/examples/starter-kit/steps/mr-review/verify.md +0 -35
  79. package/src/config/validation/subagent.ts +0 -288
  80. package/src/harness/delegation-failure.ts +0 -248
  81. package/src/harness/delegation-recovery-validation.ts +0 -161
  82. package/src/harness/delegation-retry-policy.ts +0 -120
  83. package/src/integrations/subagents/client-delegation.ts +0 -181
  84. package/src/integrations/subagents/client-messages.ts +0 -66
  85. package/src/integrations/subagents/client-types.ts +0 -36
  86. package/src/integrations/subagents/diagnostic-format.ts +0 -45
  87. package/src/integrations/subagents/diagnostic-text.ts +0 -114
  88. package/src/integrations/subagents/diagnostic-types.ts +0 -83
  89. package/src/integrations/subagents/diagnostics.ts +0 -26
  90. package/src/integrations/subagents/failure-correlation.ts +0 -285
  91. package/src/integrations/subagents/failure-transcript.ts +0 -252
  92. package/src/integrations/subagents/hidden-bash-failure.ts +0 -98
  93. package/src/integrations/subagents/replay-audit.ts +0 -146
  94. package/src/integrations/subagents/replay-safety.ts +0 -67
  95. package/src/integrations/subagents/session-diagnostics.ts +0 -357
@@ -0,0 +1,7 @@
1
+ You are the planning role for one workflow step.
2
+
3
+ Stay within the step's declared permissions. Establish facts before conclusions,
4
+ separate assumptions from evidence, and inspect existing conventions before
5
+ proposing changes. Produce a small, executable plan that maps requirements to
6
+ verification. Do not implement changes or broaden scope before the workflow's
7
+ approval gate.
@@ -0,0 +1,6 @@
1
+ You are the independent review role for one workflow step.
2
+
3
+ Remain read-only unless the step explicitly grants a different authority.
4
+ Independently verify each requirement, inspect the relevant diff and execution
5
+ evidence, and report only concrete gaps with a precise location and falsifiable
6
+ reason. Do not implement fixes or approve claims without evidence.
@@ -0,0 +1,6 @@
1
+ You are the investigation role for one workflow step.
2
+
3
+ Stay read-only. Gather the smallest set of decisive evidence, distinguish facts
4
+ from hypotheses, and name the next check that would falsify an uncertainty.
5
+ Report relevant conventions, risks, and open questions without proposing
6
+ unverified implementation details.
@@ -0,0 +1,7 @@
1
+ You are the implementation role for one workflow step.
2
+
3
+ Treat the approved workflow artifact and declared permissions as the complete
4
+ authority. Make the smallest coherent change, preserve unrelated work, and
5
+ validate observable behavior with the declared focused checks. Surface a
6
+ blocker with decisive evidence instead of inventing scope, credentials, or
7
+ external side effects.
@@ -0,0 +1,6 @@
1
+ You are the workspace preparation role for one workflow step.
2
+
3
+ Inspect the current repository state before mutation. Create or reuse only the
4
+ workflow-owned workspace described by the step, preserve unrelated changes,
5
+ and return the exact absolute workspace path required by the completion
6
+ contract. Stop with decisive evidence when ownership or safety is ambiguous.
@@ -0,0 +1,114 @@
1
+ version: 1
2
+ id: investigate
3
+ command: investigate
4
+ description: Derive, approve, investigate, and independently validate an evidence-backed finding
5
+ start: retrieve
6
+ maxStepVisits: 12
7
+ summaryMaxChars: 30000
8
+ steps:
9
+ retrieve:
10
+ title: Retrieve investigation scope and Jira evidence
11
+ prompt:
12
+ file: steps/investigate/retrieve.md
13
+ agent: scout
14
+ permissions:
15
+ tools: [read, ls, bash]
16
+ mcp: &jira-read-mcp
17
+ - atlassian/atlassian_getAccessibleAtlassianResources
18
+ - atlassian/atlassian_getJiraIssue
19
+ - atlassian/atlassian_getJiraIssueRemoteIssueLinks
20
+ - atlassian/atlassian_searchJiraIssuesUsingJql
21
+ extensions: [pi-web-tools]
22
+ skills: &retrieve-skills [caveman, coding-standards, brainstorming]
23
+ bash:
24
+ mode: allow-list
25
+ allow: &inspection-bash
26
+ - executable: grep
27
+ - executable: head
28
+ - executable: ls
29
+ - executable: pwd
30
+ - executable: rg
31
+ - executable: stat
32
+ - executable: tail
33
+ - executable: wc
34
+ - executable: git
35
+ argsPrefixes:
36
+ [
37
+ [status],
38
+ [diff],
39
+ [grep],
40
+ [log],
41
+ [ls-files],
42
+ [rev-parse],
43
+ [show],
44
+ [merge-base],
45
+ [rev-list],
46
+ [worktree, list],
47
+ ]
48
+ requires:
49
+ tools: [read, ls, bash]
50
+ skills: *retrieve-skills
51
+ gate:
52
+ provider: plannotator
53
+ submitOutcome: submit
54
+ approvedOutcome: approved
55
+ rejectedOutcome: changes-requested
56
+ timeoutMs: 30000
57
+ transitions:
58
+ approved: investigate
59
+ changes-requested: retrieve
60
+ retry: retrieve
61
+ blocked: $pause
62
+ investigate:
63
+ title: Investigate approved scope and write findings
64
+ prompt:
65
+ file: steps/investigate/investigate.md
66
+ agent: worker
67
+ permissions:
68
+ tools: [read, ls, bash, edit, write]
69
+ mcp: &investigation-mcp
70
+ - atlassian
71
+ - gitlab
72
+ - glean
73
+ - superset
74
+ - sourcegraph
75
+ - context7/resolve-library-id
76
+ - context7/query-docs
77
+ - gh_grep/searchGitHub
78
+ extensions: [pi-web-tools]
79
+ skills: &investigation-skills [caveman, coding-standards]
80
+ bash:
81
+ mode: unrestricted
82
+ requires:
83
+ tools: [read, ls, bash, edit, write]
84
+ skills: *investigation-skills
85
+ transitions:
86
+ ready: validate
87
+ retry: investigate
88
+ blocked: $pause
89
+ validate:
90
+ title: Independently validate investigation findings
91
+ prompt:
92
+ file: steps/investigate/validate.md
93
+ agent: reviewer
94
+ permissions:
95
+ tools: [read, ls, bash]
96
+ mcp: *investigation-mcp
97
+ extensions: [pi-web-tools]
98
+ skills:
99
+ &validation-skills [
100
+ caveman,
101
+ coding-standards,
102
+ systematic-debugging,
103
+ verification-before-completion,
104
+ ]
105
+ bash:
106
+ mode: unrestricted
107
+ requires:
108
+ tools: [read, ls, bash]
109
+ skills: *validation-skills
110
+ transitions:
111
+ approved: $done
112
+ gaps: investigate
113
+ retry: validate
114
+ blocked: validate
@@ -1,73 +1,119 @@
1
1
  version: 1
2
2
  id: mr-comment
3
3
  command: mr-comment
4
- description: Fetch review comments, approve fixes, edit the current checkout, verify, push, and reply
4
+ description: Fetch unresolved MR or PR comments, approve a fix plan, implement, verify, push, and reply
5
5
  start: fetch
6
- maxStepVisits: 4
7
- summaryMaxChars: 50000
6
+ maxStepVisits: 10
7
+ summaryMaxChars: 30000
8
8
  steps:
9
9
  fetch:
10
- title: Fetch merge-request or pull-request comments
10
+ title: Fetch merge-request or pull-request evidence
11
11
  prompt:
12
12
  file: steps/mr-comment/fetch.md
13
- subagent:
14
- agent: scout
15
- context: fresh
16
- timeoutMs: 1800000
13
+ agent: scout
17
14
  permissions:
18
15
  tools: [read, ls, bash]
19
- mcp: [gitlab, github]
16
+ mcp: &comment-mcp
17
+ - gitlab/gitlab_get_merge_request
18
+ - gitlab/gitlab_get_merge_request_commits
19
+ - gitlab/gitlab_get_merge_request_diffs
20
+ - gitlab/gitlab_get_merge_request_pipelines
21
+ - gitlab/gitlab_get_pipeline_jobs
22
+ - gitlab/gitlab_get_merge_request_conflicts
23
+ - gitlab/gitlab_search
24
+ - context7/resolve-library-id
25
+ - context7/query-docs
26
+ - sourcegraph/code_finder
27
+ - sourcegraph/commit_search
28
+ - sourcegraph/diff_search
29
+ - sourcegraph/keyword_search
30
+ - sourcegraph/list_files
31
+ - sourcegraph/list_repos
32
+ - sourcegraph/nls_search
33
+ - sourcegraph/read_file
34
+ - gh_grep/searchGitHub
35
+ extensions: [pi-web-tools]
36
+ skills:
37
+ &comment-fetch-skills [caveman, receiving-code-review, coding-standards]
20
38
  bash:
21
39
  mode: allow-list
22
- allow:
40
+ allow: &comment-inspection-bash
41
+ - executable: grep
42
+ - executable: head
43
+ - executable: ls
44
+ - executable: pwd
45
+ - executable: rg
46
+ - executable: stat
47
+ - executable: tail
48
+ - executable: wc
23
49
  - executable: git
24
50
  argsPrefixes:
25
51
  [
26
52
  [status],
27
53
  [diff],
28
- [log],
29
- [show],
30
54
  [grep],
55
+ [log],
31
56
  [ls-files],
32
57
  [remote, -v],
33
58
  [remote, get-url],
34
59
  [rev-parse],
60
+ [show],
35
61
  ]
36
62
  - executable: glab
37
63
  argsPrefixes: [[mr, view], [mr, diff], [api]]
38
64
  - executable: gh
39
- argsPrefixes: [[pr, view], [pr, diff], [pr, checks], [api]]
65
+ argsPrefixes: [[pr, view], [pr, diff], [api]]
40
66
  - executable: curl
41
67
  requires:
42
68
  tools: [read, ls, bash]
69
+ skills: *comment-fetch-skills
70
+ transitions:
71
+ ready: checkout-source
72
+ retry: fetch
73
+ blocked: $pause
74
+ checkout-source:
75
+ title: Check out the reviewed source branch
76
+ prompt:
77
+ file: steps/mr-comment/checkout-source.md
78
+ agent: worker
79
+ workspace:
80
+ bindOn: [ready]
81
+ allowedRoots: ['~/repositories/worktrees', '.']
82
+ permissions:
83
+ tools: [read, ls, bash]
84
+ mcp: *comment-mcp
85
+ skills: [caveman, receiving-code-review, coding-standards]
86
+ bash:
87
+ mode: unrestricted
88
+ requires:
89
+ tools: [read, ls, bash]
90
+ skills: [caveman, receiving-code-review, coding-standards]
43
91
  transitions:
44
92
  ready: plan
93
+ retry: checkout-source
45
94
  blocked: $pause
46
-
47
95
  plan:
48
- title: Propose a complete comment-fix plan
96
+ title: Propose a complete review-comment fix plan
49
97
  prompt:
50
98
  file: steps/mr-comment/plan.md
51
- subagent:
52
- agent: planner
53
- context: fresh
54
- timeoutMs: 1800000
99
+ agent: planner
55
100
  permissions:
56
101
  tools: [read, ls, bash]
57
- mcp: [gitlab, github]
102
+ mcp: *comment-mcp
103
+ extensions: [pi-web-tools]
104
+ skills:
105
+ &comment-plan-skills [
106
+ caveman,
107
+ receiving-code-review,
108
+ coding-standards,
109
+ brainstorming,
110
+ ]
58
111
  bash:
59
112
  mode: allow-list
60
- allow:
61
- - executable: git
62
- argsPrefixes:
63
- [[status], [diff], [log], [show], [grep], [ls-files], [rev-parse]]
64
- - executable: glab
65
- argsPrefixes: [[mr, view], [mr, diff], [api]]
66
- - executable: gh
67
- argsPrefixes: [[pr, view], [pr, diff], [pr, checks], [api]]
68
- - executable: curl
113
+ allow: *comment-inspection-bash
69
114
  requires:
70
115
  tools: [read, ls, bash]
116
+ skills: *comment-plan-skills
71
117
  gate:
72
118
  provider: plannotator
73
119
  submitOutcome: submit
@@ -77,60 +123,71 @@ steps:
77
123
  transitions:
78
124
  approved: implement
79
125
  changes-requested: plan
126
+ retry: plan
80
127
  blocked: $pause
81
-
82
128
  implement:
83
- title: Implement the approved comment fixes
129
+ title: Implement approved review-comment fixes
84
130
  prompt:
85
131
  file: steps/mr-comment/implement.md
86
- subagent:
87
- agent: worker
88
- context: fresh
89
- timeoutMs: 7200000
90
- artifacts: true
132
+ agent: worker
91
133
  permissions:
92
134
  tools: [read, ls, bash, edit, write]
93
- mcp: [gitlab, github]
135
+ mcp: *comment-mcp
136
+ skills:
137
+ &comment-implement-skills [
138
+ caveman,
139
+ receiving-code-review,
140
+ coding-standards,
141
+ systematic-debugging,
142
+ test-driven-development,
143
+ verification-before-completion,
144
+ ]
94
145
  bash:
95
146
  mode: unrestricted
96
147
  requires:
97
148
  tools: [read, ls, bash, edit, write]
149
+ skills: *comment-implement-skills
98
150
  transitions:
99
151
  ready: verify
152
+ retry: implement
100
153
  blocked: $pause
101
-
102
154
  verify:
103
- title: Independently verify comment handling
155
+ title: Independently verify review-comment handling
104
156
  prompt:
105
157
  file: steps/mr-comment/verify.md
106
- subagent:
107
- agent: reviewer
108
- context: fresh
109
- timeoutMs: 3600000
158
+ agent: reviewer
110
159
  permissions:
111
160
  tools: [read, ls, bash]
112
- mcp: [gitlab, github]
161
+ mcp: *comment-mcp
162
+ skills:
163
+ &comment-verify-skills [
164
+ caveman,
165
+ receiving-code-review,
166
+ coding-standards,
167
+ caveman-review,
168
+ systematic-debugging,
169
+ verification-before-completion,
170
+ ]
113
171
  bash:
114
172
  mode: unrestricted
115
173
  requires:
116
174
  tools: [read, ls, bash]
175
+ skills: *comment-verify-skills
117
176
  transitions:
118
- ready: publish
177
+ ready: deliver
119
178
  no-actions: $done
120
179
  failed: implement
121
- blocked: $pause
122
-
123
- publish:
124
- title: Push verified work and reply to comments
180
+ retry: verify
181
+ blocked: verify
182
+ deliver:
183
+ title: Push the verified commit and reply to review comments
125
184
  prompt:
126
185
  file: steps/mr-comment/publish.md
127
- subagent:
128
- agent: worker
129
- context: fresh
130
- timeoutMs: 1800000
186
+ agent: worker
131
187
  permissions:
132
188
  tools: [read, ls, bash]
133
- mcp: [gitlab, github]
189
+ mcp: *comment-mcp
190
+ skills: [caveman, receiving-code-review]
134
191
  bash:
135
192
  mode: allow-list
136
193
  allow:
@@ -143,7 +200,10 @@ steps:
143
200
  - executable: curl
144
201
  requires:
145
202
  tools: [read, ls, bash]
203
+ skills: [caveman, receiving-code-review]
146
204
  transitions:
147
205
  published: $done
148
206
  no-actions: $done
207
+ retry: deliver
208
+ superseded: $pause
149
209
  blocked: $pause
@@ -3,71 +3,100 @@ id: mr-review
3
3
  command: mr-review
4
4
  description: Fetch, approve, publish, and verify one hosted code review
5
5
  start: fetch
6
- maxStepVisits: 3
6
+ maxStepVisits: 10
7
7
  summaryMaxChars: 50000
8
8
  steps:
9
9
  fetch:
10
10
  title: Fetch complete hosted-review evidence
11
11
  prompt:
12
12
  file: steps/mr-review/fetch.md
13
- subagent:
14
- agent: scout
15
- context: fresh
16
- timeoutMs: 1800000
13
+ agent: scout
17
14
  permissions:
18
15
  tools: [read, ls, bash]
19
- mcp: [gitlab, github]
16
+ mcp: &review-mcp
17
+ - gitlab/gitlab_get_merge_request
18
+ - gitlab/gitlab_get_merge_request_commits
19
+ - gitlab/gitlab_get_merge_request_diffs
20
+ - gitlab/gitlab_get_merge_request_pipelines
21
+ - gitlab/gitlab_get_pipeline_jobs
22
+ - gitlab/gitlab_get_merge_request_conflicts
23
+ - gitlab/gitlab_search
24
+ - context7/resolve-library-id
25
+ - context7/query-docs
26
+ - sourcegraph/code_finder
27
+ - sourcegraph/commit_search
28
+ - sourcegraph/diff_search
29
+ - sourcegraph/keyword_search
30
+ - sourcegraph/list_files
31
+ - sourcegraph/list_repos
32
+ - sourcegraph/nls_search
33
+ - sourcegraph/read_file
34
+ - gh_grep/searchGitHub
35
+ extensions: [pi-web-tools]
36
+ skills:
37
+ &review-fetch-skills [
38
+ caveman,
39
+ coding-standards,
40
+ caveman-review,
41
+ brainstorming,
42
+ ]
20
43
  bash:
21
44
  mode: allow-list
22
- allow:
45
+ allow: &review-inspection-bash
46
+ - executable: grep
47
+ - executable: head
48
+ - executable: ls
49
+ - executable: pwd
50
+ - executable: rg
51
+ - executable: stat
52
+ - executable: tail
53
+ - executable: wc
23
54
  - executable: git
24
55
  argsPrefixes:
25
56
  [
26
57
  [status],
27
58
  [diff],
28
- [log],
29
- [show],
30
59
  [grep],
60
+ [log],
31
61
  [ls-files],
32
62
  [remote, -v],
33
63
  [remote, get-url],
34
64
  [rev-parse],
65
+ [show],
35
66
  ]
36
- - executable: glab
37
- argsPrefixes: [[mr, view], [mr, diff], [api]]
38
67
  - executable: gh
39
68
  argsPrefixes: [[pr, view], [pr, diff], [pr, checks], [api]]
40
- - executable: curl
69
+ - executable: glab
70
+ argsPrefixes: [[mr, view], [mr, diff], [api]]
41
71
  requires:
42
72
  tools: [read, ls, bash]
73
+ skills: *review-fetch-skills
43
74
  transitions:
44
75
  fetched: review
45
76
  blocked: $pause
46
-
47
77
  review:
48
- title: Produce and approve a complete review
78
+ title: Produce and approve the complete hosted review
49
79
  prompt:
50
- file: steps/mr-review/review.md
51
- subagent:
52
- agent: reviewer
53
- context: fresh
54
- timeoutMs: 1800000
80
+ file: steps/mr-review/review-for-approval.md
81
+ agent: reviewer
55
82
  permissions:
56
83
  tools: [read, ls, bash]
57
- mcp: [gitlab, github]
84
+ mcp: *review-mcp
85
+ extensions: [pi-web-tools]
86
+ skills:
87
+ &review-skills [
88
+ caveman,
89
+ coding-standards,
90
+ caveman-review,
91
+ systematic-debugging,
92
+ verification-before-completion,
93
+ ]
58
94
  bash:
59
95
  mode: allow-list
60
- allow:
61
- - executable: git
62
- argsPrefixes:
63
- [[status], [diff], [log], [show], [grep], [ls-files], [rev-parse]]
64
- - executable: glab
65
- argsPrefixes: [[mr, view], [mr, diff], [api]]
66
- - executable: gh
67
- argsPrefixes: [[pr, view], [pr, diff], [pr, checks], [api]]
68
- - executable: curl
96
+ allow: *review-inspection-bash
69
97
  requires:
70
98
  tools: [read, ls, bash]
99
+ skills: *review-skills
71
100
  gate:
72
101
  provider: plannotator
73
102
  submitOutcome: submit
@@ -78,55 +107,47 @@ steps:
78
107
  approved: publish
79
108
  changes-requested: review
80
109
  blocked: $pause
81
-
82
110
  publish:
83
- title: Publish the approved review
111
+ title: Publish the approved hosted review
84
112
  prompt:
85
- file: steps/mr-review/publish.md
86
- subagent:
87
- agent: worker
88
- context: fresh
89
- timeoutMs: 900000
113
+ file: steps/mr-review/publish-approved.md
114
+ agent: worker
90
115
  permissions:
91
116
  tools: [bash]
92
- mcp: [gitlab, github]
117
+ skills:
118
+ &publish-skills [
119
+ caveman,
120
+ caveman-review,
121
+ verification-before-completion,
122
+ ]
93
123
  bash:
94
- mode: allow-list
95
- allow:
96
- - executable: glab
97
- argsPrefixes: [[mr, view], [api]]
98
- - executable: gh
99
- argsPrefixes: [[pr, view], [api]]
100
- - executable: curl
124
+ mode: unrestricted
101
125
  requires:
102
126
  tools: [bash]
127
+ skills: *publish-skills
103
128
  transitions:
104
129
  published: verify
105
130
  blocked: $pause
106
-
107
131
  verify:
108
- title: Verify or return the review for publication repair
132
+ title: Verify or return the approved review for publication repair
109
133
  prompt:
110
- file: steps/mr-review/verify.md
111
- subagent:
112
- agent: reviewer
113
- context: fresh
114
- timeoutMs: 900000
134
+ file: steps/mr-review/verify-published.md
135
+ agent: reviewer
115
136
  permissions:
116
137
  tools: [bash]
117
- mcp: [gitlab, github]
138
+ skills: *publish-skills
118
139
  bash:
119
140
  mode: allow-list
120
141
  allow:
121
- - executable: glab
122
- argsPrefixes: [[mr, view], [api]]
123
142
  - executable: gh
124
143
  argsPrefixes: [[pr, view], [api]]
125
- - executable: curl
144
+ - executable: glab
145
+ argsPrefixes: [[mr, view], [api]]
126
146
  requires:
127
147
  tools: [bash]
148
+ skills: *publish-skills
128
149
  transitions:
129
150
  verified: $done
130
151
  failed: publish
131
152
  retry: verify
132
- blocked: $pause
153
+ blocked: verify
@@ -0,0 +1,3 @@
1
+ version: 1
2
+ allowProjectWorkflows: false
3
+ statusShortcut: ctrl+alt+w
@@ -0,0 +1,77 @@
1
+ You are the evidence-collection and report-writing stage for an approved
2
+ investigation. You are the active workflow step. Do not delegate this work.
3
+
4
+ Original request:
5
+ {{workflow.input}}
6
+
7
+ Approved scope artifact:
8
+ {{reviewed.artifact}}
9
+
10
+ Plannotator feedback:
11
+ {{reviewed.feedback}}
12
+
13
+ Investigate only the approved scope. Begin in the current directory: read
14
+ applicable instructions, identify relevant code, tests, configuration, history,
15
+ and documents with read-only inspection. Broaden only when evidence requires it
16
+ to relevant authorized local repositories, internal documents, and primary
17
+ external documentation. Use `rg`, `fd`, and other read-only Bash inspection
18
+ commands where available. Never mutate a repository, issue, merge request,
19
+ remote system, or source document.
20
+
21
+ Use configured remote sources only when relevant to a goal. Restrict every MCP
22
+ call to a read operation: Atlassian for Jira evidence; GitLab for hosted source
23
+ and review evidence; Glean for indexed documents; Superset for published data
24
+ metadata; Sourcegraph and GitHub search for code; Context7 for version-specific
25
+ library documentation; and web sources for current primary documentation. A
26
+ configured server can expose mutation tools, but never call one. Record an
27
+ unavailable, inaccessible, or irrelevant source as a limitation; never invent
28
+ its findings.
29
+
30
+ Separate facts, hypotheses, and unknowns while investigating. Material facts
31
+ need an exact local path and line range, a stable remote link, or an identified
32
+ primary document. Hypotheses need confidence and a falsifier. Reconcile
33
+ conflicting evidence before reporting it; when it cannot be reconciled, report
34
+ the conflict as a risk or open uncertainty rather than choosing a conclusion.
35
+
36
+ Write one Markdown report to the approved deterministic destination:
37
+ `~/repositories/investigation-findings/<jira-id-or-summary-slug>.md`. Use the
38
+ lowercase Jira key when scope has one; otherwise derive the lowercase ASCII
39
+ summary slug by joining words with hyphens. Announce the path before writing.
40
+ Create `~/repositories/investigation-findings` only when absent. You may replace
41
+ only that deterministic report file. Never commit, stage, or otherwise modify
42
+ any repository file.
43
+
44
+ The report must contain exactly this requested structure, with each section
45
+ substantive or explicitly limited by unavailable evidence:
46
+
47
+ ```md
48
+ # {Investigation title}
49
+
50
+ > {Brief description}
51
+
52
+ # Goal of the investigation
53
+ 1. {goal 1}
54
+ 2. {goal 2}
55
+
56
+ # Investigation summary that satisfy the goal
57
+ {Evidence-backed summary, bullets, numbered list, or Mermaid diagram.}
58
+
59
+ # Supporting documents
60
+ {Links, local paths with line ranges, relevant code blocks, and source limits.}
61
+
62
+ # Risks
63
+ 1. {risk 1}
64
+ 2. {risk 2}
65
+ ```
66
+
67
+ Do not add claims without support. Do not add report sections beyond this
68
+ structure. Supporting documents must distinguish direct evidence from context.
69
+ Risks must include contradictory, unavailable, stale, security, or scope
70
+ limitations when relevant.
71
+
72
+ Call `workflow_complete_step` alone with outcome `ready` only after writing the
73
+ report. Its summary must include the exact report path and a claim ledger: each
74
+ material claim, its supporting source, confidence, and unresolved limitation.
75
+ Use `retry` for a transient evidence or report-write failure after safe recovery
76
+ attempts. Use `blocked` when the approved scope cannot be investigated safely or
77
+ the report cannot be written. Do not ask a terminal question.