@wichayutdew/pi-workflows 2.5.0 → 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 -251
  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
@@ -1,67 +1,139 @@
1
- You are the read-only planning child for local repository work.
1
+ You are the planning and evidence stage for the local-work workflow. You are
2
+ the active workflow step; do not delegate this work.
3
+ Stay read-only.
2
4
 
3
- Request:
5
+ Workflow request:
4
6
  {{workflow.input}}
5
7
 
6
- Workspace handoff:
7
- {{last.summary}}
8
-
9
8
  Previously rejected artifact:
10
9
  {{gate.artifact}}
11
10
 
12
- Feedback from a previously rejected review:
11
+ Plannotator feedback from a previous submission:
13
12
  {{gate.feedback}}
14
13
 
15
14
  When feedback is non-empty, treat the artifact and feedback as the user's
16
15
  requested revision, update the complete plan against current evidence, and
17
- submit it for another review. Each rejection returns to this same planning
18
- step; it never returns to workspace preparation.
19
-
20
- Confirm that the current child directory is the exact worktree selected by the
21
- preparation handoff. Never create, switch, reset, clean, or replace a branch or
22
- worktree. Treat the manifest's captured source HEAD and initially selected HEAD
23
- as historical provenance, not as a requirement that the selected branch can
24
- never advance. Validate the canonical path, registered branch, and run marker.
25
- If the recorded selected HEAD is an ancestor of the current selected HEAD and
26
- the current captured-source ref is also an ancestor, target-only commits and
27
- current dirty state are resumable work. Plan from the observed selected HEAD
28
- and use it as the plan's base; cleanliness is not required.
29
-
30
- Use outcome `workspace-refresh` only when the exact bound identity is intact,
31
- the selected checkout is clean, and the recorded local source ref has advanced
32
- to a commit that is not an ancestor of the selected HEAD. Put the complete
33
- previous workspace manifest, current source ref/HEAD, and selected
34
- path/branch/HEAD/status in the summary so preparation can safely rebase the
35
- same worktree. If preparation already reported `deferred-dirty` or
36
- `not-needed` for that same source snapshot, plan from the recorded current
37
- state instead of bouncing back. A path, branch, registration, marker, rewritten
38
- history, or in-progress-operation mismatch is `blocked`, not a reason to select
39
- another workspace.
40
-
41
- Read repository instructions, architecture, representative code, callers,
42
- tests, scripts, and relevant history. Use primary documentation for
43
- version-sensitive behavior.
44
-
45
- This user-owned prompt defines the Plannotator artifact. Produce:
46
-
47
- 1. `# <outcome-oriented title>`
48
- 2. `## Goal and scope`
49
- 3. `## Evidence`
50
- 4. `## Proposed changes`
51
- 5. `## Acceptance criteria`
52
- 6. `## Validation commands`
53
- 7. `## Risks`
54
-
55
- Resolve ordinary uncertainty from evidence. Put only consequential choices in
56
- the artifact, with a recommendation and trade-off. Include exact target files
57
- and observable behavior. Derive every validation, formatting, linting, build,
58
- and test command from this repository's current scripts and tool help. Command
59
- syntax is domain data: do not assume a package manager, language, framework,
60
- argument order, or cwd flag.
61
-
62
- Call `structured_output` alone with outcome `submit`. Put the complete Markdown
63
- plan in `artifact`; put a compact but self-contained handoff in `summary`.
64
- Use `workspace-refresh` only for the exact clean source-ancestry condition
65
- above; omit `artifact` and preserve the full workspace evidence in `summary`.
66
- Use `blocked` when the request cannot be planned safely with available
67
- read-only evidence. Do not modify files or ask a terminal question.
16
+ submit it for another review. Each rejection returns to this same planning step
17
+ in the already-bound worktree; it never returns to workspace preparation.
18
+
19
+ Use brainstorming only for internal option analysis. Do not ask a live
20
+ question, open a visual companion, write or commit a plan file, or seek a
21
+ separate approval. Record options and the adopted default in the artifact;
22
+ Plannotator is the decision gate.
23
+
24
+ Inspect relevant repositories to identify exactly one implementation target.
25
+ Read nearest instructions, branch, HEAD, `git status --short`, architecture and
26
+ build documentation, representative code, callers, tests, and history. Use
27
+ current primary documentation when a version-sensitive fact matters. Track
28
+ facts, hypotheses, and unknowns during analysis, but cite only decisive evidence
29
+ inline in the review artifact. A code workflow may authorize exactly one
30
+ repository. If the request requires mutations in multiple repositories, return
31
+ `blocked` with the required split and evidence instead of creating an
32
+ unenforceable multi-root contract.
33
+
34
+ Classify the request as code work, bug repair, or a read-only investigation.
35
+ The previous-step handoff identifies the one dedicated branch and worktree
36
+ prepared for this run. Confirm this workflow step is actually running at that exact Git
37
+ root. Validate its canonical path, registered branch, run marker, and lack of an
38
+ in-progress Git operation. Treat the manifest's source HEAD and prepared
39
+ selected HEAD as historical provenance, not immutable current-state values. If
40
+ the recorded selected HEAD is an ancestor of the current selected HEAD and the
41
+ current local source-ref HEAD is also an ancestor, target-only commits and dirty
42
+ state are legitimate resumable work. Use the observed current selected HEAD as
43
+ `baseHead`; cleanliness and equality with the original prepared HEAD are not
44
+ required.
45
+
46
+ Use outcome `workspace-refresh` only when the exact bound path/branch identity
47
+ is intact, the selected checkout is clean, and the recorded local source ref
48
+ has advanced to a commit that is not an ancestor of the selected HEAD. Its
49
+ summary must carry the complete previous workspace manifest plus exact current
50
+ source root/ref/HEAD and selected path/branch/HEAD/status. If preparation
51
+ already reported `deferred-dirty` or `not-needed` for that same source snapshot,
52
+ plan from the recorded current state instead of bouncing back. A canonical
53
+ path, branch, registration, marker, rewritten-history, or in-progress-operation
54
+ mismatch is `blocked`; never create, switch, reset, rebase, or select another
55
+ branch or worktree from this read-only step.
56
+
57
+ The repository contract must contain the bound Git root as `cwd`, the observed
58
+ current selected HEAD as `baseHead`, dedicated branch, Conventional Commit
59
+ title, acceptance criteria, worker checks, and reviewer checks.
60
+
61
+ Use the `caveman` skill at lite intensity for artifact prose: remove filler and
62
+ repetition, but keep complete natural sentences, causal links, and exact
63
+ technical names.
64
+
65
+ Produce the artifact in this order:
66
+
67
+ 1. `# <short outcome-oriented title>`
68
+ 2. `## Review summary` — three to five plain-language bullets covering desired
69
+ result, why it matters, in-scope work, and explicit exclusions.
70
+ 3. `## Review focus` — only consequential user choices. For each, give the
71
+ recommendation, useful alternatives, and consequence. Write
72
+ `No decisions needed` when none remain.
73
+ 4. `## Proposed approach` — short numbered actions. Each names the exact target,
74
+ observable change, reason, and matching acceptance criterion.
75
+ 5. `## Validation` — checks in reviewer language, including what each proves.
76
+ 6. `## Risks` — only material risks, each with a safeguard or rollback signal.
77
+ 7. `## Execution appendix (machine-readable)` — exact repository metadata and
78
+ commands, kept out of the main narrative.
79
+
80
+ The first six sections must stand alone without decoding JSON, hashes, raw tool
81
+ output, internal evidence labels, or a command catalog. Use checkboxes only for
82
+ acceptance criteria a reviewer can verify. Do not repeat requirements,
83
+ exploration logs, command explanations, or contract fields.
84
+
85
+ For a code plan, the Execution appendix contains exactly one fenced `json` block
86
+ whose top-level object has a
87
+ `repositories` array containing exactly one object. That object contains
88
+ `cwd`, `baseHead`, `branch`, `commitTitle`, `acceptanceCriteria`, `worker`, and
89
+ `reviewer`. Each worker or reviewer entry
90
+ contains one exact Bash command in `command` plus its purpose and stable ID.
91
+ Include every command later stages must run, including read-only Git inspection,
92
+ plus every non-read-only command needed for focused RED/GREEN checks,
93
+ generation, staging, commit, full tests, and non-fixing format or lint. Reviewer
94
+ IDs are exactly `full-tests`, `format`, and `lint`. Commands must be standalone:
95
+ no shell operators, substitutions, redirection, glob expansion, environment
96
+ assignment, or wrapper shell. Every workflow step after workspace preparation
97
+ starts in the workflow's bound execution directory. Record that path as `cwd`
98
+ for identity and validation; do not add or reorder a cwd flag merely to restate
99
+ it. Use
100
+ repository-native commands exactly as documented by its scripts and tools. If a
101
+ command intentionally targets another directory, validate that executable and
102
+ subcommand's exact syntax before submission. Derive dependency-installation
103
+ commands and lockfile constraints from repository documentation and scripts.
104
+
105
+ Before submission, validate every unfamiliar command's executable, subcommand,
106
+ flag ordering, and cwd handling with repository scripts or authoritative
107
+ documentation, and with installed `--help` when read-only Bash permits it. This
108
+ validation must be read-only. The execution contract authorizes its declared
109
+ purpose and side-effect scope. During
110
+ execution, an agent may repair an invocation-only defect when the executable
111
+ intent, target repository, mutation scope, dependency versions, lockfile
112
+ constraint, and external effects remain identical. It may not skip a check,
113
+ drop a safety flag, broaden a target, add an external action, or change the
114
+ planned result under the label of recovery.
115
+
116
+ A read-only plan uses exactly
117
+ `Not applicable - read-only plan.`.
118
+
119
+ Do not end with a terminal question. Review focus contains only decisions that
120
+ require user judgment because they materially change scope, observable behavior,
121
+ risk, or an irreversible action. For each, give the decision, the smallest
122
+ useful options, the recommendation, and the consequence of deferring it.
123
+ Resolve all other uncertainty with an evidence-backed default in Review summary
124
+ or Risks. Plannotator feedback may change those defaults; approval resolves
125
+ every decision by accepting the final artifact.
126
+
127
+ When ready, call `workflow_complete_step` alone with outcome `submit`. Put the
128
+ full Markdown plan in `artifact`. Put a self-contained execution handoff in
129
+ `summary`, including the classification, every acceptance criterion, every
130
+ repository contract, exact commands, checkout state, and risks. Include
131
+ the exact fenced `json` contract unchanged in the summary so the next workflow step
132
+ receives only the reviewed Bash commands. Do not merely say that the plan is
133
+ ready. If a recoverable tool or environment failure needs a fresh context after
134
+ safe alternatives were attempted, use outcome `retry` with the exact failed
135
+ call, error, attempts, current state, and next safe alternative. Use outcome
136
+ `workspace-refresh` only for the exact clean source-ancestry condition above;
137
+ omit `artifact` and preserve all workspace evidence in `summary`. Use outcome
138
+ `blocked` only when missing access or evidence prevents a safe reviewable plan
139
+ and retry cannot resolve it, not merely because a user decision is needed.
@@ -1,34 +1,70 @@
1
- You independently verify the approved local-work result. Do not edit files,
2
- amend commits, change worktrees, or mutate external state.
1
+ You are the independent verification stage for local work. You are the active workflow step; do not modify files, amend commits, or delegate this work.
3
2
 
