@imdeadpool/guardex 7.0.16 → 7.0.18

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.
@@ -2,8 +2,8 @@
2
2
  set -euo pipefail
3
3
 
4
4
  if [[ $# -lt 1 ]]; then
5
- echo "Usage: $0 <plan-slug> [role ...]"
6
- echo "Example: $0 stabilize-dashboard planner architect critic executor writer verifier"
5
+ echo "Usage: $0 <plan-slug> [agent-role ...]"
6
+ echo "Example: $0 add-ralplan-openspec-plan-export planner architect critic executor writer verifier"
7
7
  exit 1
8
8
  fi
9
9
 
@@ -11,10 +11,14 @@ PLAN_SLUG="$1"
11
11
  shift || true
12
12
 
13
13
  if [[ "$PLAN_SLUG" =~ [^a-z0-9-] ]]; then
14
- echo "Error: plan slug must be kebab-case (lowercase letters, numbers, hyphens)." >&2
14
+ echo "Error: plan slug must be kebab-case (lowercase letters, numbers, hyphens)."
15
15
  exit 1
16
16
  fi
17
17
 
18
+ to_kebab() {
19
+ printf '%s' "$1" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9]+/-/g; s/^-+//; s/-+$//'
20
+ }
21
+
18
22
  if [[ $# -gt 0 ]]; then
19
23
  ROLES=("$@")
20
24
  else
@@ -24,137 +28,635 @@ fi
24
28
  PLAN_DIR="openspec/plan/${PLAN_SLUG}"
25
29
  mkdir -p "$PLAN_DIR"
26
30
 
27
- write_if_missing() {
28
- local file="$1"
29
- shift
30
- if [[ ! -f "$file" ]]; then
31
- mkdir -p "$(dirname "$file")"
32
- cat > "$file" <<EOF
33
- $*
34
- EOF
35
- fi
36
- }
37
-
38
- write_if_missing "$PLAN_DIR/summary.md" "# Plan Summary: ${PLAN_SLUG}
31
+ if [[ ! -f "$PLAN_DIR/summary.md" ]]; then
32
+ cat > "$PLAN_DIR/summary.md" <<SUMEOF
33
+ # Plan Summary: ${PLAN_SLUG}
39
34
 
40
35
  - **Mode:** ralplan
41
36
  - **Status:** draft
42
37
 
43
38
  ## Context
44
39
 
45
- Describe the problem, constraints, and intended outcomes.
46
- "
40
+ Describe the planning context, constraints, and desired outcomes.
41
+ SUMEOF
42
+ fi
47
43
 
48
- write_if_missing "$PLAN_DIR/checkpoints.md" "# Plan Checkpoints: ${PLAN_SLUG}
44
+ if [[ ! -f "$PLAN_DIR/checkpoints.md" ]]; then
45
+ cat > "$PLAN_DIR/checkpoints.md" <<CPTEOF
46
+ # Plan Checkpoints: ${PLAN_SLUG}
49
47
 
50
48
  Chronological checkpoint log for all roles.
51
- "
52
49
 
53
- write_if_missing "$PLAN_DIR/README.md" "# Plan Workspace: ${PLAN_SLUG}
50
+ CPTEOF
51
+ fi
52
+
53
+ if [[ ! -f "$PLAN_DIR/README.md" ]]; then
54
+ {
55
+ echo "# Plan Workspace: ${PLAN_SLUG}"
56
+ echo
57
+ echo "This folder stores durable planning artifacts before implementation changes."
58
+ echo
59
+ echo "## Role folders"
60
+ for role in "${ROLES[@]}"; do
61
+ echo "- \`${role}/\`"
62
+ done
63
+ echo
64
+ echo "Each role folder contains OpenSpec-style artifacts:"
65
+ echo "- \`.openspec.yaml\`"
66
+ echo "- \`proposal.md\`"
67
+ echo "- \`tasks.md\` (Spec / Tests / Implementation / Checkpoints checklists)"
68
+ echo "- \`specs/<role>/spec.md\`"
69
+ echo "Planner also gets \`plan.md\`; executor also gets \`checkpoints.md\`."
70
+ echo "Planner plans should follow \`openspec/plan/PLANS.md\`."
71
+ } > "$PLAN_DIR/README.md"
72
+ fi
73
+
74
+ if [[ ! -f "$PLAN_DIR/coordinator-prompt.md" ]]; then
75
+ cat > "$PLAN_DIR/coordinator-prompt.md" <<COORDPROMPTEOF
76
+ # Master Coordinator Prompt
77
+
78
+ You are the coordinator for plan \`${PLAN_SLUG}\`.
79
+
80
+ ## Objective
81
+
82
+ Drive this plan from draft to execution-ready status with strict checkpoint discipline and no scope drift.
83
+
84
+ ## Source-of-truth artifacts
85
+
86
+ - \`openspec/plan/${PLAN_SLUG}/summary.md\`
87
+ - \`openspec/plan/${PLAN_SLUG}/checkpoints.md\`
88
+ - \`openspec/plan/${PLAN_SLUG}/planner/plan.md\`
89
+ - role \`tasks.md\` files for planner/architect/critic/executor/writer/verifier
90
+
91
+ ## Coordinator responsibilities
92
+
93
+ 1. Keep checkpoints current in each role \`tasks.md\` and root \`checkpoints.md\`.
94
+ 2. Ensure each role has explicit acceptance criteria and verification evidence.
95
+ 3. Prevent implementation from starting before planning gates are complete.
96
+ 4. Keep handoffs concise: files changed, behavior touched, verification output, risks.
97
+
98
+ ## Wave-splitting decision (optional)
99
+
100
+ Create wave prompts in \`kickoff-prompts.md\` only when at least one applies:
101
+
102
+ - 3+ independent implementation lanes can run in parallel.
103
+ - Runtime cutover/rollback sequencing needs explicit lane ownership.
104
+ - Risk is high enough that bounded execution packets reduce coordination mistakes.
105
+
106
+ If wave splitting is not needed, keep execution under a single owner with normal role checkpoints.
107
+
108
+ ## Exit criteria
109
+
110
+ - All role checkpoints required for planning are done.
111
+ - Execution lanes (if any) have clear ownership boundaries.
112
+ - Verification plan and rollback expectations are explicit and testable.
113
+ COORDPROMPTEOF
114
+ fi
115
+
116
+ if [[ ! -f "$PLAN_DIR/kickoff-prompts.md" ]]; then
117
+ cat > "$PLAN_DIR/kickoff-prompts.md" <<KICKOFFPROMPTEOF
118
+ # Kickoff Prompts (Copy/Paste)
119
+
120
+ Use these only when the coordinator decides wave-splitting is needed.
121
+
122
+ ## Prompt A — Wave A (Primary lane)
123
+
124
+ \`\`\`text
125
+ You own Wave-A for plan \`${PLAN_SLUG}\` in /home/deadpool/Documents/codex-lb.
126
+
127
+ Goal:
128
+ Implement the assigned Wave-A scope and return verification evidence.
129
+
130
+ Hard constraints:
131
+ - You are not alone in the codebase; do not revert others' work.
132
+ - Stay in your owned files/modules only.
133
+ - Record explicit handoff notes for integration.
134
+
135
+ Owned scope:
136
+ - <fill owned files/modules>
137
+
138
+ Verification:
139
+ - <fill commands>
140
+
141
+ Handoff format:
142
+ - Files changed
143
+ - Behavior touched
144
+ - Verification outputs
145
+ - Risks/follow-ups
146
+ \`\`\`
147
+
148
+ ## Prompt B — Wave B (Secondary lane)
149
+
150
+ \`\`\`text
151
+ You own Wave-B for plan \`${PLAN_SLUG}\` in /home/deadpool/Documents/codex-lb.
152
+
153
+ Goal:
154
+ Implement the assigned Wave-B scope and return verification evidence.
155
+
156
+ Hard constraints:
157
+ - You are not alone in the codebase; do not revert others' work.
158
+ - Stay in your owned files/modules only.
159
+ - Record explicit handoff notes for integration.
160
+
161
+ Owned scope:
162
+ - <fill owned files/modules>
163
+
164
+ Verification:
165
+ - <fill commands>
166
+
167
+ Handoff format:
168
+ - Files changed
169
+ - Behavior touched
170
+ - Verification outputs
171
+ - Risks/follow-ups
172
+ \`\`\`
173
+
174
+ ## Prompt C — Wave C (Secondary lane)
175
+
176
+ \`\`\`text
177
+ You own Wave-C for plan \`${PLAN_SLUG}\` in /home/deadpool/Documents/codex-lb.
178
+
179
+ Goal:
180
+ Implement the assigned Wave-C scope and return verification evidence.
181
+
182
+ Hard constraints:
183
+ - You are not alone in the codebase; do not revert others' work.
184
+ - Stay in your owned files/modules only.
185
+ - Record explicit handoff notes for integration.
186
+
187
+ Owned scope:
188
+ - <fill owned files/modules>
189
+
190
+ Verification:
191
+ - <fill commands>
192
+
193
+ Handoff format:
194
+ - Files changed
195
+ - Behavior touched
196
+ - Verification outputs
197
+ - Risks/follow-ups
198
+ \`\`\`
199
+
200
+ ## Prompt D — Integrator lane
201
+
202
+ \`\`\`text
203
+ You are the integrator for plan \`${PLAN_SLUG}\` in /home/deadpool/Documents/codex-lb.
54
204
 
55
- Durable pre-implementation planning workspace.
205
+ Goal:
206
+ Integrate completed waves, resolve conflicts, run final verification, and prepare rollout/cutover notes.
56
207
 
57
- Each role folder includes a copyable \`prompt.md\` for joined Codex helpers.
58
- Helpers reuse the owner branch/worktree, claim the role files they touch, and
59
- leave PR merge + sandbox cleanup to the owner change lane.
208
+ Hard constraints:
209
+ - You are not alone in the codebase; do not revert others' work.
210
+ - Preserve safety-critical behavior unless explicitly planned and tested.
211
+ - Keep final output evidence-first.
60
212
 
61
- Use this command to update checkpoints:
213
+ Owned scope:
214
+ - integration glue and shared touchpoints
215
+ - final validation + handoff summary
62
216
 
63
- \`\`\`bash
64
- /opsx:checkpoint ${PLAN_SLUG} <role> <checkpoint-id> <state> <note...>
217
+ Verification:
218
+ - <fill commands>
219
+
220
+ Final report:
221
+ - Files changed
222
+ - Integration decisions
223
+ - Verification outputs
224
+ - Remaining risks
65
225
  \`\`\`
66
- "
226
+ KICKOFFPROMPTEOF
227
+ fi
228
+
229
+ if [[ ! -f "$PLAN_DIR/phases.md" ]]; then
230
+ cat > "$PLAN_DIR/phases.md" <<PHASESEOF
231
+ # Plan Phases: ${PLAN_SLUG}
232
+
233
+ One entry per phase. Checkbox marks map to: \`x\` = completed, \`>\` = in progress, space = pending.
234
+ Indented sub-bullets are optional metadata consumed by the Plans UI:
235
+
236
+ - \`session\`: which agent kind runs the phase (\`codex\` / \`claude\`).
237
+ - \`checkpoints\`: comma-separated role checkpoint ids delivered within the phase.
238
+ - \`summary\`: one short sentence rendered under the phase title.
239
+
240
+ One phase is intended to fit into a single Codex or Claude session task.
241
+
242
+ - [ ] [PH01] First milestone title goes here
243
+ - session: codex
244
+ - checkpoints: P1, A1
245
+ - summary: Describe the single session outcome expected for this phase.
246
+ PHASESEOF
247
+ fi
248
+
249
+ for role in "${ROLES[@]}"; do
250
+ ROLE_DIR="$PLAN_DIR/$role"
251
+ mkdir -p "$ROLE_DIR"
252
+
253
+ if [[ ! -f "$ROLE_DIR/README.md" ]]; then
254
+ cat > "$ROLE_DIR/README.md" <<ROLEEOF
255
+ # ${role}
256
+
257
+ Role workspace for \`${role}\`.
258
+
259
+ Default artifacts:
260
+ - \`.openspec.yaml\`
261
+ - \`proposal.md\`
262
+ - \`tasks.md\`
263
+ - \`specs/<role>/spec.md\`
264
+
265
+ Use this folder for role notes, artifacts, and status updates.
266
+ ROLEEOF
267
+ fi
268
+
269
+ ROLE_SPEC_SLUG="$(to_kebab "$role")"
270
+ if [[ -z "$ROLE_SPEC_SLUG" ]]; then
271
+ ROLE_SPEC_SLUG="role"
272
+ fi
273
+
274
+ if [[ ! -f "$ROLE_DIR/.openspec.yaml" ]]; then
275
+ cat > "$ROLE_DIR/.openspec.yaml" <<ROLEYAMLEOF
276
+ schema: 1
277
+ plan: ${PLAN_SLUG}
278
+ role: ${role}
279
+ status: draft
280
+ artifacts:
281
+ proposal: proposal.md
282
+ tasks: tasks.md
283
+ spec: specs/${ROLE_SPEC_SLUG}/spec.md
284
+ ROLEYAMLEOF
285
+ fi
286
+
287
+ if [[ ! -f "$ROLE_DIR/proposal.md" ]]; then
288
+ cat > "$ROLE_DIR/proposal.md" <<ROLEPROPOSALEOF
289
+ # Proposal: ${role} (${PLAN_SLUG})
290
+
291
+ ## Why
292
+
293
+ Summarize why this role's work is required for plan \`${PLAN_SLUG}\`.
294
+
295
+ ## What Changes
67
296
 
68
- write_if_missing "$PLAN_DIR/planner/plan.md" "# ExecPlan: ${PLAN_SLUG}
297
+ - [ ] List the planned role-specific changes
69
298
 
70
- This document is a living plan. Keep progress and decisions current.
299
+ ## Impact
300
+
301
+ - Scope:
302
+ - Risks:
303
+ - Dependencies:
304
+ ROLEPROPOSALEOF
305
+ fi
306
+
307
+ ROLE_SPEC_DIR="$ROLE_DIR/specs/$ROLE_SPEC_SLUG"
308
+ mkdir -p "$ROLE_SPEC_DIR"
309
+
310
+ if [[ ! -f "$ROLE_SPEC_DIR/spec.md" ]]; then
311
+ cat > "$ROLE_SPEC_DIR/spec.md" <<ROLESPECEOF
312
+ # Capability Spec: ${role}
313
+
314
+ ## ADDED Requirements
315
+
316
+ ### Requirement: ${role} responsibilities for \`${PLAN_SLUG}\`
317
+ This role MUST define and deliver its scoped outputs with evidence.
318
+
319
+ #### Scenario: Role executes assigned scope
320
+ - **WHEN** the role begins execution for \`${PLAN_SLUG}\`
321
+ - **THEN** it follows \`tasks.md\` and records evidence for completion
322
+ ROLESPECEOF
323
+ fi
324
+
325
+ if [[ "$role" == "planner" && ! -f "$ROLE_DIR/plan.md" ]]; then
326
+ cat > "$ROLE_DIR/plan.md" <<PLANEOF
327
+ # ExecPlan: ${PLAN_SLUG}
328
+
329
+ This ExecPlan is a living document. Keep \`Progress\`, \`Surprises & Discoveries\`, \`Decision Log\`, and \`Outcomes & Retrospective\` current as work proceeds.
330
+
331
+ Follow repository guidance in \`openspec/plan/PLANS.md\`.
71
332
 
72
333
  ## Purpose / Big Picture
73
334
 
335
+ Describe what becomes possible after this plan is executed and how a user/operator can observe it working.
336
+
74
337
  ## Progress
75
338
 
76
- - [ ] Initial draft
77
- - [ ] Review + iterate
78
- - [ ] Approved for execution
339
+ - [ ] (YYYY-MM-DD HH:MMZ) Capture initial scope and acceptance criteria.
340
+ - [ ] (YYYY-MM-DD HH:MMZ) Draft architecture/tradeoff plan and verification strategy.
341
+ - [ ] (YYYY-MM-DD HH:MMZ) Finalize execution-ready handoff.
79
342
 
80
343
  ## Surprises & Discoveries
81
344
 
345
+ - Observation: _none yet_
346
+ Evidence: _n/a_
347
+
82
348
  ## Decision Log
83
349
 
350
+ - Decision: Use OpenSpec plan workspace as source of truth for this planning cycle.
351
+ Rationale: Keeps planning artifacts in-repo and reviewable.
352
+ Date/Author: YYYY-MM-DD / planner
353
+
84
354
  ## Outcomes & Retrospective
85
355
 
356
+ Summarize outcomes, gaps, and lessons learned when a milestone or the full plan is completed.
357
+
358
+ ## Context and Orientation
359
+
360
+ Describe relevant modules, files, constraints, and assumptions for a newcomer. Use repository-relative paths.
361
+
362
+ ## Plan of Work
363
+
364
+ Describe the sequence of edits and deliverables in prose. Name target files and expected effects.
365
+
366
+ ## Concrete Steps
367
+
368
+ List exact commands with working directory and short expected outcomes.
369
+
370
+ cd /home/deadpool/Documents/codex-lb
371
+ openspec validate --specs
372
+
86
373
  ## Validation and Acceptance
87
- "
88
374
 
89
- for role in "${ROLES[@]}"; do
90
- ROLE_DIR="$PLAN_DIR/$role"
91
- mkdir -p "$ROLE_DIR"
375
+ State observable behavior and verification evidence required before execution handoff.
92
376
 
93
- write_if_missing "$ROLE_DIR/README.md" "# ${role}
377
+ ## Idempotence and Recovery
94
378
 
95
- Role workspace for \`${role}\`.
96
- "
379
+ Document safe re-run behavior, rollback strategy, and failure recovery notes.
97
380
 
98
- write_if_missing "$ROLE_DIR/prompt.md" "# ${role} prompt
381
+ ## Artifacts and Notes
99
382
 
100
- You are the \`${role}\` lane for shared plan \`${PLAN_SLUG}\`.
383
+ Capture concise command output snippets, evidence pointers, and references.
101
384
 
102
- ## Scope
385
+ ## Interfaces and Dependencies
103
386
 
104
- - Work inside \`openspec/plan/${PLAN_SLUG}/${role}/\` plus directly-related shared plan files you explicitly claim.
105
- - Reuse the owner's branch/worktree instead of creating a separate sandbox unless the owner says otherwise.
387
+ Name concrete interfaces/modules/dependencies and any required signatures/contracts.
106
388
 
107
- ## Ownership
389
+ ## Revision Note
108
390
 
109
- - Before editing, claim this role's files in the shared owner lane:
110
- \`python3 scripts/agent-file-locks.py claim --branch <owner-branch> openspec/plan/${PLAN_SLUG}/${role}/README.md openspec/plan/${PLAN_SLUG}/${role}/prompt.md openspec/plan/${PLAN_SLUG}/${role}/tasks.md openspec/plan/${PLAN_SLUG}/checkpoints.md\`
111
- - Record branch, worktree, and scope in \`tasks.md\`.
112
- - Do not change another role's files without reassignment.
391
+ - YYYY-MM-DD HH:MMZ: Initial scaffold generated by \`scripts/openspec/init-plan-workspace.sh\`.
392
+ PLANEOF
393
+ fi
394
+
395
+ if [[ "$role" == "executor" && ! -f "$ROLE_DIR/checkpoints.md" ]]; then
396
+ cat > "$ROLE_DIR/checkpoints.md" <<EXCCPTEOF
397
+ # executor checkpoints
398
+
399
+ Timestamped execution checkpoints for \`${PLAN_SLUG}\`.
400
+
401
+ EXCCPTEOF
402
+ fi
403
+
404
+ if [[ ! -f "$ROLE_DIR/tasks.md" ]]; then
405
+ case "$role" in
406
+ planner)
407
+ cat > "$ROLE_DIR/tasks.md" <<TASKEOF
408
+ # planner tasks
409
+
410
+ ## 1. Spec
411
+
412
+ - [ ] 1.1 Define planning principles, decision drivers, and viable options for \`${PLAN_SLUG}\`
413
+ - [ ] 1.2 Validate that scope, constraints, and acceptance criteria are captured in \`summary.md\`
414
+
415
+ ## 2. Tests
416
+
417
+ - [ ] 2.1 Define verification approach for plan quality (traceability, testability, evidence expectations)
418
+ - [ ] 2.2 Validate OpenSpec consistency checkpoints (including \`openspec validate --specs\` when applicable)
419
+
420
+ ## 3. Implementation
421
+
422
+ - [ ] 3.1 Produce the initial RALPLAN-DR plan draft
423
+ - [ ] 3.2 Integrate Architect/Critic feedback into revised plan iterations
424
+ - [ ] 3.3 Publish final planning handoff with explicit execution lanes
425
+
426
+ ## 4. Checkpoints
427
+
428
+ - [ ] [P1] READY - Initial planning draft checkpoint
429
+
430
+ ## 5. Collaboration
431
+
432
+ - [ ] 5.1 Owner recorded this lane before edits.
433
+ - [ ] 5.2 Record joined agents / handoffs, or mark \`N/A\` when solo.
434
+
435
+ ## 6. Cleanup
436
+
437
+ - [ ] 6.1 If this lane owns finalization, run \`gx branch finish --branch <agent-branch> --base dev --via-pr --wait-for-merge --cleanup\`.
438
+ - [ ] 6.2 Record PR URL + final \`MERGED\` state in the handoff.
439
+ - [ ] 6.3 Confirm sandbox cleanup (\`git worktree list\`, \`git branch -a\`) or append \`BLOCKED:\` and stop.
440
+ TASKEOF
441
+ ;;
442
+ architect)
443
+ cat > "$ROLE_DIR/tasks.md" <<TASKEOF
444
+ # architect tasks
445
+
446
+ ## 1. Spec
447
+
448
+ - [ ] 1.1 Define ownership boundaries, interfaces, and artifact responsibilities for \`${PLAN_SLUG}\`
449
+ - [ ] 1.2 Validate architecture constraints and non-functional requirements coverage
450
+
451
+ ## 2. Tests
452
+
453
+ - [ ] 2.1 Define architectural verification checkpoints (integration boundaries, failure modes, compatibility)
454
+ - [ ] 2.2 Validate that acceptance criteria map to concrete architecture decisions
455
+
456
+ ## 3. Implementation
457
+
458
+ - [ ] 3.1 Review plan for strongest antithesis/tradeoff tensions
459
+ - [ ] 3.2 Propose synthesis path and guardrails for implementation teams
460
+ - [ ] 3.3 Record architecture sign-off notes for downstream execution
461
+
462
+ ## 4. Checkpoints
463
+
464
+ - [ ] [A1] READY - Architecture review checkpoint
465
+
466
+ ## 5. Collaboration
467
+
468
+ - [ ] 5.1 Owner recorded this lane before edits.
469
+ - [ ] 5.2 Record joined agents / handoffs, or mark \`N/A\` when solo.
470
+
471
+ ## 6. Cleanup
472
+
473
+ - [ ] 6.1 If this lane owns finalization, run \`gx branch finish --branch <agent-branch> --base dev --via-pr --wait-for-merge --cleanup\`.
474
+ - [ ] 6.2 Record PR URL + final \`MERGED\` state in the handoff.
475
+ - [ ] 6.3 Confirm sandbox cleanup (\`git worktree list\`, \`git branch -a\`) or append \`BLOCKED:\` and stop.
476
+ TASKEOF
477
+ ;;
478
+ critic)
479
+ cat > "$ROLE_DIR/tasks.md" <<TASKEOF
480
+ # critic tasks
481
+
482
+ ## 1. Spec
483
+
484
+ - [ ] 1.1 Validate principle-driver-option consistency across the plan
485
+ - [ ] 1.2 Validate risks, consequences, and mitigation clarity (including idempotency expectations)
486
+
487
+ ## 2. Tests
488
+
489
+ - [ ] 2.1 Validate testability and measurability of all acceptance criteria
490
+ - [ ] 2.2 Validate verification steps are concrete and reproducible
491
+
492
+ ## 3. Implementation
493
+
494
+ - [ ] 3.1 Produce verdict (APPROVE / ITERATE / REJECT) with actionable feedback
495
+ - [ ] 3.2 Confirm revised drafts resolve prior findings before approval
496
+ - [ ] 3.3 Publish final quality/risk sign-off notes
497
+
498
+ ## 4. Checkpoints
499
+
500
+ - [ ] [C1] READY - Quality gate checkpoint
113
501
 
114
- ## Deliverables
502
+ ## 5. Collaboration
503
+
504
+ - [ ] 5.1 Owner recorded this lane before edits.
505
+ - [ ] 5.2 Record joined agents / handoffs, or mark \`N/A\` when solo.
506
+
507
+ ## 6. Cleanup
508
+
509
+ - [ ] 6.1 If this lane owns finalization, run \`gx branch finish --branch <agent-branch> --base dev --via-pr --wait-for-merge --cleanup\`.
510
+ - [ ] 6.2 Record PR URL + final \`MERGED\` state in the handoff.
511
+ - [ ] 6.3 Confirm sandbox cleanup (\`git worktree list\`, \`git branch -a\`) or append \`BLOCKED:\` and stop.
512
+ TASKEOF
513
+ ;;
514
+ executor)
515
+ cat > "$ROLE_DIR/tasks.md" <<TASKEOF
516
+ # executor tasks
517
+
518
+ ## 1. Spec
519
+
520
+ - [ ] 1.1 Map approved plan requirements to concrete implementation work items
521
+ - [ ] 1.2 Validate touched components/files are explicitly listed before coding starts
522
+
523
+ ## 2. Tests
524
+
525
+ - [ ] 2.1 Define test additions/updates required to lock intended behavior
526
+ - [ ] 2.2 Validate regression and smoke verification commands for delivery
527
+
528
+ ## 3. Implementation
529
+
530
+ - [ ] 3.1 Execute implementation tasks in approved order
531
+ - [ ] 3.2 Keep progress and evidence linked back to plan checkpoints
532
+ - [ ] 3.3 Complete final verification bundle for handoff
533
+
534
+ ## 4. Checkpoints
535
+
536
+ - [ ] [E1] READY - Execution start checkpoint
537
+
538
+ ## 5. Collaboration
539
+
540
+ - [ ] 5.1 Owner recorded this lane before edits.
541
+ - [ ] 5.2 Record joined agents / handoffs, or mark \`N/A\` when solo.
542
+
543
+ ## 6. Cleanup
544
+
545
+ - [ ] 6.1 If this lane owns finalization, run \`gx branch finish --branch <agent-branch> --base dev --via-pr --wait-for-merge --cleanup\`.
546
+ - [ ] 6.2 Record PR URL + final \`MERGED\` state in the handoff.
547
+ - [ ] 6.3 Confirm sandbox cleanup (\`git worktree list\`, \`git branch -a\`) or append \`BLOCKED:\` and stop.
548
+ TASKEOF
549
+ ;;
550
+ writer)
551
+ cat > "$ROLE_DIR/tasks.md" <<TASKEOF
552
+ # writer tasks
553
+
554
+ ## 1. Spec
555
+
556
+ - [ ] 1.1 Validate documentation scope and audience for \`${PLAN_SLUG}\`
557
+ - [ ] 1.2 Validate consistency between plan terminology and OpenSpec artifacts
558
+
559
+ ## 2. Tests
115
560
 
116
- - Complete the role checklist in \`tasks.md\`.
117
- - Leave a handoff with files changed, verification, and risks.
118
- - The owner alone runs the change completion flow and sandbox cleanup after change tasks 4.1-4.3 are done.
119
- "
561
+ - [ ] 2.1 Define documentation verification checklist (accuracy, completeness, command correctness)
562
+ - [ ] 2.2 Validate command/help text examples against current workflow behavior
120
563
 
121
- write_if_missing "$ROLE_DIR/tasks.md" "# ${role} tasks
564
+ ## 3. Implementation
565
+
566
+ - [ ] 3.1 Update workflow docs and command guidance for approved plan behavior
567
+ - [ ] 3.2 Add or refine examples for operator usage and handoff clarity
568
+ - [ ] 3.3 Publish final docs change summary with references
569
+
570
+ ## 4. Checkpoints
571
+
572
+ - [ ] [W1] READY - Docs update checkpoint
573
+
574
+ ## 5. Collaboration
575
+
576
+ - [ ] 5.1 Owner recorded this lane before edits.
577
+ - [ ] 5.2 Record joined agents / handoffs, or mark \`N/A\` when solo.
578
+
579
+ ## 6. Cleanup
580
+
581
+ - [ ] 6.1 If this lane owns finalization, run \`gx branch finish --branch <agent-branch> --base dev --via-pr --wait-for-merge --cleanup\`.
582
+ - [ ] 6.2 Record PR URL + final \`MERGED\` state in the handoff.
583
+ - [ ] 6.3 Confirm sandbox cleanup (\`git worktree list\`, \`git branch -a\`) or append \`BLOCKED:\` and stop.
584
+ TASKEOF
585
+ ;;
586
+ verifier)
587
+ cat > "$ROLE_DIR/tasks.md" <<TASKEOF
588
+ # verifier tasks
589
+
590
+ ## 1. Spec
591
+
592
+ - [ ] 1.1 Define end-to-end validation matrix for \`${PLAN_SLUG}\`
593
+ - [ ] 1.2 Validate success/failure conditions and evidence requirements
122
594
 
123
- ## Ownership
595
+ ## 2. Tests
596
+
597
+ - [ ] 2.1 Execute verification commands and collect outputs
598
+ - [ ] 2.2 Validate idempotency/re-run behavior and error-path handling
599
+
600
+ ## 3. Implementation
601
+
602
+ - [ ] 3.1 Verify completed work against acceptance criteria
603
+ - [ ] 3.2 Produce pass/fail findings with concrete evidence links
604
+ - [ ] 3.3 Publish final verification sign-off (or blocker report)
605
+
606
+ ## 4. Checkpoints
124
607
 
125
- - [ ] Claim this role's files in the shared owner branch/worktree before editing.
126
- - [ ] Record branch, worktree, and scope for this role.
127
- - [ ] Copy or hand off \`prompt.md\` when another agent joins this role.
608
+ - [ ] [V1] READY - Verification checkpoint
609
+
610
+ ## 5. Collaboration
611
+
612
+ - [ ] 5.1 Owner recorded this lane before edits.
613
+ - [ ] 5.2 Record joined agents / handoffs, or mark \`N/A\` when solo.
614
+
615
+ ## 6. Cleanup
616
+
617
+ - [ ] 6.1 If this lane owns finalization, run \`gx branch finish --branch <agent-branch> --base dev --via-pr --wait-for-merge --cleanup\`.
618
+ - [ ] 6.2 Record PR URL + final \`MERGED\` state in the handoff.
619
+ - [ ] 6.3 Confirm sandbox cleanup (\`git worktree list\`, \`git branch -a\`) or append \`BLOCKED:\` and stop.
620
+ TASKEOF
621
+ ;;
622
+ *)
623
+ cat > "$ROLE_DIR/tasks.md" <<TASKEOF
624
+ # ${role} tasks
128
625
 
129
626
  ## 1. Spec
130
627
 
131
- - [ ] Define requirements and scope for ${role}
132
- - [ ] Confirm acceptance criteria are explicit and testable
628
+ - [ ] 1.1 Define ${role}-specific requirements and acceptance criteria
629
+ - [ ] 1.2 Validate relevant OpenSpec/spec artifacts
133
630
 
134
631
  ## 2. Tests
135
632
 
136
- - [ ] Define verification approach and evidence requirements
137
- - [ ] List concrete commands for verification
633
+ - [ ] 2.1 Define verification scope for ${role}
634
+ - [ ] 2.2 Confirm regression coverage expectations
138
635
 
139
636
  ## 3. Implementation
140
637
 
141
- - [ ] Execute role-specific deliverables
142
- - [ ] Capture decisions, risks, and handoff notes
638
+ - [ ] 3.1 Execute ${role} deliverables for this plan
639
+ - [ ] 3.2 Record handoff/status notes for downstream roles
640
+ - [ ] 3.3 Mark completion with evidence links
143
641
 
144
642
  ## 4. Checkpoints
145
643
 
146
- - [ ] Publish checkpoint update for this role
644
+ - [ ] [${role^^}1] READY - Role checkpoint
147
645
 
148
646
  ## 5. Collaboration
149
647
 
150
- - [ ] Leave a role handoff with files changed, verification, and risks.
151
- - [ ] Owner records \`accept\`, \`revise\`, or \`reject\` for joined output, or marks \`N/A\` if no helper joined.
648
+ - [ ] 5.1 Owner recorded this lane before edits.
649
+ - [ ] 5.2 Record joined agents / handoffs, or mark \`N/A\` when solo.
152
650
 
153
- ## 6. Completion
651
+ ## 6. Cleanup
154
652
 
155
- - [ ] Keep sandbox cleanup blocked until change tasks 4.1-4.3 are complete.
156
- "
653
+ - [ ] 6.1 If this lane owns finalization, run \`gx branch finish --branch <agent-branch> --base dev --via-pr --wait-for-merge --cleanup\`.
654
+ - [ ] 6.2 Record PR URL + final \`MERGED\` state in the handoff.
655
+ - [ ] 6.3 Confirm sandbox cleanup (\`git worktree list\`, \`git branch -a\`) or append \`BLOCKED:\` and stop.
656
+ TASKEOF
657
+ ;;
658
+ esac
659
+ fi
157
660
  done
158
661
 
159
- echo "[gitguardex] OpenSpec plan workspace ready: ${PLAN_DIR}"
160
- echo "[gitguardex] Roles: ${ROLES[*]}"
662
+ echo "Plan workspace ready: $PLAN_DIR"