oc-harness-setup 0.2.0 → 0.3.1
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/.docs/unwired-routing.md +14 -9
- package/.gitignore +14 -1
- package/AGENTS.md +70 -106
- package/README.md +55 -24
- package/agents/build.md +10 -12
- package/agents/explore.md +14 -8
- package/agents/general.md +7 -9
- package/agents/orchestrator.md +38 -0
- package/agents/plan.md +10 -13
- package/agents/reviewer.md +9 -14
- package/agents/vault.md +44 -35
- package/bin/cli.js +32 -3
- package/commands/build.md +2 -8
- package/commands/checkpoint.md +3 -1
- package/commands/code-simplify.md +3 -9
- package/commands/gauntlet.md +7 -0
- package/commands/handoff.md +3 -1
- package/commands/keeper.md +3 -3
- package/commands/kill.md +11 -0
- package/commands/plan.md +2 -13
- package/commands/retro.md +15 -0
- package/commands/review.md +1 -1
- package/commands/ship.md +3 -27
- package/commands/spec.md +3 -11
- package/commands/test.md +2 -9
- package/commands/webperf.md +7 -0
- package/opencode.jsonc +23 -8
- package/package.json +5 -4
- package/reference/README.md +14 -14
- package/reference/auto-mandate.md +11 -0
- package/reference/backup-convention.md +9 -0
- package/reference/clean-mandate.md +13 -0
- package/reference/editor-parity.md +7 -0
- package/reference/gc-scripts.md +8 -0
- package/reference/intent-routing.md +14 -0
- package/reference/lifecycle.md +15 -0
- package/reference/model-keeper.md +30 -10
- package/reference/model-test.md +11 -6
- package/reference/models.md +25 -14
- package/reference/oc-source-map.md +162 -0
- package/reference/owner-pin.md +31 -0
- package/reference/roster.md +15 -0
- package/reference/session-scope.md +9 -0
- package/reference/session-state.md +13 -0
- package/reference/swarm.md +32 -0
- package/scripts/backup-config.ps1 +42 -0
- package/scripts/gc-branch.ps1 +196 -0
- package/scripts/gc-bump.ps1 +198 -0
- package/scripts/gc-clean.ps1 +648 -0
- package/scripts/gc-commit.ps1 +143 -0
- package/scripts/gc-merge.ps1 +272 -0
- package/scripts/gc-pr.ps1 +190 -0
- package/scripts/gc-push.ps1 +111 -0
- package/scripts/gc-read.ps1 +150 -0
- package/scripts/gc-rebase.ps1 +162 -0
- package/scripts/gc-release.ps1 +225 -0
- package/scripts/gc-stage.ps1 +103 -0
- package/scripts/gc-status.ps1 +127 -0
- package/scripts/gc-sync.ps1 +65 -0
- package/scripts/gc.core.ps1 +715 -0
- package/scripts/gc.smoke.ps1 +779 -0
- package/scripts/harness-doctor.ps1 +11 -9
- package/scripts/interrupt-session.ps1 +65 -0
- package/scripts/logbook/README.md +108 -0
- package/scripts/logbook/logbook.test.ts +440 -0
- package/scripts/logbook/logbook.ts +797 -0
- package/scripts/pirep/README.md +147 -0
- package/scripts/pirep/pirep.test.ts +735 -0
- package/scripts/pirep/pirep.ts +836 -0
- package/scripts/testflight/README.md +112 -0
- package/scripts/testflight/testflight.test.ts +512 -0
- package/scripts/testflight/testflight.ts +806 -0
- package/skills/_shared/SOURCES.md +7 -7
- package/skills/_shared/references/definition-of-done.md +2 -2
- package/skills/_shared/references/orchestration-patterns.md +1 -2
- package/skills/_shared/references/security-checklist.md +2 -2
- package/skills/api-and-interface-design/SKILL.md +7 -360
- package/skills/browser-testing-with-devtools/SKILL.md +303 -0
- package/skills/code-simplification/SKILL.md +7 -364
- package/skills/creative-writing/SKILL.md +1 -1
- package/skills/debugging-and-error-recovery/SKILL.md +8 -309
- package/skills/flight-deck/SKILL.md +17 -0
- package/skills/frontend-ui-engineering/SKILL.md +8 -320
- package/skills/gauntlet/SKILL.md +21 -0
- package/skills/git-ceremony/SKILL.md +16 -318
- package/skills/grilling/SKILL.md +10 -30
- package/skills/observability-and-instrumentation/SKILL.md +9 -229
- package/skills/performance-optimization/SKILL.md +8 -488
- package/skills/pilot-report/SKILL.md +18 -0
- package/skills/planning-and-task-breakdown/SKILL.md +8 -249
- package/skills/security-and-hardening/SKILL.md +9 -490
- package/skills/source-driven-development/SKILL.md +8 -208
- package/skills/spec-driven-development/SKILL.md +15 -234
- package/skills/test-driven-development/SKILL.md +8 -388
- package/skills/test-flight/SKILL.md +14 -0
- package/skills/writing-for-agents/SKILL-MECHANICS.md +3 -3
- package/skills/writing-for-agents/SKILL.md +7 -1
- package/agents/coder.md +0 -19
- package/agents/documenter.md +0 -28
- package/agents/keeper.md +0 -22
- package/agents/master.md +0 -70
- package/agents/researcher.md +0 -21
- package/agents/security-auditor.md +0 -20
- package/agents/test-engineer.md +0 -20
- package/agents/web-performance-auditor.md +0 -19
- package/commands/council.md +0 -24
- package/commands/doctor.md +0 -19
- package/commands/ponytail-audit.md +0 -7
- package/commands/ponytail-debt.md +0 -14
- package/commands/report.md +0 -13
- package/scripts/harness-report.ps1 +0 -695
- package/scripts/panic/panic.ts +0 -240
- package/skills/code-review-and-quality/SKILL.md +0 -396
- package/skills/incremental-implementation/SKILL.md +0 -249
- package/skills/swarm-orchestration/SKILL.md +0 -54
package/agents/vault.md
CHANGED
|
@@ -1,64 +1,73 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "
|
|
2
|
+
description: "Privileged background worker for OpenCode harness files and credential-bearing paths; values never leave their files."
|
|
3
3
|
mode: subagent
|
|
4
|
-
# model: <YOUR_MODEL>
|
|
5
4
|
steps: 40
|
|
6
5
|
permissions:
|
|
7
|
-
- action:
|
|
6
|
+
- action: "*"
|
|
7
|
+
resource: "~/.config/opencode/*"
|
|
8
|
+
effect: allow
|
|
9
|
+
- action: "*"
|
|
8
10
|
resource: "*secrets*"
|
|
9
11
|
effect: allow
|
|
10
|
-
- action:
|
|
12
|
+
- action: "*"
|
|
11
13
|
resource: "*.env*"
|
|
12
14
|
effect: allow
|
|
13
|
-
- action:
|
|
15
|
+
- action: "*"
|
|
16
|
+
resource: "*credentials*"
|
|
17
|
+
effect: allow
|
|
18
|
+
- action: "*"
|
|
19
|
+
resource: "*auth.json*"
|
|
20
|
+
effect: allow
|
|
21
|
+
- action: "*"
|
|
14
22
|
resource: "*service.json*"
|
|
15
23
|
effect: allow
|
|
16
|
-
- action:
|
|
17
|
-
resource: "
|
|
24
|
+
- action: "*"
|
|
25
|
+
resource: "*id_rsa*"
|
|
18
26
|
effect: allow
|
|
19
|
-
- action:
|
|
20
|
-
resource: "*
|
|
27
|
+
- action: "*"
|
|
28
|
+
resource: "*id_ed25519*"
|
|
21
29
|
effect: allow
|
|
22
|
-
- action:
|
|
23
|
-
resource: "
|
|
30
|
+
- action: "*"
|
|
31
|
+
resource: "*id_ecdsa*"
|
|
24
32
|
effect: allow
|
|
25
|
-
- action:
|
|
26
|
-
resource: "*
|
|
33
|
+
- action: "*"
|
|
34
|
+
resource: "*id_dsa*"
|
|
27
35
|
effect: allow
|
|
28
|
-
- action:
|
|
29
|
-
resource: "*
|
|
36
|
+
- action: "*"
|
|
37
|
+
resource: "*.pem*"
|
|
30
38
|
effect: allow
|
|
31
|
-
- action:
|
|
32
|
-
resource: "*.
|
|
39
|
+
- action: "*"
|
|
40
|
+
resource: "*.key*"
|
|
33
41
|
effect: allow
|
|
34
|
-
- action:
|
|
35
|
-
resource: "*
|
|
42
|
+
- action: "*"
|
|
43
|
+
resource: "*.pfx*"
|
|
36
44
|
effect: allow
|
|
37
|
-
- action:
|
|
38
|
-
resource: "*
|
|
45
|
+
- action: "*"
|
|
46
|
+
resource: "*.p12*"
|
|
39
47
|
effect: allow
|
|
40
|
-
- action:
|
|
41
|
-
resource: "*.
|
|
48
|
+
- action: "*"
|
|
49
|
+
resource: "*.netrc*"
|
|
50
|
+
effect: allow
|
|
51
|
+
- action: "*"
|
|
52
|
+
resource: "*.npmrc*"
|
|
42
53
|
effect: allow
|
|
43
54
|
- action: shell
|
|
44
|
-
resource: "*
|
|
55
|
+
resource: "*"
|
|
45
56
|
effect: allow
|
|
46
57
|
- action: subagent
|
|
47
58
|
resource: "*"
|
|
48
59
|
effect: deny
|
|
49
60
|
- action: question
|
|
50
61
|
resource: "*"
|
|
51
|
-
effect:
|
|
62
|
+
effect: deny
|
|
52
63
|
---
|
|
53
64
|
|
|
54
|
-
You are the
|
|
65
|
+
You are the privileged background worker for OpenCode harness files and credential-bearing paths.
|
|
55
66
|
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
-
|
|
62
|
-
-
|
|
63
|
-
- Work only within the brief; one writer per artifact. You do not spawn helpers and you do not hand off review; the parent owns both.
|
|
64
|
-
- Report by pointer: paths + key names touched, commands run, evidence shape, remaining risk, next step.
|
|
67
|
+
- The harness is intentionally editable. When the user requests a change under `~/.config/opencode/`, implement it normally; no extra approval or fixed-config assumption applies.
|
|
68
|
+
- For agent-facing prose or skill structure, exact-load `writing-for-agents`; it is explicit-only to avoid taxing unrelated turns.
|
|
69
|
+
- Values never leave their files. Work by path and key name; never print, paste, echo, log, commit, or place a value in a URL or session artifact.
|
|
70
|
+
- Read the narrowest shape needed. Verify presence, parsing, permissions, or hashes in-process without returning contents.
|
|
71
|
+
- Back up credential files before changing them, write atomically, and verify consumers afterward. Keep examples placeholder-only and confirm project secret files are ignored.
|
|
72
|
+
- Work only inside the brief. Do not delegate, ask the user, or perform adjacent maintenance.
|
|
73
|
+
- Report only what matters for this task: paths and key names touched, commands run, evidence shape, remaining risk, and the next action — each only when it has real content, omit otherwise.
|
package/bin/cli.js
CHANGED
|
@@ -39,11 +39,11 @@ const COPY_FILES = ['AGENTS.md', '.gitignore'];
|
|
|
39
39
|
// allowlist is deny-then-allows; see mergeJsonc).
|
|
40
40
|
// everything else (known or unknown) — the adopter's value wins; the distro
|
|
41
41
|
// value stays when the adopter does not define the key.
|
|
42
|
-
const INSTALL_OWNED = ['$schema', 'default_agent', 'compaction', 'tool_output', 'media', 'watcher'];
|
|
42
|
+
const INSTALL_OWNED = ['$schema', 'default_agent', 'formatter', 'compaction', 'tool_output', 'media', 'watcher'];
|
|
43
43
|
const UNION_KEYS = ['plugins'];
|
|
44
44
|
// Adopter-owned files: shipped copies are skeletons, so an existing destination
|
|
45
45
|
// that differs MUST survive an upgrade — overwriting it destroys their data.
|
|
46
|
-
const PRESERVE_IF_EXISTS = new Set(['reference/models.md', 'AGENTS.md', '.gitignore']);
|
|
46
|
+
const PRESERVE_IF_EXISTS = new Set(['reference/models.md', 'reference/owner-pin.md', 'AGENTS.md', '.gitignore']);
|
|
47
47
|
// Author-leak markers — they catch the MAINTAINER's machine leaking into the
|
|
48
48
|
// shipped tree (paths, username, session ids). They are linted against the
|
|
49
49
|
// package source only, never the adopter's config, so a legitimate
|
|
@@ -510,6 +510,31 @@ function registerPlugins() {
|
|
|
510
510
|
return list;
|
|
511
511
|
}
|
|
512
512
|
|
|
513
|
+
// The doctor's Law 6 grades `opencode plugin list`, but right after `plugin
|
|
514
|
+
// add` on a fresh config the registry can lag the file write by minutes - the
|
|
515
|
+
// doctor would grade an empty list and fail. Poll the list (bounded: up to 10
|
|
516
|
+
// attempts, 6 s apart) until every requested name appears in a row, mirroring
|
|
517
|
+
// the doctor's own row-contains-name check. Warning-only on expiry - exit
|
|
518
|
+
// codes are unchanged (the doctor grades; a re-run is idempotent).
|
|
519
|
+
async function waitForPluginRegistration(plugins, configDir) {
|
|
520
|
+
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
521
|
+
for (let attempt = 1; attempt <= 10; attempt++) {
|
|
522
|
+
const res = exec('opencode', ['plugin', 'list'], true);
|
|
523
|
+
const rows = (res.stdout || '').split(/\r?\n/).filter((l) => l.trim() !== '');
|
|
524
|
+
const missing = plugins.filter((name) => !rows.some((row) => row.includes(name)));
|
|
525
|
+
const state = res.error || res.status !== 0
|
|
526
|
+
? `list failed (${res.error ? 'not found' : `exit ${res.status}`})`
|
|
527
|
+
: `${rows.length} row(s), missing: ${missing.length ? missing.join(', ') : 'none'}`;
|
|
528
|
+
log('plugin', `registration wait ${attempt}/10 (${configDir}) - ${state}`);
|
|
529
|
+
if (!missing.length) {
|
|
530
|
+
for (const name of plugins) log('plugin', `${name} appears in the registry`);
|
|
531
|
+
return;
|
|
532
|
+
}
|
|
533
|
+
if (attempt < 10) await sleep(6000);
|
|
534
|
+
}
|
|
535
|
+
console.warn(`[plugin] WARNING: plugin registry did not confirm ${plugins.join(', ')} within 60s - the doctor will grade it; re-run setup (idempotent) if it fails`);
|
|
536
|
+
}
|
|
537
|
+
|
|
513
538
|
/* --------------------------------- doctor ---------------------------------- */
|
|
514
539
|
|
|
515
540
|
function pwshProbe() {
|
|
@@ -560,7 +585,7 @@ function printManifest(configDir, files, backupPath, doctor) {
|
|
|
560
585
|
console.log(` incoming files : ${files.length} (${newCount} new, ${sameCount} already identical — rerun-safe)`);
|
|
561
586
|
console.log(` backup path : ${backupPath}`);
|
|
562
587
|
console.log(' opencode.jsonc merge : distro base (permissions/deny block, skill allowlist,');
|
|
563
|
-
console.log(' default_agent: "
|
|
588
|
+
console.log(' default_agent: "orchestrator", references registry)');
|
|
564
589
|
console.log(' + your keys kept · permissions: harness allows, yours, harness denies last');
|
|
565
590
|
console.log(' plugin registration : oc-flight-deck (via \'opencode plugin add\')');
|
|
566
591
|
console.log(` doctor plan : ${doctor}`);
|
|
@@ -794,6 +819,10 @@ async function setup(opts) {
|
|
|
794
819
|
registerPlugins();
|
|
795
820
|
mergeJsonc(configDir, backup, manifest);
|
|
796
821
|
|
|
822
|
+
// Right after a fresh `plugin add` the registry can lag by minutes; wait
|
|
823
|
+
// (bounded) for it to settle so the doctor's Law 6 grades a settled list.
|
|
824
|
+
await waitForPluginRegistration(manifest.plugins, configDir);
|
|
825
|
+
|
|
797
826
|
// R6: record the skip in the journal so "all 16 laws unrun" is never silent.
|
|
798
827
|
manifest.doctorSkipped = !doctorProbe.usable || !existsSync(path.join(configDir, 'scripts', 'harness-doctor.ps1'));
|
|
799
828
|
writeManifest(configDir, manifest);
|
package/commands/build.md
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Implement the request with the smallest working change
|
|
3
3
|
agent: build
|
|
4
|
+
subagent: true
|
|
4
5
|
---
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
- Pick the local skill that fits: `spec-driven-development` for a new or specified feature, `incremental-implementation` for the build loop, `test-driven-development` when tests should come first, and `debugging-and-error-recovery` for hard bugs. For UI, consult `frontend-ui-engineering`; for API boundaries, use `api-and-interface-design`.
|
|
9
|
-
- Inspect before editing; understand the real flow, then stop at the first rung that holds.
|
|
10
|
-
- Preserve safety, validation, security, accessibility, reversibility, and anything the user explicitly asked for — never lean these away.
|
|
11
|
-
- Run the narrow check that proves the change and report: files changed, what you ran, what it proved, and residual risk.
|
|
12
|
-
- Mark deliberate shortcuts with `lean: <ceiling>; revisit when <trigger>` so `/ponytail-debt` can collect them.
|
|
13
|
-
- For work that splits at natural seams, spawn helpers in parallel with one writer per artifact; follow the `swarm-orchestration` skill.
|
|
7
|
+
Implement `$ARGUMENTS` inside the supplied scope. Define done, inspect first, make the smallest coherent change, run the narrow proving check, and return changed files and evidence, adding residual risk and anything unverified only when they have real content, omit otherwise. Do not widen scope or delegate.
|
package/commands/checkpoint.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Write or refresh this session's checkpoint
|
|
3
|
+
agent: orchestrator
|
|
4
|
+
subagent: false
|
|
3
5
|
---
|
|
4
6
|
|
|
5
|
-
Update `
|
|
7
|
+
Update `session.yaml` in this session's state directory with goal, done, now, next, key files, and blockers. Append one timestamped event to `events.yaml`. `$ARGUMENTS` optionally narrows the checkpoint. Keep it terse; never create Markdown state files.
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Simplify current changes by cutting unnecessary complexity
|
|
3
|
-
agent:
|
|
3
|
+
agent: general
|
|
4
|
+
subagent: true
|
|
4
5
|
---
|
|
5
6
|
|
|
6
|
-
Simplify `$ARGUMENTS` (default:
|
|
7
|
-
|
|
8
|
-
1. First **review** the target for what can be cut — tags `delete` (dead code, unused flags), `stdlib` (reinvented standard library), `native` (platform features replaced by custom code), `yagni` (speculative flexibility), `shrink` (over-abstraction). Or run `/ponytail-audit --diff` first if the diff is large.
|
|
9
|
-
2. Then **apply** the safe cuts: one writer per artifact, smallest diff, no behavior change unless removing the behavior is the point.
|
|
10
|
-
3. Preserve the lean safety floor: validation, security, accessibility, reversibility, and explicit user requirements are never cut.
|
|
11
|
-
4. Run the check that proves behavior is unchanged (or correctly simpler) and report: what was cut, lines/dependencies removed, what you ran, and what it proved.
|
|
12
|
-
|
|
13
|
-
Mark anything you deliberately deferred with `lean: <ceiling>; revisit when <trigger>`. Route correctness, security, and performance findings to `/review` — this command cuts complexity only.
|
|
7
|
+
Simplify `$ARGUMENTS` (default: current changes) using `code-simplification`. Remove dead or speculative machinery and prefer standard or native behavior while preserving requirements, safety, accessibility, and reversibility. Run the proving check and report what was removed and the evidence, adding residual risk only when it has real content, omit otherwise. Do not pursue unrelated defects.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Closed-loop challenge engine - drive $ARGUMENTS to a defined green (challenge, revise, re-challenge)
|
|
3
|
+
agent: orchestrator
|
|
4
|
+
subagent: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Run the explicit `gauntlet` workflow against `$ARGUMENTS` (default: current changes). Pre-register acceptance evidence, dispatch bounded challenge and repair rounds, keep challengers read-only and one writer per artifact, then report the terminal verdict and evidence. Never move the acceptance bar mid-loop.
|
package/commands/handoff.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Write a handoff for a fresh session
|
|
3
|
+
agent: orchestrator
|
|
4
|
+
subagent: false
|
|
3
5
|
---
|
|
4
6
|
|
|
5
|
-
Write `handoff
|
|
7
|
+
Write `session.yaml.handoff` in this session's state directory: goal, current state, exact next steps, files to read first, and open decisions. `$ARGUMENTS` optionally narrows the handoff. Never create Markdown state files.
|
package/commands/keeper.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Refresh the model catalog
|
|
3
|
-
agent:
|
|
2
|
+
description: Refresh the model catalog from live evidence
|
|
3
|
+
agent: vault
|
|
4
4
|
subagent: true
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
Refresh
|
|
7
|
+
Refresh `~/.config/opencode/reference/models.md` from live evidence using `~/.config/opencode/reference/model-keeper.md`. Do not change agent pins, routing, or bindings. Apply only sourced catalog corrections and report changes, sources, uncertainty, or a clean no-change result.
|
package/commands/kill.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Kill a session now — interrupt its active execution in place
|
|
3
|
+
agent: orchestrator
|
|
4
|
+
subagent: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
If `$ARGUMENTS` is empty, ask once for one target and stop. Otherwise run:
|
|
8
|
+
|
|
9
|
+
`pwsh -NoProfile -File "$HOME/.config/opencode/scripts/interrupt-session.ps1" "$ARGUMENTS"`
|
|
10
|
+
|
|
11
|
+
Return the script's single result. Never substitute a message, deletion, batch sweep, or guessed session ID for the interrupt.
|
package/commands/plan.md
CHANGED
|
@@ -1,18 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Produce an implementation plan with steps, ownership, and acceptance evidence
|
|
3
3
|
agent: plan
|
|
4
|
-
subagent:
|
|
4
|
+
subagent: false
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
> Scale ceremony to blast radius — tiny stays tiny, big gets a plan plus helpers.
|
|
9
|
-
> Route via the existing intent table and lifecycle; no new routes, no second router.
|
|
10
|
-
|
|
11
|
-
Plan `$ARGUMENTS`. Inspect the current system before planning (spawn `explore` for recon only when the codebase is unknown). Produce a user-facing plan:
|
|
12
|
-
|
|
13
|
-
- **Outcome:** the definition of done, stated so anyone can verify it.
|
|
14
|
-
- **Approach:** the shape of the solution and the lean rung it stops at (remove the need → reuse → stdlib → native platform → installed dependency → minimum change).
|
|
15
|
-
- **Ordered steps:** each with an owner (local specialist: `coder`, `explore`, `reviewer`, `documenter`, `keeper`), what it changes, and its acceptance evidence — the narrow runnable check that proves it.
|
|
16
|
-
- **Risks and open decisions:** with the smallest next action for each.
|
|
17
|
-
|
|
18
|
-
Write `plan.md` to this session's state directory (`~/.opencode/state/sessions/<session-id>/`). If the steps aren't obvious yet, state the one decision that must be sharpened rather than inventing detail. Leave implementation to `/build`.
|
|
7
|
+
Plan `$ARGUMENTS`. Inspect through `explore` when evidence is missing, then produce in chat: outcome, scope and exclusions, approach, ordered steps with owners, acceptance evidence, risks, and open decisions. Do not implement or write files. Hand approved execution to `orchestrator`.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Run the bounded retro pass over logbook + pattern inbox; emit a proposal queue, never edits
|
|
3
|
+
agent: general
|
|
4
|
+
subagent: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Run one bounded retro pass. Read `~/.opencode/memory/patterns.md` and query `logbook` read-only; never use `--reindex`.
|
|
8
|
+
|
|
9
|
+
Caps (hard): ≤8 logbook queries, ≤50 hits per query (`--limit=50`), ≤30 min wall-clock, repeat threshold ≥3 distinct sessions. If a query hits its cap, stop paging and record the cap-hit as a finding about corpus size, not a failure.
|
|
10
|
+
|
|
11
|
+
Look for repeated friction: hand-typed commands, failed or thrashing dispatches, violated instructions, and user restatements. Return a proposal queue to the parent; do not write the child session's state. Each item includes evidence, uncertainty, and one outcome (`core invariant`, `agent`, `skill`, `command`, `reference`, `delete`, or `discard`).
|
|
12
|
+
|
|
13
|
+
Never apply the queue here — applying is always a separate, reviewed step. Never touch `~/.config/opencode/scripts/`, `~/.config/opencode/agents/`, `~/.config/opencode/skills/`, `~/.config/opencode/opencode.jsonc`, or `~/.config/opencode/AGENTS.md` from this command. Never read or print `.secrets` / `.env`.
|
|
14
|
+
|
|
15
|
+
Close with queries and hit counts, proposals or honest-empty evidence, caps hit, and anything unverified.
|
package/commands/review.md
CHANGED
|
@@ -4,4 +4,4 @@ agent: reviewer
|
|
|
4
4
|
subagent: true
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Review `$ARGUMENTS` independently. Inspect behavior, run relevant checks, report findings in severity order with `file:line` evidence, and end with one verdict (`pass`, `revise`, or `blocked`) plus the smallest next action. Do not edit or delegate.
|
package/commands/ship.md
CHANGED
|
@@ -1,31 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Bounded parallel review fan-out, then a lead go/no-go merge decision
|
|
3
|
+
agent: orchestrator
|
|
4
|
+
subagent: false
|
|
3
5
|
---
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## Phase 1 — Bounded parallel fan-out
|
|
8
|
-
|
|
9
|
-
Verify in parse → smoke → fresh-eyes order: well-formed first, then the narrow runnable check, then independent review.
|
|
10
|
-
Never weaken the check to fake a green; report check output verbatim, not paraphrased.
|
|
11
|
-
The 3-way fan-out below is unchanged.
|
|
12
|
-
|
|
13
|
-
Spawn these three specialists **in parallel** with short briefs (what, where, done, how to prove it). Bounded: each gets one pass, no grandchildren, findings only — nobody edits files.
|
|
14
|
-
|
|
15
|
-
- **`reviewer`** — independent verification: inspect the changes and their real behavior, run the checks that matter, report findings in severity order with file:line evidence, end with exactly one verdict (`pass`, `revise`, `blocked`).
|
|
16
|
-
- **`security-auditor`** — security-only pass: boundary validation, secrets by pointer, injection surfaces, auth/authz changes, unsafe dependency additions. Report findings in severity order with file:line evidence and a verdict (`pass`, `revise`, `blocked`).
|
|
17
|
-
- **`test-engineer`** — test evidence: run the existing suite, confirm coverage of the changed behavior, report what passed/failed/untested and the risk that leaves. Verdict (`pass`, `revise`, `blocked`).
|
|
18
|
-
|
|
19
|
-
## Phase 2 — Lead merge
|
|
20
|
-
|
|
21
|
-
As lead, merge the three reports yourself. Do not spawn a router agent. Resolve conflicts from fresh evidence (re-check a claim yourself if two reports disagree); never trust an unchecked claim. Collapse into one findings list in severity order.
|
|
22
|
-
|
|
23
|
-
## Phase 3 — Go/no-go
|
|
24
|
-
|
|
25
|
-
Emit exactly one decision:
|
|
26
|
-
|
|
27
|
-
- **GO:** all three verdicts pass; no open high-severity findings; evidence is fresh. Next: ship via the repository's normal flow, preserving its existing isolation and commit checks.
|
|
28
|
-
- **NO-GO (revise):** any `revise` verdict or high-severity finding. List the smallest fixes with owners (`coder` for implementation, `test-engineer` for gaps), then re-run `/ship` after they land.
|
|
29
|
-
- **NO-GO (blocked):** any `blocked` verdict, or a safety-constraint violation (validation, security, accessibility, secrets, reversibility). State the blocker and the explicit next action.
|
|
30
|
-
|
|
31
|
-
Report the three verdicts, the merged findings, and the decision. Close with result, evidence, remaining risk, next step.
|
|
7
|
+
Gate `$ARGUMENTS` (default: current changes). Dispatch three one-pass reviewers in parallel: correctness, security, and test evidence. Each is read-only, bounded, and returns findings plus one verdict. Merge the reports; if they conflict, dispatch one focused reviewer for the disputed claim. Emit exactly one decision: `GO`, `NO-GO (revise)`, or `NO-GO (blocked)`, with whatever evidence, risk, and next action actually exist — omit any section with no real content (a clean `GO` carries no risk field). Never weaken checks or ship on stale evidence.
|
package/commands/spec.md
CHANGED
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Turn
|
|
2
|
+
description: Turn the current request into a sharp, buildable spec — inline, in this conversation
|
|
3
3
|
agent: plan
|
|
4
|
-
subagent:
|
|
4
|
+
subagent: false
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
- **Outcome:** what "done" means, observable.
|
|
10
|
-
- **In scope / out of scope:** explicit non-goals.
|
|
11
|
-
- **Constraints:** safety, validation, security, accessibility, platform limits — the things that must never be leaned away.
|
|
12
|
-
- **Acceptance evidence:** how each part will be proven (the check that runs).
|
|
13
|
-
- **Risks and open decisions:** what would change the build if answered differently.
|
|
14
|
-
|
|
15
|
-
If the request is ambiguous enough that a wrong build would be expensive, don't guess — run the `grilling` skill to settle the open decisions first, then return to the spec. When the user wants this published, write the approved spec to the requested project artifact; otherwise report it only. Implement nothing.
|
|
7
|
+
Turn `$ARGUMENTS`—or the current request—into a buildable spec using `spec-driven-development`. Inspect through `explore` when facts are missing. Produce the spec in chat: observable outcome, scope and non-goals, constraints, acceptance evidence, risks, and open decisions. Ask only for decisions that materially change the outcome. Do not write files or implement; hand approved work to `orchestrator`.
|
package/commands/test.md
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Run tests and report evidence — identify the narrowest missing coverage
|
|
3
|
-
agent:
|
|
3
|
+
agent: reviewer
|
|
4
4
|
subagent: true
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
1. Run the existing test/check suite first and report results as evidence — exact commands and outcomes.
|
|
10
|
-
2. If behavior lacks coverage, describe the narrowest tests that would prove it, following the local `test-driven-development` skill (red-green-refactor). Do not add them in this read-only audit; hand the test task to `/build`.
|
|
11
|
-
3. Do not edit product code or tests to make the report pass. Report genuine defects separately with file:line evidence.
|
|
12
|
-
4. Never weaken assertions, skip flaky tests silently, or lower coverage to get green.
|
|
13
|
-
|
|
14
|
-
End with: what passed, what failed, what is untested (with the risk that leaves), and the smallest next action.
|
|
7
|
+
Audit tests for `$ARGUMENTS` (default: current changes). Run the existing narrow suite first, report exact commands and outcomes, identify the smallest missing coverage, and separate genuine defects from test gaps. Do not edit, weaken assertions, hide flakes, or lower coverage. Return what passed, failed, remains untested, the resulting risk, and the smallest next action.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Audit load/runtime cost and Core Web Vitals risks with prioritized fixes
|
|
3
|
+
agent: reviewer
|
|
4
|
+
subagent: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Audit web performance for `$ARGUMENTS` (default: current project or diff) using `performance-optimization` and, when runnable, `browser-testing-with-devtools`. Measure load cost, runtime cost, and Core Web Vitals risk. Cite files, assets, or measurements; report prioritized `<risk> → <fix> → <expected impact>` findings and the highest-value next action. Do not edit.
|
package/opencode.jsonc
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
// This is the oc-harness-setup base config; the installer preserves your
|
|
7
7
|
// model/providers/mcp/plugins.
|
|
8
8
|
"$schema": "https://opencode.ai/config.json",
|
|
9
|
-
"default_agent": "
|
|
9
|
+
"default_agent": "orchestrator",
|
|
10
|
+
"formatter": true,
|
|
10
11
|
"compaction": {
|
|
11
12
|
"auto": true,
|
|
12
13
|
"keep": {
|
|
@@ -63,7 +64,11 @@
|
|
|
63
64
|
"references": {
|
|
64
65
|
"orchestration": {
|
|
65
66
|
"path": "~/.config/opencode/reference",
|
|
66
|
-
"description": "Harness references
|
|
67
|
+
"description": "Harness references - smoke checks, model keeper, db hygiene."
|
|
68
|
+
},
|
|
69
|
+
"quality": {
|
|
70
|
+
"path": "~/.config/opencode/skills/_shared/references",
|
|
71
|
+
"description": "Supporting security, testing, accessibility, performance, and observability checklists used by matching skills."
|
|
67
72
|
}
|
|
68
73
|
},
|
|
69
74
|
"permissions": [
|
|
@@ -335,7 +340,7 @@
|
|
|
335
340
|
},
|
|
336
341
|
{
|
|
337
342
|
"action": "skill",
|
|
338
|
-
"resource": "
|
|
343
|
+
"resource": "browser-testing-with-devtools",
|
|
339
344
|
"effect": "allow"
|
|
340
345
|
},
|
|
341
346
|
{
|
|
@@ -353,6 +358,11 @@
|
|
|
353
358
|
"resource": "debugging-and-error-recovery",
|
|
354
359
|
"effect": "allow"
|
|
355
360
|
},
|
|
361
|
+
{
|
|
362
|
+
"action": "skill",
|
|
363
|
+
"resource": "flight-deck",
|
|
364
|
+
"effect": "allow"
|
|
365
|
+
},
|
|
356
366
|
{
|
|
357
367
|
"action": "skill",
|
|
358
368
|
"resource": "frontend-ui-engineering",
|
|
@@ -360,17 +370,17 @@
|
|
|
360
370
|
},
|
|
361
371
|
{
|
|
362
372
|
"action": "skill",
|
|
363
|
-
"resource": "
|
|
373
|
+
"resource": "gauntlet",
|
|
364
374
|
"effect": "allow"
|
|
365
375
|
},
|
|
366
376
|
{
|
|
367
377
|
"action": "skill",
|
|
368
|
-
"resource": "
|
|
378
|
+
"resource": "git-ceremony",
|
|
369
379
|
"effect": "allow"
|
|
370
380
|
},
|
|
371
381
|
{
|
|
372
382
|
"action": "skill",
|
|
373
|
-
"resource": "
|
|
383
|
+
"resource": "grilling",
|
|
374
384
|
"effect": "allow"
|
|
375
385
|
},
|
|
376
386
|
{
|
|
@@ -383,6 +393,11 @@
|
|
|
383
393
|
"resource": "performance-optimization",
|
|
384
394
|
"effect": "allow"
|
|
385
395
|
},
|
|
396
|
+
{
|
|
397
|
+
"action": "skill",
|
|
398
|
+
"resource": "pilot-report",
|
|
399
|
+
"effect": "allow"
|
|
400
|
+
},
|
|
386
401
|
{
|
|
387
402
|
"action": "skill",
|
|
388
403
|
"resource": "planning-and-task-breakdown",
|
|
@@ -405,12 +420,12 @@
|
|
|
405
420
|
},
|
|
406
421
|
{
|
|
407
422
|
"action": "skill",
|
|
408
|
-
"resource": "
|
|
423
|
+
"resource": "test-driven-development",
|
|
409
424
|
"effect": "allow"
|
|
410
425
|
},
|
|
411
426
|
{
|
|
412
427
|
"action": "skill",
|
|
413
|
-
"resource": "test-
|
|
428
|
+
"resource": "test-flight",
|
|
414
429
|
"effect": "allow"
|
|
415
430
|
},
|
|
416
431
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oc-harness-setup",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"oc-harness-setup": "bin/cli.js"
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
26
|
"check": "npm pack --dry-run",
|
|
27
|
-
"test": "node --check bin/cli.js"
|
|
27
|
+
"test": "node --check bin/cli.js && bun test",
|
|
28
|
+
"prepublishOnly": "npm run check"
|
|
28
29
|
},
|
|
29
30
|
"publishConfig": {
|
|
30
31
|
"access": "public"
|
|
@@ -33,9 +34,9 @@
|
|
|
33
34
|
"author": "nathwn12",
|
|
34
35
|
"repository": {
|
|
35
36
|
"type": "git",
|
|
36
|
-
"url": "https://github.com/nathwn12/oc-harness-setup.git"
|
|
37
|
+
"url": "git+https://github.com/nathwn12/oc-harness-setup.git"
|
|
37
38
|
},
|
|
38
|
-
"description": "Plug-and-play OpenCode harness:
|
|
39
|
+
"description": "Plug-and-play OpenCode harness: orchestrator primary, agents, commands, skills, git ceremony, doctor - installed by one explicit command.",
|
|
39
40
|
"keywords": [
|
|
40
41
|
"opencode",
|
|
41
42
|
"harness",
|
package/reference/README.md
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
# Harness references
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`AGENTS.md` is the always-loaded contract. Everything here is on-demand support; load only the file named by a matching rule or workflow.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- `roster.md` — active seats and authority.
|
|
6
|
+
- `swarm.md` — dispatch, reporting, fan-in, recovery, and close.
|
|
7
|
+
- `lifecycle.md` — action boundaries and authorization.
|
|
8
|
+
- `session-scope.md` — avoid collisions with other live sessions.
|
|
9
|
+
- `session-state.md` — optional YAML checkpoint and handoff format.
|
|
10
|
+
- `auto-mandate.md` — exact `--auto` behavior.
|
|
11
|
+
- `clean-mandate.md` — exact `--clean` housekeeper behavior.
|
|
12
|
+
- `editor-parity.md` — use only when dependency/config changes affect the editor.
|
|
13
|
+
- `gc-scripts.md` — deterministic Git wrapper map.
|
|
14
|
+
- `model-keeper.md`, `models.md`, `model-test.md` - model evidence; seat wiring lives in the adopter's `agents` map (or agent frontmatter) and is not shipped.
|
|
15
|
+
- `oc-source-map.md` — local OpenCode source map.
|
|
16
|
+
- `owner-pin.md` - adopter-owned template: volatile owner countdown and next item (the installer preserves an existing file).
|
|
6
17
|
|
|
7
|
-
|
|
8
|
-
- `scripts\harness-doctor.ps1` — self-contained harness health check (run `pwsh -File scripts\harness-doctor.ps1` from `~/.config/opencode` after changing the harness).
|
|
9
|
-
|
|
10
|
-
## Gotchas (verified 2026-09-20)
|
|
11
|
-
|
|
12
|
-
Two traps were hit in one session and both cost real time. Check them before editing permission globs or running shell.
|
|
13
|
-
|
|
14
|
-
- **A leading `*` glob can render as `~`.** Agent and `opencode.jsonc` resource globs are written `*.config/opencode/*` (leading `*`, char code 42), but some views display that as `~/.config/opencode/*`. Verify by raw bytes before editing or copying a glob:
|
|
15
|
-
`[System.IO.File]::ReadAllLines($p) | Select-String 'resource:'` — 42 = `*`, 126 = `~`.
|
|
16
|
-
Both forms resolve (V2 expands `~` at config load; `*` matches across separators and drive prefixes), so the hazard is not matching — it is *rewriting* a glob from a rendered view and silently drifting the file. This is how the mirror's agent globs diverged from local.
|
|
17
|
-
- **The shell deny matches the command string, not the intent.** A command carrying a forbidden token — even inside a harmless `Select-String -Pattern '…'` — is refused with `Permission denied: shell`. Keep credential-path words out of command text; work by pointer, or express the pattern so the literal token never appears.
|
|
18
|
-
- **A doctor FAIL immediately after a config edit can be transient.** Observed once right after writing a config file, then **not** reproduced across three consecutive runs — most likely the file watcher reloading mid-check, so a CLI-derived law momentarily sees an empty roster. The daily pulse escalates on any non-zero doctor exit, so **re-run once before treating a FAIL as a regression**; never silence a law to reach green.
|
|
18
|
+
Current control plane: the adopter's default primary seat and any planning-only primary are defined in the `agents` map; all substantive work runs through background seats.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Autonomy mandate (`--auto`)
|
|
2
|
+
|
|
3
|
+
A standalone `--auto` or `--a` arms this posture for the session; `--ask` disarms it.
|
|
4
|
+
|
|
5
|
+
While armed, choose and execute the best bounded, reversible, in-scope path without asking preference questions. State consequential assumptions briefly and keep moving. Verification and event reporting remain required.
|
|
6
|
+
|
|
7
|
+
`--auto` does not widen scope or authorize destructive, irreversible, production, outward-facing, identity, credential, or policy changes. It never overrides a permission denial. Report adjacent opportunities as deferred findings.
|
|
8
|
+
|
|
9
|
+
Stop and report when the objective is impossible, the same attempt repeats without new evidence, progress no longer advances a measurable checkpoint, work drifts outside scope, or an explicit countermand arrives.
|
|
10
|
+
|
|
11
|
+
Close as `done`, `blocked`, or `stopped`, with the result; include evidence, remaining risk, and next action only when they have real content, omit otherwise.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Backup Convention
|
|
2
|
+
|
|
3
|
+
When any agent must back up a config file before editing it, run:
|
|
4
|
+
|
|
5
|
+
scripts\backup-config.ps1 -Path <file>
|
|
6
|
+
|
|
7
|
+
- Backups land in `%USERPROFILE%\.opencode\config-backups\`.
|
|
8
|
+
- The script enforces keep-last-5 retention per file name.
|
|
9
|
+
- Never write `.bak` files inside `~\.config\opencode`.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Housekeeper mandate (`--clean`)
|
|
2
|
+
|
|
3
|
+
A standalone `--clean` arms the housekeeper for this session: junk, trash, and test-generated files may be deleted. `--no-clean` disarms it. Unarmed, every sweep is a report-only dry run - it never deletes, no matter how much junk exists.
|
|
4
|
+
|
|
5
|
+
Auto path: at terminal close, after all workers are collected (global AGENTS.md close rule), run `scripts/gc-clean.ps1`. Armed, it deletes and reports; unarmed, it dry-runs and reports the same tables. The closing agent embeds the summary in the close report. Manual runs follow the same gate: the script never deletes without `-Force`, and `-Force` is passed only while `--clean` is armed.
|
|
6
|
+
|
|
7
|
+
Roots: `%TEMP%\opencode` and `%USERPROFILE%\.cache\opencode` (a `-Root` override exists for sandboxed test runs). Deletions are permitted for exactly these junk classes: `*.bak*` temp config backups; stale cache entries under `github\v2` for plugins not in the adopter's live set (classified only while a live set is passed via `-LiveCache`; without one, v2 entries are reported, never deleted); old-layout leftovers under `github\` that are not `github\v2\`; and directories left empty after those deletions. Repo-local untracked files are listed dry-run only - this tool never deletes them. Anything unclassified is reported, never deleted.
|
|
8
|
+
|
|
9
|
+
The keep-list is law, PROTECT-IF-PRESENT: the script itself, the reference directory, any `*.tgz` npm pack, the adopter's live v2 cache entries (`-LiveCache`), and anything passed via `-KeepExtra`. An absent keep is skipped with a note - never a hard exit. What stays a hard refusal: a junk-class misclassification (only the four classes above are ever deleted), and an unresolvable keep-list, which stops `-Force` with exit 2 - never a silent guess. The root-resolution guard also stands: nothing outside the two resolved roots (or the `-Root` sandbox) can ever be deleted.
|
|
10
|
+
|
|
11
|
+
Safety: the sweep never touches `~/.config`, `~/.local/state`, credential-bearing paths, junctions or reparse points, or anything containing obvious secrets. A secret hit is reported by path only - contents are never printed.
|
|
12
|
+
|
|
13
|
+
Report shape: before/after item list with sizes, bytes freed, keep-list confirmed intact, and the final `RESULT` line.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Editor parity
|
|
2
|
+
|
|
3
|
+
Use this only when a dependency, compiler, language-server, project, or toolchain configuration change could make the user's editor disagree with the proving command.
|
|
4
|
+
|
|
5
|
+
Verify the editor can resolve the project from committed metadata and the documented install/restore step. Check the relevant manifest, lockfile, compiler config, interpreter/SDK pin, and project files. Add editor-specific settings only when the repository genuinely requires them; do not install extensions or rewrite unrelated configuration.
|
|
6
|
+
|
|
7
|
+
Report whether the editor should be green immediately, after dependency restore, or after restart. Ordinary source-only changes do not require this ceremony.
|