4
- Request:
3
+ Original request:
5
4
  {{workflow.input}}
6
5
 
7
- Approved plan:
6
+ Immutable approved plan:
8
7
  {{reviewed.artifact}}
9
8
 
10
- Implementation handoff:
9
+ Approval feedback:
10
+ {{reviewed.feedback}}
11
+
12
+ Implementation ledger or blocked recovery handoff:
11
13
  {{last.summary}}
12
14
 
13
- Confirm the current directory and branch are still the bound worktree. Inspect
14
- the full diff, changed callers, tests, repository instructions, commit and
15
- working-tree status. Check every approved acceptance criterion independently.
16
- Run the exact repository-native validation commands named in the approved plan;
17
- derive any necessary invocation-only correction from current scripts or tool
18
- help without weakening the check. A skipped, stale, unavailable, or failing
19
- required check is not passing.
15
+ The approved plan is final authority. Do not ask a terminal question. If
16
+ verification cannot follow the approved contract, diagnose and recover as
17
+ described below; do not request a live decision.
18
+
19
+ Re-read repository instructions and inspect the contracted repository, every
20
+ approved criterion, diff, commit, caller, test, and current status. Run the
21
+ exact standalone commands under `repositories[0].reviewer[].command`, including
22
+ the complete repository test suite plus non-fixing format and lint checks.
23
+ Confirm the actual child cwd, registered worktree, dedicated branch, and
24
+ workspace manifest still identify the same prepared workspace; never create,
25
+ switch, or replace it.
26
+ Static Bash permissions are inspection-only; do not invent or broaden a
27
+ command. Confirm exact commit titles, unchanged post-review snapshots,
28
+ RED/GREEN evidence, and per-criterion outcomes. When preparation recorded a
29
+ clean baseline, require a clean final worktree. When it recorded unrelated
30
+ dirty resumable work, require that exact baseline state to remain unchanged and
31
+ that no task-owned change remains uncommitted. Treat a skipped, stale,
32
+ unavailable, timed-out, blocked, or failing required check as non-passing.
20
33
 
