@plainconceptsplatform/agent-harness 3.9.0 → 3.11.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.
- package/LICENSE +21 -21
- package/README.md +555 -551
- package/cli/commands/join.js +259 -259
- package/cli/commands/migrate.js +310 -310
- package/cli/commands/shared.js +27 -27
- package/cli/commands/single.js +79 -79
- package/cli/commands/update.js +121 -121
- package/cli/commands/wizard.js +134 -134
- package/cli/fragments/archive/az.md +97 -97
- package/cli/fragments/archive/gh.md +96 -96
- package/cli/fragments/archive/gl.md +96 -96
- package/cli/fragments/archive/none.md +75 -75
- package/cli/fragments/guardrails/codegraph.md +5 -5
- package/cli/fragments/guardrails/humanizer.md +4 -4
- package/cli/fragments/guardrails/memory.md +4 -4
- package/cli/fragments/guardrails/rtk.md +3 -3
- package/cli/fragments/guardrails/simple-english.md +4 -4
- package/cli/fragments/ops-backlog/az.md +28 -28
- package/cli/fragments/ops-backlog/gh.md +28 -28
- package/cli/fragments/ops-backlog/jira.md +28 -28
- package/cli/fragments/ops-review/az.md +62 -62
- package/cli/fragments/ops-review/gh.md +51 -51
- package/cli/fragments/ops-review/gl.md +55 -55
- package/cli/fragments/ops-ship/az.md +81 -81
- package/cli/fragments/ops-ship/gh.md +67 -67
- package/cli/fragments/ops-ship/gl.md +84 -84
- package/cli/index.js +116 -116
- package/cli/presets/agents-content.json +34 -34
- package/cli/presets/browser.json +10 -10
- package/cli/presets/clean.json +21 -21
- package/cli/presets/models.json +68 -68
- package/cli/presets/optimization.json +32 -32
- package/cli/presets/platforms.json +76 -76
- package/cli/presets/source.json +23 -23
- package/cli/steps/browser/index.js +52 -48
- package/cli/steps/clean/index.js +120 -120
- package/cli/steps/copy/agents.js +176 -176
- package/cli/steps/copy/commands.js +79 -79
- package/cli/steps/copy/fullstack-engineer.js +81 -81
- package/cli/steps/copy/index.js +88 -88
- package/cli/steps/copy/opencode-json.js +359 -324
- package/cli/steps/copy/skills.js +353 -316
- package/cli/steps/metadata/index.js +115 -115
- package/cli/steps/models/format.js +88 -88
- package/cli/steps/models/index.js +64 -64
- package/cli/steps/models/write.js +38 -38
- package/cli/steps/openspec/index.js +136 -136
- package/cli/steps/optimization/codegraph.js +141 -141
- package/cli/steps/optimization/detect.js +66 -66
- package/cli/steps/optimization/humanizer.js +17 -17
- package/cli/steps/optimization/index.js +158 -158
- package/cli/steps/optimization/memory.js +91 -91
- package/cli/steps/optimization/patch-guardrails.js +111 -111
- package/cli/steps/optimization/simple-english.js +17 -17
- package/cli/steps/optimization/skills-lock.js +30 -30
- package/cli/steps/platform/index.js +109 -109
- package/cli/steps/source/index.js +123 -123
- package/cli/utils/agent-color.js +111 -111
- package/cli/utils/copy.js +134 -134
- package/cli/utils/exec-spinner.js +47 -47
- package/cli/utils/exec.js +134 -134
- package/cli/utils/legacy-check.js +30 -30
- package/cli/utils/models-cache.js +58 -58
- package/cli/utils/models-pricing.js +42 -42
- package/cli/utils/paths.js +82 -82
- package/cli/utils/process.js +3 -3
- package/cli/utils/terminal.js +6 -6
- package/cli/utils/update-manifest.js +75 -75
- package/harness/.opencode/_gitignore +12 -12
- package/harness/.opencode/commands/init.md +5 -5
- package/harness/.opencode/commands/make-architecture.md +5 -5
- package/harness/.opencode/commands/make-design.md +5 -5
- package/harness/.opencode/commands/make-engineer.md +5 -5
- package/harness/.opencode/commands/make-guardrails.md +5 -5
- package/harness/.opencode/commands/make-user-model.md +5 -5
- package/harness/.opencode/commands/ops-backlog.md +10 -10
- package/harness/.opencode/commands/ops-review.md +10 -10
- package/harness/.opencode/commands/ops-ship.md +9 -9
- package/harness/.opencode/commands/plan-apply.md +9 -9
- package/harness/.opencode/commands/plan-archive.md +7 -7
- package/harness/.opencode/commands/plan-explore.md +11 -11
- package/harness/.opencode/commands/plan-goal.md +5 -5
- package/harness/.opencode/commands/plan-mockup.md +11 -0
- package/harness/.opencode/commands/plan-propose.md +11 -11
- package/harness/.opencode/commands/plan-quick.md +7 -7
- package/harness/.opencode/commands/plan-story.md +11 -11
- package/harness/.opencode/commands/repo-audit.md +7 -7
- package/harness/.opencode/commands/repo-help.md +5 -5
- package/harness/.opencode/commands/repo-initialize.md +5 -5
- package/harness/.opencode/commands/repo-onboard.md +5 -5
- package/harness/.opencode/commands/repo-verify.md +5 -5
- package/harness/.opencode/plugins/pc-commit-coauthor.js +41 -41
- package/harness/.opencode/plugins/pc-subagent-monitor.js +184 -184
- package/harness/.opencode/plugins/pc-system-reminders.js +424 -424
- package/harness/.opencode/scripts/check-diff.mjs +305 -305
- package/harness/.opencode/scripts/code-rules.mjs +288 -288
- package/harness/.opencode/scripts/platform-contract.mjs +366 -366
- package/harness/AGENTS.md +55 -55
- package/harness/ARCHITECTURE.md +13 -13
- package/harness/DESIGN.md +13 -13
- package/harness/opencode.jsonc +37 -36
- package/harness/openspec/config.yaml +20 -20
- package/harness/skills-lock.json +23 -17
- package/package.json +14 -12
- package/skills/README.md +18 -18
- package/skills/agent-harness-cli/SKILL.md +86 -86
- package/skills/browser-automation/SKILL.md +100 -72
- package/skills/pc-guardrails-generic/SKILL.md +53 -53
- package/skills/pc-guardrails-project/SKILL.md +8 -8
- package/skills/pc-make-architecture/SKILL.md +33 -33
- package/skills/pc-make-architecture/structure-template.md +64 -64
- package/skills/pc-make-design/SKILL.md +45 -45
- package/skills/pc-make-engineer/SKILL.md +59 -59
- package/skills/pc-make-engineer/signal-mapping.md +53 -53
- package/skills/pc-make-engineer/template.md +36 -36
- package/skills/pc-make-guardrails/SKILL.md +44 -44
- package/skills/pc-make-guardrails/category-reference.md +112 -112
- package/skills/pc-make-merge-risk-assess/SKILL.md +70 -70
- package/skills/pc-make-merge-risk-assess/category-reference.md +114 -114
- package/skills/pc-make-user-model/SKILL.md +56 -56
- package/skills/pc-ops-ship/SKILL.md +22 -22
- package/skills/pc-plan-apply/SKILL.md +92 -90
- package/skills/pc-plan-apply/simple-mode.md +21 -21
- package/skills/pc-plan-archive/SKILL.md +66 -66
- package/skills/pc-plan-explore/SKILL.md +22 -21
- package/skills/pc-plan-goal/SKILL.md +91 -91
- package/skills/pc-plan-goal/branching.md +39 -39
- package/skills/pc-plan-goal/failure-policy.md +30 -30
- package/skills/pc-plan-goal/output-mode.md +10 -10
- package/skills/pc-plan-goal/output.md +71 -71
- package/skills/pc-plan-mockup/SKILL.md +85 -0
- package/skills/pc-plan-mockup/mockup-contract.md +65 -0
- package/skills/pc-plan-propose/SKILL.md +127 -127
- package/skills/pc-plan-propose/task-annotation.md +39 -39
- package/skills/pc-plan-quick/SKILL.md +46 -46
- package/skills/pc-plan-story/SKILL.md +96 -93
- package/skills/pc-repo-audit/SKILL.md +44 -44
- package/skills/pc-repo-help/SKILL.md +90 -87
- package/skills/pc-repo-initialize/SKILL.md +119 -119
- package/skills/pc-repo-onboard/SKILL.md +32 -32
- package/skills/pc-repo-verify/SKILL.md +150 -150
- package/skills/pc-userstory-az/SKILL.md +71 -71
- package/skills/pc-userstory-browser/SKILL.md +73 -64
- package/skills/pc-userstory-gh/SKILL.md +63 -63
- package/skills/pc-userstory-jira/SKILL.md +74 -74
|
@@ -1,90 +1,92 @@
|
|
|
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`). Read `.opencode/harness-models.json` (written by `pc-subagent-tiers` and `node .opencode/scripts/sync-agents.mjs`) for the effective model of every tier and the generated agent files. If the manifest is missing, run `node .opencode/scripts/sync-agents.mjs` once; if it still fails, stop. The tier-suffixed name in an annotation (for example, `backend-engineer.build`) is the worker to spawn; its model is the manifest's, not `harness.json`'s. `harness.user.json` overrides `harness.json`, so never report a model from `harness.json` alone. Read `.opencode/harness.json` -> `agents.maxConcurrent` (the wave cap, 1 to 5, enforced by `pc-subagent-monitor`).
|
|
41
|
-
|
|
42
|
-
When `.platform/contract.yml` declares `reuse` and the change's `proposal.md` has no `## What is reused` section, stop the APPLY stage and report it: the plan never checked what the template already ships. Otherwise every spawn prompt in step 7 carries that section.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
**
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
<!-- PC-OPTIMIZATION-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
**
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
- `
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
**
|
|
87
|
-
|
|
88
|
-
**
|
|
89
|
-
|
|
90
|
-
|
|
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`). Read `.opencode/harness-models.json` (written by `pc-subagent-tiers` and `node .opencode/scripts/sync-agents.mjs`) for the effective model of every tier and the generated agent files. If the manifest is missing, run `node .opencode/scripts/sync-agents.mjs` once; if it still fails, stop. The tier-suffixed name in an annotation (for example, `backend-engineer.build`) is the worker to spawn; its model is the manifest's, not `harness.json`'s. `harness.user.json` overrides `harness.json`, so never report a model from `harness.json` alone. Read `.opencode/harness.json` -> `agents.maxConcurrent` (the wave cap, 1 to 5, enforced by `pc-subagent-monitor`).
|
|
41
|
+
|
|
42
|
+
When `.platform/contract.yml` declares `reuse` and the change's `proposal.md` has no `## What is reused` section, stop the APPLY stage and report it: the plan never checked what the template already ships. Otherwise every spawn prompt in step 7 carries that section.
|
|
43
|
+
|
|
44
|
+
When the change comes from an issue that carries a mockup (a section reading `UX mockup: intent, not a spec`, or a `mockups` branch folder for it), every spawn prompt for UI work in step 7 carries its component table and this line: the mockup states UX intent only; build with the components the table names, `DESIGN.md` and the repository's conventions, and never copy its markup, styles or `data-mockup-section` and `data-component` attributes. A `new:<Name>` entry is a component this change builds.
|
|
45
|
+
|
|
46
|
+
Before hydrating the Todo board, resolve every task's annotated worker. If any task has a blank agent annotation, its base template is missing, its tier variant is unavailable, or the manifest has no effective model for its tier, 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.
|
|
47
|
+
|
|
48
|
+
**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>`, with the model read from `.opencode/harness-models.json`, 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`.
|
|
49
|
+
|
|
50
|
+
**4. Worker context.** Before each wave, derive file-disjointness from `touches:` globs and `git diff`.
|
|
51
|
+
|
|
52
|
+
<!-- PC-OPTIMIZATION-CODEGRAPH-START -->
|
|
53
|
+
<!-- PC-OPTIMIZATION-CODEGRAPH-END -->
|
|
54
|
+
|
|
55
|
+
<!-- PC-OPTIMIZATION-MEMORY-START -->
|
|
56
|
+
<!-- PC-OPTIMIZATION-MEMORY-END -->
|
|
57
|
+
|
|
58
|
+
**5. The wave loop.** Repeat until no tasks remain:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
eligible = unchecked tasks whose every depends_on is DONE (committed/checked)
|
|
62
|
+
if eligible is empty but tasks remain -> STALL: report blocked tasks + the failed
|
|
63
|
+
dependency causing it, then STOP.
|
|
64
|
+
groups = pack eligible tasks that share a file (touches and gathered context)
|
|
65
|
+
into ONE worker each, to run sequentially (the worker uses the task's `agent`)
|
|
66
|
+
wave = pick groups whose file-sets are pairwise DISJOINT, capped at maxConcurrentAgents
|
|
67
|
+
(opencode runs every task() you emit at once; a spawn past the cap
|
|
68
|
+
is denied, and a denied spawn is not a failed group: re-issue it)
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**6. Context per group.** For each group, gather the task text, relevant plan decisions, and source context needed to implement it.
|
|
72
|
+
|
|
73
|
+
**7. Spawn the wave: one assistant turn, multiple `task()` calls (they run in parallel).** For each group:
|
|
74
|
+
- `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.
|
|
75
|
+
- `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.
|
|
76
|
+
- `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.
|
|
77
|
+
- **Diff budget, in every prompt.** When `.opencode/scripts/check-diff.mjs` exists, the prompt says: comments stay under a tenth of the code added and only explain what the code cannot show; tests cover the public contract, about one test line per code line, and a bug fix gets one regression test; and before reporting, run `node .opencode/scripts/check-diff.mjs --paths <the group's touches, comma-separated>` and fix every finding. A worker that writes to the budget does not hand the lead a cleanup: Pliny-Bot #809's lead spent 13 of 65 minutes and fourteen `check-diff` runs trimming what its workers had written.
|
|
78
|
+
- 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`.
|
|
79
|
+
|
|
80
|
+
**8. Collect the wave.** Each foreground `task()` returns its result to you. For each group:
|
|
81
|
+
- 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`.
|
|
82
|
+
- 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.
|
|
83
|
+
- A failed group only blocks its dependents; unrelated tasks keep flowing.
|
|
84
|
+
- After the wave's commits, run `node .opencode/scripts/check-diff.mjs` once on the whole diff. Findings in files a task of this wave touched reopen that task for the next wave, with the findings in its prompt; do not fix them in the lead. A budget overrun caught here costs one worker turn; caught at step 10 it costs a pass over every file.
|
|
85
|
+
|
|
86
|
+
**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.
|
|
87
|
+
|
|
88
|
+
**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.
|
|
89
|
+
|
|
90
|
+
**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.
|
|
91
|
+
|
|
92
|
+
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 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
|
+
# 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,22 @@
|
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
<!-- PC-OPTIMIZATION-MEMORY-
|
|
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
|
+
- When the idea changes what someone sees on screen, point at `/plan-mockup` once the direction is settled: a picture settles layout questions faster than prose.
|
|
14
|
+
|
|
15
|
+
Load `@openspec-explore` for the approach.
|
|
16
|
+
|
|
17
|
+
## Autonomous handoff
|
|
18
|
+
|
|
19
|
+
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.
|
|
20
|
+
|
|
21
|
+
<!-- PC-OPTIMIZATION-MEMORY-START -->
|
|
22
|
+
<!-- PC-OPTIMIZATION-MEMORY-END -->
|