@plainconceptsplatform/agent-harness 3.2.0 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +454 -452
  3. package/cli/commands/join.js +259 -259
  4. package/cli/commands/migrate.js +310 -310
  5. package/cli/commands/shared.js +27 -27
  6. package/cli/commands/single.js +79 -79
  7. package/cli/commands/update.js +121 -121
  8. package/cli/commands/wizard.js +134 -134
  9. package/cli/fragments/archive/az.md +97 -97
  10. package/cli/fragments/archive/gh.md +96 -96
  11. package/cli/fragments/archive/gl.md +96 -96
  12. package/cli/fragments/archive/none.md +75 -75
  13. package/cli/fragments/guardrails/codegraph.md +5 -5
  14. package/cli/fragments/guardrails/humanizer.md +4 -4
  15. package/cli/fragments/guardrails/memory.md +4 -4
  16. package/cli/fragments/guardrails/rtk.md +3 -3
  17. package/cli/fragments/guardrails/simple-english.md +4 -4
  18. package/cli/fragments/ops-backlog/az.md +28 -28
  19. package/cli/fragments/ops-backlog/gh.md +28 -28
  20. package/cli/fragments/ops-backlog/jira.md +28 -28
  21. package/cli/fragments/ops-review/az.md +62 -62
  22. package/cli/fragments/ops-review/gh.md +51 -51
  23. package/cli/fragments/ops-review/gl.md +55 -55
  24. package/cli/fragments/ops-ship/az.md +81 -81
  25. package/cli/fragments/ops-ship/gh.md +67 -67
  26. package/cli/fragments/ops-ship/gl.md +84 -84
  27. package/cli/index.js +116 -116
  28. package/cli/presets/agents-content.json +34 -34
  29. package/cli/presets/browser.json +10 -10
  30. package/cli/presets/clean.json +21 -21
  31. package/cli/presets/models.json +68 -68
  32. package/cli/presets/optimization.json +32 -32
  33. package/cli/presets/platforms.json +76 -76
  34. package/cli/presets/source.json +23 -23
  35. package/cli/steps/browser/index.js +48 -48
  36. package/cli/steps/clean/index.js +120 -120
  37. package/cli/steps/copy/agents.js +120 -120
  38. package/cli/steps/copy/commands.js +79 -79
  39. package/cli/steps/copy/fullstack-engineer.js +89 -89
  40. package/cli/steps/copy/index.js +88 -88
  41. package/cli/steps/copy/opencode-json.js +324 -324
  42. package/cli/steps/copy/skills.js +307 -307
  43. package/cli/steps/metadata/index.js +115 -115
  44. package/cli/steps/models/format.js +88 -88
  45. package/cli/steps/models/index.js +64 -64
  46. package/cli/steps/models/write.js +38 -38
  47. package/cli/steps/openspec/index.js +136 -136
  48. package/cli/steps/optimization/codegraph.js +141 -127
  49. package/cli/steps/optimization/detect.js +66 -66
  50. package/cli/steps/optimization/humanizer.js +17 -17
  51. package/cli/steps/optimization/index.js +158 -158
  52. package/cli/steps/optimization/memory.js +91 -88
  53. package/cli/steps/optimization/patch-guardrails.js +111 -111
  54. package/cli/steps/optimization/simple-english.js +17 -17
  55. package/cli/steps/optimization/skills-lock.js +30 -30
  56. package/cli/steps/platform/index.js +109 -109
  57. package/cli/steps/source/index.js +123 -123
  58. package/cli/utils/agent-color.js +111 -111
  59. package/cli/utils/copy.js +134 -134
  60. package/cli/utils/exec-spinner.js +47 -47
  61. package/cli/utils/exec.js +134 -134
  62. package/cli/utils/legacy-check.js +30 -30
  63. package/cli/utils/models-cache.js +58 -58
  64. package/cli/utils/models-pricing.js +42 -42
  65. package/cli/utils/paths.js +80 -80
  66. package/cli/utils/process.js +3 -3
  67. package/cli/utils/terminal.js +6 -6
  68. package/cli/utils/update-manifest.js +75 -75
  69. package/harness/.opencode/_gitignore +9 -9
  70. package/harness/.opencode/commands/init.md +5 -5
  71. package/harness/.opencode/commands/make-architecture.md +5 -5
  72. package/harness/.opencode/commands/make-design.md +5 -5
  73. package/harness/.opencode/commands/make-engineer.md +5 -5
  74. package/harness/.opencode/commands/make-guardrails.md +5 -5
  75. package/harness/.opencode/commands/make-user-model.md +5 -5
  76. package/harness/.opencode/commands/ops-backlog.md +10 -10
  77. package/harness/.opencode/commands/ops-review.md +8 -8
  78. package/harness/.opencode/commands/ops-ship.md +9 -9
  79. package/harness/.opencode/commands/plan-apply.md +9 -9
  80. package/harness/.opencode/commands/plan-archive.md +5 -5
  81. package/harness/.opencode/commands/plan-explore.md +9 -9
  82. package/harness/.opencode/commands/plan-goal.md +5 -5
  83. package/harness/.opencode/commands/plan-propose.md +9 -9
  84. package/harness/.opencode/commands/plan-quick.md +5 -5
  85. package/harness/.opencode/commands/plan-story.md +9 -9
  86. package/harness/.opencode/commands/repo-audit.md +5 -5
  87. package/harness/.opencode/commands/repo-help.md +5 -5
  88. package/harness/.opencode/commands/repo-initialize.md +5 -5
  89. package/harness/.opencode/commands/repo-onboard.md +5 -5
  90. package/harness/.opencode/commands/repo-verify.md +5 -5
  91. package/harness/.opencode/package.json +5 -5
  92. package/harness/.opencode/plugins/pc-subagent-monitor.js +184 -184
  93. package/harness/.opencode/plugins/pc-subagent-tiers.js +354 -354
  94. package/harness/.opencode/plugins/pc-system-reminders.js +386 -386
  95. package/harness/.opencode/scripts/check-diff.mjs +26 -7
  96. package/harness/.opencode/scripts/code-rules.mjs +288 -280
  97. package/harness/AGENTS.md +49 -49
  98. package/harness/ARCHITECTURE.md +13 -13
  99. package/harness/DESIGN.md +13 -13
  100. package/harness/opencode.jsonc +36 -36
  101. package/harness/openspec/config.yaml +20 -20
  102. package/harness/skills-lock.json +17 -17
  103. package/package.json +14 -12
  104. package/skills/README.md +18 -18
  105. package/skills/agent-harness-cli/SKILL.md +86 -86
  106. package/skills/browser-automation/SKILL.md +72 -72
  107. package/skills/pc-guardrails-project/SKILL.md +8 -8
  108. package/skills/pc-make-architecture/SKILL.md +32 -32
  109. package/skills/pc-make-architecture/structure-template.md +64 -64
  110. package/skills/pc-make-design/SKILL.md +45 -45
  111. package/skills/pc-make-engineer/SKILL.md +59 -59
  112. package/skills/pc-make-engineer/signal-mapping.md +53 -53
  113. package/skills/pc-make-engineer/template.md +36 -36
  114. package/skills/pc-make-guardrails/SKILL.md +44 -44
  115. package/skills/pc-make-guardrails/category-reference.md +112 -112
  116. package/skills/pc-make-merge-risk-assess/SKILL.md +70 -70
  117. package/skills/pc-make-merge-risk-assess/category-reference.md +114 -114
  118. package/skills/pc-make-user-model/SKILL.md +56 -56
  119. package/skills/pc-ops-ship/SKILL.md +22 -18
  120. package/skills/pc-plan-apply/SKILL.md +86 -86
  121. package/skills/pc-plan-apply/simple-mode.md +21 -21
  122. package/skills/pc-plan-archive/SKILL.md +66 -66
  123. package/skills/pc-plan-explore/SKILL.md +21 -21
  124. package/skills/pc-plan-goal/SKILL.md +91 -91
  125. package/skills/pc-plan-goal/branching.md +39 -39
  126. package/skills/pc-plan-goal/failure-policy.md +30 -30
  127. package/skills/pc-plan-goal/output-mode.md +10 -10
  128. package/skills/pc-plan-goal/output.md +71 -71
  129. package/skills/pc-plan-propose/SKILL.md +125 -125
  130. package/skills/pc-plan-propose/task-annotation.md +39 -39
  131. package/skills/pc-plan-quick/SKILL.md +46 -46
  132. package/skills/pc-plan-story/SKILL.md +93 -93
  133. package/skills/pc-repo-audit/SKILL.md +44 -44
  134. package/skills/pc-repo-help/SKILL.md +87 -87
  135. package/skills/pc-repo-initialize/SKILL.md +119 -119
  136. package/skills/pc-repo-onboard/SKILL.md +32 -32
  137. package/skills/pc-repo-verify/SKILL.md +150 -150
  138. package/skills/pc-userstory-az/SKILL.md +71 -71
  139. package/skills/pc-userstory-browser/SKILL.md +64 -64
  140. package/skills/pc-userstory-gh/SKILL.md +63 -63
  141. package/skills/pc-userstory-jira/SKILL.md +74 -74
