oc-harness-setup 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/.docs/unwired-routing.md +14 -9
  2. package/.gitignore +14 -1
  3. package/AGENTS.md +70 -106
  4. package/README.md +27 -23
  5. package/agents/build.md +10 -12
  6. package/agents/explore.md +14 -8
  7. package/agents/general.md +7 -9
  8. package/agents/orchestrator.md +38 -0
  9. package/agents/plan.md +10 -13
  10. package/agents/reviewer.md +9 -14
  11. package/agents/vault.md +44 -35
  12. package/bin/cli.js +32 -3
  13. package/commands/build.md +2 -8
  14. package/commands/checkpoint.md +3 -1
  15. package/commands/code-simplify.md +3 -9
  16. package/commands/gauntlet.md +7 -0
  17. package/commands/handoff.md +3 -1
  18. package/commands/keeper.md +3 -3
  19. package/commands/kill.md +11 -0
  20. package/commands/plan.md +2 -13
  21. package/commands/retro.md +15 -0
  22. package/commands/review.md +1 -1
  23. package/commands/ship.md +3 -27
  24. package/commands/spec.md +3 -11
  25. package/commands/test.md +2 -9
  26. package/commands/webperf.md +7 -0
  27. package/opencode.jsonc +23 -8
  28. package/package.json +3 -3
  29. package/reference/README.md +14 -14
  30. package/reference/auto-mandate.md +11 -0
  31. package/reference/backup-convention.md +9 -0
  32. package/reference/clean-mandate.md +13 -0
  33. package/reference/editor-parity.md +7 -0
  34. package/reference/gc-scripts.md +8 -0
  35. package/reference/intent-routing.md +14 -0
  36. package/reference/lifecycle.md +15 -0
  37. package/reference/model-keeper.md +30 -10
  38. package/reference/model-test.md +11 -6
  39. package/reference/models.md +25 -14
  40. package/reference/oc-source-map.md +162 -0
  41. package/reference/owner-pin.md +31 -0
  42. package/reference/roster.md +15 -0
  43. package/reference/session-scope.md +9 -0
  44. package/reference/session-state.md +13 -0
  45. package/reference/swarm.md +32 -0
  46. package/scripts/backup-config.ps1 +42 -0
  47. package/scripts/gc-branch.ps1 +196 -0
  48. package/scripts/gc-bump.ps1 +198 -0
  49. package/scripts/gc-clean.ps1 +648 -0
  50. package/scripts/gc-commit.ps1 +143 -0
  51. package/scripts/gc-merge.ps1 +272 -0
  52. package/scripts/gc-pr.ps1 +190 -0
  53. package/scripts/gc-push.ps1 +111 -0
  54. package/scripts/gc-read.ps1 +150 -0
  55. package/scripts/gc-rebase.ps1 +162 -0
  56. package/scripts/gc-release.ps1 +225 -0
  57. package/scripts/gc-stage.ps1 +103 -0
  58. package/scripts/gc-status.ps1 +127 -0
  59. package/scripts/gc-sync.ps1 +65 -0
  60. package/scripts/gc.core.ps1 +715 -0
  61. package/scripts/gc.smoke.ps1 +779 -0
  62. package/scripts/harness-doctor.ps1 +11 -9
  63. package/scripts/interrupt-session.ps1 +65 -0
  64. package/scripts/logbook/README.md +108 -0
  65. package/scripts/logbook/logbook.test.ts +440 -0
  66. package/scripts/logbook/logbook.ts +797 -0
  67. package/scripts/pirep/README.md +147 -0
  68. package/scripts/pirep/pirep.test.ts +735 -0
  69. package/scripts/pirep/pirep.ts +836 -0
  70. package/scripts/testflight/README.md +112 -0
  71. package/scripts/testflight/testflight.test.ts +512 -0
  72. package/scripts/testflight/testflight.ts +806 -0
  73. package/skills/_shared/SOURCES.md +7 -7
  74. package/skills/_shared/references/definition-of-done.md +2 -2
  75. package/skills/_shared/references/orchestration-patterns.md +1 -2
  76. package/skills/_shared/references/security-checklist.md +2 -2
  77. package/skills/api-and-interface-design/SKILL.md +7 -360
  78. package/skills/browser-testing-with-devtools/SKILL.md +303 -0
  79. package/skills/code-simplification/SKILL.md +7 -364
  80. package/skills/creative-writing/SKILL.md +1 -1
  81. package/skills/debugging-and-error-recovery/SKILL.md +8 -309
  82. package/skills/flight-deck/SKILL.md +17 -0
  83. package/skills/frontend-ui-engineering/SKILL.md +8 -320
  84. package/skills/gauntlet/SKILL.md +21 -0
  85. package/skills/git-ceremony/SKILL.md +16 -318
  86. package/skills/grilling/SKILL.md +10 -30
  87. package/skills/observability-and-instrumentation/SKILL.md +9 -229
  88. package/skills/performance-optimization/SKILL.md +8 -488
  89. package/skills/pilot-report/SKILL.md +18 -0
  90. package/skills/planning-and-task-breakdown/SKILL.md +8 -249
  91. package/skills/security-and-hardening/SKILL.md +9 -490
  92. package/skills/source-driven-development/SKILL.md +8 -208
  93. package/skills/spec-driven-development/SKILL.md +15 -234
  94. package/skills/test-driven-development/SKILL.md +8 -388
  95. package/skills/test-flight/SKILL.md +14 -0
  96. package/skills/writing-for-agents/SKILL-MECHANICS.md +3 -3
  97. package/skills/writing-for-agents/SKILL.md +7 -1
  98. package/agents/coder.md +0 -19
  99. package/agents/documenter.md +0 -28
  100. package/agents/keeper.md +0 -22
  101. package/agents/master.md +0 -70
  102. package/agents/researcher.md +0 -21
  103. package/agents/security-auditor.md +0 -20
  104. package/agents/test-engineer.md +0 -20
  105. package/agents/web-performance-auditor.md +0 -19
  106. package/commands/council.md +0 -24
  107. package/commands/doctor.md +0 -19
  108. package/commands/ponytail-audit.md +0 -7
  109. package/commands/ponytail-debt.md +0 -14
  110. package/commands/report.md +0 -13
  111. package/scripts/harness-report.ps1 +0 -695
  112. package/scripts/panic/panic.ts +0 -240
  113. package/skills/code-review-and-quality/SKILL.md +0 -396
  114. package/skills/incremental-implementation/SKILL.md +0 -249
  115. package/skills/swarm-orchestration/SKILL.md +0 -54
