@difflab/pi 0.4.0 → 0.5.0-rc.202609231313.eaf7fa0

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 (128) hide show
  1. package/README.md +9 -9
  2. package/agents/diffpi-copilot.md +6 -3
  3. package/agents/diffpi-orchestrator.md +1 -1
  4. package/agents/diffpi-planner.md +3 -3
  5. package/agents/diffpi-reviewer.md +3 -3
  6. package/agents/diffpi-worker.md +2 -2
  7. package/dist/assets.d.ts +1 -0
  8. package/dist/assets.d.ts.map +1 -1
  9. package/dist/cli/plan.d.ts +7 -3
  10. package/dist/cli/plan.d.ts.map +1 -1
  11. package/dist/cli.js +306 -811
  12. package/dist/commands/plan.d.ts +0 -1
  13. package/dist/commands/plan.d.ts.map +1 -1
  14. package/dist/commands/review.d.ts +0 -1
  15. package/dist/commands/review.d.ts.map +1 -1
  16. package/dist/commands.d.ts +22 -0
  17. package/dist/commands.d.ts.map +1 -0
  18. package/dist/config.d.ts.map +1 -1
  19. package/dist/environment.d.ts +2 -1
  20. package/dist/environment.d.ts.map +1 -1
  21. package/dist/extensions/cmdtsx.d.ts +2 -0
  22. package/dist/extensions/cmdtsx.d.ts.map +1 -0
  23. package/dist/extensions/fsx.d.ts +8 -0
  24. package/dist/extensions/fsx.d.ts.map +1 -0
  25. package/dist/extensions/index.js +5057 -3069
  26. package/dist/extensions/processx.d.ts +1 -0
  27. package/dist/extensions/processx.d.ts.map +1 -1
  28. package/dist/extensions/subagentx.d.ts +1 -1
  29. package/dist/extensions/subagentx.d.ts.map +1 -1
  30. package/dist/extensions/tuicrx.d.ts +1 -8
  31. package/dist/extensions/tuicrx.d.ts.map +1 -1
  32. package/dist/extensions/zodx.d.ts +8 -0
  33. package/dist/extensions/zodx.d.ts.map +1 -0
  34. package/dist/index.d.ts +10 -11
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +352 -1149
  37. package/dist/plan/index.d.ts +2 -5
  38. package/dist/plan/index.d.ts.map +1 -1
  39. package/dist/plan/markdown.d.ts.map +1 -1
  40. package/dist/plan/operations.d.ts +43 -0
  41. package/dist/plan/operations.d.ts.map +1 -0
  42. package/dist/plan/reviews.d.ts +28 -0
  43. package/dist/plan/reviews.d.ts.map +1 -0
  44. package/dist/plan/store.d.ts +6 -3
  45. package/dist/plan/store.d.ts.map +1 -1
  46. package/dist/plan/types.d.ts +3 -22
  47. package/dist/plan/types.d.ts.map +1 -1
  48. package/dist/review/github-review-backend.d.ts.map +1 -1
  49. package/dist/review/gitlab-review-backend.d.ts.map +1 -1
  50. package/dist/review/index.d.ts +6 -6
  51. package/dist/review/index.d.ts.map +1 -1
  52. package/dist/review/local-reviews.d.ts +31 -0
  53. package/dist/review/local-reviews.d.ts.map +1 -0
  54. package/dist/review/review-backend.d.ts +2 -3
  55. package/dist/review/review-backend.d.ts.map +1 -1
  56. package/dist/review/review-markdown.d.ts +1 -4
  57. package/dist/review/review-markdown.d.ts.map +1 -1
  58. package/dist/review/types.d.ts +0 -28
  59. package/dist/review/types.d.ts.map +1 -1
  60. package/dist/store.d.ts +0 -2
  61. package/dist/store.d.ts.map +1 -1
  62. package/dist/tools/ci.d.ts +6 -0
  63. package/dist/tools/ci.d.ts.map +1 -0
  64. package/dist/tools/index.d.ts +1 -0
  65. package/dist/tools/index.d.ts.map +1 -1
  66. package/dist/tools/index.js +1887 -2805
  67. package/dist/tools/log.d.ts.map +1 -1
  68. package/dist/tools/modes.d.ts.map +1 -1
  69. package/dist/tools/plan-schema.d.ts +211 -0
  70. package/dist/tools/plan-schema.d.ts.map +1 -0
  71. package/dist/tools/plan.d.ts +2 -2
  72. package/dist/tools/plan.d.ts.map +1 -1
  73. package/dist/tools/review.d.ts +0 -30
  74. package/dist/tools/review.d.ts.map +1 -1
  75. package/dist/workflow.d.ts +80 -0
  76. package/dist/workflow.d.ts.map +1 -0
  77. package/package.json +4 -2
  78. package/skills/plan/SKILL.md +15 -7
  79. package/skills/review/SKILL.md +6 -8
  80. package/templates/plan/PLAN.md +2 -0
  81. package/workflows/plan/annotate.md +13 -0
  82. package/workflows/plan/finalize.md +15 -0
  83. package/workflows/plan/go.md +20 -0
  84. package/{skills/plan/references/workflows → workflows/plan}/help.md +11 -4
  85. package/workflows/plan/init.md +13 -0
  86. package/workflows/plan/new.md +20 -0
  87. package/workflows/plan/update.md +18 -0
  88. package/workflows/review/address.md +8 -0
  89. package/workflows/review/auto.md +8 -0
  90. package/workflows/review/complete.md +7 -0
  91. package/workflows/review/edit.md +7 -0
  92. package/workflows/review/help.md +14 -0
  93. package/workflows/review/merge.md +6 -0
  94. package/workflows/review/new.md +7 -0
  95. package/workflows/review/publish.md +6 -0
  96. package/dist/plan/annotations.d.ts +0 -25
  97. package/dist/plan/annotations.d.ts.map +0 -1
  98. package/dist/plan/controller.d.ts +0 -65
  99. package/dist/plan/controller.d.ts.map +0 -1
  100. package/dist/plan/execution.d.ts +0 -13
  101. package/dist/plan/execution.d.ts.map +0 -1
  102. package/dist/plan/ids.d.ts +0 -5
  103. package/dist/plan/ids.d.ts.map +0 -1
  104. package/dist/plan/lock.d.ts +0 -11
  105. package/dist/plan/lock.d.ts.map +0 -1
  106. package/dist/plan/log.d.ts +0 -6
  107. package/dist/plan/log.d.ts.map +0 -1
  108. package/dist/plan/parser.d.ts +0 -18
  109. package/dist/plan/parser.d.ts.map +0 -1
  110. package/dist/review/local-review-backend.d.ts +0 -3
  111. package/dist/review/local-review-backend.d.ts.map +0 -1
  112. package/dist/review/review-state.d.ts +0 -20
  113. package/dist/review/review-state.d.ts.map +0 -1
  114. package/skills/plan/references/workflows/annotate.md +0 -6
  115. package/skills/plan/references/workflows/finalize.md +0 -7
  116. package/skills/plan/references/workflows/go.md +0 -8
  117. package/skills/plan/references/workflows/init.md +0 -6
  118. package/skills/plan/references/workflows/new.md +0 -8
  119. package/skills/plan/references/workflows/update.md +0 -7
  120. package/skills/review/references/workflows/address.md +0 -11
  121. package/skills/review/references/workflows/auto.md +0 -18
  122. package/skills/review/references/workflows/complete.md +0 -7
  123. package/skills/review/references/workflows/edit.md +0 -7
  124. package/skills/review/references/workflows/help.md +0 -30
  125. package/skills/review/references/workflows/merge.md +0 -6
  126. package/skills/review/references/workflows/new.md +0 -19
  127. package/skills/review/references/workflows/open.md +0 -3
  128. package/skills/review/references/workflows/publish.md +0 -8
