oc-harness-setup 0.1.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 (67) hide show
  1. package/AGENTS.md +106 -0
  2. package/LICENSE +21 -0
  3. package/README.md +67 -0
  4. package/agents/build.md +22 -0
  5. package/agents/coder.md +19 -0
  6. package/agents/documenter.md +28 -0
  7. package/agents/explore.md +20 -0
  8. package/agents/general.md +21 -0
  9. package/agents/keeper.md +22 -0
  10. package/agents/master.md +68 -0
  11. package/agents/plan.md +32 -0
  12. package/agents/researcher.md +21 -0
  13. package/agents/reviewer.md +27 -0
  14. package/agents/security-auditor.md +20 -0
  15. package/agents/test-engineer.md +20 -0
  16. package/agents/vault.md +64 -0
  17. package/agents/web-performance-auditor.md +19 -0
  18. package/bin/cli.js +641 -0
  19. package/commands/build.md +13 -0
  20. package/commands/checkpoint.md +5 -0
  21. package/commands/code-simplify.md +13 -0
  22. package/commands/council.md +24 -0
  23. package/commands/doctor.md +18 -0
  24. package/commands/handoff.md +5 -0
  25. package/commands/keeper.md +7 -0
  26. package/commands/plan.md +18 -0
  27. package/commands/ponytail-audit.md +7 -0
  28. package/commands/ponytail-debt.md +14 -0
  29. package/commands/review.md +7 -0
  30. package/commands/ship.md +31 -0
  31. package/commands/spec.md +15 -0
  32. package/commands/test.md +14 -0
  33. package/opencode.jsonc +427 -0
  34. package/package.json +45 -0
  35. package/reference/README.md +18 -0
  36. package/reference/model-keeper.md +26 -0
  37. package/reference/model-test.md +171 -0
  38. package/reference/models.md.example +21 -0
  39. package/scripts/harness-doctor.ps1 +964 -0
  40. package/scripts/panic/panic.ts +240 -0
  41. package/skills/_shared/SOURCES.md +26 -0
  42. package/skills/_shared/references/accessibility-checklist.md +160 -0
  43. package/skills/_shared/references/definition-of-done.md +67 -0
  44. package/skills/_shared/references/observability-checklist.md +92 -0
  45. package/skills/_shared/references/orchestration-patterns.md +156 -0
  46. package/skills/_shared/references/performance-checklist.md +236 -0
  47. package/skills/_shared/references/security-checklist.md +245 -0
  48. package/skills/_shared/references/testing-patterns.md +235 -0
  49. package/skills/api-and-interface-design/SKILL.md +367 -0
  50. package/skills/code-review-and-quality/SKILL.md +396 -0
  51. package/skills/code-simplification/SKILL.md +371 -0
  52. package/skills/creative-writing/SKILL.md +96 -0
  53. package/skills/debugging-and-error-recovery/SKILL.md +316 -0
  54. package/skills/frontend-ui-engineering/SKILL.md +328 -0
  55. package/skills/git-ceremony/SKILL.md +329 -0
  56. package/skills/grilling/SKILL.md +38 -0
  57. package/skills/incremental-implementation/SKILL.md +249 -0
  58. package/skills/observability-and-instrumentation/SKILL.md +238 -0
  59. package/skills/performance-optimization/SKILL.md +496 -0
  60. package/skills/planning-and-task-breakdown/SKILL.md +257 -0
  61. package/skills/security-and-hardening/SKILL.md +499 -0
  62. package/skills/source-driven-development/SKILL.md +216 -0
  63. package/skills/spec-driven-development/SKILL.md +245 -0
  64. package/skills/swarm-orchestration/SKILL.md +54 -0
  65. package/skills/test-driven-development/SKILL.md +398 -0
  66. package/skills/writing-for-agents/SKILL-MECHANICS.md +22 -0
  67. package/skills/writing-for-agents/SKILL.md +83 -0