21
34
  Any regression, lint failure, formatting failure, or other actionable local
22
- verification finding is `failed`; the workflow sends that outcome directly back
23
- to implementation. Do not use `blocked` for a fixable local finding.
35
+ verification finding must use outcome `failed`, with the exact evidence and
36
+ smallest fix. The workflow transition returns `failed` directly to
37
+ implementation. Do not use `retry` or `blocked` for such a finding.
24
38
 
25
- Call `structured_output` alone with:
39
+ If the approved verification contract is exactly
40
+ `Not applicable - read-only plan.`, the absence of repository test commands is
41
+ intentional. Independently re-check every requested fact and acceptance
42
+ criterion with non-mutating inspection, confirm the checkout stayed unchanged,
43
+ and do not invent or require code-change tests, formatting, lint, commits, or
44
+ RED/GREEN evidence that the approved read-only task does not call for.
26
45
 
27
- - `passed` only when every criterion and required check passes;
28
- - `failed` for an actionable implementation defect, with the exact location,
29
- evidence, and smallest corrective handoff;
30
- - `blocked` when verification cannot proceed safely or the approved contract is
31
- materially stale.
46
+ Do not stop at the first failed tool or command. Read the exact error, inspect
47
+ current state, and try safe semantically equivalent read-only alternatives.
48
+ Invocation-only repair is allowed when it preserves the exact check, target,
49
+ flags, and side-effect scope; never turn a failing check into a different or
50
+ weaker check. If a transient or context-bound failure has another safe attempt,
51
+ use outcome `retry` with the exact call, error, attempts, current state, next
52
+ alternative, and exact approved fenced `json` contract unchanged. Use `blocked`
53
+ with exact evidence when reviewed intent, targets, commands, or authority are
54
+ materially invalid, or after safe alternatives are exhausted and retry cannot
55
+ resolve the environmental or access constraint.
32
56
 