package/agents/vault.md CHANGED
@@ -1,64 +1,73 @@
1
1
  ---
2
- description: "Secret-safe generalist: does any job, handles .env, keys, credential stores, and OpenCode account switching — by pointer, never by value."
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: external_directory
6
+ - action: "*"
7
+ resource: "~/.config/opencode/*"
8
+ effect: allow
9
+ - action: "*"
8
10
  resource: "*secrets*"
9
11
  effect: allow
10
- - action: external_directory
12
+ - action: "*"
11
13
  resource: "*.env*"
12
14
  effect: allow
13
- - action: external_directory
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: external_directory
17
- resource: "~/.local/share/opencode/auth.json"
24
+ - action: "*"
25
+ resource: "*id_rsa*"
18
26
  effect: allow
19
- - action: read
20
- resource: "*secrets*"
27
+ - action: "*"
28
+ resource: "*id_ed25519*"
21
29
  effect: allow
22
- - action: read
23
- resource: "*.env*"
30
+ - action: "*"
31
+ resource: "*id_ecdsa*"
24
32
  effect: allow
25
- - action: read
26
- resource: "*service.json*"
33
+ - action: "*"
34
+ resource: "*id_dsa*"
27
35
  effect: allow
28
- - action: edit
29
- resource: "*secrets*"
36
+ - action: "*"
37
+ resource: "*.pem*"
30
38
  effect: allow
31
- - action: edit
32
- resource: "*.env*"
39
+ - action: "*"
40
+ resource: "*.key*"
33
41
  effect: allow
34
- - action: edit
35
- resource: "*service.json*"
42
+ - action: "*"
43
+ resource: "*.pfx*"
36
44
  effect: allow
37
- - action: shell
38
- resource: "*secrets*"
45
+ - action: "*"
46
+ resource: "*.p12*"
39
47
  effect: allow