@@ -0,0 +1,26 @@
1
+ # Model Keeper
2
+
3
+ The `keeper` maintains the model picture: the catalog in `reference/models.md.example` and the agent model bindings in the file-based agent definitions under `~/.config/opencode/agents/*.md` (the `model:` frontmatter). `opencode.jsonc` carries global defaults and may mirror bindings; for a given agent, its `agents\*.md` file is authoritative. `/keeper` is the explicit refresh point. The keeper works from live evidence and reports changes, sources, and uncertainty — or a clean no-change result.
4
+
5
+ ## Keeper pass
6
+
7
+ 1. Read `reference/models.md.example`, the agent files in `~/.config/opencode/agents/*.md`, `opencode.jsonc`, and the harness references that describe routing.
8
+ 2. Query the live provider catalogs and list the models and variants each one offers.
9
+ 3. Check official pricing, context sizes, capabilities, and available variants for the candidate models.
10
+ 4. Diff the live picture against the configured bindings and the catalog: additions, removals, renames, price changes, capability changes, and variant changes.
11
+ 5. Update `reference/models.md.example` and the `model:` bindings in `agents\*.md` together (touching `opencode.jsonc` only when defaults or mirrored bindings change), keeping every configured agent binding in agreement with the catalog. Only the `keeper` writes agent files; one writer per artifact.
12
+ 6. Validate: every `model:` frontmatter value parses and resolves against the catalog, agent files still parse with their frontmatter, and `opencode.jsonc` (if touched) stays consistent.
13
+
14
+ ## Evidence rules
15
+
16
+ - Live provider catalogs are the availability authority.
17
+ - Official provider pricing is the price authority.
18
+ - Promotions, temporary discounts, free trials, and usage multipliers are not routing evidence.
19
+ - Record cache-read rates, context tiers, and per-model allocations when the source exposes them.
20
+ - Record source URLs and the verification date in `reference/models.md.example`.
21
+ - Preserve uncertainty when sources disagree; never invent a model ID, price, or variant.
22
+ - Keep secrets by pointer only: never print, paste, log, or commit a key value.
23
+
24
+ ## Cadence
25
+
26
+ Refresh after a provider catalog change, an OpenCode update, or a recurring personal review. No background watcher runs on its own; the keeper runs when invoked. A no-change result is a valid outcome.
@@ -0,0 +1,171 @@
1
+ # Model Test — fixed contender intake (Go only)
2
+
3
+ How a new OpenCode Go model earns a row in `reference/models.md.example`. Same bytes in, same
4
+ harness around it, every time — so scores are comparable across models and across months.
5
+
6
+ ## 0. Sweep (every recheck, every 3 days)
7
+
8
+ List the live catalog and diff against the ranked table — **all Go IDs are contenders**:
9
+
10
+ ```powershell
11
+ opencode models 2>$null | Select-String 'opencode-go/'
12
+ ```
13
+
14
+ **Fresh-online rule (standing):** re-pull the model list, prices, caps, and context
15
+ windows live every recheck — Go docs pricing tables + models.dev Go provider catalog.
16
+ Never rank off a cached snapshot older than the current recheck; if a rate, cap, or ID
17
+ disagrees between sources, the live `opencode models` output wins for IDs and the Go
18
+ docs win for prices, and the disagreement is recorded in one line.
19
+
20
+ Any live ID not in `models.md.example`, or any ranked ID with a new variant/rung, enters intake below.
21
+
22
+ ## 1. Third-party benchmarks first
23
+
24
+ Before spending a single token, check (in this order) and record source + date:
25
+
26
+ 1. Artificial Analysis intelligence / coding / agentic scores
27
+ 2. OpenRouter benchmark + cost-throughput surfaces
28
+ 3. models.opencode.ai Go catalog (rate, context window, output limit)
29
+ 4. opencode.ai usage data (token share, peers)
30
+
31
+ If two independent third-party sources agree the contender is **outside** our ranked caliber
32
+ (weaker than MiMo v2.5 on intelligence, or pricier than Qwen3.8-flash per task with no
33
+ quality edge), reject on paper — record the rejection in one line, no run. Our own
34
+ usage-report tooling med-cost counts as a source: a contender metering 5×+ above the incumbent with
35
+ no quality evidence is rejected on paper (the Hy4 lesson, <DATE> — tested at $0.0156
36
+ when our own data already said $0.0098/turn). Otherwise, run the fixed test.
37
+
38
+ ## 2. The fixed test — mockup login screen, one shot
39
+
40
+ Same task, same prompt bytes, same cage. This is the login-screen sibling of our <DATE>
41
+ bench (same family as `ranking.json`, new fixed rubric below — old scores carry over as-is
42
+ with their source labels, not re-scored).
43
+
44
+ **Fixed prompt v2** (verbatim each run; v1 retired <DATE> — v1 scores carry over
45
+ labeled, never re-scored):
46
+
47
+ > Build a single self-contained `index.html` login screen to production mockup standard:
48
+ > email + password fields with labels, show/hide password toggle (icon + text, `aria-pressed`),
49
+ > "Sign in" button with loading/spinner state and `aria-busy`, "Forgot password" link that
50
+ > responds inline (no dead links), remember-me checkbox persisted via localStorage,
51
+ > inline validation (empty + bad-email + min-length 8) on blur and submit with focus moved
52
+ > to the first invalid field, caps-lock warning on the password field, success panel on
53
+ > valid submit, visible focus rings throughout, `prefers-reduced-motion` support,
54
+ > responsive down to 360px with no horizontal scroll, dark theme with real depth
55
+ > (layered surfaces, not one flat card), zero remote refs (no CDNs, no external
56
+ > fonts/images). All CSS/JS inline. Short-to-medium length: dense, no filler sections.
57
+
58
+ **Fixed cage:**
59
+
60
+ - Fresh temp workspace; project-level agent; global config untouched; main history DB clean
61
+ (or isolated DB copy).
62
+ - **Rung protocol (standing — highest reasoning must earn its keep):**
63
+ 1. Research the model's known quirks online first: vendor docs (thinking-level map,
64
+ verbosity controls), community reports (overthinking, tool loops, token bloat).
65
+ Record one line per model; social/vendor claims nominate questions, never answers.
66
+ 2. Always pair the top rung against one level down on the fixed task.
67
+ 3. Keep the highest rung only if it wins clearly (better quality at acceptable cost —
68
+ the Muse xhigh precedent: +3 qual, +73% TPS, −27% wall for +18%). Otherwise drop
69
+ one and live there (the DeepSeek max precedent: 7,337 reasoning tokens, −5 quality,
70
+ 3× wall, +68% cost — verbosity that loses value to performance).
71
+ 4. No two models expose the same rungs — probe, never assume (`<YOUR_MODEL>` exposes none).
72
+ - `steps: 8` ceiling, shell / web / subagents denied, 600 s hard timeout, single run
73
+ (n=1, stated as caveat). Sequential runs only when pairing rungs.
74
+
75
+ **Fixed measurements** (host-recorded, never estimated):
76
+
77
+ - `cost` (recorded accounting), `tpsAggregate` (streaming window), wall seconds, turns,
78
+ output tokens, reasoning tokens.
79
+
80
+ **Fixed rubric v2 — quality /100 (rendered DOM + visual):**
81
+
82
+ - Objective /60, measured live: email+password+labeled (10) · toggle with icon+text and
83
+ `aria-pressed` (8) · submit with loading state + `aria-busy` (6) · forgot-link responds
84
+ inline, zero dead links (6) · remember-me persisted (4) · validation empty+bad-email+
85
+ min-8 on blur AND submit, focus to first invalid (10) · caps-lock warning (4) ·
86
+ responsive at 360px without horizontal scroll (4) · zero remote refs, self-contained (4) ·
87
+ ARIA hooks ≥15/≥8 (4/2).
88
+ - Design /40, visual review 5 criteria × 8: layout · typography · colour & contrast ·
89
+ depth & detail (layered surfaces expected) · demo polish (loading/success motion).
90
+
91
+ **Fixed prompt v3** (verbatim each run; v2 retired on first v3 firing — v2 scores frozen
92
+ as-labeled, never re-scored). Same page, adversarial acceptance, 12 KB budget:
93
+
94
+ > Build a single self-contained `index.html` login screen to production mockup standard,
95
+ > max 12 KB total: email + password fields with labels, show/hide toggle whose state a
96
+ > screen-reader user always knows, sign-in flow that always communicates progress,
97
+ > "Forgot password" that responds inline (no dead links, no navigation), remember-me
98
+ > persisted without ever storing the password, validation that catches empty, bad-email,
99
+ > and short passwords on blur and submit with focus moved to the first invalid field,
100
+ > caps-lock warning, success confirmation, visible focus throughout, reduced-motion
101
+ > support, responsive to 360px with no horizontal scroll, layered dark surfaces.
102
+ > Adversarial bars: typing `"><script>alert(1)</script>` as the email must render as
103
+ > inert text everywhere it echoes; with JavaScript disabled the form must still submit
104
+ > via native validation (`required`, `minlength`, `action`); the entire flow must be
105
+ > operable keyboard-only with focus never dropped to `<body>`; Escape closes any open
106
+ > pane and returns focus to its trigger. Zero remote refs. All inline. Dense, no filler.
107
+
108
+ **Fixed rubric v3 — quality /100:**
109
+
110
+ - Objective /60, measured live: labels + outcomes-known toggle state (8) · progress
111
+ always communicated (6) · inline forgot, zero dead links (6) · remember persisted,
112
+ password never stored (6) · validation + focus-first-invalid (8) · caps warning (4) ·
113
+ XSS echoes inert (8) · no-JS native submit works (6) · keyboard-only complete,
114
+ focus never dropped, Escape returns focus (8).
115
+ - Design /40: layout · typography · colour & contrast · restraint under budget ·
116
+ polish. Bloat past 12 KB caps design at 20 regardless of beauty.
117
+
118
+ ## 4. Benchmark iteration loop — Vn until saturation
119
+
120
+ The benchmark itself versions (v1 → v2 → v3…). Each new version is derived from the
121
+ previous round's results, never from imagination:
122
+
123
+ 1. **Analyze compression.** Any rubric bar every runner aces gets promoted to harder
124
+ acceptance or replaced. Bars that separated the field stay.
125
+ 2. **Add exactly one adversarial axis per version** (XSS escape, no-JS fallback,
126
+ focus discipline, size budget…). One — so a score drop is attributable.
127
+ 3. **Freeze prior scores as-labeled.** Vn scores never re-score under Vn+1; cross-version
128
+ comparison is rank-order only, never points.
129
+ 4. **Same test, same length class.** One self-contained login file, short-to-medium.
130
+ A version that needs a bigger artifact is a different benchmark, not Vn+1.
131
+ 5. **Stop condition (maximum quality reached):** two consecutive versions that change
132
+ neither the rank order nor surface a new failure mode. The benchmark is saturated —
133
+ further versions add noise, not signal. Record the saturation and hold.
134
+
135
+ ## 5. Judges — specialists, design slice only, on demand
136
+
137
+ No standing persona panel exists; the objective /60 stays deterministic (DOM-measured,
138
+ lead-scored). When the top two are within 3 points, the subjective design /40 goes to a
139
+ three-judge panel of existing specialists, each scoring blind from the artifact:
140
+
141
+ - `security-auditor` — escape/XSS discipline, inline-script hygiene, autocomplete +
142
+ persistence privacy.
143
+ - `reviewer` — correctness of states, a11y outcomes, focus management, no-dead-link rule.
144
+ - `web-performance-auditor` — size budget, render cost, animation discipline,
145
+ reduced-motion honesty.
146
+
147
+ Majority moves the design score; dissent recorded in one line. Judges never touch the
148
+ objective slice and never see each other's scores first.
149
+
150
+ ## 3. Record & re-rank — only our runs move rows (unchanged, applies to every version)
151
+
152
+ Third-party scores never change the table. Re-ranks happen **only** on fixed-test results,
153
+ on the three tracked axes: **TPS** (streaming window) / **cost** (recorded accounting) /
154
+ **quality** (fixed /100 rubric).
155
+
156
+ Decision rule per contender run:
157
+ - First, append one JSON row in the `ranking.json` schema
158
+ (`id, model, variant, wallSec, turns, output, input, cacheRead, cost, tpsAggregate,
159
+ objective, design, quality`) to the current bench assets file — every run is kept.
160
+ - **Desktop rule (standing):** every scored run's artifact + the current stats JSON are
161
+ copied to `Desktop/bench-<series>-<date>/` for user evaluation — no screenshots, the
162
+ user opens the pages directly. Sync the stats file on every row appended.
163
+
164
+ - **Takes (or jumps) a row:** beats the incumbent on quality at equal-or-lower cost, or
165
+ matches quality at clearly lower cost. Re-number the table, state the beaten incumbent.
166
+ - **Stays out:** loses on quality, or wins quality only at a cost the verdict can't defend
167
+ (the Qwen precedent: 100/100 at $0.014 stays row 6). One rejection line in Sources.
168
+ - **Paired-rung upgrade:** if the top rung beats the usable rung on all three axes for
169
+ +<25% cost (the Muse xhigh precedent), the rank holds the top rung, noted in the row.
170
+
171
+ Then move the `models.md.example` recheck date +3 days. Never re-score old runs under a new rubric.
@@ -0,0 +1,21 @@
1
+ # OpenCode Model Catalog — example skeleton
2
+
3
+ Copy or rename this file to `models.md` when you adopt the harness, then fill
4
+ in your own providers and models. The `keeper` maintains it from live evidence
5
+ per `model-keeper.md`; new models enter only through `model-test.md`.
6
+
7
+ > **Recheck due: YYYY-MM-DD — every 3 days.** Procedure: `model-test.md`.
8
+ > On recheck, move this date +3 days and re-verify the table below.
9
+
10
+ | # | Model (provider/<id>) | Price in / out / cache-read | Monthly cap | Smart evidence | Cheap evidence | Status |
11
+ |---|-----------------------|-----------------------------|-------------|----------------|----------------|--------|
12
+ | 1 | `<YOUR_MODEL>` | `<in> / <out> / <cache-read>` | `<cap>` | `<benchmark / evidence>` | `<measured cost per turn>` | `<active / beta / ...>` |
13
+ | 2 | `<YOUR_MODEL>` | `<in> / <out> / <cache-read>` | `<cap>` | `<benchmark / evidence>` | `<measured cost per turn>` | `<active / beta / ...>` |
14
+
15
+ ## Notes
16
+
17
+ - Columns follow the harness ordering: context gate first, then price, cap, and
18
+ real measured evidence — never vendor claims.
19
+ - The `model:` lines in `agents\*.md` must resolve against this table; the
20
+ harness doctor's Law 8 enforces it.
21
+ - Rank rows by judgment, not a single formula; state the judgment calls.