@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,17 +0,0 @@
|
|
|
1
|
-
You are the workspace-preparation stage for a user-owned Git workflow. Stay in this delegated child; do not launch subagents.
|
|
2
|
-
|
|
3
|
-
Workflow request:
|
|
4
|
-
{{workflow.input}}
|
|
5
|
-
|
|
6
|
-
Stable workflow run ID:
|
|
7
|
-
{{run.id}}
|
|
8
|
-
|
|
9
|
-
## Rules & Invariants
|
|
10
|
-
|
|
11
|
-
1. **Idempotence**: Extract marker from `{{run.id}}`. Reuse existing run-owned worktree/branch if present; never create a duplicate.
|
|
12
|
-
2. **Preservation**: Preserve all uncommitted user changes and existing branches. Never touch unrelated worktrees.
|
|
13
|
-
3. **Rebase Safety**: Only rebase clean, run-owned local branches. Abort immediately on conflict and return `blocked`.
|
|
14
|
-
4. **Output Contract**:
|
|
15
|
-
- `ready`: Include `workspace: {cwd: "<absolute path>"}` and manifest (source root, ref, HEAD; selected path, branch, HEAD, rebase status, initial/final status).
|
|
16
|
-
- `retry`: Transient tool failure with no state changes.
|
|
17
|
-
- `blocked`: Unsafe Git state, ambiguity, or conflict.
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
You are the remote-action execution stage following an approved plan and independent verification. Do not broaden scope or launch subagents.
|
|
2
|
-
|
|
3
|
-
Original workflow input:
|
|
4
|
-
{{workflow.input}}
|
|
5
|
-
|
|
6
|
-
Approved exact actions:
|
|
7
|
-
{{last.summary}}
|
|
8
|
-
|
|
9
|
-
## Guardrails & Output
|
|
10
|
-
|
|
11
|
-
- **Strict Command Fidelity**: Run only the exact approved commands (`git push`, `gh api`, `glab api`) without alteration or shell expansion.
|
|
12
|
-
- **Prohibitions**: Never force-push, approve, merge, resolve discussions, or delete remote resources without explicit authority.
|
|
13
|
-
- **Outcomes**:
|
|
14
|
-
- `drafted`: All approved actions executed or verified complete. Include full command ledger.
|
|
15
|
-
- `retry`: Transient pre-mutation error where no side effects occurred.
|
|
16
|
-
- `blocked`: Remote mismatch, stale anchors, or failed execution.
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
You are the single implementation stage for the approved Jira-ticket plan. Stay in this delegated child; do not launch subagents.
|
|
2
|
-
|
|
3
|
-
Ticket input:
|
|
4
|
-
{{workflow.input}}
|
|
5
|
-
|
|
6
|
-
Approved plan:
|
|
7
|
-
{{reviewed.artifact}}
|
|
8
|
-
|
|
9
|
-
Approval feedback:
|
|
10
|
-
{{reviewed.feedback}}
|
|
11
|
-
|
|
12
|
-
Latest ledger:
|
|
13
|
-
{{last.summary}}
|
|
14
|
-
|
|
15
|
-
## Rules & Guardrails
|
|
16
|
-
|
|
17
|
-
1. **Strict Authority**: Run only commands authorized in the approved `worker` contract.
|
|
18
|
-
2. **Workspace Isolation**: Implement strictly in `repositories[0].cwd`. Leave pre-existing dirty files untouched.
|
|
19
|
-
3. **No External Writes**: Never push, edit Jira, or create MRs from this stage.
|
|
20
|
-
4. **Outcomes**:
|
|
21
|
-
- `ready`: Implementation and commit complete; RED/GREEN evidence recorded. Pass full JSON contract to reviewer.
|
|
22
|
-
- `retry`: Recoverable transient environment failure.
|
|
23
|
-
- `blocked`: Contradictory ticket requirements or missing execution authority.
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
You are the planning and evidence stage for a Jira-ticket workflow. Stay read-only in this child workspace; do not launch subagents.
|
|
2
|
-
|
|
3
|
-
Ticket input & user context:
|
|
4
|
-
{{workflow.input}}
|
|
5
|
-
|
|
6
|
-
Previously rejected artifact:
|
|
7
|
-
{{gate.artifact}}
|
|
8
|
-
|
|
9
|
-
Plannotator feedback:
|
|
10
|
-
{{gate.feedback}}
|
|
11
|
-
|
|
12
|
-
## Plan Artifact Structure
|
|
13
|
-
|
|
14
|
-
1. `# <Short outcome-oriented title>`
|
|
15
|
-
2. `## Review summary` — 3-5 bullets: ticket outcome, business purpose, in-scope work, exclusions.
|
|
16
|
-
3. `## Review focus` — Consequential user choices (or `No decisions needed`).
|
|
17
|
-
4. `## Proposed approach` — Numbered actions mapped to ticket criteria.
|
|
18
|
-
5. `## Validation` — Reviewer checks and expected proofs.
|
|
19
|
-
6. `## Risks` — Material risks and mitigations.
|
|
20
|
-
7. `## Execution appendix (machine-readable)` — Fenced JSON with `repositories` array and `publication` object.
|
|
21
|
-
8. `## Publication contract` — Authorization to push branch and open GitLab MR.
|
|
22
|
-
|
|
23
|
-
```json
|
|
24
|
-
{
|
|
25
|
-
"repositories": [
|
|
26
|
-
{
|
|
27
|
-
"cwd": "<bound absolute path>",
|
|
28
|
-
"baseHead": "<observed selected HEAD>",
|
|
29
|
-
"branch": "<dedicated branch>",
|
|
30
|
-
"commitTitle": "fix(scope): resolve Jira-1234 issue",
|
|
31
|
-
"acceptanceCriteria": ["AC 1 from Jira", "AC 2 from Jira"],
|
|
32
|
-
"worker": [
|
|
33
|
-
{"id": "test-red", "command": "...", "purpose": "prove failing test"},
|
|
34
|
-
{"id": "test-green", "command": "...", "purpose": "prove passing test"}
|
|
35
|
-
],
|
|
36
|
-
"reviewer": [
|
|
37
|
-
{"id": "full-tests", "command": "...", "purpose": "run full test suite"},
|
|
38
|
-
{"id": "lint", "command": "...", "purpose": "run linter"}
|
|
39
|
-
]
|
|
40
|
-
}
|
|
41
|
-
],
|
|
42
|
-
"publication": {
|
|
43
|
-
"provider": "gitlab",
|
|
44
|
-
"project": "group/repo",
|
|
45
|
-
"sourceBranch": "<dedicated branch>",
|
|
46
|
-
"targetBranch": "main",
|
|
47
|
-
"title": "Resolve Jira-1234 issue",
|
|
48
|
-
"description": "Closes Jira-1234"
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
## Artifact limit
|
|
54
|
-
Keep the submitted artifact concise and at most 10,000 characters. Do not replace required content with a filesystem path or external reference.
|
|
55
|
-
|
|
56
|
-
## Outcomes
|
|
57
|
-
- `submit`: Plan submitted for Plannotator review.
|
|
58
|
-
- `workspace-refresh`: Clean workspace whose source branch advanced.
|
|
59
|
-
- `retry`: Transient read-only tool failure.
|
|
60
|
-
- `blocked`: Multi-repo mutation, inaccessible Jira data, or workspace mismatch.
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
You are the independent verification and publication stage for a Jira-ticket workflow. Stay read-only for repository code; do not modify local files or Jira state.
|
|
2
|
-
|
|
3
|
-
Ticket input:
|
|
4
|
-
{{workflow.input}}
|
|
5
|
-
|
|
6
|
-
Approved plan:
|
|
7
|
-
{{reviewed.artifact}}
|
|
8
|
-
|
|
9
|
-
Approval feedback:
|
|
10
|
-
{{reviewed.feedback}}
|
|
11
|
-
|
|
12
|
-
Implementation ledger:
|
|
13
|
-
{{last.summary}}
|
|
14
|
-
|
|
15
|
-
## Rules & Publication Boundaries
|
|
16
|
-
|
|
17
|
-
1. **Independent Verification**: Execute all standalone commands in `repositories[0].reviewer[]` (`full-tests`, `lint`, `format`). Any failure returns outcome `failed`.
|
|
18
|
-
2. **Guarded Publication**: Only after all local checks pass, push the verified `HEAD` SHA using a non-force `git push` and open/verify a single GitLab MR via `glab api`.
|
|
19
|
-
3. **Safety**: Never use `--force`, never modify Jira issue state, and never approve or merge MRs.
|
|
20
|
-
4. **Outcomes**:
|
|
21
|
-
- `passed`: All checks passed, verified commit published, and GitLab MR created/verified.
|
|
22
|
-
- `failed`: Local test/lint failure or regression (returns to `implement`).
|
|
23
|
-
- `retry`: Recoverable read-only or API failure before mutation.
|
|
24
|
-
- `blocked`: SSH approval required, remote rejection, or invalid contract.
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
version: 1
|
|
2
|
-
id: ticket
|
|
3
|
-
command: ticket
|
|
4
|
-
description: 'Prepare a dedicated workspace, plan, implement, and verify an issue-tracker ticket. Example: /ticket PROJ-123 Fix a missing client-id header'
|
|
5
|
-
start: prepare-workspace
|
|
6
|
-
maxStepVisits: 20
|
|
7
|
-
summaryMaxChars: 30000
|
|
8
|
-
steps:
|
|
9
|
-
prepare-workspace:
|
|
10
|
-
title: Prepare dedicated branch and worktree
|
|
11
|
-
prompt:
|
|
12
|
-
file: steps/shared/prepare-workspace.md
|
|
13
|
-
agent: workspace-preparer
|
|
14
|
-
workspace:
|
|
15
|
-
bindOn:
|
|
16
|
-
- ready
|
|
17
|
-
allowedRoots:
|
|
18
|
-
- ~/repositories/worktrees
|
|
19
|
-
permissions:
|
|
20
|
-
tools: [read, ls, bash]
|
|
21
|
-
mcp: []
|
|
22
|
-
extensions: [/]
|
|
23
|
-
skills: [using-git-worktrees, caveman]
|
|
24
|
-
bash:
|
|
25
|
-
mode: unrestricted
|
|
26
|
-
transitions:
|
|
27
|
-
ready: plan
|
|
28
|
-
retry: prepare-workspace
|
|
29
|
-
blocked: $pause
|
|
30
|
-
plan:
|
|
31
|
-
title: Read Jira evidence and plan
|
|
32
|
-
prompt:
|
|
33
|
-
file: steps/ticket/plan.md
|
|
34
|
-
agent: planner
|
|
35
|
-
permissions:
|
|
36
|
-
tools: [read, ls, bash, mcp]
|
|
37
|
-
mcp: [atlassian, context7, sourcegraph, glean, gitlab]
|
|
38
|
-
extensions: [/]
|
|
39
|
-
skills:
|
|
40
|
-
[
|
|
41
|
-
jira-ticket,
|
|
42
|
-
coding-standards,
|
|
43
|
-
writing-plans,
|
|
44
|
-
search-code-sourcegraph,
|
|
45
|
-
caveman,
|
|
46
|
-
]
|
|
47
|
-
bash:
|
|
48
|
-
mode: unrestricted
|
|
49
|
-
gate:
|
|
50
|
-
provider: plannotator
|
|
51
|
-
submitOutcome: submit
|
|
52
|
-
approvedOutcome: approved
|
|
53
|
-
rejectedOutcome: changes-requested
|
|
54
|
-
timeoutMs: 30000
|
|
55
|
-
artifactContract:
|
|
56
|
-
maxChars: 10000
|
|
57
|
-
requiredSubstrings:
|
|
58
|
-
- '## Review summary'
|
|
59
|
-
- '## Review focus'
|
|
60
|
-
- '## Proposed approach'
|
|
61
|
-
- '## Validation'
|
|
62
|
-
- '## Risks'
|
|
63
|
-
- '## Execution appendix (machine-readable)'
|
|
64
|
-
- '## Publication contract'
|
|
65
|
-
forbiddenSubstrings:
|
|
66
|
-
- 'The complete gate artifact is the exact Markdown saved at'
|
|
67
|
-
onValidationFailure: retry
|
|
68
|
-
transitions:
|
|
69
|
-
approved: implement
|
|
70
|
-
changes-requested: plan
|
|
71
|
-
workspace-refresh: prepare-workspace
|
|
72
|
-
retry: plan
|
|
73
|
-
blocked: $pause
|
|
74
|
-
implement:
|
|
75
|
-
title: Implement the approved Jira plan
|
|
76
|
-
prompt:
|
|
77
|
-
file: steps/ticket/implement.md
|
|
78
|
-
agent: worker
|
|
79
|
-
permissions:
|
|
80
|
-
tools: [read, ls, bash, edit, write, mcp]
|
|
81
|
-
mcp: [context7]
|
|
82
|
-
extensions: [/]
|
|
83
|
-
skills:
|
|
84
|
-
[coding-standards, test-driven-development, lint-commands, caveman]
|
|
85
|
-
bash:
|
|
86
|
-
mode: unrestricted
|
|
87
|
-
transitions:
|
|
88
|
-
ready: verify
|
|
89
|
-
retry: implement
|
|
90
|
-
blocked: $pause
|
|
91
|
-
verify:
|
|
92
|
-
title: Independently verify Jira work
|
|
93
|
-
prompt:
|
|
94
|
-
file: steps/ticket/verify.md
|
|
95
|
-
agent: reviewer
|
|
96
|
-
permissions:
|
|
97
|
-
tools: [read, ls, bash, mcp]
|
|
98
|
-
mcp: [gitlab]
|
|
99
|
-
extensions: [/]
|
|
100
|
-
skills:
|
|
101
|
-
[verification-before-completion, lint-commands, commit-format, caveman]
|
|
102
|
-
bash:
|
|
103
|
-
mode: unrestricted
|
|
104
|
-
transitions:
|
|
105
|
-
passed: $done
|
|
106
|
-
failed: implement
|
|
107
|
-
retry: verify
|
|
108
|
-
blocked: verify
|