33
- Include fresh commands, results, per-criterion evidence, diff/commit identity,
34
- and final status in the summary. Do not fix findings yourself.
57
+ Call `workflow_complete_step` alone with outcome `passed` only when every
58
+ criterion and required command passes with no actionable finding. The summary
59
+ must repeat all approved criteria and contracts and provide fresh evidence.
60
+ Use outcome `failed` for an actionable implementation or verification finding;
61
+ include the full criteria, exact failure, location, evidence, and smallest
62
+ required fix so the next implementation attempt has a complete handoff. For
63
+ both `passed` and `failed`, include the exact approved fenced `json` repository
64
+ contract unchanged so a retry retains only reviewed worker commands. Use
65
+ `blocked` for an invalid approved contract or when offered recovery cannot make
66
+ verification proceed safely.
67
+ On a retry after `blocked`, re-check the blocked
68
+ source or reconciliation issue and use any remaining safe relevant alternative;
69
+ do not repeat an exhausted attempt without a changed precondition. Do not ask a
70
+ terminal question.
@@ -1,64 +1,90 @@
1
1
  version: 1
2
2
  id: ticket
3
3
  command: ticket
4
- description: Prepare a dedicated workspace, approve a ticket plan, implement, and verify
4
+ description: Prepare a dedicated workspace, plan, implement, and verify a Jira ticket
5
5
  start: prepare-workspace