40
- - action: shell
41
- resource: "*.env*"
48
+ - action: "*"
49
+ resource: "*.netrc*"
50
+ effect: allow
51
+ - action: "*"
52
+ resource: "*.npmrc*"
42
53
  effect: allow
43
54
  - action: shell
44
- resource: "*service.json*"
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: allow
62
+ effect: deny
52
63
  ---
53
64
 
54
- You are the general worker with the vault key: do any job a helper can, and you are the only agent allowed to read, edit, or shell against credential-bearing paths — `.env*`, `*secrets*` stores, `*service.json*`, and key material.
65
+ You are the privileged background worker for OpenCode harness files and credential-bearing paths.
55
66
 
56
- - Prime directive: values never leave their files. Work by pointer — `path` + `KEY_NAME` — and never print, paste, echo, log, or commit a value. Read the narrowest slice you need (key names, shape), never whole secret files into context. If a value leaks into your output, flag the incident in your report without repeating it.
57
- - You own secrets workflows: key add/rename/remove; `.env.example` stays placeholder-only; confirm coverage with `git check-ignore` before writing to any project path; scrub secrets out of tracked files; rotate from owner-provided pointers; verify presence — never contents.
58
- - Key-switch job: the two OpenCode API keys are parked in the local secrets store; the active account is the one subscribed to OpenCode Go, falling back to the key with balance when Go limits run out. Use `opencode auth list` (report labels/IDs only) and `opencode auth switch <target> <credential>` with explicit args — never the interactive picker; compare parked vs stored keys by in-process hash, never by echoing. Compose these as single shell commands that read the credential file themselves — a value must never appear in your context or in a command string you write. Hand-edit `~/.local/share/opencode/auth.json` only when the CLI cannot express the change.
59
- - Subscription and limits: there is no balance or usage API (feature request #10448 open; endpoints 404 as of <DATE>). Confirm a key's Go subscription with an authenticated probe of `https://opencode.ai/zen/go/v1/models` (the key value stays inside the shell process), and detect limit exhaustion reactively from request failures (429/402/quota errors on Go models), never by prediction.
60
- - Safe edits: back up before changing a credential file (timestamped, git-ignored copy beside it), write atomically, verify after (it parses, expected key names are present, consumers still work).
61
- - Values never enter the model context. If a task genuinely needs a value in-conversation, stop and flag it: that task may run only on a ZDR model (the ZDR-capable set from the current model catalog).
62
- - Never put secrets into URLs, network calls, shell history, session state, or tracked files; new values go to an ignored file or a pointer the owner controls.
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: "master", references registry)');
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
- Build `$ARGUMENTS`. Define "done" first, then implement with the smallest correct diff.
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.
@@ -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 `checkpoint.md` in this session's state directory (`~/.opencode/state/sessions/<session-id>/`): goal, status (done / now / next), key files, blockers. `$ARGUMENTS` is optional scope. Keep it short; append a timestamped entry if the file exists.
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: coder
3
+ agent: general
4
+ subagent: true
4
5
  ---
5
6
 