@@ -1 +1 @@
1
- {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/tools/log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAsBlF,eAAO,MAAM,aAAa,EAAE,cA0B1B,CAAC"}
1
+ {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/tools/log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAoBlF,eAAO,MAAM,aAAa,EAAE,cA0B1B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"modes.d.ts","sourceRoot":"","sources":["../../src/tools/modes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAElF,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,UAAU,CAAC;AAiB5D,wBAAgB,eAAe,CAAC,UAAU,EAAE,cAAc,GAAG,SAAS,cAAc,EAAE,CAiErF"}
1
+ {"version":3,"file":"modes.d.ts","sourceRoot":"","sources":["../../src/tools/modes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGlF,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,UAAU,CAAC;AAiB5D,wBAAgB,eAAe,CAAC,UAAU,EAAE,cAAc,GAAG,SAAS,cAAc,EAAE,CAiErF"}
@@ -0,0 +1,211 @@
1
+ import { z } from 'zod';
2
+ declare const planTaskDraftSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ title: z.ZodString;
5
+ steps: z.ZodOptional<z.ZodArray<z.ZodString>>;
6
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
7
+ fileScopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
8
+ acceptanceCriteria: z.ZodOptional<z.ZodArray<z.ZodString>>;
9
+ }, z.core.$strict>;
10
+ declare const planPhaseDraftSchema: z.ZodObject<{
11
+ id: z.ZodString;
12
+ title: z.ZodString;
13
+ objective: z.ZodString;
14
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
15
+ tasks: z.ZodOptional<z.ZodArray<z.ZodObject<{
16
+ id: z.ZodString;
17
+ title: z.ZodString;
18
+ steps: z.ZodOptional<z.ZodArray<z.ZodString>>;
19
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
20
+ fileScopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
21
+ acceptanceCriteria: z.ZodOptional<z.ZodArray<z.ZodString>>;
22
+ }, z.core.$strict>>>;
23
+ }, z.core.$strict>;
24
+ export declare const planContextParametersSchema: z.ZodObject<{
25
+ cwd: z.ZodOptional<z.ZodString>;
26
+ plan: z.ZodOptional<z.ZodString>;
27
+ branch: z.ZodOptional<z.ZodString>;
28
+ statuses: z.ZodOptional<z.ZodArray<z.ZodEnum<{
29
+ draft: "draft";
30
+ ready: "ready";
31
+ in_progress: "in_progress";
32
+ blocked: "blocked";
33
+ completed: "completed";
34
+ }>>>;
35
+ }, z.core.$strict>;
36
+ export declare const planInitParametersSchema: z.ZodObject<{
37
+ cwd: z.ZodOptional<z.ZodString>;
38
+ shortSlug: z.ZodString;
39
+ branch: z.ZodOptional<z.ZodString>;
40
+ title: z.ZodOptional<z.ZodString>;
41
+ intent: z.ZodOptional<z.ZodString>;
42
+ issueId: z.ZodOptional<z.ZodString>;
43
+ issueUrl: z.ZodOptional<z.ZodString>;
44
+ open: z.ZodOptional<z.ZodBoolean>;
45
+ }, z.core.$strict>;
46
+ export declare const planUpdateOverviewParametersSchema: z.ZodObject<{
47
+ cwd: z.ZodOptional<z.ZodString>;
48
+ plan: z.ZodString;
49
+ expectedPlanRevision: z.ZodNumber;
50
+ intent: z.ZodOptional<z.ZodString>;
51
+ requirements: z.ZodOptional<z.ZodArray<z.ZodString>>;
52
+ design: z.ZodOptional<z.ZodObject<{
53
+ bigIdeas: z.ZodString;
54
+ keyApiUpdates: z.ZodString;
55
+ consequences: z.ZodString;
56
+ }, z.core.$strict>>;
57
+ references: z.ZodOptional<z.ZodArray<z.ZodObject<{
58
+ id: z.ZodString;
59
+ value: z.ZodString;
60
+ }, z.core.$strict>>>;
61
+ }, z.core.$strict>;
62
+ export declare const planAddPhaseParametersSchema: z.ZodObject<{
63
+ cwd: z.ZodOptional<z.ZodString>;
64
+ plan: z.ZodString;
65
+ expectedPlanRevision: z.ZodNumber;
66
+ afterPhaseId: z.ZodOptional<z.ZodString>;
67
+ phase: z.ZodObject<{
68
+ id: z.ZodString;
69
+ title: z.ZodString;
70
+ objective: z.ZodString;
71
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
72
+ tasks: z.ZodOptional<z.ZodArray<z.ZodObject<{
73
+ id: z.ZodString;
74
+ title: z.ZodString;
75
+ steps: z.ZodOptional<z.ZodArray<z.ZodString>>;
76
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
77
+ fileScopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
78
+ acceptanceCriteria: z.ZodOptional<z.ZodArray<z.ZodString>>;
79
+ }, z.core.$strict>>>;
80
+ }, z.core.$strict>;
81
+ }, z.core.$strict>;
82
+ export declare const planRemovePhaseParametersSchema: z.ZodObject<{
83
+ cwd: z.ZodOptional<z.ZodString>;
84
+ plan: z.ZodString;
85
+ expectedPlanRevision: z.ZodNumber;
86
+ phaseId: z.ZodString;
87
+ reason: z.ZodString;
88
+ }, z.core.$strict>;
89
+ export declare const planUpdatePhaseParametersSchema: z.ZodObject<{
90
+ cwd: z.ZodOptional<z.ZodString>;
91
+ plan: z.ZodString;
92
+ expectedPlanRevision: z.ZodNumber;
93
+ phaseId: z.ZodString;
94
+ patch: z.ZodObject<{
95
+ title: z.ZodOptional<z.ZodString>;
96
+ objective: z.ZodOptional<z.ZodString>;
97
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
98
+ tasks: z.ZodOptional<z.ZodArray<z.ZodObject<{
99
+ id: z.ZodString;
100
+ title: z.ZodString;
101
+ steps: z.ZodOptional<z.ZodArray<z.ZodString>>;
102
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
103
+ fileScopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
104
+ acceptanceCriteria: z.ZodOptional<z.ZodArray<z.ZodString>>;
105
+ }, z.core.$strict>>>;
106
+ }, z.core.$strict>;
107
+ }, z.core.$strict>;
108
+ export declare const planValidateParametersSchema: z.ZodObject<{
109
+ cwd: z.ZodOptional<z.ZodString>;
110
+ plan: z.ZodString;
111
+ strict: z.ZodOptional<z.ZodBoolean>;
112
+ }, z.core.$strict>;
113
+ export declare const planLogProgressParametersSchema: z.ZodObject<{
114
+ cwd: z.ZodOptional<z.ZodString>;
115
+ plan: z.ZodString;
116
+ actor: z.ZodString;
117
+ message: z.ZodString;
118
+ executionId: z.ZodOptional<z.ZodString>;
119
+ phaseId: z.ZodOptional<z.ZodString>;
120
+ taskId: z.ZodOptional<z.ZodString>;
121
+ evidence: z.ZodOptional<z.ZodArray<z.ZodString>>;
122
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
123
+ }, z.core.$strict>;
124
+ export declare const planRunGatesParametersSchema: z.ZodObject<{
125
+ cwd: z.ZodOptional<z.ZodString>;
126
+ plan: z.ZodString;
127
+ phaseId: z.ZodString;
128
+ expectedPhaseRevision: z.ZodNumber;
129
+ executionId: z.ZodString;
130
+ actor: z.ZodString;
131
+ }, z.core.$strict>;
132
+ export declare const planRecordCiParametersSchema: z.ZodObject<{
133
+ cwd: z.ZodOptional<z.ZodString>;
134
+ plan: z.ZodString;
135
+ phaseId: z.ZodString;
136
+ sha: z.ZodString;
137
+ executionId: z.ZodString;
138
+ actor: z.ZodString;
139
+ status: z.ZodEnum<{
140
+ skipped: "skipped";
141
+ passed: "passed";
142
+ failed: "failed";
143
+ }>;
144
+ detail: z.ZodString;
145
+ retryReason: z.ZodOptional<z.ZodString>;
146
+ }, z.core.$strict>;
147
+ export declare const planLookupParametersSchema: z.ZodObject<{
148
+ cwd: z.ZodOptional<z.ZodString>;
149
+ plan: z.ZodOptional<z.ZodString>;
150
+ }, z.core.$strict>;
151
+ export declare const planStartExecutionParametersSchema: z.ZodObject<{
152
+ cwd: z.ZodOptional<z.ZodString>;
153
+ plan: z.ZodString;
154
+ commitMode: z.ZodEnum<{
155
+ push: "push";
156
+ "no-commit": "no-commit";
157
+ commit: "commit";
158
+ }>;
159
+ actor: z.ZodString;
160
+ }, z.core.$strict>;
161
+ export declare const planUpdateStatusParametersSchema: z.ZodObject<{
162
+ cwd: z.ZodOptional<z.ZodString>;
163
+ plan: z.ZodString;
164
+ target: z.ZodObject<{
165
+ type: z.ZodEnum<{
166
+ phase: "phase";
167
+ task: "task";
168
+ plan: "plan";
169
+ }>;
170
+ id: z.ZodOptional<z.ZodString>;
171
+ }, z.core.$strict>;
172
+ expectedStatus: z.ZodEnum<{
173
+ draft: "draft";
174
+ ready: "ready";
175
+ in_progress: "in_progress";
176
+ blocked: "blocked";
177
+ completed: "completed";
178
+ pending: "pending";
179
+ skipped: "skipped";
180
+ }>;
181
+ status: z.ZodEnum<{
182
+ draft: "draft";
183
+ ready: "ready";
184
+ in_progress: "in_progress";
185
+ blocked: "blocked";
186
+ completed: "completed";
187
+ pending: "pending";
188
+ skipped: "skipped";
189
+ }>;
190
+ actor: z.ZodString;
191
+ message: z.ZodString;
192
+ executionId: z.ZodOptional<z.ZodString>;
193
+ evidence: z.ZodOptional<z.ZodArray<z.ZodString>>;
194
+ blockedReason: z.ZodOptional<z.ZodString>;
195
+ attempts: z.ZodOptional<z.ZodArray<z.ZodString>>;
196
+ needsUserDecision: z.ZodOptional<z.ZodBoolean>;
197
+ commit: z.ZodOptional<z.ZodObject<{
198
+ sha: z.ZodString;
199
+ subject: z.ZodString;
200
+ completedAt: z.ZodString;
201
+ pushedAt: z.ZodOptional<z.ZodString>;
202
+ ci: z.ZodOptional<z.ZodObject<{
203
+ status: z.ZodLiteral<"pending">;
204
+ startedAt: z.ZodString;
205
+ }, z.core.$strict>>;
206
+ }, z.core.$strict>>;
207
+ }, z.core.$strict>;
208
+ export type PlanTaskDraft = z.infer<typeof planTaskDraftSchema>;
209
+ export type PlanPhaseDraft = z.infer<typeof planPhaseDraftSchema>;
210
+ export {};
211
+ //# sourceMappingURL=plan-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan-schema.d.ts","sourceRoot":"","sources":["../../src/tools/plan-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,QAAA,MAAM,mBAAmB;;;;;;;kBASd,CAAC;AAEZ,QAAA,MAAM,oBAAoB;;;;;;;;;;;;;kBAQf,CAAC;AAYZ,eAAO,MAAM,2BAA2B;;;;;;;;;;;kBAO7B,CAAC;AAEZ,eAAO,MAAM,wBAAwB;;;;;;;;;kBAW1B,CAAC;AAEZ,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;kBAa3C,CAAC;AAEL,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;kBAQ9B,CAAC;AAEZ,eAAO,MAAM,+BAA+B;;;;;;kBAQjC,CAAC;AAEZ,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;kBAejC,CAAC;AAEZ,eAAO,MAAM,4BAA4B;;;;kBAE9B,CAAC;AAEZ,eAAO,MAAM,+BAA+B;;;;;;;;;;kBAYjC,CAAC;AAEZ,eAAO,MAAM,4BAA4B;;;;;;;kBAS9B,CAAC;AAEZ,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;kBAY9B,CAAC;AAEZ,eAAO,MAAM,0BAA0B;;;kBAAkE,CAAC;AAE1G,eAAO,MAAM,kCAAkC;;;;;;;;;kBAOpC,CAAC;AAEZ,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA+BlC,CAAC;AAEZ,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import type { ExtensionAPI, ToolDefinition } from '@earendil-works/pi-coding-agent';
2
2
  import type { ModeController } from '../modes';
3
- import { type PlanController } from '../plan';
3
+ import { type PlanStore } from '../plan/store';
4
4
  export type PlanToolRuntime = Pick<ExtensionAPI, 'events' | 'sendUserMessage'> & Partial<Pick<ExtensionAPI, 'sendMessage'>>;
5
- export declare function createPlanTools(pi: PlanToolRuntime, modes: ModeController, store?: PlanController): readonly ToolDefinition[];
5
+ export declare function createPlanTools(_pi: PlanToolRuntime, _modes: ModeController, store?: PlanStore): readonly ToolDefinition[];
6
6
  //# sourceMappingURL=plan.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/tools/plan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAoB,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAQtG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAML,KAAK,cAAc,EAEpB,MAAM,SAAS,CAAC;AAiCjB,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,YAAY,EAAE,QAAQ,GAAG,iBAAiB,CAAC,GAC5E,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC;AAE7C,wBAAgB,eAAe,CAC7B,EAAE,EAAE,eAAe,EACnB,KAAK,EAAE,cAAc,EACrB,KAAK,GAAE,cAAuC,GAC7C,SAAS,cAAc,EAAE,CAimB3B"}
1
+ {"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/tools/plan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAQpF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAM/C,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAmBhE,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,YAAY,EAAE,QAAQ,GAAG,iBAAiB,CAAC,GAC5E,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC;AAE7C,wBAAgB,eAAe,CAC7B,GAAG,EAAE,eAAe,EACpB,MAAM,EAAE,cAAc,EACtB,KAAK,GAAE,SAA6B,GACnC,SAAS,cAAc,EAAE,CA6W3B"}
@@ -1,34 +1,4 @@
1
1
  import { type ToolDefinition } from '@earendil-works/pi-coding-agent';
2
- import { type ReviewComment, type ReviewThreadRecord } from '../review';
3
- export declare function hasReviewDraft(comments: readonly ReviewComment[], body: string): boolean;
4
- export declare function partitionReviewComments(comments: readonly ReviewComment[], knownFingerprints: ReadonlySet<string>, model: string): {
5
- checkpointed: {
6
- source: ReviewComment;
7
- published: {
8
- body: string;
9
- file: string;
10
- line?: number;
11
- side?: import("..").ReviewSide;
12
- author?: string;
13
- sourceCommentId?: string;
14
- };
15
- fingerprint: string;
16
- }[];
17
- candidates: {
18
- source: ReviewComment;
19
- published: {
20
- body: string;
21
- file: string;
22
- line?: number;
23
- side?: import("..").ReviewSide;
24
- author?: string;
25
- sourceCommentId?: string;
26
- };
27
- fingerprint: string;
28
- }[];
29
- };
30
- export declare function resolveReviewThread(comment: ReviewComment, threads: readonly ReviewThreadRecord[]): ReviewThreadRecord | undefined;
31
2
  export declare function workingTreeDiff(cwd: string): Promise<string>;
32
3
  export declare function createReviewTools(): readonly ToolDefinition[];
33
- export declare function syncLocalThreadArtifact(path: string, title: string, sessionSlug: string, threads: readonly ReviewThreadRecord[]): Promise<ReviewThreadRecord[]>;
34
4
  //# sourceMappingURL=review.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../src/tools/review.ts"],"names":[],"mappings":"AAGA,OAAO,EAAqC,KAAK,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAMzG,OAAO,EAwBL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACxB,MAAM,WAAW,CAAC;AAwEnB,wBAAgB,cAAc,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAExF;AAED,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,SAAS,aAAa,EAAE,EAClC,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAAC,EACtC,KAAK,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;EAUd;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,SAAS,kBAAkB,EAAE,GACrC,kBAAkB,GAAG,SAAS,CAmBhC;AAED,wBAAsB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAalE;AAID,wBAAgB,iBAAiB,IAAI,SAAS,cAAc,EAAE,CAyc7D;AAID,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,SAAS,kBAAkB,EAAE,GACrC,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAwB/B"}
1
+ {"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../src/tools/review.ts"],"names":[],"mappings":"AAGA,OAAO,EAAqC,KAAK,cAAc,EAAE,MAAM,iCAAiC,CAAC;AA2EzG,wBAAsB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAalE;AAID,wBAAgB,iBAAiB,IAAI,SAAS,cAAc,EAAE,CAma7D"}
@@ -0,0 +1,80 @@
1
+ export type PlanWorkflowName = 'init' | 'new' | 'update' | 'annotate' | 'finalize' | 'go' | 'help';
2
+ export type ReviewWorkflowName = 'auto' | 'new' | 'edit' | 'address' | 'publish' | 'complete' | 'merge' | 'help';
3
+ export type PlanWorkflowArguments = {
4
+ init: {
5
+ plan: string;
6
+ branch?: string;
7
+ };
8
+ new: {
9
+ plan: string;
10
+ branch?: string;
11
+ background: boolean;
12
+ prompt?: string;
13
+ };
14
+ update: {
15
+ plan?: string;
16
+ branch?: string;
17
+ background: boolean;
18
+ instructions?: string;
19
+ };
20
+ annotate: {
21
+ plan?: string;
22
+ };
23
+ finalize: {
24
+ plan?: string;
25
+ };
26
+ go: {
27
+ plan: string;
28
+ commitMode: 'no-commit' | 'commit' | 'push';
29
+ background: boolean;
30
+ };
31
+ help: Record<string, never>;
32
+ };
33
+ export type ReviewWorkflowArguments = {
34
+ auto: {
35
+ target?: string;
36
+ local: boolean;
37
+ background: boolean;
38
+ };
39
+ new: {
40
+ title?: string;
41
+ intent?: string;
42
+ base?: string;
43
+ local: boolean;
44
+ background: boolean;
45
+ };
46
+ edit: {
47
+ target?: string;
48
+ local: boolean;
49
+ background: boolean;
50
+ };
51
+ address: {
52
+ target?: string;
53
+ local: boolean;
54
+ background: boolean;
55
+ };
56
+ publish: {
57
+ target?: string;
58
+ comment: boolean;
59
+ approve: boolean;
60
+ requestChanges: boolean;
61
+ close: boolean;
62
+ background: boolean;
63
+ };
64
+ complete: {
65
+ target?: string;
66
+ local: boolean;
67
+ approve: boolean;
68
+ reject: boolean;
69
+ abandon: boolean;
70
+ background: boolean;
71
+ };
72
+ merge: {
73
+ target?: string;
74
+ background: boolean;
75
+ };
76
+ help: Record<string, never>;
77
+ };
78
+ export declare function loadPlanWorkflow<Name extends PlanWorkflowName>(name: Name, args: PlanWorkflowArguments[Name]): Promise<string>;
79
+ export declare function loadReviewWorkflow<Name extends ReviewWorkflowName>(name: Name, args: ReviewWorkflowArguments[Name]): Promise<string>;
80
+ //# sourceMappingURL=workflow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../src/workflow.ts"],"names":[],"mappings":"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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@difflab/pi",
3
- "version": "0.4.0",
3
+ "version": "0.5.0-rc.202609231313.eaf7fa0",
4
4
  "description": "Tools and skills for the pi coding agent",
5
5
  "repository": {
6
6
  "type": "git",
@@ -34,7 +34,8 @@
34
34
  "agents/",
35
35
  "dist/",
36
36
  "skills/",
37
- "templates/"
37
+ "templates/",
38
+ "workflows/"
38
39
  ],
39
40
  "pi": {
40
41
  "extensions": [
@@ -57,6 +58,7 @@
57
58
  },
58
59
  "dependencies": {
59
60
  "@juicesharp/rpiv-ask-user-question": "^2.10.1",
61
+ "cmd-ts": "^0.15.0",
60
62
  "commander": "^14.0.0",
61
63
  "mdast-builder": "1.1.1",
62
64
  "pi-mcp-adapter": "^2.33.0",
@@ -1,15 +1,23 @@
1
1
  ---
2
2
  name: plan
3
- description: Create, annotate, validate, update, and execute durable Diffpi plans. Use for /plan workflows, implementation planning, plan annotations, and resumable plan execution.
4
- allowed-tools: Agent get_subagent_result steer_subagent ask_user_question plan_context plan_init plan_update_overview plan_add_phase plan_remove_phase plan_update_phase plan_validate plan_annotate plan_annotations plan_ack_annotations plan_log_progress plan_update_status plan_run_gates plan_watch_ci plan_start_execution diffpi_modes_set diffpi_modes_unset
3
+ description: Route natural-language planning requests to Diffpi's /plan commands. Use when a user wants to create, revise, annotate, finalize, or execute a durable plan, or asks which /plan command to run.
4
+ allowed-tools: ask_user_question
5
5
  ---
6
6
 
7
- # plan
7
+ # Plan Command Guide
8
8
 
9
- Parse the first argument as `init`, `new`, `update`, `annotate`, `finalize`, `go`, or `help`. An empty or unknown verb uses [help](references/workflows/help.md). Read and follow `references/workflows/<verb>.md`.
9
+ Use `/plan` commands as the execution boundary. Do not reproduce their workflows, call `plan_*` tools directly, or edit managed plan files.
10
10
 
11
- Foreground `init`, `new`, and `update` run in Planner mode. Foreground `annotate`, `finalize`, `go`, and `help` run in Worker mode. Finalize exits to the default mode when implementation is deferred, and completed inline execution exits to the default mode automatically.
11
+ ## Natural-language routing
12
12
 
13
- `--bg` is handled and removed by the `/plan` extension command. A simple background `new`, `update`, or `go` dispatch starts one named planner/orchestrator through the pi-subagents cross-extension RPC; do not add an extra model turn, invoke recursive Pi, or use `/bg --agent`. Background workflows never ask questions. They record safe assumptions and return an actionable blocker for unresolved decisions. For additional delegation, use `Agent`, `get_subagent_result`, and `steer_subagent`; use `SubagentWorkflow` when orchestration must be deterministic and multi-stage. Reserve pi-background-tasks for ordinary long-running shell commands, tests, builds, and servers. Foreground workflows use `ask_user_question` for every choice that cannot be derived from the request; never ask in plain chat.
13
+ Map the user's intent to one command:
14
14
 
15
- Use plan tools for every `PLAN.md`, status, log, gate, and annotation mutation. Do not edit managed plan files directly. Validate after authoring. Preserve stable IDs, user prose, completed evidence, and annotation acknowledgement order.
15
+ - Create an empty plan shell: `/plan init <short-slug> [--branch <name>]`
16
+ - Research and author a complete plan: `/plan new <short-slug> [--branch <name>] [--bg] [prompt...]`
17
+ - Revise a plan from chat instructions or its current plan review: `/plan update [short-slug] [--branch <name>] [--bg] [instructions...]`
18
+ - Review a plan in tuicr and save the result: `/plan annotate [short-slug]`
19
+ - Validate and mark a plan ready: `/plan finalize [short-slug]`
20
+ - Execute a plan: `/plan go <short-slug> [--mode <no-commit|commit|push>] [--bg]`
21
+ - Show command help: `/plan help`
22
+
23
+ Infer the command, slug, branch, and free-text arguments from recent conversation when they are clear. If a required value cannot be inferred, use `ask_user_question`; do not ask in plain chat. Then give the user one exact, copyable `/plan` command. Explain defaults only when relevant: `go` uses `--mode no-commit` when `--mode` is omitted.
@@ -1,17 +1,15 @@
1
1
  ---
2
2
  name: review
3
- description: Code review workflows over GitHub, GitLab, or the local tuicr backend. Use for auto reviews, review opening and editing, addressing, publishing, completing, merging, or local review requests.
4
- allowed-tools: ask_user_question review_context review_new review_edit review_diff review_gates review_submit review_add_comment review_comments review_respond review_publish review_complete review_merge review_launch_ui diffpi_template
3
+ description: Code review workflows over GitHub, GitLab, or local tuicr revision dumps. Use for auto reviews, review opening and editing, addressing, publishing, completing, merging, or local review requests.
4
+ allowed-tools: ask_user_question review_context review_new review_edit review_diff review_gates review_submit review_add_comment review_comments review_dump review_respond review_publish review_complete review_merge review_launch_ui
5
5
  ---
6
6
 
7
7
  # review
8
8
 
9
- Treat `--local` as a backend selector. It always uses the local `tuicr` working-tree backend; without it, the detected GitHub or GitLab forge owns the remote target. Treat `--bg` as an execution selector handled by the `/review` command; it is removed before workflow parsing. Target selection, storage, provenance, templates, comment staging, replies, publication, and forge calls belong to the tools.
9
+ Use the exact package workflow supplied by the `/review` command. Do not look for workflow files inside this skill.
10
10
 
11
- Parse the first non-flag argument as VERB and preserve remaining flags. Normalize `open`, `create`, and `draft` to `new`; normalize `launch` to `auto`, `ready` to `publish`, `close` to `complete`, and `land` to `merge`. An empty or unknown verb uses `references/workflows/help.md`.
11
+ Call `review_context` first. Treat `--local` as a working-tree tuicr flow. A completed local session becomes one immutable review dump; applying feedback starts a new revision. Local reviews have no thread ledger, replies, resolution state, or remote promotion.
12
12
 
13
- Read and follow `references/workflows/{VERB}.md`. Call `review_context` first in every workflow. Use `ask_user_question` for choices that cannot be derived from the request. Never ask those questions as plain chat text.
13
+ Without `--local`, use the detected GitHub or GitLab target directly. Stage findings, read forge threads, post replies, publish status, and perform lifecycle actions through the remote review tools.
14
14
 
15
- For inline execution, `/review auto` and `/review address` activate the reviewer profile on Sol; lifecycle verbs activate the orchestrator profile on Luna. The reviewer coordinates `address`, classifies every thread, and delegates bounded implementation to lightweight worker agents. With `--bg`, the command leaves the current chat mode unchanged and launches one named background orchestrator through the pi-subagents cross-extension RPC. Do not add an extra model turn or use recursive Pi or `/bg --agent` for this dispatch. For further delegation, use `Agent`, `get_subagent_result`, and `steer_subagent`; use `SubagentWorkflow` for deterministic multi-stage orchestration. Reserve pi-background-tasks for ordinary long-running shell commands, tests, builds, and servers.
16
-
17
- Workflow index: `auto` generates findings and leaves remote comments pending; `new` creates a local review or remote draft PR/MR; `edit` opens an existing local or remote review for the user; `address` fixes local or remote comments, commits remote fixes through `/git`, and records or posts replies; `publish` promotes pending review work; `complete` approves, rejects, abandons, or archives a review without merging; `merge` is the separate GitHub-only merge action; `help` prints the reference.
15
+ Use `ask_user_question` only for decisions that cannot be derived. Inline `auto` and `address` run under Reviewer; lifecycle workflows run under Orchestrator. Background execution is already routed by the command and must not change the foreground mode.
@@ -4,6 +4,8 @@
4
4
 
5
5
  - **Plan ID:** {{id}}
6
6
  - **Branch:** {{branch}}
7
+ - **Issue:** {{issue_id}}
8
+ - **Issue URL:** {{issue_url}}
7
9
  - **Status:** draft
8
10
  - **Revision:** 0
9
11
 
@@ -0,0 +1,13 @@
1
+ # annotate
2
+
3
+ ## Arguments
4
+
5
+ - **Invocation:** `/plan annotate [short-slug]`
6
+ - `[short-slug]` (optional): Plan to annotate. Omit it only when context resolves exactly one plan.
7
+
8
+ ## Instructions
9
+
10
+ 1. Call `plan_context` and infer planId from the provided short slug/conversation context. Fall back to looking at available active plan candidates, and ask user which to annotate listing available options.
11
+ 2. Call `plan_annotate`; it uses `tuicr --file .diffpi/plan/{planId}`, never `-p` or `--path`.
12
+ 3. Report the selected plan, launch result, and copyable fallback command. Closing tuicr saves one immutable plan review for the current plan revision.
13
+ 4. Tell the user to run `/plan update <plan-id>` after closing tuicr.
@@ -0,0 +1,15 @@
1
+ # finalize
2
+
3
+ ## Arguments
4
+
5
+ - **Invocation:** `/plan finalize [short-slug]`
6
+ - `[short-slug]` (optional): Plan to validate and mark ready. Omit it only when context resolves exactly one plan.
7
+
8
+ ## Instructions
9
+
10
+ 1. Call `plan_context` and use the current persisted plan, including changes authored through chat.
11
+ 2. Call `plan_review` once. If a review exists for the current plan revision, apply its feedback using the update workflow's mutation rules. If no review exists, continue directly.
12
+ 3. Call `plan_validate` with `strict: true`. Address validation issues and stop on unresolved errors or Design above 800 words.
13
+ 4. Mark the draft ready with `plan_update_status`.
14
+ 5. Use one `ask_user_question` call to choose the next action. Choices are foreground execution, background execution, execute later, or continue planning. When execution is selected, also ask for `no-commit`, `commit`, or `push` mode.
15
+ 6. Call `diffpi_modes_unset` before returning so finalization exits to the default inline mode. For execution, return the exact `/plan go <short-slug> --mode <mode>` command, adding `--bg` for background execution. Do not call `plan_start_execution`; `/plan go` routes execution to Orchestrator.
@@ -0,0 +1,20 @@
1
+ # go
2
+
3
+ ## Arguments
4
+
5
+ - **Invocation:** `/plan go <short-slug> [--mode <no-commit|commit|push>] [--bg]`
6
+ - `<short-slug>` (required): Plan to execute.
7
+ - `--mode no-commit` (optional, default): Execute without creating commits.
8
+ - `--mode commit` (optional): Create one local commit after each completed phase. Do not push or monitor remote CI.
9
+ - `--mode push` (optional): Create and push one commit after each completed phase, then monitor remote CI before completion.
10
+ - `--bg` (optional): Launch the execution Orchestrator in the background and preserve the current foreground mode.
11
+
12
+ ## Instructions
13
+
14
+ 1. Call `plan_context` with the supplied slug.
15
+ 2. Read the requested commit mode from `--mode`. Use `no-commit` when the flag is omitted. Do not ask the user to select a commit mode.
16
+ 3. Reject values other than `no-commit`, `commit`, or `push`. The command parser normally performs this validation before invoking the workflow.
17
+ 4. The command has already selected the foreground Orchestrator or launched the background Orchestrator. Continue as the current Orchestrator and launch implementation Workers as needed.
18
+ 5. Call `plan_start_execution` with the selected commit mode. This tool initializes durable execution state and returns the execution packet. It does not select a mode, send another turn, or launch an agent.
19
+ 6. In `no-commit` mode, do not create or push commits. In `commit` mode, create one local commit after each phase passes its gates, but do not push or monitor remote CI. In `push` mode, commit and push each phase, record pending CI, and launch a bounded background Worker to call `watch_ci` for the exact commit and then `plan_record_ci` for the phase while the next phase executes. Collect that monitor before the next push and collect all monitors before completion; failed or timed-out CI blocks execution.
20
+ 7. For foreground execution, call `diffpi_modes_unset` after the plan is completed. Background execution must not change the foreground mode. Report the execution ID and selected commit mode.
@@ -1,13 +1,20 @@
1
1
  # help
2
2
 
3
- Use these commands:
3
+ ## Arguments
4
+
5
+ - **Invocation:** `/plan help`
6
+ - This workflow accepts no arguments.
7
+
8
+ ## Instructions
9
+
10
+ Show these commands:
4
11
 
5
12
  - `/plan init <short-slug> [--branch <name>]` creates a phase-less draft.
6
13
  - `/plan new <short-slug> [--branch <name>] [--bg] [prompt...]` creates and populates a plan.
7
- - `/plan update [short-slug] [--branch <name>] [--bg] [instructions...]` applies pending annotations before other instructions.
8
- - `/plan annotate [short-slug]` opens `PLAN.md` with `tuicr --file`.
14
+ - `/plan update [short-slug] [--branch <name>] [--bg] [instructions...]` applies the current plan review before other instructions.
15
+ - `/plan annotate [short-slug]` reviews the plan with tuicr and saves an immutable review dump when tuicr closes.
9
16
  - `/plan finalize [short-slug]` validates and marks a plan ready.
10
- - `/plan go <short-slug> [--commit|--no-commit] [--bg]` starts execution.
17
+ - `/plan go <short-slug> [--mode <no-commit|commit|push>] [--bg]` starts execution.
11
18
  - `/plan help` shows this reference.
12
19
 
13
20
  `--branch` records or filters a branch. It does not create or switch branches. Background workflows do not ask questions.
@@ -0,0 +1,13 @@
1
+ # init
2
+
3
+ ## Arguments
4
+
5
+ - **Invocation:** `/plan init <short-slug> [--branch <name>]`
6
+ - `<short-slug>` (required): Short, stable name used to identify the plan.
7
+ - `--branch <name>` (optional): Branch metadata to record on the plan. It does not create or switch branches.
8
+
9
+ ## Instructions
10
+
11
+ 1. Call `plan_init` with the supplied slug and branch metadata. Include explicit intent, title and issue tracker id/url when available. The tool creates only `PLAN.md`.
12
+ 2. Open `PLAN.md` in supported IDEs/terminals/multiplexers in a new or available chat-adjacent tab. Skip to next step if IDE/terminal/mux is unsupported.
13
+ 3. Report the plan ID and path (clickable link so users can click to open in their environment). Explain that `/plan annotate` records a plan review and `/plan update` applies that plan review or direct chat instructions until `/plan finalize` is called.
@@ -0,0 +1,20 @@
1
+ # new
2
+
3
+ ## Arguments
4
+
5
+ - **Invocation:** `/plan new <short-slug> [--branch <name>] [--bg] [prompt...]`
6
+ - `<short-slug>` (required): Short, stable name used to identify the plan.
7
+ - `--branch <name>` (optional): Branch metadata to record on the plan. It does not create or switch branches.
8
+ - `--bg` (optional): Whether this is a background agent, or running in chat thread
9
+ - `[prompt...]` (optional): Natural-language scope, requirements, or constraints for the plan.
10
+
11
+ ## Instructions
12
+
13
+ 1. Call `plan_context`, then `plan_init` if the supplied plan does not exist.
14
+ 2. In foreground mode, if `prompt` is not provided, ask the user "What would you like to plan?". If its clear from recent chat or branch name what is going to be worked on, provide options for the user to choose from along with a free text entry option. Use `ask_user_question` only for decisions that materially change scope.
15
+ 3. In background mode, never ask; record safe assumptions and stop with a blocker if ambiguity cannot be resolved.
16
+ 4. Once goal is understood, ground the plan in repository files and the supplied prompt if chat has not established this context..
17
+ 5. Use `plan_update_overview`, `plan_add_phase`, and `plan_update_phase` to create the plan. Use the planning tools to enforce the declared requirements, references, phase dependencies, file scopes, steps, and acceptance criteria; do not write PLAN.md by hand when a tool can make the change.
18
+ 6. Create one implementation file per phase at `.diffpi/plan/<plan-id>/implementation/phase-<phase-id>.md`. Fill in the implementation template with the phase summary, file tree, public APIs and data contracts, required libraries or algorithms, and implementation constraints. Keep each phase focused on one or two modules or libraries, preferably one. The only exception is when scaffolding structures for new projects/modules/libraries/etc.
19
+ 7. Keep Design near 300 words and call `plan_validate` in the background.
20
+ 8. After validation, if in foreground mode, notify the user that you will continue updating the plan with continued conversation. In background mode, finish planning and notify the user that they can explicitly call `/plan update` if they want to make updates and re-enter plan mode. Also notify them to use `/plan finalize` when ready for implementation.
@@ -0,0 +1,18 @@
1
+ # update
2
+
3
+ ## Arguments
4
+
5
+ - **Invocation:** `/plan update [short-slug] [--branch <name>] [--bg] [instructions...]`
6
+ - `[short-slug]` (optional): Plan to update. Omit it only when exactly one plan candidate is selected.
7
+ - `--branch <name>` (optional): Branch metadata used to select or update the plan. It does not create or switch branches.
8
+ - `--bg` (optional): Whether workflow is running in a bacground agent or main chat thread.
9
+ - `[instructions...]` (optional): Natural-language changes to apply after the current plan review.
10
+
11
+ ## Instructions
12
+
13
+ 1. Call `plan_context` with the supplied slug and branch metadata. Infer slug based on recency/chat if not provided.
14
+ 2. Call `plan_review` before interpreting the supplied instructions. It returns the latest immutable tuicr review dump for the current plan revision. If no review exists, continue with the supplied instructions alone.
15
+ 3. Apply the review feedback and then the explicit instructions through `plan_update_overview`, `plan_add_phase`, `plan_remove_phase`, or `plan_update_phase`. Updating the plan advances its revision, so the review dump will not be applied again.
16
+ 4. In foreground mode, use `ask_user_question` for requests which need further discussion. In background mode, do not ask; address with best effort.
17
+ 5. Call `plan_validate` and address any issues.
18
+ 6. Tell the user they can continue updating the plan through chat, run `/plan annotate` for another review, finalize with `/plan finalize`, or proceed to implementation.
@@ -0,0 +1,8 @@
1
+ # address
2
+
3
+ 1. Read `Arguments.target` and `Arguments.local`.
4
+ 2. Call `review_context`.
5
+ 3. In local mode, call `review_dump`. This saves one immutable review revision and removes the completed tuicr session. Apply its feedback to the working tree, run relevant checks, then call `review_launch_ui` with `local: true` to begin the next revision. Local reviews have no replies or resolution state.
6
+ 4. In remote mode, call `review_comments`. Classify every thread and apply only justified changes. Run relevant checks and commit fixes through `/git commit --no-push` when code changes.
7
+ 5. For remote threads, call `review_respond` with a concise outcome. Leave the thread open unless the user explicitly requested resolution.
8
+ 6. Report changed, answered, skipped, and remaining items. Do not publish, complete, or merge.
@@ -0,0 +1,8 @@
1
+ # auto
2
+
3
+ 1. Read `Arguments.target` and `Arguments.local`.
4
+ 2. Call `review_context` with the selected target and backend.
5
+ 3. Create or open the review with `review_new` or `review_edit`.
6
+ 4. Run `review_gates`, then call `review_diff` and review only that change.
7
+ 5. Produce grounded findings and call `review_submit`. Local findings stay in tuicr. Remote findings stay pending until `/review publish`.
8
+ 6. Report the backend, findings, gate results, artifact, and launch instruction. Do not publish, complete, or merge.