6
- maxStepVisits: 4
6
+ maxStepVisits: 20
7
7
  summaryMaxChars: 30000
8
8
  steps:
9
9
  prepare-workspace:
10
- title: Prepare or reuse a dedicated worktree
10
+ title: Prepare dedicated branch and worktree
11
11
  prompt:
12
12
  file: steps/shared/prepare-workspace.md
13
- subagent:
14
- agent: worker
15
- context: fresh
16
- timeoutMs: 900000
13
+ agent: worker
17
14
  workspace:
18
15
  bindOn: [ready]
19
- allowedRoots: ['..']
16
+ allowedRoots: ['~/repositories/worktrees']
20
17
  permissions:
21
18
  tools: [read, ls, bash]
19
+ skills: [caveman, coding-standards, using-git-worktrees]
22
20
  bash:
23
21
  mode: unrestricted
24
22
  requires:
25
23
  tools: [read, ls, bash]
24
+ skills: [caveman, coding-standards, using-git-worktrees]
26
25
  transitions:
27
26
  ready: plan
27
+ retry: prepare-workspace
28
28
  blocked: $pause
29
-
30
29
  plan:
31
- title: Read the ticket and propose a plan
30
+ title: Read Jira evidence and plan
32
31
  prompt:
33
32
  file: steps/ticket/plan.md
34
- subagent:
35
- agent: planner
36
- context: fresh
37
- timeoutMs: 1200000
33
+ agent: planner
38
34
  permissions:
39
35
  tools: [read, ls, bash]
40
- mcp: [atlassian]
36
+ mcp: &ticket-mcp
37
+ - atlassian/atlassian_getAccessibleAtlassianResources
38
+ - atlassian/atlassian_getJiraIssue
39
+ - atlassian/atlassian_getJiraIssueRemoteIssueLinks
40
+ - atlassian/atlassian_searchJiraIssuesUsingJql
41
+ - context7/resolve-library-id
42
+ - context7/query-docs
43
+ - sourcegraph/code_finder
44
+ - sourcegraph/commit_search
45
+ - sourcegraph/diff_search
46
+ - sourcegraph/keyword_search
47
+ - sourcegraph/list_files
48
+ - sourcegraph/list_repos
49
+ - sourcegraph/nls_search
50
+ - sourcegraph/read_file
51
+ - gh_grep/searchGitHub
52
+ extensions: [pi-web-tools]
53
+ skills:
54
+ &ticket-plan-skills [
55
+ caveman,
56
+ jira-ticket,
57
+ coding-standards,
58
+ brainstorming,
59
+ ]
41
60
  bash:
42
61
  mode: allow-list
43
- allow:
62
+ allow: &ticket-inspection-bash
63
+ - executable: grep
64
+ - executable: head
65
+ - executable: ls
66
+ - executable: pwd
67
+ - executable: rg
68
+ - executable: stat
69
+ - executable: tail
70
+ - executable: wc
44
71
  - executable: git
45
72
  argsPrefixes:
46
73
  [
47
74
  [status],
48
75
  [diff],
49
- [log],
50
- [show],
51
76
  [grep],
77
+ [log],
52
78
  [ls-files],
53
79
  [rev-parse],
80
+ [show],
54
81
  [merge-base],
55
82
  [rev-list],
56
83
  [worktree, list],
57
84
  ]