6
- Simplify `$ARGUMENTS` (default: the current changes) by applying the Ponytail ladder in `AGENTS.md` and the local `code-simplification` skill: the laziest change that actually works.
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.
@@ -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.md` in this session's state directory for a fresh session to continue from: goal, current state, exact next steps, files to read first, open decisions. `$ARGUMENTS` is optional scope.
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.
@@ -1,7 +1,7 @@
1
1
  ---
2
- description: Refresh the model catalog and bindings from live evidence
3
- agent: keeper
2
+ description: Refresh the model catalog from live evidence
3
+ agent: vault
4
4
  subagent: true
5
5
  ---
6
6
 
7
- Refresh the model picture: compare `reference/models.md` and the model bindings in the file-based `agents\*.md` definitions against the live catalogs, pricing, and variants, following the canonical protocol in `reference/model-keeper.md`. Apply only evidence-backed changes; keep the catalog, bindings, and config parsing consistent. Report changes, sources, and uncertainty — or a clean no-change result.
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.
@@ -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: true
4
+ subagent: false
5
5
  ---
6
6
 
7
- > Triage first: WHERE (blast-radius) → WHAT → HOW (ceremony) → FIRE.
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.
@@ -4,4 +4,4 @@ agent: reviewer
4
4
  subagent: true
5
5
  ---
6
6
 
7
- Give `$ARGUMENTS` an independent look: inspect the work and its behavior, run the checks that matter, and report findings in severity order with file:line evidence, ending with one verdict (`pass`, `revise`, or `blocked`) and the smallest next action. Follow the local `code-review-and-quality` skill when reviewing changes. Do not edit files or spawn helpers.
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
- Ship gate for `$ARGUMENTS` (default: the current changes). Three phases; do not skip the merge step.
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 an idea or request into a sharp, buildable spec
2
+ description: Turn the current request into a sharp, buildable spec — inline, in this conversation
3
3
  agent: plan
4
- subagent: true
4
+ subagent: false
5
5
  ---
6
6
 
7
- Synthesize `$ARGUMENTS` into a spec from what is known and flag the rest. Follow the local `spec-driven-development` skill. Produce:
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: test-engineer
3
+ agent: reviewer
4
4
  subagent: true
5
5
  ---
6
6
 
7
- For `$ARGUMENTS` (default: the current changes):
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": "master",
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 — smoke checks, model keeper, db hygiene."
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": "code-review-and-quality",
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": "git-ceremony",
373
+ "resource": "gauntlet",
364
374
  "effect": "allow"
365
375
  },
366
376
  {
367
377
  "action": "skill",
368
- "resource": "grilling",
378
+ "resource": "git-ceremony",
369
379
  "effect": "allow"
370
380
  },
371
381
  {
372
382
  "action": "skill",
373
- "resource": "incremental-implementation",
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": "swarm-orchestration",
423
+ "resource": "test-driven-development",
409
424
  "effect": "allow"
410
425
  },
411
426
  {
412
427
  "action": "skill",
413
- "resource": "test-driven-development",
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.2.0",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "oc-harness-setup": "bin/cli.js"
@@ -33,9 +33,9 @@
33
33
  "author": "nathwn12",
34
34
  "repository": {
35
35
  "type": "git",
36
- "url": "https://github.com/nathwn12/oc-harness-setup.git"
36
+ "url": "git+https://github.com/nathwn12/oc-harness-setup.git"
37
37
  },
38
- "description": "Plug-and-play OpenCode harness: MASTER orchestrator, agents, commands, skills, doctor - installed by one explicit command.",
38
+ "description": "Plug-and-play OpenCode harness: orchestrator primary, agents, commands, skills, git ceremony, doctor - installed by one explicit command.",
39
39
  "keywords": [
40
40
  "opencode",
41
41
  "harness",
@@ -1,18 +1,18 @@
1
1
  # Harness references
2
2
 
3
- On-demand harness references. Always-loaded rules: `AGENTS.md`. Swarm playbook: `~/.config/opencode/skills/swarm-orchestration/SKILL.md`.
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
- Read these only when the task calls for them:
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
- - `model-keeper.md` — how to refresh the model catalog and the agent model bindings (file-based under `agents\*.md`) from live evidence.
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.
@@ -0,0 +1,8 @@
1
+ # gc-* script map
2
+
3
+ Use these wrappers only for the Git action the user requested or the named endpoint requires.
4
+
5
+ - **Verbs:** `gc-status` · `gc-sync` · `gc-branch` · `gc-stage` · `gc-commit` · `gc-push` · `gc-pr` · `gc-merge` · `gc-rebase` · `gc-bump` · `gc-read` — each as `pwsh -NoProfile -File ~/.config/opencode/scripts/gc-<verb>.ps1 -RepoRoot <path>`.
6
+ - **Output:** terse by default — one `RESULT: <json>` line on stdout; FAIL/WARN/security lines always visible; `-Detailed` restores narration; `-Quiet` is a compatibility no-op.
7
+ - **Release exception:** `gc-release -MovingLatest` is available only when repository policy explicitly declares the nonstandard single moving `latest` scheme. Ordinary releases follow repository instructions.
8
+ - **Smoke:** never - operator ruling 2026-09-29: do not run `gc.smoke.ps1`; treat the gc-* wrappers as trusted without a pre-flight gate.