@@ -1,86 +1,86 @@
1
- ---
2
- name: pc-plan-apply
3
- description: Implement tasks from a plan. OpenSpec-annotated tasks (from pc-plan-propose) run as parallel subagent waves; Todo pane tasks (from /plan-quick) run sequentially in-session. Load when implementing a prepared plan. Invoked by the /plan-apply command (interactive) and the plan-goal pipeline (autonomous).
4
- license: MIT
5
- ---
6
-
7
- # Plan Apply
8
-
9
- ## Input
10
-
11
- The caller provides (all optional):
12
- - A mode (see below). Default: `interactive`.
13
- - A `start_from` hint: `branch` (default, full protocol from step 1) or `load-plan` (the caller already created the feature branch; skip step 1).
14
-
15
- ## Modes
16
-
17
- - `interactive` (default): report progress to the user and surface failures for their decision.
18
- - `autonomous`: there is no user to return to between waves. Loop until every task is DONE, or until the progress guard or the retry limit trips, then report to the caller, whose failure policy governs. APPLY completes by handing control back to `/plan-goal`, which has four phases left to run: `N/N tasks` is this stage's boundary, not the pipeline's.
19
-
20
- ## Plan source detection
21
-
22
- 1. Check if an OpenSpec change exists: inspect `openspec/changes/` for an active change folder with a `tasks.md`.
23
- 2. If found and tasks have `<!-- agent` annotations (written by `pc-plan-propose`): OpenSpec mode. Follow the protocol below. Annotated tasks run in subagent waves. They never become sequential lead work because the task count seems small, the lead prefers direct implementation, or a worker has not yet been inspected.
24
- 3. If no OpenSpec change exists, but there are `pending` items in the Todo pane (from `/plan-quick`): Simple mode. Follow the [simple mode](simple-mode.md) reference.
25
-
26
- ## OpenSpec mode: parallel subagent waves
27
-
28
- Load `@openspec-apply-change` for change selection, status, and closing. Its own implement step does not apply here: annotated tasks are implemented only by spawning the annotated tier worker, and the lead never implements. Take that step from the protocol below instead.
29
-
30
- Referring to it by number would break silently. `@openspec-apply-change` is installed by `openspec init --force` with no version pinned, so an inserted step upstream renumbers the one being replaced, and the sequential default would then run alongside these waves.
31
-
32
- **Implement via native subagent waves.**
33
-
34
- You are the lead. You orchestrate from this session only; you spawn workers with the native `task` tool. Workers are ephemeral (one batch, then they exit) and navigable (`ctrl+x` arrow down, left/right arrows). There is no board, no claiming, no merging, no external dashboard.
35
-
36
- Core rule: push, don't pull. A worker is born with its work: every `task()` spawn prompt contains the exact task IDs and text it must do. There is no claim step, so a worker can never sit idle waiting for an assignment.
37
-
38
- **1. Branch.** Create `feature/{change-slug}` if not already on one. (Skip this step when the caller passed `start_from: load-plan`.)
39
-
40
- **2. Load the plan and workers.** Parse `tasks.md`. Each task carries `<!-- agent, depends_on, touches -->` (from `pc-plan-propose`). Inspect `.opencode/agents/` for each base engineer and its generated `.<tier>.md` variants. The tier-suffixed name in an annotation (for example, `backend-engineer.build`) is the worker to spawn: `pc-subagent-tiers` resolves its model at startup and registers it as `mode: subagent`. Read `.opencode/harness.json` -> `agents.maxConcurrent` (the wave cap, 1 to 5, enforced by `pc-subagent-monitor`).
41
-
42
- Before hydrating the Todo board, resolve every task's annotated worker. If any task has a blank agent annotation, its base template is missing, or its tier variant is unavailable, stop the APPLY stage and report the task ID, expected worker, and missing file. Do not replace the worker with `fullstack-engineer`, `general`, or the lead session.
43
-
44
- **3. Hydrate the Todo board.** `todowrite` one item per task: `pending`. The Todo pane is the visible subagent board (opencode plugins cannot draw a custom pane, so the native Todo widget is the live UI). While a task is in flight, its label must carry the worker: `<agent> · <model>`: so the pane shows which agent on which model is doing what. The Todo list is a projection only: never read it for recovery; rebuild it from `tasks.md` and git and `.opencode/harness-run.json`.
45
-
46
- **4. Worker context.** Before each wave, derive file-disjointness from `touches:` globs and `git diff`.
47
-
48
- <!-- PC-OPTIMIZATION-CODEGRAPH-START -->
49
- <!-- PC-OPTIMIZATION-CODEGRAPH-END -->
50
-
51
- <!-- PC-OPTIMIZATION-MEMORY-START -->
52
- <!-- PC-OPTIMIZATION-MEMORY-END -->
53
-
54
- **5. The wave loop.** Repeat until no tasks remain:
55
-
56
- ```
57
- eligible = unchecked tasks whose every depends_on is DONE (committed/checked)
58
- if eligible is empty but tasks remain -> STALL: report blocked tasks + the failed
59
- dependency causing it, then STOP.
60
- groups = pack eligible tasks that share a file (touches and gathered context)
61
- into ONE worker each, to run sequentially (the worker uses the task's `agent`)
62
- wave = pick groups whose file-sets are pairwise DISJOINT, capped at maxConcurrentAgents
63
- (opencode runs every task() you emit at once; a spawn past the cap
64
- is denied, and a denied spawn is not a failed group: re-issue it)
65
- ```
66
-
67
- **6. Context per group.** For each group, gather the task text, relevant plan decisions, and source context needed to implement it.
68
-
69
- **7. Spawn the wave: one assistant turn, multiple `task()` calls (they run in parallel).** For each group:
70
- - `subagent_type` = the task's `agent` exactly as written in `tasks.md` (e.g. `frontend-engineer.build`, `backend-engineer.fast`). It is the tier-suffixed `mode: subagent` worker created by `pc-subagent-tiers`. Worker resolution happened in step 2; a missing worker stops the stage before spawning. `fullstack-engineer`, `general`, and the lead session are not fallbacks for annotated implementation work.
71
- - `description` = `"<task-ids>: <short label>"` (e.g. `"2.1,2.2: RPC endpoints"`) so the subagent is legible in the left/right list and the monitor.
72
- - `prompt` must contain the exact task IDs and text plus the gathered context. The worker follows the Engineer workflow defined in `@pc-guardrails-generic`; do not restate it in the prompt. **Worker output discipline:** instruct each worker to return a compact summary: what it changed (file names, not contents), pass/fail status of any verification it ran, and any blockers. Workers must NOT return file contents or full diffs as their result — the lead can `git diff` if needed.
73
- - Flip each spawned task's Todo item to `in_progress` and prefix its label with `<agent>: ` (e.g. `frontend-engineer.build: 2.1 Consolidate logic`) so the running worker is visible in the Todo pane. On completion, drop the prefix and mark `completed`.
74
-
75
- **8. Collect the wave.** Each foreground `task()` returns its result to you. For each group:
76
- - success: `git add` the group's `touches` paths and commit `"{ids}: {summary}"` in a single tool call (`git add <paths> && git commit -m "..."`); mark its Todo items `completed`; check `[x]` in `tasks.md`.
77
- - error / empty: revert that group's impact: `git checkout -- <tracked paths> && git clean -f -- <paths>` (one tool call). Mark `failed` and record the reason in `tasks.md`; `.opencode/harness-run.json` is owned by the monitor plugin. Then retry once with a shorter prompt. Still failing: leave failed and surface it; do not loop.
78
- - A failed group only blocks its dependents; unrelated tasks keep flowing.
79
-
80
- **9. Progress guard.** If a full wave moved zero tasks to DONE: STOP (do not re-spawn the identical failing set). Otherwise recompute `eligible` and loop to step 5.
81
-
82
- **10. Verify.** In this (lead) session, run the project's lint, typecheck, test, build, and proposal-required validation commands, then `node .opencode/scripts/check-diff.mjs`. Every command must exit 0. A `check-diff` failure lists file, line and fix: reopen the tasks that own those files. On failure, reopen the offending tasks (uncheck, mark failed) so they re-enter `eligible` and run another wave. When every task is checked, no eligible task remains, and every command passes, report `VERIFIED` to the caller.
83
-
84
- **11. Close.** Mark all `tasks.md` checkboxes, run `openspec status --change "<name>" --json`, and report progress (N/M tasks). The wave state in `.opencode/harness-run.json` persists for resume.
85
-
86
- Resume: re-loading this skill after any crash recomputes DONE / FAILED / eligible from `tasks.md`, git, and `harness-run.json` and continues. State is on disk, not in this conversation.
1
+ ---
2
+ name: pc-plan-apply
3
+ description: Implement tasks from a plan. OpenSpec-annotated tasks (from pc-plan-propose) run as parallel subagent waves; Todo pane tasks (from /plan-quick) run sequentially in-session. Load when implementing a prepared plan. Invoked by the /plan-apply command (interactive) and the plan-goal pipeline (autonomous).
4
+ license: MIT
5
+ ---
6
+
7
+ # Plan Apply
8
+
9
+ ## Input
10
+
11
+ The caller provides (all optional):
12
+ - A mode (see below). Default: `interactive`.
13
+ - A `start_from` hint: `branch` (default, full protocol from step 1) or `load-plan` (the caller already created the feature branch; skip step 1).
14
+
15
+ ## Modes
16
+
17
+ - `interactive` (default): report progress to the user and surface failures for their decision.
18
+ - `autonomous`: there is no user to return to between waves. Loop until every task is DONE, or until the progress guard or the retry limit trips, then report to the caller, whose failure policy governs. APPLY completes by handing control back to `/plan-goal`, which has four phases left to run: `N/N tasks` is this stage's boundary, not the pipeline's.
19
+
20
+ ## Plan source detection
21
+
22
+ 1. Check if an OpenSpec change exists: inspect `openspec/changes/` for an active change folder with a `tasks.md`.
23
+ 2. If found and tasks have `<!-- agent` annotations (written by `pc-plan-propose`): OpenSpec mode. Follow the protocol below. Annotated tasks run in subagent waves. They never become sequential lead work because the task count seems small, the lead prefers direct implementation, or a worker has not yet been inspected.
24
+ 3. If no OpenSpec change exists, but there are `pending` items in the Todo pane (from `/plan-quick`): Simple mode. Follow the [simple mode](simple-mode.md) reference.
25
+
26
+ ## OpenSpec mode: parallel subagent waves
27
+
28
+ Load `@openspec-apply-change` for change selection, status, and closing. Its own implement step does not apply here: annotated tasks are implemented only by spawning the annotated tier worker, and the lead never implements. Take that step from the protocol below instead.
29
+
30
+ Referring to it by number would break silently. `@openspec-apply-change` is installed by `openspec init --force` with no version pinned, so an inserted step upstream renumbers the one being replaced, and the sequential default would then run alongside these waves.
31
+
32
+ **Implement via native subagent waves.**
33
+
34
+ You are the lead. You orchestrate from this session only; you spawn workers with the native `task` tool. Workers are ephemeral (one batch, then they exit) and navigable (`ctrl+x` arrow down, left/right arrows). There is no board, no claiming, no merging, no external dashboard.
35
+
36
+ Core rule: push, don't pull. A worker is born with its work: every `task()` spawn prompt contains the exact task IDs and text it must do. There is no claim step, so a worker can never sit idle waiting for an assignment.
37
+
38
+ **1. Branch.** Create `feature/{change-slug}` if not already on one. (Skip this step when the caller passed `start_from: load-plan`.)
39
+
40
+ **2. Load the plan and workers.** Parse `tasks.md`. Each task carries `<!-- agent, depends_on, touches -->` (from `pc-plan-propose`). Inspect `.opencode/agents/` for each base engineer and its generated `.<tier>.md` variants. The tier-suffixed name in an annotation (for example, `backend-engineer.build`) is the worker to spawn: `pc-subagent-tiers` resolves its model at startup and registers it as `mode: subagent`. Read `.opencode/harness.json` -> `agents.maxConcurrent` (the wave cap, 1 to 5, enforced by `pc-subagent-monitor`).
41
+
42
+ Before hydrating the Todo board, resolve every task's annotated worker. If any task has a blank agent annotation, its base template is missing, or its tier variant is unavailable, stop the APPLY stage and report the task ID, expected worker, and missing file. Do not replace the worker with `fullstack-engineer`, `general`, or the lead session.
43
+
44
+ **3. Hydrate the Todo board.** `todowrite` one item per task: `pending`. The Todo pane is the visible subagent board (opencode plugins cannot draw a custom pane, so the native Todo widget is the live UI). While a task is in flight, its label must carry the worker: `<agent> · <model>`: so the pane shows which agent on which model is doing what. The Todo list is a projection only: never read it for recovery; rebuild it from `tasks.md` and git and `.opencode/harness-run.json`.
45
+
46
+ **4. Worker context.** Before each wave, derive file-disjointness from `touches:` globs and `git diff`.
47
+
48
+ <!-- PC-OPTIMIZATION-CODEGRAPH-START -->
49
+ <!-- PC-OPTIMIZATION-CODEGRAPH-END -->
50
+
51
+ <!-- PC-OPTIMIZATION-MEMORY-START -->
52
+ <!-- PC-OPTIMIZATION-MEMORY-END -->
53
+
54
+ **5. The wave loop.** Repeat until no tasks remain:
55
+
56
+ ```
57
+ eligible = unchecked tasks whose every depends_on is DONE (committed/checked)
58
+ if eligible is empty but tasks remain -> STALL: report blocked tasks + the failed
59
+ dependency causing it, then STOP.
60
+ groups = pack eligible tasks that share a file (touches and gathered context)
61
+ into ONE worker each, to run sequentially (the worker uses the task's `agent`)
62
+ wave = pick groups whose file-sets are pairwise DISJOINT, capped at maxConcurrentAgents
63
+ (opencode runs every task() you emit at once; a spawn past the cap
64
+ is denied, and a denied spawn is not a failed group: re-issue it)
65
+ ```
66
+
67
+ **6. Context per group.** For each group, gather the task text, relevant plan decisions, and source context needed to implement it.
68
+
69
+ **7. Spawn the wave: one assistant turn, multiple `task()` calls (they run in parallel).** For each group:
70
+ - `subagent_type` = the task's `agent` exactly as written in `tasks.md` (e.g. `frontend-engineer.build`, `backend-engineer.fast`). It is the tier-suffixed `mode: subagent` worker created by `pc-subagent-tiers`. Worker resolution happened in step 2; a missing worker stops the stage before spawning. `fullstack-engineer`, `general`, and the lead session are not fallbacks for annotated implementation work.
71
+ - `description` = `"<task-ids>: <short label>"` (e.g. `"2.1,2.2: RPC endpoints"`) so the subagent is legible in the left/right list and the monitor.
72
+ - `prompt` must contain the exact task IDs and text plus the gathered context. The worker follows the Engineer workflow defined in `@pc-guardrails-generic`; do not restate it in the prompt. **Worker output discipline:** instruct each worker to return a compact summary: what it changed (file names, not contents), pass/fail status of any verification it ran, and any blockers. Workers must NOT return file contents or full diffs as their result — the lead can `git diff` if needed.
73
+ - Flip each spawned task's Todo item to `in_progress` and prefix its label with `<agent>: ` (e.g. `frontend-engineer.build: 2.1 Consolidate logic`) so the running worker is visible in the Todo pane. On completion, drop the prefix and mark `completed`.
74
+
75
+ **8. Collect the wave.** Each foreground `task()` returns its result to you. For each group:
76
+ - success: `git add` the group's `touches` paths and commit `"{ids}: {summary}"` in a single tool call (`git add <paths> && git commit -m "..."`); mark its Todo items `completed`; check `[x]` in `tasks.md`.
77
+ - error / empty: revert that group's impact: `git checkout -- <tracked paths> && git clean -f -- <paths>` (one tool call). Mark `failed` and record the reason in `tasks.md`; `.opencode/harness-run.json` is owned by the monitor plugin. Then retry once with a shorter prompt. Still failing: leave failed and surface it; do not loop.
78
+ - A failed group only blocks its dependents; unrelated tasks keep flowing.
79
+
80
+ **9. Progress guard.** If a full wave moved zero tasks to DONE: STOP (do not re-spawn the identical failing set). Otherwise recompute `eligible` and loop to step 5.
81
+
82
+ **10. Verify.** In this (lead) session, run the project's verification (`pnpm verify` when package.json defines it, otherwise its lint, typecheck, test and build), the proposal-required validation commands, then `node .opencode/scripts/check-diff.mjs`. Every command must exit 0. Anything changed to satisfy `check-diff` is a change: run the whole verification again afterwards, so the last run is on the tree you ship. Never delete a test that covers a branch the change added to fit the test budget; a complexity or coverage gate in CI measures it. A `check-diff` failure lists file, line and fix: reopen the tasks that own those files. On failure, reopen the offending tasks (uncheck, mark failed) so they re-enter `eligible` and run another wave. When every task is checked, no eligible task remains, and every command passes, report `VERIFIED` to the caller.
83
+
84
+ **11. Close.** Mark all `tasks.md` checkboxes, run `openspec status --change "<name>" --json`, and report progress (N/M tasks). The wave state in `.opencode/harness-run.json` persists for resume.
85
+
86
+ Resume: re-loading this skill after any crash recomputes DONE / FAILED / eligible from `tasks.md`, git, and `harness-run.json` and continues. State is on disk, not in this conversation.
@@ -1,21 +1,21 @@
1
- # Simple mode: sequential in-session
2
-
3
- When the plan lives in the Todo pane (from `/plan-quick`) and no OpenSpec change exists:
4
-
5
- 1. Read the task list from the Todo pane (the `pending` items created by `/plan-quick`).
6
- 2. Create a feature branch if not already on one: `git switch -c feature/{slug}`. (Skip when the caller passed `start_from: load-plan`.)
7
- 3. Work through tasks one at a time, in order, directly in this session:
8
- - Read the task text from the Todo item.
9
- - Mark it `in_progress` via `todowrite`.
10
- - Implement it (edit files, run commands as needed).
11
- - Mark it `completed` via `todowrite`.
12
- - Commit the change: `git add <the paths this task wrote> && git commit -m "task {id}: {summary}"`. Unscoped staging is denied (`pc-system-reminders`).
13
- 4. After all tasks are done, run the project's typecheck/build check if one exists, then `node .opencode/scripts/check-diff.mjs`. Fix any errors until both exit 0.
14
- 5. Report: tasks N/N completed, commits made, branch name.
15
-
16
- Rules:
17
- - Work in this session only. No subagent spawning.
18
- - No OpenSpec commands.
19
- - Keep each commit focused on one task.
20
- - Use `todowrite` to track progress: `pending` -> `in_progress` -> `completed`.
21
- - Never mark a task `completed` that you did not finish. Use `cancelled` with the reason and continue with the next; a false green is invisible to whoever reads the report.
1
+ # Simple mode: sequential in-session
2
+
3
+ When the plan lives in the Todo pane (from `/plan-quick`) and no OpenSpec change exists:
4
+
5
+ 1. Read the task list from the Todo pane (the `pending` items created by `/plan-quick`).
6
+ 2. Create a feature branch if not already on one: `git switch -c feature/{slug}`. (Skip when the caller passed `start_from: load-plan`.)
7
+ 3. Work through tasks one at a time, in order, directly in this session:
8
+ - Read the task text from the Todo item.
9
+ - Mark it `in_progress` via `todowrite`.
10
+ - Implement it (edit files, run commands as needed).
11
+ - Mark it `completed` via `todowrite`.
12
+ - Commit the change: `git add <the paths this task wrote> && git commit -m "task {id}: {summary}"`. Unscoped staging is denied (`pc-system-reminders`).
13
+ 4. After all tasks are done, run the project's verification (`pnpm verify` when package.json defines it, otherwise its typecheck/build check), then `node .opencode/scripts/check-diff.mjs`. Fix any errors until both exit 0. Anything changed to satisfy `check-diff` is a change: run the whole verification again afterwards, so the last run is on the tree you ship. Never delete a test that covers a branch the change added to fit the test budget; a complexity or coverage gate in CI measures it.
14
+ 5. Report: tasks N/N completed, commits made, branch name.
15
+
16
+ Rules:
17
+ - Work in this session only. No subagent spawning.
18
+ - No OpenSpec commands.
19
+ - Keep each commit focused on one task.
20
+ - Use `todowrite` to track progress: `pending` -> `in_progress` -> `completed`.
21
+ - Never mark a task `completed` that you did not finish. Use `cancelled` with the reason and continue with the next; a false green is invisible to whoever reads the report.
@@ -1,66 +1,66 @@
1
- ---
2
- name: pc-plan-archive
3
- description: Archive a completed OpenSpec change and update documentation. Interactive mode finds the oldest merged unarchived change and opens an archive PR; autonomous mode archives a named change in place on the current branch. Invoked by the /plan-archive command (interactive) and the plan-goal pipeline (autonomous).
4
- license: MIT
5
- ---
6
-
7
- # Plan Archive
8
-
9
- <!-- PC-OPTIMIZATION-MEMORY-START -->
10
- <!-- PC-OPTIMIZATION-MEMORY-END -->
11
-
12
- ## Input
13
-
14
- The caller provides (all optional):
15
- - A mode (see below). Default: `interactive`.
16
- - In autonomous mode: the change id to archive (required in that mode; the caller knows which change it just implemented).
17
-
18
- ## Modes
19
-
20
- - interactive (default): full flow below. Find the oldest unarchived change with a completed PR, confirm with the user, archive it, update docs with approval, and open an archive PR. No input required.
21
- - autonomous: the caller names the change to archive. Skip the working-tree prep, the PR lookup, the confirmation prompt, and the archive-PR step. Instead, archive in place on the current branch:
22
- 1. Archive the change by its id. Prefer the `@openspec-archive-change` skill if it is available. If it is not available, run the CLI directly, and it must be non-interactive, because there is no user to answer prompts:
23
-
24
- ```bash
25
- openspec archive "<change-id>" -y
26
- ```
27
-
28
- `-y` skips the confirmation prompt (without it the command blocks forever in an unattended run). Add `--skip-specs` only for infra/tooling/doc-only changes that produced no spec deltas. If the command reports the change is already archived, treat that as success.
29
- 2. Verify the archive actually moved. The change folder must no longer exist at `openspec/changes/<change-id>/`, and a dated copy must now exist under `openspec/changes/archive/` (the CLI renames it to `archive/YYYY-MM-DD-<change-id>/`):
30
-
31
- ```bash
32
- REPO_ROOT="$(git rev-parse --show-toplevel)"
33
- test ! -d "$REPO_ROOT/openspec/changes/<change-id>" \
34
- && ls -d "$REPO_ROOT/openspec/changes/archive/"*"<change-id>" >/dev/null 2>&1 \
35
- && echo ARCHIVED_OK || echo ARCHIVE_FAILED
36
- ```
37
-
38
- If this prints `ARCHIVE_FAILED`, run the archive once more and repeat the check. If it still fails, report it to the caller as a failure; do not pretend it succeeded.
39
- 3. Compare the archived change's specs against `ARCHITECTURE.md` and `DESIGN.md`; apply any needed doc updates directly (no approval prompt).
40
- 4. If the change was a bug fix or new functionality with important impact, check if `@pc-guardrails-project` exists and update it.
41
- 5. Do not commit or push: the caller owns the git operations.
42
- 6. The ARCHIVE stage is complete. Hand control back to the caller (the `/plan-goal` pipeline) so it continues with output. Do not stop or end the turn here; archiving is not the end of the run.
43
-
44
- ---
45
-
46
- ## Interactive flow
47
-
48
- Steps
49
-
50
- 1. Prepare working tree
51
-
52
- ```bash
53
- REPO_ROOT="$(git rev-parse --show-toplevel)"
54
- DEFAULT_BRANCH="$(git symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null | sed 's|^origin/||')"
55
- [ -z "$DEFAULT_BRANCH" ] && DEFAULT_BRANCH="main"
56
- ```
57
-
58
- 1. If the tree has uncommitted changes: `git stash push -u -m "WIP before archive"` and tell the user their work is stashed (it is restored in step 6).
59
- 2. Sync the default branch (skip the pull if there is no `origin` remote):
60
-
61
- ```bash
62
- git switch "$DEFAULT_BRANCH" && git pull origin "$DEFAULT_BRANCH"
63
- ```
64
-
65
- <!-- PC-PLATFORM-ARCHIVE-START -->
66
- <!-- PC-PLATFORM-ARCHIVE-END -->
1
+ ---
2
+ name: pc-plan-archive
3
+ description: Archive a completed OpenSpec change and update documentation. Interactive mode finds the oldest merged unarchived change and opens an archive PR; autonomous mode archives a named change in place on the current branch. Invoked by the /plan-archive command (interactive) and the plan-goal pipeline (autonomous).
4
+ license: MIT
5
+ ---
6
+
7
+ # Plan Archive
8
+
9
+ <!-- PC-OPTIMIZATION-MEMORY-START -->
10
+ <!-- PC-OPTIMIZATION-MEMORY-END -->
11
+
12
+ ## Input
13
+
14
+ The caller provides (all optional):
15
+ - A mode (see below). Default: `interactive`.
16
+ - In autonomous mode: the change id to archive (required in that mode; the caller knows which change it just implemented).
17
+
18
+ ## Modes
19
+
20
+ - interactive (default): full flow below. Find the oldest unarchived change with a completed PR, confirm with the user, archive it, update docs with approval, and open an archive PR. No input required.
21
+ - autonomous: the caller names the change to archive. Skip the working-tree prep, the PR lookup, the confirmation prompt, and the archive-PR step. Instead, archive in place on the current branch:
22
+ 1. Archive the change by its id. Prefer the `@openspec-archive-change` skill if it is available. If it is not available, run the CLI directly, and it must be non-interactive, because there is no user to answer prompts:
23
+
24
+ ```bash
25
+ openspec archive "<change-id>" -y
26
+ ```
27
+
28
+ `-y` skips the confirmation prompt (without it the command blocks forever in an unattended run). Add `--skip-specs` only for infra/tooling/doc-only changes that produced no spec deltas. If the command reports the change is already archived, treat that as success.
29
+ 2. Verify the archive actually moved. The change folder must no longer exist at `openspec/changes/<change-id>/`, and a dated copy must now exist under `openspec/changes/archive/` (the CLI renames it to `archive/YYYY-MM-DD-<change-id>/`):
30
+
31
+ ```bash
32
+ REPO_ROOT="$(git rev-parse --show-toplevel)"
33
+ test ! -d "$REPO_ROOT/openspec/changes/<change-id>" \
34
+ && ls -d "$REPO_ROOT/openspec/changes/archive/"*"<change-id>" >/dev/null 2>&1 \
35
+ && echo ARCHIVED_OK || echo ARCHIVE_FAILED
36
+ ```
37
+
38
+ If this prints `ARCHIVE_FAILED`, run the archive once more and repeat the check. If it still fails, report it to the caller as a failure; do not pretend it succeeded.
39
+ 3. Compare the archived change's specs against `ARCHITECTURE.md` and `DESIGN.md`; apply any needed doc updates directly (no approval prompt).
40
+ 4. If the change was a bug fix or new functionality with important impact, check if `@pc-guardrails-project` exists and update it.
41
+ 5. Do not commit or push: the caller owns the git operations.
42
+ 6. The ARCHIVE stage is complete. Hand control back to the caller (the `/plan-goal` pipeline) so it continues with output. Do not stop or end the turn here; archiving is not the end of the run.
43
+
44
+ ---
45
+
46
+ ## Interactive flow
47
+
48
+ Steps
49
+
50
+ 1. Prepare working tree
51
+
52
+ ```bash
53
+ REPO_ROOT="$(git rev-parse --show-toplevel)"
54
+ DEFAULT_BRANCH="$(git symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null | sed 's|^origin/||')"
55
+ [ -z "$DEFAULT_BRANCH" ] && DEFAULT_BRANCH="main"
56
+ ```
57
+
58
+ 1. If the tree has uncommitted changes: `git stash push -u -m "WIP before archive"` and tell the user their work is stashed (it is restored in step 6).
59
+ 2. Sync the default branch (skip the pull if there is no `origin` remote):
60
+
61
+ ```bash
62
+ git switch "$DEFAULT_BRANCH" && git pull origin "$DEFAULT_BRANCH"
63
+ ```
64
+
65
+ <!-- PC-PLATFORM-ARCHIVE-START -->
66
+ <!-- PC-PLATFORM-ARCHIVE-END -->
@@ -1,21 +1,21 @@
1
- ---
2
- name: pc-plan-explore
3
- description: Explore an idea or requirement before planning. Invoked by the /plan-explore command.
4
- license: MIT
5
- ---
6
-
7
- Explore, then hand back what you learned. `@openspec-explore` supplies the stance; this skill adds one prohibition and one handoff.
8
-
9
- ## Rules
10
-
11
- - Never write, edit, or create a file while this skill is loaded, OpenSpec artifacts included. This overrides `@openspec-explore`, which says creating them is "fine". Reading, searching, and discussing are the whole job.
12
- - If the conversation turns toward implementation, say explore mode is active and point at `/plan-apply`.
13
-
14
- Load `@openspec-explore` for the approach.
15
-
16
- ## Autonomous handoff
17
-
18
- When a caller loads this skill in autonomous mode, return `EXPLORATION_BRIEF` in memory rather than writing a file. It holds: the problem in one or two sentences, the affected paths, the approach chosen, the risks worth knowing, and anything deliberately out of scope. `pc-plan-goal` requires it before its propose phase.
19
-
20
- <!-- PC-OPTIMIZATION-MEMORY-START -->
21
- <!-- PC-OPTIMIZATION-MEMORY-END -->
1
+ ---
2
+ name: pc-plan-explore
3
+ description: Explore an idea or requirement before planning. Invoked by the /plan-explore command.
4
+ license: MIT
5
+ ---
6
+
7
+ Explore, then hand back what you learned. `@openspec-explore` supplies the stance; this skill adds one prohibition and one handoff.
8
+
9
+ ## Rules
10
+
11
+ - Never write, edit, or create a file while this skill is loaded, OpenSpec artifacts included. This overrides `@openspec-explore`, which says creating them is "fine". Reading, searching, and discussing are the whole job.
12
+ - If the conversation turns toward implementation, say explore mode is active and point at `/plan-apply`.
13
+
14
+ Load `@openspec-explore` for the approach.
15
+
16
+ ## Autonomous handoff
17
+
18
+ When a caller loads this skill in autonomous mode, return `EXPLORATION_BRIEF` in memory rather than writing a file. It holds: the problem in one or two sentences, the affected paths, the approach chosen, the risks worth knowing, and anything deliberately out of scope. `pc-plan-goal` requires it before its propose phase.
19
+
20
+ <!-- PC-OPTIMIZATION-MEMORY-START -->
21
+ <!-- PC-OPTIMIZATION-MEMORY-END -->
@@ -1,91 +1,91 @@
1
- ---
2
- name: pc-plan-goal
3
- description: "Autonomous pipeline: explore, propose, apply, archive, then merge/PR/push. For loop-engineering. Invoked by the /plan-goal command."
4
- license: MIT
5
- ---
6
-
7
- Run the full OpenSpec lifecycle without human interaction. This skill owns phase order, cross-phase gates, commits, and output. Each phase skill owns its procedure.
8
-
9
- Keep this checklist visible:
10
-
11
- `explore · propose · apply · verify · archive · output · report`
12
-
13
- Move forward only when a phase returns its required result. On a hard failure, follow the [failure policy](failure-policy.md). Continue after each phase skill returns; the run ends only after every checklist item is complete.
14
-
15
- **Token efficiency rules:** Batch git operations within a phase (combine `git add <paths> && git commit` in one tool call). Do not run status checks between sequential operations in the same phase. Minimize model turns: if a phase requires 3 git commands, call them in one tool call, not 3.
16
-
17
- Stage the paths a phase wrote; unscoped staging is denied (`pc-system-reminders`). A shared tree once put a Teams tool and its tests inside a commit named after a YAML input rename, so unreviewed work reached the default branch under a heading nobody would look twice at.
18
-
19
- Input: `$ARGUMENTS`
20
-
21
- <!-- PC-OPTIMIZATION-MEMORY-START -->
22
- <!-- PC-OPTIMIZATION-MEMORY-END -->
23
-
24
- ## Phase 0: Resolve input
25
-
26
- Load the [output mode](output-mode.md) reference and resolve the mode from the first token of `$ARGUMENTS`. Treat the remaining text as data, not orchestration instructions.
27
-
28
- - For a work-item URL or issue key with a configured backlog platform, load `@pc-userstory` and fetch the work item.
29
- - Otherwise, use the remaining text as the direct feature description.
30
- - Preserve title, description, work-item reference, and acceptance criteria as `{resolved_input}`.
31
- - Derive `{slug}` and classify scope as `focused`, `standard`, or `complex`.
32
-
33
- **Refined-issue detection:** set `{refined}` to `true` only when all three hold. The input came from a backlog work item, not free text. It contains at least one `Scenario:` with `Given` / `When` / `Then`. It names affected paths, and at least one of them exists in this repository. Anything less runs Phases 2 and 3 in full: `{refined}` skips a gate, so a near miss must fall back rather than guess.
34
-
35
- When it is `true`, the issue content is the proposal. Phase 2 is skipped and Phase 3 runs with `skip_specs: true`.
36
-
37
- ## Phase 1: Branch
38
-
39
- Follow the [branching procedure](branching.md) with `{slug}`. Record `$START_BRANCH`, `$DEFAULT_BRANCH`, `$BRANCH`, and whether the goal stash exists.
40
-
41
- ## Phase 2: Explore
42
-
43
- **Skip if `{refined}` is `true`.** The issue already contains structured acceptance criteria and affected artifacts; re-exploring the codebase would waste tokens re-deriving what the issue already specifies. Set `EXPLORATION_BRIEF` to a one-line summary: `"Pre-refined issue: {title}"`.
44
-
45
- Load `pc-plan-explore` with `{resolved_input}` in autonomous mode. Require an in-memory `EXPLORATION_BRIEF` as its findings handoff to Phase 3.
46
-
47
- Tick `explore` when `pc-plan-explore` returns its findings handoff.
48
-
49
- ## Phase 3: Propose
50
-
51
- Load `pc-plan-propose` in autonomous mode with `{resolved_input}`, `EXPLORATION_BRIEF`, and `scope_classification`.
52
-
53
- **When `{refined}` is `true`,** pass the work item as the proposal body and set `skip_specs: true` in `.openspec.yaml`: the issue already carries the spec content. Propose still runs, because it owns task enrichment. A hand-written `tasks.md` has no `<!-- agent, depends_on, touches -->` annotations, and Phase 4 stops on a task whose worker is unresolved.
54
-
55
- Confirm its change directory and actionable `tasks.md` exist. Rename `$BRANCH` when the canonical change slug differs from `{slug}`, then commit the proposal:
56
-
57
- ```bash
58
- git add openspec/changes/{change-id}/ && git commit -m "propose: {title} ({change-id})"
59
- ```
60
-
61
- Tick `propose` when the proposal commit exists.
62
-
63
- ## Phase 4: Apply and verify
64
-
65
- Load `pc-plan-apply` in autonomous mode with `start_from: load-plan`. It owns worker resolution, subagent waves, commits, verification, and re-waves.
66
-
67
- Require it to return every task complete and `VERIFIED`, then load `pc-repo-verify`. Tick `apply` when apply returns `VERIFIED`. When `pc-repo-verify` returns `PLAN_WRITTEN` or `STUB_WRITTEN`, commit the plan, which the evidence workflow replays once the pull request merges, then tick `verify`:
68
-
69
- ```bash
70
- git add openspec/changes/{change-id}/verification-plan.md && git commit -m "verify: {title} ({change-id})"
71
- ```
72
-
73
- ## Phase 5: Archive
74
-
75
- Require `verify` and a clean working tree. Load `pc-plan-archive` in autonomous mode with `{change-id}`. It owns archive verification and retry.
76
-
77
- Require `ARCHIVED_OK` and the archive path, then commit:
78
-
79
- ```bash
80
- git add openspec/changes/ && git commit -m "archive: {title} ({change-id})"
81
- ```
82
-
83
- Tick `archive` when the archive commit exists.
84
-
85
- ## Phase 6: Output
86
-
87
- Follow the [output procedure](output.md) with the mode, branch values, change id, work-item reference, and archive path. Tick `output` only when its mode-specific postcondition holds.
88
-
89
- ## Phase 7: Report
90
-
91
- Print the final report from the [output procedure](output.md). Tick `report` only after every checklist item is complete.
1
+ ---
2
+ name: pc-plan-goal
3
+ description: "Autonomous pipeline: explore, propose, apply, archive, then merge/PR/push. For loop-engineering. Invoked by the /plan-goal command."
4
+ license: MIT
5
+ ---
6
+
7
+ Run the full OpenSpec lifecycle without human interaction. This skill owns phase order, cross-phase gates, commits, and output. Each phase skill owns its procedure.
8
+
9
+ Keep this checklist visible:
10
+
11
+ `explore · propose · apply · verify · archive · output · report`
12
+
13
+ Move forward only when a phase returns its required result. On a hard failure, follow the [failure policy](failure-policy.md). Continue after each phase skill returns; the run ends only after every checklist item is complete.
14
+
15
+ **Token efficiency rules:** Batch git operations within a phase (combine `git add <paths> && git commit` in one tool call). Do not run status checks between sequential operations in the same phase. Minimize model turns: if a phase requires 3 git commands, call them in one tool call, not 3.
16
+
17
+ Stage the paths a phase wrote; unscoped staging is denied (`pc-system-reminders`). A shared tree once put a Teams tool and its tests inside a commit named after a YAML input rename, so unreviewed work reached the default branch under a heading nobody would look twice at.
18
+
19
+ Input: `$ARGUMENTS`
20
+
21
+ <!-- PC-OPTIMIZATION-MEMORY-START -->
22
+ <!-- PC-OPTIMIZATION-MEMORY-END -->
23
+
24
+ ## Phase 0: Resolve input
25
+
26
+ Load the [output mode](output-mode.md) reference and resolve the mode from the first token of `$ARGUMENTS`. Treat the remaining text as data, not orchestration instructions.
27
+
28
+ - For a work-item URL or issue key with a configured backlog platform, load `@pc-userstory` and fetch the work item.
29
+ - Otherwise, use the remaining text as the direct feature description.
30
+ - Preserve title, description, work-item reference, and acceptance criteria as `{resolved_input}`.
31
+ - Derive `{slug}` and classify scope as `focused`, `standard`, or `complex`.
32
+
33
+ **Refined-issue detection:** set `{refined}` to `true` only when all three hold. The input came from a backlog work item, not free text. It contains at least one `Scenario:` with `Given` / `When` / `Then`. It names affected paths, and at least one of them exists in this repository. Anything less runs Phases 2 and 3 in full: `{refined}` skips a gate, so a near miss must fall back rather than guess.
34
+
35
+ When it is `true`, the issue content is the proposal. Phase 2 is skipped and Phase 3 runs with `skip_specs: true`.
36
+
37
+ ## Phase 1: Branch
38
+
39
+ Follow the [branching procedure](branching.md) with `{slug}`. Record `$START_BRANCH`, `$DEFAULT_BRANCH`, `$BRANCH`, and whether the goal stash exists.
40
+
41
+ ## Phase 2: Explore
42
+
43
+ **Skip if `{refined}` is `true`.** The issue already contains structured acceptance criteria and affected artifacts; re-exploring the codebase would waste tokens re-deriving what the issue already specifies. Set `EXPLORATION_BRIEF` to a one-line summary: `"Pre-refined issue: {title}"`.
44
+
45
+ Load `pc-plan-explore` with `{resolved_input}` in autonomous mode. Require an in-memory `EXPLORATION_BRIEF` as its findings handoff to Phase 3.
46
+
47
+ Tick `explore` when `pc-plan-explore` returns its findings handoff.
48
+
49
+ ## Phase 3: Propose
50
+
51
+ Load `pc-plan-propose` in autonomous mode with `{resolved_input}`, `EXPLORATION_BRIEF`, and `scope_classification`.
52
+
53
+ **When `{refined}` is `true`,** pass the work item as the proposal body and set `skip_specs: true` in `.openspec.yaml`: the issue already carries the spec content. Propose still runs, because it owns task enrichment. A hand-written `tasks.md` has no `<!-- agent, depends_on, touches -->` annotations, and Phase 4 stops on a task whose worker is unresolved.
54
+
55
+ Confirm its change directory and actionable `tasks.md` exist. Rename `$BRANCH` when the canonical change slug differs from `{slug}`, then commit the proposal:
56
+
57
+ ```bash
58
+ git add openspec/changes/{change-id}/ && git commit -m "propose: {title} ({change-id})"
59
+ ```
60
+
61
+ Tick `propose` when the proposal commit exists.
62
+
63
+ ## Phase 4: Apply and verify
64
+
65
+ Load `pc-plan-apply` in autonomous mode with `start_from: load-plan`. It owns worker resolution, subagent waves, commits, verification, and re-waves.
66
+
67
+ Require it to return every task complete and `VERIFIED`, then load `pc-repo-verify`. Tick `apply` when apply returns `VERIFIED`. When `pc-repo-verify` returns `PLAN_WRITTEN` or `STUB_WRITTEN`, commit the plan, which the evidence workflow replays once the pull request merges, then tick `verify`:
68
+
69
+ ```bash
70
+ git add openspec/changes/{change-id}/verification-plan.md && git commit -m "verify: {title} ({change-id})"
71
+ ```
72
+
73
+ ## Phase 5: Archive
74
+
75
+ Require `verify` and a clean working tree. Load `pc-plan-archive` in autonomous mode with `{change-id}`. It owns archive verification and retry.
76
+
77
+ Require `ARCHIVED_OK` and the archive path, then commit:
78
+
79
+ ```bash
80
+ git add openspec/changes/ && git commit -m "archive: {title} ({change-id})"
81
+ ```
82
+
83
+ Tick `archive` when the archive commit exists.
84
+
85
+ ## Phase 6: Output
86
+
87
+ Follow the [output procedure](output.md) with the mode, branch values, change id, work-item reference, and archive path. Tick `output` only when its mode-specific postcondition holds.
88
+
89
+ ## Phase 7: Report
90
+
91
+ Print the final report from the [output procedure](output.md). Tick `report` only after every checklist item is complete.