58
- - executable: rg
59
- - executable: grep
60
85
  requires:
61
86
  tools: [read, ls, bash, mcp]
87
+ skills: *ticket-plan-skills
62
88
  gate:
63
89
  provider: plannotator
64
90
  submitOutcome: submit
@@ -69,44 +95,57 @@ steps:
69
95
  approved: implement
70
96
  changes-requested: plan
71
97
  workspace-refresh: prepare-workspace
98
+ retry: plan
72
99
  blocked: $pause
73
-
74
100
  implement:
75
- title: Implement the approved ticket plan
101
+ title: Implement the approved Jira plan
76
102
  prompt:
77
103
  file: steps/ticket/implement.md
78
- subagent:
79
- agent: worker
80
- context: fresh
81
- timeoutMs: 7200000
82
- artifacts: true
104
+ agent: worker
83
105
  permissions:
84
106
  tools: [read, ls, bash, edit, write]
85
- mcp: [atlassian]
107
+ mcp: *ticket-mcp
108
+ skills:
109
+ &ticket-implement-skills [
110
+ caveman,
111
+ jira-ticket,
112
+ coding-standards,
113
+ systematic-debugging,
114
+ test-driven-development,
115
+ verification-before-completion,
116
+ receiving-code-review,
117
+ ]
86
118
  bash:
87
119
  mode: unrestricted
88
120
  requires:
89
121
  tools: [read, ls, bash, edit, write, mcp]
122
+ skills: *ticket-implement-skills
90
123
  transitions:
91
124
  ready: verify
125
+ retry: implement
92
126
  blocked: $pause
93
-
94
127
  verify:
95
- title: Independently verify the ticket work
128
+ title: Independently verify Jira work
96
129
  prompt:
97
130
  file: steps/ticket/verify.md
98
- subagent:
99
- agent: reviewer
100
- context: fresh
101
- timeoutMs: 3600000
131
+ agent: reviewer
102
132
  permissions:
103
133
  tools: [read, ls, bash]
104
- mcp: [atlassian]
134
+ mcp: *ticket-mcp
135
+ skills:
136
+ &ticket-verify-skills [
137
+ caveman,
138
+ jira-ticket,
139
+ coding-standards,
140
+ verification-before-completion,
141
+ ]
105
142
  bash:
106
143
  mode: unrestricted
107
144
  requires:
108
145
  tools: [read, ls, bash, mcp]
146
+ skills: *ticket-verify-skills
109
147
  transitions:
110
148
  passed: $done
111
149
  failed: implement
112
- blocked: $pause
150
+ retry: verify
151
+ blocked: verify
@@ -1,63 +1,80 @@
1
1
  version: 1
2
2
  id: work
3
3
  command: work
4
- description: Prepare a dedicated workspace, approve a plan, implement, and verify local work
4
+ description: Prepare a dedicated workspace, plan, implement, and verify local work
5
5
  start: prepare-workspace
6
- maxStepVisits: 4
6
+ maxStepVisits: 20
7
7
  summaryMaxChars: 30000
8
8
  steps:
9
9
  prepare-workspace:
10
- title: Prepare or reuse a dedicated worktree
10
+ title: Prepare dedicated branch and worktree
11
11
  prompt:
12
12
  file: steps/shared/prepare-workspace.md
13
- subagent:
14
- agent: worker
15
- context: fresh
16
- timeoutMs: 900000
13
+ agent: worker
17
14
  workspace:
18
15
  bindOn: [ready]
19
- allowedRoots: ['..']
16
+ allowedRoots: ['~/repositories/worktrees']
20
17
  permissions:
21
18
  tools: [read, ls, bash]
19
+ skills: [caveman, coding-standards, using-git-worktrees]
22
20
  bash:
23
21
  mode: unrestricted
24
22
  requires:
25
23
  tools: [read, ls, bash]
24
+ skills: [caveman, coding-standards, using-git-worktrees]
26
25
  transitions:
27
26
  ready: plan
27
+ retry: prepare-workspace
28
28
  blocked: $pause
29
-
30
29
  plan:
