@pi-unipi/workflow 0.1.6 → 0.1.8
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/commands.ts +24 -5
- package/package.json +2 -2
- package/skills/auto/SKILL.md +166 -0
- package/skills/plan/SKILL.md +39 -9
- package/skills/review-work/SKILL.md +28 -4
- package/skills/work/SKILL.md +62 -26
- package/skills/worktree-merge/SKILL.md +2 -0
package/commands.ts
CHANGED
|
@@ -192,6 +192,13 @@ const COMMANDS: WorkflowCommand[] = [
|
|
|
192
192
|
skillName: "scan-issues",
|
|
193
193
|
argumentHint: "<scope>",
|
|
194
194
|
},
|
|
195
|
+
{
|
|
196
|
+
name: WORKFLOW_COMMANDS.AUTO,
|
|
197
|
+
description:
|
|
198
|
+
"Full pipeline — brainstorm → plan → work → review → merge",
|
|
199
|
+
skillName: "auto",
|
|
200
|
+
argumentHint: "<description> plan:<file> specs:<file>",
|
|
201
|
+
},
|
|
195
202
|
];
|
|
196
203
|
|
|
197
204
|
/**
|
|
@@ -207,29 +214,41 @@ export function registerWorkflowCommands(
|
|
|
207
214
|
pi.registerCommand(fullCommand, {
|
|
208
215
|
description: cmd.description,
|
|
209
216
|
getArgumentCompletions: (prefix: string) => {
|
|
217
|
+
let items: { value: string; label: string; description: string }[] | null = null;
|
|
218
|
+
|
|
210
219
|
// Plan command: suggest spec files
|
|
211
220
|
if (cmd.name === WORKFLOW_COMMANDS.PLAN) {
|
|
212
|
-
|
|
221
|
+
items = suggestSpecFiles(prefix);
|
|
213
222
|
}
|
|
214
223
|
|
|
215
224
|
// Work command: suggest plan files
|
|
216
225
|
if (cmd.name === WORKFLOW_COMMANDS.WORK) {
|
|
217
|
-
|
|
226
|
+
items = suggestPlanFiles(prefix);
|
|
218
227
|
}
|
|
219
228
|
|
|
220
229
|
// Review-work command: suggest plan files
|
|
221
230
|
if (cmd.name === WORKFLOW_COMMANDS.REVIEW_WORK) {
|
|
222
|
-
|
|
231
|
+
items = suggestPlanFiles(prefix);
|
|
223
232
|
}
|
|
224
233
|
|
|
225
234
|
// Worktree merge: suggest existing worktrees
|
|
226
235
|
if (cmd.name === WORKFLOW_COMMANDS.WORKTREE_MERGE) {
|
|
227
|
-
|
|
236
|
+
items = suggestWorktrees();
|
|
228
237
|
}
|
|
229
238
|
|
|
230
239
|
// Worktree create: suggest existing worktrees as reference
|
|
231
240
|
if (cmd.name === WORKFLOW_COMMANDS.WORKTREE_CREATE) {
|
|
232
|
-
|
|
241
|
+
items = suggestWorktrees();
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// Auto command: suggest plan files
|
|
245
|
+
if (cmd.name === WORKFLOW_COMMANDS.AUTO) {
|
|
246
|
+
items = suggestPlanFiles(prefix);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// Defensive: filter out any items with non-string value
|
|
250
|
+
if (items) {
|
|
251
|
+
return items.filter((item) => typeof item.value === "string");
|
|
233
252
|
}
|
|
234
253
|
|
|
235
254
|
// Other commands: no dynamic completions (free-text args)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-unipi/workflow",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "Structured development workflow commands for Pi coding agent",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@pi-unipi/core": "^0.1.
|
|
36
|
+
"@pi-unipi/core": "^0.1.6"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"@mariozechner/pi-ai": "*",
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: auto
|
|
3
|
+
description: "Full pipeline — brainstorm → plan → work → review → merge. One command, end to end."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Auto Pipeline
|
|
7
|
+
|
|
8
|
+
Run the complete development pipeline from idea to merged code.
|
|
9
|
+
|
|
10
|
+
## Command Format
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
/unipi:auto <description>(optional) plan:<path>(optional) specs:<path>(optional)
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
- `description` — what to build (triggers brainstorm first)
|
|
17
|
+
- `plan:<path>` — existing plan to execute (skips brainstorm + plan, starts at work)
|
|
18
|
+
- `specs:<path>` — existing spec to plan from (skips brainstorm, starts at plan)
|
|
19
|
+
- No args → ask user what to do
|
|
20
|
+
|
|
21
|
+
## Pipeline Stages
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
brainstorm → plan → work → review → merge
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Each stage hands off to the next automatically. User can intervene at any gate.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Phase 1: Determine Entry Point
|
|
32
|
+
|
|
33
|
+
Based on args:
|
|
34
|
+
|
|
35
|
+
**If `description` provided (no plan/specs):**
|
|
36
|
+
→ Start at brainstorm. Full pipeline.
|
|
37
|
+
|
|
38
|
+
**If `specs:<path>` provided (no plan):**
|
|
39
|
+
→ Start at plan. Skip brainstorm.
|
|
40
|
+
|
|
41
|
+
**If `plan:<path>` provided:**
|
|
42
|
+
→ Start at work. Skip brainstorm + plan.
|
|
43
|
+
|
|
44
|
+
**If no args:**
|
|
45
|
+
→ Ask user:
|
|
46
|
+
1. "What do you want to build?" → brainstorm
|
|
47
|
+
2. "I have a spec, plan from it" → provide spec path
|
|
48
|
+
3. "I have a plan, execute it" → provide plan path
|
|
49
|
+
4. "I have a plan, just review + merge" → provide plan path
|
|
50
|
+
|
|
51
|
+
**Exit:** Entry point determined. Pipeline scope clear.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Phase 2: Brainstorm (if needed)
|
|
56
|
+
|
|
57
|
+
1. Load brainstorm skill content
|
|
58
|
+
2. Run full brainstorm flow — explore, question, design, write spec
|
|
59
|
+
3. Wait for user approval at design gate
|
|
60
|
+
4. On approval → proceed to plan
|
|
61
|
+
|
|
62
|
+
**Gate:** User must approve design before continuing.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Phase 3: Plan (if needed)
|
|
67
|
+
|
|
68
|
+
1. Load plan skill content
|
|
69
|
+
2. Create implementation plan from spec
|
|
70
|
+
3. Present plan to user
|
|
71
|
+
4. On approval → proceed to work
|
|
72
|
+
|
|
73
|
+
**Gate:** User must approve plan before continuing.
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Phase 4: Work (if needed)
|
|
78
|
+
|
|
79
|
+
1. Read `workbranch` from plan frontmatter
|
|
80
|
+
2. If `workbranch` non-empty → create worktree, work within it
|
|
81
|
+
3. If `workbranch` empty → work directly on main branch
|
|
82
|
+
4. Load work skill content
|
|
83
|
+
5. Execute all tasks in the plan
|
|
84
|
+
6. Commit incrementally
|
|
85
|
+
7. On completion → proceed to review
|
|
86
|
+
|
|
87
|
+
**Gate:** All tasks must complete. If blocked → stop and ask.
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Phase 5: Review
|
|
92
|
+
|
|
93
|
+
1. Load review-work skill content
|
|
94
|
+
2. Read `workbranch` from plan — switch to branch if set, else review on main
|
|
95
|
+
3. Check task completion against acceptance criteria
|
|
96
|
+
4. Run codebase checks (lint, type check, test, build)
|
|
97
|
+
5. Write reviewer remarks to plan
|
|
98
|
+
|
|
99
|
+
**If review passes:** → proceed to merge (or skip if on main)
|
|
100
|
+
**If review fails:** → go back to work (Phase 4) with failure context
|
|
101
|
+
|
|
102
|
+
**Gate:** All checks must pass. Reviewer remarks must say Done.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Phase 6: Merge (if worktree)
|
|
107
|
+
|
|
108
|
+
If `workbranch` was set (worktree):
|
|
109
|
+
1. Load worktree-merge skill content
|
|
110
|
+
2. Merge worktree branch back to main
|
|
111
|
+
3. Clean up worktree and branch
|
|
112
|
+
4. Run final verification on main
|
|
113
|
+
|
|
114
|
+
If `workbranch` was empty (main branch):
|
|
115
|
+
→ Skip merge — changes already on main.
|
|
116
|
+
|
|
117
|
+
**Exit:** Code on main. Worktree cleaned (if applicable).
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Phase 7: Summary
|
|
122
|
+
|
|
123
|
+
Report pipeline results:
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
Pipeline Complete: {topic}
|
|
127
|
+
|
|
128
|
+
✓ Brainstorm — {spec-path}
|
|
129
|
+
✓ Plan — {plan-path}
|
|
130
|
+
✓ Work — {N} tasks completed on {branch or "main"}
|
|
131
|
+
✓ Review — all checks passed
|
|
132
|
+
✓ Merge — {merged to main, worktree cleaned or "already on main"}
|
|
133
|
+
|
|
134
|
+
Artifacts:
|
|
135
|
+
- Spec: .unipi/docs/specs/{spec}
|
|
136
|
+
- Plan: .unipi/docs/plans/{plan}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Suggest next steps:
|
|
140
|
+
- `/unipi:consolidate` — save learnings
|
|
141
|
+
- `/unipi:scan-issues` — deeper code review
|
|
142
|
+
- `/unipi:document` — generate docs
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Interruption Handling
|
|
147
|
+
|
|
148
|
+
If any phase fails or user interrupts:
|
|
149
|
+
|
|
150
|
+
1. Record current phase and progress
|
|
151
|
+
2. Suggest resuming from the failed phase
|
|
152
|
+
3. Don't lose context — spec/plan/progress preserved
|
|
153
|
+
|
|
154
|
+
Example:
|
|
155
|
+
> "Pipeline paused at review phase. 3/5 tasks complete, tests failing.
|
|
156
|
+
> Resume with: `/unipi:auto plan:<plan-path>`"
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Notes
|
|
161
|
+
|
|
162
|
+
- Each phase loads its skill content dynamically
|
|
163
|
+
- Gates between phases ensure user oversight
|
|
164
|
+
- Pipeline is resumable — can restart from any phase
|
|
165
|
+
- Worktree isolation protects main branch (skipped for small tasks — work directly on main)
|
|
166
|
+
- Auto command has `full` sandbox — all tools available
|
package/skills/plan/SKILL.md
CHANGED
|
@@ -56,8 +56,20 @@ Committed to current branch.
|
|
|
56
56
|
2. If concerns: raise with user before proceeding
|
|
57
57
|
3. If `string(greedy)` provided: use it to scope planning (e.g., "focus on auth only")
|
|
58
58
|
4. Ask clarifying questions if needed (one at a time)
|
|
59
|
+
5. **Ask about work branch:**
|
|
59
60
|
|
|
60
|
-
|
|
61
|
+
> "Where should this work happen?"
|
|
62
|
+
>
|
|
63
|
+
> 1. **Main branch** — work directly on main (small/medium tasks, low risk)
|
|
64
|
+
> 2. **New branch** — isolated worktree (larger tasks, risky changes)
|
|
65
|
+
>
|
|
66
|
+
> If "New branch": "What branch name? (e.g., `feat/auth`, or press enter for auto-naming based on spec topic)"
|
|
67
|
+
|
|
68
|
+
Record the decision:
|
|
69
|
+
- Main branch → `workbranch:` will be empty in plan frontmatter
|
|
70
|
+
- New branch → `workbranch: {branch-name}` in plan frontmatter (auto-generate `feat/{topic}` if not provided)
|
|
71
|
+
|
|
72
|
+
**Exit:** No blockers. Branch strategy decided. Ready to plan.
|
|
61
73
|
|
|
62
74
|
---
|
|
63
75
|
|
|
@@ -70,7 +82,7 @@ Structure the plan with heart of gold style:
|
|
|
70
82
|
title: "{Topic} — Implementation Plan"
|
|
71
83
|
type: plan
|
|
72
84
|
date: YYYY-MM-DD
|
|
73
|
-
workbranch: {branch-name
|
|
85
|
+
workbranch: {branch-name} # empty string = work on main branch
|
|
74
86
|
specs:
|
|
75
87
|
- path/to/spec.md
|
|
76
88
|
---
|
|
@@ -111,6 +123,20 @@ specs:
|
|
|
111
123
|
- **Steps** are bite-sized — agent can follow without guessing
|
|
112
124
|
- Order tasks by dependency (foundational work first)
|
|
113
125
|
|
|
126
|
+
### Task Status Lifecycle
|
|
127
|
+
|
|
128
|
+
Tasks use prefixes to track progress:
|
|
129
|
+
|
|
130
|
+
| Status | Meaning |
|
|
131
|
+
|--------|----------|
|
|
132
|
+
| `unstarted:` | Not started |
|
|
133
|
+
| `in-progress:` | Being worked on |
|
|
134
|
+
| `completed:` | Done and verified |
|
|
135
|
+
| `failed:` | Attempted but failed, needs investigation |
|
|
136
|
+
| `awaiting_user:` | Needs user action (test, approve, provide input) |
|
|
137
|
+
| `blocked:` | Waiting on dependency or external factor |
|
|
138
|
+
| `skipped:` | Intentionally not doing (deferred, out of scope) |
|
|
139
|
+
|
|
114
140
|
---
|
|
115
141
|
|
|
116
142
|
## Phase 4: Update Brainstorm Checkboxes
|
|
@@ -156,15 +182,19 @@ Do NOT re-read or re-edit the spec checkboxes — Phase 4 already wrote them.
|
|
|
156
182
|
Present plan summary to user. Then ask:
|
|
157
183
|
|
|
158
184
|
1. **Proceed to /unipi:work** — Start implementing in a worktree
|
|
159
|
-
2. **
|
|
160
|
-
3. **
|
|
185
|
+
2. **Proceed to /unipi:auto** — Run full pipeline (work → review → merge)
|
|
186
|
+
3. **Revise plan** — Adjust tasks or scope
|
|
187
|
+
4. **Done for now** — Return later
|
|
161
188
|
|
|
162
|
-
If user selects "Proceed to /unipi:work"
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
189
|
+
If user selects "Proceed to /unipi:work":
|
|
190
|
+
- **Worktree branch** → suggest: `/unipi:work worktree:<branch-name> specs:YYYY-MM-DD-<topic>-plan`
|
|
191
|
+
- **Main branch** → suggest: `/unipi:work specs:YYYY-MM-DD-<topic>-plan` (no worktree arg)
|
|
192
|
+
|
|
193
|
+
If user selects "Proceed to /unipi:auto":
|
|
194
|
+
- **Worktree branch** → suggest: `/unipi:auto plan:YYYY-MM-DD-<topic>-plan.md`
|
|
195
|
+
- **Main branch** → suggest: `/unipi:auto plan:YYYY-MM-DD-<topic>-plan.md` (same — auto reads workbranch from plan)
|
|
166
196
|
|
|
167
|
-
Recommend starting a **new session** for work
|
|
197
|
+
Recommend starting a **new session** for work if using a worktree.
|
|
168
198
|
|
|
169
199
|
---
|
|
170
200
|
|
|
@@ -9,7 +9,7 @@ Review what was built, verify task completion, run codebase checks, add reviewer
|
|
|
9
9
|
|
|
10
10
|
## Boundaries
|
|
11
11
|
|
|
12
|
-
**This skill MAY:** read codebase, run checks (lint, build, test, docker), write reviewer remarks to plan docs.
|
|
12
|
+
**This skill MAY:** read codebase, run checks (lint, build, test, docker), write reviewer remarks to plan docs, run bash for git operations (checkout worktree branch).
|
|
13
13
|
**This skill MAY NOT:** edit code, implement features, create new files.
|
|
14
14
|
|
|
15
15
|
## Command Format
|
|
@@ -46,9 +46,13 @@ For each task in plan:
|
|
|
46
46
|
1. Read acceptance criteria
|
|
47
47
|
2. Verify against actual implementation
|
|
48
48
|
3. Determine status:
|
|
49
|
-
- **Done** — all criteria met
|
|
49
|
+
- **Done** — all criteria met → `completed:`
|
|
50
50
|
- **Partially Done X/Y** — some steps complete, others not
|
|
51
|
-
- **Unstarted** — nothing done
|
|
51
|
+
- **Unstarted** — nothing done → `unstarted:`
|
|
52
|
+
- **Failed** — attempted but broken → `failed:`
|
|
53
|
+
- **Awaiting User** — needs user action → `awaiting_user:`
|
|
54
|
+
- **Blocked** — waiting on dependency → `blocked:`
|
|
55
|
+
- **Skipped** — intentionally not done → `skipped:`
|
|
52
56
|
|
|
53
57
|
If `string(greedy)` scope provided, only check matching tasks.
|
|
54
58
|
|
|
@@ -108,17 +112,37 @@ Followed by description explaining the status.
|
|
|
108
112
|
Based on review results:
|
|
109
113
|
|
|
110
114
|
**If all tasks done and checks pass:**
|
|
111
|
-
|
|
115
|
+
|
|
116
|
+
*If `workbranch` is set (worktree):*
|
|
117
|
+
> "All tasks complete and verified. Ready to merge back to main."
|
|
118
|
+
```
|
|
119
|
+
/unipi:worktree-merge
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
*If `workbranch` is empty (main branch):*
|
|
123
|
+
> "All tasks complete and verified. Changes already on main — no merge needed."
|
|
124
|
+
```
|
|
125
|
+
/unipi:consolidate
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Either way, user can consolidate learnings:
|
|
112
129
|
```
|
|
113
130
|
/unipi:consolidate
|
|
114
131
|
```
|
|
115
132
|
|
|
116
133
|
**If tasks incomplete or checks fail:**
|
|
117
134
|
> "Tasks remaining and/or checks failing. Continue work?"
|
|
135
|
+
|
|
136
|
+
*If `workbranch` is set:*
|
|
118
137
|
```
|
|
119
138
|
/unipi:work worktree:<branch> specs:<plan-path>
|
|
120
139
|
```
|
|
121
140
|
|
|
141
|
+
*If `workbranch` is empty (main):*
|
|
142
|
+
```
|
|
143
|
+
/unipi:work specs:<plan-path>
|
|
144
|
+
```
|
|
145
|
+
|
|
122
146
|
**If scoped review complete:**
|
|
123
147
|
> "Scoped review complete. Run full review or continue work?"
|
|
124
148
|
```
|
package/skills/work/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: work
|
|
3
|
-
description: "Execute plan — implement
|
|
3
|
+
description: "Execute plan — implement tasks, test, commit on done. Works in worktree or on main branch. Resumable."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Executing Plans
|
|
@@ -9,8 +9,12 @@ Load plan, review critically, execute tasks, commit when complete.
|
|
|
9
9
|
|
|
10
10
|
## Boundaries
|
|
11
11
|
|
|
12
|
-
**This skill MAY:** read/write code
|
|
13
|
-
**This skill MAY NOT:**
|
|
12
|
+
**This skill MAY:** read/write code, read/write `.unipi/docs/`, run tests, commit, create worktree.
|
|
13
|
+
**This skill MAY NOT:** merge branches, deploy.
|
|
14
|
+
|
|
15
|
+
**Worktree vs Main:**
|
|
16
|
+
- If `workbranch` in plan → work within worktree directory
|
|
17
|
+
- If `workbranch` empty → work directly on main branch (current directory)
|
|
14
18
|
|
|
15
19
|
## Command Format
|
|
16
20
|
|
|
@@ -25,32 +29,36 @@ Load plan, review critically, execute tasks, commit when complete.
|
|
|
25
29
|
|
|
26
30
|
## Sandbox
|
|
27
31
|
|
|
28
|
-
- **Read/Write:** full access within worktree
|
|
32
|
+
- **Read/Write:** full access within worktree (or project root if on main)
|
|
29
33
|
- **Write:** `.unipi/docs/` for progress tracking
|
|
30
|
-
- **Cannot:** modify files outside worktree
|
|
31
34
|
|
|
32
35
|
---
|
|
33
36
|
|
|
34
37
|
## Phase 1: Resolve Args
|
|
35
38
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
- "Do you want to work on current branch or create a worktree?"
|
|
40
|
-
- If worktree: "What branch name?" (suggest based on spec topic)
|
|
41
|
-
- Create worktree if not exists
|
|
42
|
-
- **After creating/confirming worktree:** write `workbranch: {branch-name}` to the plan file frontmatter
|
|
43
|
-
|
|
44
|
-
2. **Specs:**
|
|
45
|
-
- List available plans in `.unipi/docs/plans/`
|
|
46
|
-
- "Which plan(s) to execute?"
|
|
39
|
+
1. **Specs:**
|
|
40
|
+
- If `specs:` arg provided, read those plan files
|
|
41
|
+
- If not, list available plans in `.unipi/docs/plans/` and ask user
|
|
47
42
|
- Can select multiple
|
|
48
43
|
|
|
44
|
+
2. **Read `workbranch` from plan frontmatter:**
|
|
45
|
+
- If `workbranch:` is **non-empty** → use that branch/worktree
|
|
46
|
+
- If worktree arg also provided → use worktree arg (override)
|
|
47
|
+
- Create worktree if not exists: `git worktree add .unipi/worktrees/{branch} -b {branch}`
|
|
48
|
+
- Work within worktree directory
|
|
49
|
+
- If `workbranch:` is **empty or missing** → work on current branch (main)
|
|
50
|
+
- No worktree creation needed
|
|
51
|
+
- Edit files directly in project root
|
|
52
|
+
- If neither plan nor args specify branch → ask user:
|
|
53
|
+
> "Where should this work happen?"
|
|
54
|
+
> 1. Current branch (main)
|
|
55
|
+
> 2. New worktree (provide branch name)
|
|
56
|
+
|
|
49
57
|
3. **Scope:**
|
|
50
58
|
- If `string(greedy)` provided, use to scope tasks
|
|
51
59
|
- Otherwise execute all incomplete tasks
|
|
52
60
|
|
|
53
|
-
**Exit:**
|
|
61
|
+
**Exit:** Branch/worktree resolved. Plan(s) loaded. Scope defined.
|
|
54
62
|
|
|
55
63
|
---
|
|
56
64
|
|
|
@@ -59,7 +67,7 @@ If args not provided, ask user interactively:
|
|
|
59
67
|
1. Read plan file(s)
|
|
60
68
|
2. Review critically — identify questions or concerns
|
|
61
69
|
3. If concerns: raise with user before starting
|
|
62
|
-
4. Identify task status: `unstarted:` (pending), `in-progress:` (started), `completed:` (done)
|
|
70
|
+
4. Identify task status: `unstarted:` (pending), `in-progress:` (started), `completed:` (done), `failed:` (needs investigation), `awaiting_user:` (needs user action), `blocked:` (waiting on dependency), `skipped:` (deferred)
|
|
63
71
|
|
|
64
72
|
**Exit:** Plan reviewed, ready to execute.
|
|
65
73
|
|
|
@@ -67,14 +75,36 @@ If args not provided, ask user interactively:
|
|
|
67
75
|
|
|
68
76
|
## Phase 3: Execute Tasks
|
|
69
77
|
|
|
70
|
-
For each
|
|
78
|
+
For each task in order, skip `completed:`, `skipped:`, and `awaiting_user:` tasks:
|
|
71
79
|
|
|
80
|
+
### If `unstarted:`
|
|
72
81
|
1. Change `unstarted:` to `in-progress:` in plan
|
|
73
82
|
2. Follow each step exactly (plan has bite-sized steps)
|
|
74
83
|
3. Run verifications as specified in acceptance criteria
|
|
75
84
|
4. Change `in-progress:` to `completed:` when complete
|
|
76
85
|
5. Update plan file with progress
|
|
77
86
|
|
|
87
|
+
### If `in-progress:`
|
|
88
|
+
1. Continue from where it left off
|
|
89
|
+
2. Follow remaining steps
|
|
90
|
+
3. Change to `completed:` when done
|
|
91
|
+
|
|
92
|
+
### If `failed:`
|
|
93
|
+
1. Read failure notes
|
|
94
|
+
2. Investigate root cause
|
|
95
|
+
3. Fix and re-verify
|
|
96
|
+
4. Change to `completed:` when fixed, or keep `failed:` if still broken
|
|
97
|
+
|
|
98
|
+
### If `awaiting_user:`
|
|
99
|
+
1. Remind user what's needed
|
|
100
|
+
2. Wait for user response
|
|
101
|
+
3. Resume when user provides input
|
|
102
|
+
|
|
103
|
+
### If `blocked:`
|
|
104
|
+
1. Check if blocker is resolved
|
|
105
|
+
2. If resolved → change to `unstarted:` and continue
|
|
106
|
+
3. If still blocked → skip and move to next task
|
|
107
|
+
|
|
78
108
|
### When to Stop and Ask
|
|
79
109
|
|
|
80
110
|
**STOP immediately when:**
|
|
@@ -112,17 +142,22 @@ When all tasks are `completed:`:
|
|
|
112
142
|
|
|
113
143
|
1. Run final verification (tests, lint, build)
|
|
114
144
|
2. Commit all remaining changes
|
|
115
|
-
3. Inform user:
|
|
116
|
-
|
|
117
|
-
> "All tasks complete. Worktree: `feat/<branch>`. Recommend reviewing before merge."
|
|
145
|
+
3. Inform user based on branch strategy:
|
|
118
146
|
|
|
119
|
-
|
|
147
|
+
**If working in worktree:**
|
|
148
|
+
> "All tasks complete. Worktree: `{branch}`. Recommend reviewing before merge."
|
|
120
149
|
```
|
|
121
150
|
/unipi:review-work plan:<plan-path>
|
|
122
151
|
```
|
|
123
|
-
|
|
124
152
|
**Recommend starting a new session** for review.
|
|
125
153
|
|
|
154
|
+
**If working on main branch:**
|
|
155
|
+
> "All tasks complete. All changes committed directly on main."
|
|
156
|
+
```
|
|
157
|
+
/unipi:review-work plan:<plan-path>
|
|
158
|
+
```
|
|
159
|
+
No merge needed — changes already on main.
|
|
160
|
+
|
|
126
161
|
---
|
|
127
162
|
|
|
128
163
|
## Resumability
|
|
@@ -139,6 +174,7 @@ If user provides scope string, only execute matching tasks.
|
|
|
139
174
|
|
|
140
175
|
## Notes
|
|
141
176
|
|
|
142
|
-
- Agent reads plan
|
|
143
|
-
- Worktree
|
|
177
|
+
- Agent reads plan on start — finds what's incomplete
|
|
178
|
+
- Worktree: changes don't affect main branch until merge (skip for small tasks)
|
|
179
|
+
- Main branch: changes committed directly, no merge needed
|
|
144
180
|
- Each worktree session is independent — no coordination with other worktrees
|
|
@@ -7,6 +7,8 @@ description: "Merge worktree branches back to main. Gathers context from specs/p
|
|
|
7
7
|
|
|
8
8
|
Merge completed worktree branches into main. Gather context from docs before merging.
|
|
9
9
|
|
|
10
|
+
**Note:** Only needed when work was done in a worktree (plan `workbranch` set). If work was on main branch directly, skip this — changes already on main.
|
|
11
|
+
|
|
10
12
|
## Process
|
|
11
13
|
|
|
12
14
|
### Phase 1: Gather Context
|