@plainconceptsplatform/agent-harness 2.4.1 → 2.5.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/README.md +435 -437
- package/cli/fragments/archive/az.md +97 -95
- package/cli/fragments/archive/gh.md +96 -94
- package/cli/fragments/archive/gl.md +96 -94
- package/cli/fragments/archive/none.md +75 -73
- package/cli/fragments/guardrails/codegraph.md +5 -7
- 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 +1 -1
- package/cli/fragments/ops-backlog/gh.md +1 -1
- package/cli/fragments/ops-backlog/jira.md +1 -1
- package/cli/fragments/ops-evidence/az.md +44 -41
- package/cli/fragments/ops-evidence/gh.md +54 -53
- package/cli/fragments/ops-evidence/jira.md +42 -38
- package/cli/fragments/ops-review/az.md +1 -1
- package/cli/fragments/ops-review/gh.md +1 -1
- package/cli/fragments/ops-review/gl.md +1 -1
- package/cli/fragments/ops-ship/az.md +81 -80
- package/cli/fragments/ops-ship/gh.md +68 -68
- package/cli/fragments/ops-ship/gl.md +85 -85
- package/cli/presets/agents-content.json +34 -53
- package/cli/steps/copy/agents.js +18 -17
- package/cli/steps/copy/opencode-json.js +5 -1
- package/cli/steps/copy/skills.js +98 -5
- package/cli/steps/optimization/patch-guardrails.js +5 -3
- package/cli/utils/copy.js +8 -3
- package/cli/utils/update-manifest.js +28 -2
- package/harness/.agents/skills/pc-guardrails-generic/SKILL.md +47 -68
- package/harness/.agents/skills/pc-make-architecture/SKILL.md +31 -51
- package/harness/.agents/skills/pc-make-design/SKILL.md +45 -68
- package/harness/.agents/skills/pc-make-engineer/SKILL.md +59 -219
- package/harness/.agents/skills/pc-make-engineer/signal-mapping.md +53 -68
- package/harness/.agents/skills/pc-make-engineer/template.md +42 -80
- package/harness/.agents/skills/pc-make-evidence-scaffold/SKILL.md +18 -18
- package/harness/.agents/skills/pc-make-evidence-scaffold/evidence-contract.md +29 -29
- package/harness/.agents/skills/pc-make-guardrails/SKILL.md +43 -74
- package/harness/.agents/skills/pc-make-guardrails/category-reference.md +10 -5
- package/harness/.agents/skills/pc-make-merge-risk-assess/category-reference.md +26 -7
- package/harness/.agents/skills/pc-make-user-model/SKILL.md +56 -66
- package/harness/.agents/skills/pc-ops-evidence/SKILL.md +133 -127
- package/harness/.agents/skills/pc-plan-apply/SKILL.md +14 -5
- package/harness/.agents/skills/pc-plan-apply/simple-mode.md +21 -21
- package/harness/.agents/skills/pc-plan-archive/SKILL.md +66 -66
- package/harness/.agents/skills/pc-plan-explore/SKILL.md +19 -2
- package/harness/.agents/skills/pc-plan-goal/SKILL.md +7 -5
- package/harness/.agents/skills/pc-plan-goal/output-mode.md +1 -0
- package/harness/.agents/skills/pc-plan-goal/output.md +71 -65
- package/harness/.agents/skills/pc-plan-propose/SKILL.md +1 -1
- package/harness/.agents/skills/pc-plan-quick/SKILL.md +46 -62
- package/harness/.agents/skills/pc-plan-story/SKILL.md +48 -149
- package/harness/.agents/skills/pc-repo-help/SKILL.md +89 -91
- package/harness/.agents/skills/pc-repo-initialize/SKILL.md +112 -130
- package/harness/.agents/skills/pc-repo-onboard/SKILL.md +32 -87
- package/harness/.agents/skills/pc-repo-verify/SKILL.md +2 -0
- package/harness/.agents/skills/pc-userstory-az/SKILL.md +71 -157
- package/harness/.agents/skills/pc-userstory-browser/SKILL.md +50 -122
- package/harness/.agents/skills/pc-userstory-gh/SKILL.md +63 -120
- package/harness/.agents/skills/pc-userstory-jira/SKILL.md +74 -131
- 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-evidence-scaffold.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/plan-apply.md +9 -9
- package/harness/.opencode/commands/plan-goal.md +5 -5
- package/harness/.opencode/commands/plan-quick.md +5 -5
- package/harness/.opencode/commands/plan-story.md +9 -9
- package/harness/.opencode/commands/repo-audit.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-subagent-monitor.js +82 -2
- package/harness/.opencode/plugins/pc-subagent-tiers.js +9 -6
- package/harness/.opencode/plugins/pc-system-reminders.js +312 -3
- package/harness/AGENTS.md +49 -71
- package/harness/opencode.jsonc +1 -1
- package/package.json +1 -1
|
@@ -1,127 +1,133 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: pc-ops-evidence
|
|
3
|
-
description: Writes a capturePlan in evidence.json for the Visual Evidence CI workflow to execute on a runner with Docker and Chrome access. Load after a change is implemented. Invoked by /ops-evidence
|
|
4
|
-
license: MIT
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Ops Evidence
|
|
8
|
-
|
|
9
|
-
Write a capture plan so the Visual Evidence CI workflow can capture screenshots on a runner with full Docker and Chrome access.
|
|
10
|
-
|
|
11
|
-
The agent runs inside the awf sandbox where Docker-in-Docker is unsupported and headless Chromium's sandbox is blocked by the container security policy. The agent cannot capture screenshots itself. Instead, it analyzes the diff and writes a `capturePlan` in `evidence.json`. A separate CI workflow executes the plan.
|
|
12
|
-
|
|
13
|
-
## Convention
|
|
14
|
-
|
|
15
|
-
Every platform project has `pnpm run dev` at root that starts the **full stack** (database + API + web). The app runs with mock auth in development mode (no real authentication needed). This is the only contract — no per-project evidence harness, fixture apps, or scenario registries.
|
|
16
|
-
|
|
17
|
-
## Input
|
|
18
|
-
|
|
19
|
-
The caller provides (all optional):
|
|
20
|
-
- change id: locates `openspec/changes/{change-id}/` (or the archived `archive/*{change-id}/`).
|
|
21
|
-
- issue / work-item ref and PR number: where to publish.
|
|
22
|
-
- output mode (`default` / `push` / `pr`): whether the branch was pushed.
|
|
23
|
-
- operation: `capture` (default), `publish`, or `both`.
|
|
24
|
-
|
|
25
|
-
## Part 1: Capture (operation: capture / both)
|
|
26
|
-
|
|
27
|
-
**Step 1: Decide whether evidence is required.** Inspect the change's diff:
|
|
28
|
-
- Required when changed files include user-visible UI: `*.tsx/jsx/vue/svelte`, `*.css/scss/less`, pages, layouts, components, navigation.
|
|
29
|
-
- Skipped when docs-only, internal refactor, dependency-only, test-only, backend-only.
|
|
30
|
-
- Mixed or unknown: required (be safe).
|
|
31
|
-
|
|
32
|
-
If skipped: write `evidence.json` with `status: "skipped"` and reason. Done.
|
|
33
|
-
|
|
34
|
-
**Step 2: Discover routes from git diff.** Parse changed files to determine which routes to screenshot:
|
|
35
|
-
- `pages/**/*.tsx` or `app/**/page.tsx` → extract the route path
|
|
36
|
-
- `features/**/*.tsx` or `components/**/*.tsx` → screenshot the homepage and any routes that import the changed component
|
|
37
|
-
- If no routes found → screenshot `/` only
|
|
38
|
-
- Always include `/` (homepage) as a baseline
|
|
39
|
-
|
|
40
|
-
**Step 3: Write `evidence.json` with `capturePlan`.** The agent never attempts to start the app stack or launch a browser — those always fail inside the awf sandbox. Instead, write a `capturePlan` immediately.
|
|
41
|
-
|
|
42
|
-
### The `capturePlan` schema
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
capturePlan:
|
|
46
|
-
routes: # Array of route objects to screenshot (at minimum [{ path: "/" }])
|
|
47
|
-
- path: string # URL path, e.g. "/
|
|
48
|
-
sampleId: # string | "first" | "any" — how to resolve dynamic segments
|
|
49
|
-
caption: # string — human-readable description of what this screenshot shows
|
|
50
|
-
viewports: # Array of viewport objects
|
|
51
|
-
- width: number
|
|
52
|
-
height: number
|
|
53
|
-
label: string # "desktop" | "mobile" | custom
|
|
54
|
-
requireApi: # boolean — true when the route needs the backend API running
|
|
55
|
-
requireLogin: # boolean — true when the route needs authentication
|
|
56
|
-
loginMethod: # string — "mock-sso" | "none" | custom method identifier
|
|
57
|
-
reason: # string — why evidence was blocked and what the screenshots should show
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
### Rules for writing capturePlan
|
|
61
|
-
|
|
62
|
-
1. `routes` MUST always include `{ path: "/", caption: "Homepage" }` as the first entry.
|
|
63
|
-
2. Every additional route discovered from the diff goes after the homepage entry.
|
|
64
|
-
3. `sampleId: "first"` means the CI workflow should use the first record returned by the API
|
|
65
|
-
4. `requireApi` is `true` when any route needs the backend to return data. It is `false` only for purely static pages (login, not-found).
|
|
66
|
-
5. `requireLogin` is `true` when any route needs authentication. For dev mode with mock auth, `loginMethod` is `"mock-sso"`.
|
|
67
|
-
6. `reason` should explain both WHY capture was blocked and WHAT the screenshots should show once captured.
|
|
68
|
-
|
|
69
|
-
### Example `evidence.json`
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
{ "
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
"
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
"
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
##
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
1
|
+
---
|
|
2
|
+
name: pc-ops-evidence
|
|
3
|
+
description: Writes a capturePlan in evidence.json for the Visual Evidence CI workflow to execute on a runner with Docker and Chrome access. Load after a change is implemented. Invoked by /ops-evidence.
|
|
4
|
+
license: MIT
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Ops Evidence
|
|
8
|
+
|
|
9
|
+
Write a capture plan so the Visual Evidence CI workflow can capture screenshots on a runner with full Docker and Chrome access.
|
|
10
|
+
|
|
11
|
+
The agent runs inside the awf sandbox where Docker-in-Docker is unsupported and headless Chromium's sandbox is blocked by the container security policy. The agent cannot capture screenshots itself. Instead, it analyzes the diff and writes a `capturePlan` in `evidence.json`. A separate CI workflow executes the plan.
|
|
12
|
+
|
|
13
|
+
## Convention
|
|
14
|
+
|
|
15
|
+
Every platform project has `pnpm run dev` at root that starts the **full stack** (database + API + web). The app runs with mock auth in development mode (no real authentication needed). This is the only contract — no per-project evidence harness, fixture apps, or scenario registries.
|
|
16
|
+
|
|
17
|
+
## Input
|
|
18
|
+
|
|
19
|
+
The caller provides (all optional):
|
|
20
|
+
- change id: locates `openspec/changes/{change-id}/` (or the archived `archive/*{change-id}/`).
|
|
21
|
+
- issue / work-item ref and PR number: where to publish.
|
|
22
|
+
- output mode (`default` / `push` / `pr`): whether the branch was pushed.
|
|
23
|
+
- operation: `capture` (default), `publish`, or `both`.
|
|
24
|
+
|
|
25
|
+
## Part 1: Capture (operation: capture / both)
|
|
26
|
+
|
|
27
|
+
**Step 1: Decide whether evidence is required.** Inspect the change's diff:
|
|
28
|
+
- Required when changed files include user-visible UI: `*.tsx/jsx/vue/svelte`, `*.css/scss/less`, pages, layouts, components, navigation.
|
|
29
|
+
- Skipped when docs-only, internal refactor, dependency-only, test-only, backend-only.
|
|
30
|
+
- Mixed or unknown: required (be safe).
|
|
31
|
+
|
|
32
|
+
If skipped: write `evidence.json` with `status: "skipped"` and reason. Done.
|
|
33
|
+
|
|
34
|
+
**Step 2: Discover routes from git diff.** Parse changed files to determine which routes to screenshot:
|
|
35
|
+
- `pages/**/*.tsx` or `app/**/page.tsx` → extract the route path
|
|
36
|
+
- `features/**/*.tsx` or `components/**/*.tsx` → screenshot the homepage and any routes that import the changed component
|
|
37
|
+
- If no routes found → screenshot `/` only
|
|
38
|
+
- Always include `/` (homepage) as a baseline
|
|
39
|
+
|
|
40
|
+
**Step 3: Write `evidence.json` with `capturePlan`.** The agent never attempts to start the app stack or launch a browser — those always fail inside the awf sandbox. Instead, write a `capturePlan` immediately.
|
|
41
|
+
|
|
42
|
+
### The `capturePlan` schema
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
capturePlan:
|
|
46
|
+
routes: # Array of route objects to screenshot (at minimum [{ path: "/" }])
|
|
47
|
+
- path: string # URL path, e.g. "/items/:id"
|
|
48
|
+
sampleId: # string | "first" | "any" — how to resolve dynamic segments
|
|
49
|
+
caption: # string — human-readable description of what this screenshot shows
|
|
50
|
+
viewports: # Array of viewport objects
|
|
51
|
+
- width: number
|
|
52
|
+
height: number
|
|
53
|
+
label: string # "desktop" | "mobile" | custom
|
|
54
|
+
requireApi: # boolean — true when the route needs the backend API running
|
|
55
|
+
requireLogin: # boolean — true when the route needs authentication
|
|
56
|
+
loginMethod: # string — "mock-sso" | "none" | custom method identifier
|
|
57
|
+
reason: # string — why evidence was blocked and what the screenshots should show
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Rules for writing capturePlan
|
|
61
|
+
|
|
62
|
+
1. `routes` MUST always include `{ path: "/", caption: "Homepage" }` as the first entry.
|
|
63
|
+
2. Every additional route discovered from the diff goes after the homepage entry.
|
|
64
|
+
3. `sampleId: "first"` means the CI workflow should use the first record returned by the API. `sampleId: "any"` means any valid ID.
|
|
65
|
+
4. `requireApi` is `true` when any route needs the backend to return data. It is `false` only for purely static pages (login, not-found).
|
|
66
|
+
5. `requireLogin` is `true` when any route needs authentication. For dev mode with mock auth, `loginMethod` is `"mock-sso"`.
|
|
67
|
+
6. `reason` should explain both WHY capture was blocked and WHAT the screenshots should show once captured.
|
|
68
|
+
|
|
69
|
+
### Example `evidence.json`
|
|
70
|
+
|
|
71
|
+
Adapt the routes and captions to this repository. Edits between the
|
|
72
|
+
`PC-PROJECT-EXAMPLE` markers are carried over when the harness updates;
|
|
73
|
+
anything outside them is replaced by the shipped version.
|
|
74
|
+
|
|
75
|
+
<!-- PC-PROJECT-EXAMPLE-START -->
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"version": 1,
|
|
79
|
+
"changeId": "status-badge-in-detail-panel",
|
|
80
|
+
"required": true,
|
|
81
|
+
"status": "blocked",
|
|
82
|
+
"assets": [],
|
|
83
|
+
"capturePlan": {
|
|
84
|
+
"routes": [
|
|
85
|
+
{ "path": "/", "sampleId": "any", "caption": "Homepage" },
|
|
86
|
+
{ "path": "/items/:id", "sampleId": "first", "caption": "Item detail with the new status badge" }
|
|
87
|
+
],
|
|
88
|
+
"viewports": [
|
|
89
|
+
{ "width": 1280, "height": 720, "label": "desktop" },
|
|
90
|
+
{ "width": 375, "height": 667, "label": "mobile" }
|
|
91
|
+
],
|
|
92
|
+
"requireApi": true,
|
|
93
|
+
"requireLogin": true,
|
|
94
|
+
"loginMethod": "mock-sso",
|
|
95
|
+
"reason": "Status badge added to the item detail panel; visual change on the detail page."
|
|
96
|
+
},
|
|
97
|
+
"reason": "Visual evidence cannot be captured inside the awf sandbox (Docker-in-Docker unsupported, headless Chromium sandbox blocked). A capturePlan has been written for the Visual Evidence CI workflow.",
|
|
98
|
+
"prMarkdown": "## Evidence\n\nVisual evidence for this change is **blocked** in this agent run. A `capturePlan` has been written to `evidence.json` — the Visual Evidence CI workflow will execute it on a runner with full Docker and Chrome access.\n\nAutomated verification that did run:\n- Lint: clean\n- Tests: all pass\n- Build: success"
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
<!-- PC-PROJECT-EXAMPLE-END -->
|
|
102
|
+
|
|
103
|
+
### When evidence is not required
|
|
104
|
+
|
|
105
|
+
If evidence is skipped (no UI files changed), write without a `capturePlan`:
|
|
106
|
+
|
|
107
|
+
```json
|
|
108
|
+
{
|
|
109
|
+
"version": 1,
|
|
110
|
+
"changeId": "{change-id}",
|
|
111
|
+
"required": false,
|
|
112
|
+
"status": "skipped",
|
|
113
|
+
"assets": [],
|
|
114
|
+
"reason": "No user-visible UI files changed in this PR.",
|
|
115
|
+
"prMarkdown": "## Evidence\n\nSkipped: no user-visible UI changes."
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Capture never commits, stages, or pushes. The caller owns git.
|
|
120
|
+
|
|
121
|
+
## Part 2: Publish (operation: publish / both)
|
|
122
|
+
|
|
123
|
+
Preconditions:
|
|
124
|
+
- An issue/PR number was provided. Else skip.
|
|
125
|
+
- Image URLs resolve only if the branch was pushed (`pr`/`push` modes).
|
|
126
|
+
- Backlog platform from `.opencode/harness.json`; `none` means skip.
|
|
127
|
+
|
|
128
|
+
<!-- PC-PLATFORM-EVIDENCE-START -->
|
|
129
|
+
<!-- PC-PLATFORM-EVIDENCE-END -->
|
|
130
|
+
|
|
131
|
+
## Report
|
|
132
|
+
|
|
133
|
+
One block: the `status` (passed/skipped/failed/blocked) and why; capturePlan written or why not. Never present a blocked capture as passed.
|
|
@@ -15,7 +15,7 @@ The caller provides (all optional):
|
|
|
15
15
|
## Modes
|
|
16
16
|
|
|
17
17
|
- `interactive` (default): report progress to the user and surface failures for their decision.
|
|
18
|
-
- `autonomous`:
|
|
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
19
|
|
|
20
20
|
## Plan source detection
|
|
21
21
|
|
|
@@ -25,9 +25,17 @@ The caller provides (all optional):
|
|
|
25
25
|
|
|
26
26
|
## OpenSpec mode: parallel subagent waves
|
|
27
27
|
|
|
28
|
-
Load `@openspec-apply-change`
|
|
28
|
+
Load `@openspec-apply-change` for change selection, status, and closing. Its
|
|
29
|
+
own implement step does not apply here: annotated tasks are implemented only by
|
|
30
|
+
spawning the annotated tier worker, and the lead never implements. Take that
|
|
31
|
+
step from the protocol below instead.
|
|
29
32
|
|
|
30
|
-
|
|
33
|
+
Referring to it by number would break silently. `@openspec-apply-change` is
|
|
34
|
+
installed by `openspec init --force` with no version pinned, so an inserted step
|
|
35
|
+
upstream renumbers the one being replaced, and the sequential default would then
|
|
36
|
+
run alongside these waves.
|
|
37
|
+
|
|
38
|
+
**Implement via native subagent waves.**
|
|
31
39
|
|
|
32
40
|
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.
|
|
33
41
|
|
|
@@ -35,7 +43,7 @@ Core rule: push, don't pull. A worker is born with its work: every `task()` spaw
|
|
|
35
43
|
|
|
36
44
|
**1. Branch.** Create `feature/{change-slug}` if not already on one. (Skip this step when the caller passed `start_from: load-plan`.)
|
|
37
45
|
|
|
38
|
-
**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).
|
|
46
|
+
**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`).
|
|
39
47
|
|
|
40
48
|
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.
|
|
41
49
|
|
|
@@ -58,7 +66,8 @@ if eligible is empty but tasks remain -> STALL: report blocked tasks + the fail
|
|
|
58
66
|
groups = pack eligible tasks that share a file (touches and gathered context)
|
|
59
67
|
into ONE worker each, to run sequentially (the worker uses the task's `agent`)
|
|
60
68
|
wave = pick groups whose file-sets are pairwise DISJOINT, capped at maxConcurrentAgents
|
|
61
|
-
(
|
|
69
|
+
(opencode runs every task() you emit at once; a spawn past the cap
|
|
70
|
+
is denied, and a denied spawn is not a failed group: re-issue it)
|
|
62
71
|
```
|
|
63
72
|
|
|
64
73
|
**6. Context per group.** For each group, gather the task text, relevant plan decisions, and source context needed to implement it.
|
|
@@ -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}"`.
|
|
13
|
-
4. After all tasks are done, run the project's typecheck/build check if one exists. Fix any errors.
|
|
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
|
-
-
|
|
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. Fix any errors.
|
|
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
|
|
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 -->
|
|
@@ -4,9 +4,26 @@ description: Explore an idea or requirement before planning. Invoked by the /pla
|
|
|
4
4
|
license: MIT
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Explore, then hand back what you learned. `@openspec-explore` supplies the
|
|
8
|
+
stance; this skill adds one prohibition and one handoff.
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
## Rules
|
|
11
|
+
|
|
12
|
+
- Never write, edit, or create a file while this skill is loaded, OpenSpec
|
|
13
|
+
artifacts included. This overrides `@openspec-explore`, which says creating
|
|
14
|
+
them is "fine". Reading, searching, and discussing are the whole job.
|
|
15
|
+
- If the conversation turns toward implementation, say explore mode is active
|
|
16
|
+
and point at `/plan-apply`.
|
|
17
|
+
|
|
18
|
+
Load `@openspec-explore` for the approach.
|
|
19
|
+
|
|
20
|
+
## Autonomous handoff
|
|
21
|
+
|
|
22
|
+
When a caller loads this skill in autonomous mode, return `EXPLORATION_BRIEF`
|
|
23
|
+
in memory rather than writing a file. It holds: the problem in one or two
|
|
24
|
+
sentences, the affected paths, the approach chosen, the risks worth knowing,
|
|
25
|
+
and anything deliberately out of scope. `pc-plan-goal` requires it before its
|
|
26
|
+
propose phase.
|
|
10
27
|
|
|
11
28
|
<!-- PC-OPTIMIZATION-MEMORY-START -->
|
|
12
29
|
<!-- PC-OPTIMIZATION-MEMORY-END -->
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
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.
|
|
3
|
+
description: "Autonomous pipeline: explore, propose, apply, archive, then merge/PR/push. For loop-engineering. Invoked by the /plan-goal command."
|
|
4
4
|
license: MIT
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -14,7 +14,7 @@ Move forward only when a phase returns its required result. On a hard failure, f
|
|
|
14
14
|
|
|
15
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
16
|
|
|
17
|
-
|
|
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
18
|
|
|
19
19
|
Input: `$ARGUMENTS`
|
|
20
20
|
|
|
@@ -30,7 +30,9 @@ Load the [output mode](output-mode.md) reference and resolve the mode from the f
|
|
|
30
30
|
- Preserve title, description, work-item reference, and acceptance criteria as `{resolved_input}`.
|
|
31
31
|
- Derive `{slug}` and classify scope as `focused`, `standard`, or `complex`.
|
|
32
32
|
|
|
33
|
-
**Refined-issue detection:**
|
|
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`.
|
|
34
36
|
|
|
35
37
|
## Phase 1: Branch
|
|
36
38
|
|
|
@@ -46,10 +48,10 @@ Tick `explore` when `pc-plan-explore` returns its findings handoff.
|
|
|
46
48
|
|
|
47
49
|
## Phase 3: Propose
|
|
48
50
|
|
|
49
|
-
**Skip if `{refined}` is `true`.** Instead, create a minimal OpenSpec change directly: run `openspec new change "{change-id}"`, write `tasks.md` from the issue's acceptance criteria (one task per criterion or artifact group), create `.openspec.yaml` with `skip_specs: true` (the issue already has the spec content), and commit: `git add openspec/changes/{change-id}/ && git commit -m "propose: {title} ({change-id})"`.
|
|
50
|
-
|
|
51
51
|
Load `pc-plan-propose` in autonomous mode with `{resolved_input}`, `EXPLORATION_BRIEF`, and `scope_classification`.
|
|
52
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
|
+
|
|
53
55
|
Confirm its change directory and actionable `tasks.md` exist. Rename `$BRANCH` when the canonical change slug differs from `{slug}`, then commit the proposal:
|
|
54
56
|
|
|
55
57
|
```bash
|
|
@@ -4,6 +4,7 @@ Determine the mode only from the first whitespace-delimited token of `$ARGUMENTS
|
|
|
4
4
|
|
|
5
5
|
- `pr`: remove the token, push the feature branch, and create a PR.
|
|
6
6
|
- `push`: remove the token and push the feature branch.
|
|
7
|
+
- `branch`: remove the token, keep the feature branch, merge nothing and push nothing.
|
|
7
8
|
- Any other first token: keep the full input and merge locally into the default branch.
|
|
8
9
|
|
|
9
10
|
Words such as "push notifications" or "PR template" inside the feature description are feature data. They do not change output mode.
|