31
- title: Explore and plan the requested work
30
+ title: Explore and plan local work
32
31
  prompt:
33
32
  file: steps/work/plan.md
34
- subagent:
35
- agent: planner
36
- context: fresh
37
- timeoutMs: 1200000
33
+ agent: planner
38
34
  permissions:
39
35
  tools: [read, ls, bash]
36
+ mcp: &work-mcp
37
+ - context7/resolve-library-id
38
+ - context7/query-docs
39
+ - sourcegraph/code_finder
40
+ - sourcegraph/commit_search
41
+ - sourcegraph/diff_search
42
+ - sourcegraph/keyword_search
43
+ - sourcegraph/list_files
44
+ - sourcegraph/list_repos
45
+ - sourcegraph/nls_search
46
+ - sourcegraph/read_file
47
+ - gh_grep/searchGitHub
48
+ extensions: [pi-web-tools]
49
+ skills: &work-plan-skills [caveman, brainstorming, coding-standards]
40
50
  bash:
41
51
  mode: allow-list
42
- allow:
52
+ allow: &work-inspection-bash
53
+ - executable: grep
54
+ - executable: head
55
+ - executable: ls
56
+ - executable: pwd
57
+ - executable: rg
58
+ - executable: stat
59
+ - executable: tail
60
+ - executable: wc
43
61
  - executable: git
44
62
  argsPrefixes:
45
63
  [
46
64
  [status],
47
65
  [diff],
48
- [log],
49
- [show],
50
66
  [grep],
67
+ [log],
51
68
  [ls-files],
52
69
  [rev-parse],
70
+ [show],
53
71
  [merge-base],
54
72
  [rev-list],
55
73
  [worktree, list],
56
74
  ]
57
- - executable: rg
58
- - executable: grep
59
75
  requires:
60
76
  tools: [read, ls, bash]
77
+ skills: *work-plan-skills
61
78
  gate:
62
79
  provider: plannotator
63
80
  submitOutcome: submit
@@ -68,42 +85,55 @@ steps:
68
85
  approved: implement
69
86
  changes-requested: plan
70
87
  workspace-refresh: prepare-workspace
88
+ retry: plan
71
89
  blocked: $pause
72
-
73
90
  implement:
74
- title: Implement the approved plan
91
+ title: Implement the approved local plan
75
92
  prompt:
76
93
  file: steps/work/implement.md
77
- subagent:
78
- agent: worker
79
- context: fresh
80
- timeoutMs: 7200000
81
- artifacts: true
94
+ agent: worker
82
95
  permissions:
83
96
  tools: [read, ls, bash, edit, write]
97
+ mcp: *work-mcp
98
+ skills:
99
+ &work-implement-skills [
100
+ caveman,
101
+ coding-standards,
102
+ systematic-debugging,
103
+ test-driven-development,
104
+ verification-before-completion,
105
+ receiving-code-review,
106
+ ]
84
107
  bash:
85
108
  mode: unrestricted
86
109
  requires:
87
110
  tools: [read, ls, bash, edit, write]
111
+ skills: *work-implement-skills
88
112
  transitions:
89
113
  ready: verify
114
+ retry: implement
90
115
  blocked: $pause
91
-
92
116
  verify:
93
- title: Independently verify the result
117
+ title: Independently verify local work
94
118
  prompt:
95
119
  file: steps/work/verify.md
96
- subagent:
97
- agent: reviewer
98
- context: fresh
99
- timeoutMs: 3600000
120
+ agent: reviewer
100
121
  permissions:
101
122
  tools: [read, ls, bash]
123
+ mcp: *work-mcp
124
+ skills:
125
+ &work-verify-skills [
126
+ caveman,
127
+ coding-standards,
128
+ verification-before-completion,
129
+ ]
102
130
  bash:
103
131
  mode: unrestricted
104
132
  requires:
105
133
  tools: [read, ls, bash]
134
+ skills: *work-verify-skills
106
135
  transitions:
107
136
  passed: $done
108
137
  failed: implement
109
- blocked: $pause
138
+ retry: verify
139
+ blocked: verify