oc-harness-setup 0.3.2 → 0.4.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 (136) hide show
  1. package/.docs/unwired-routing.md +16 -15
  2. package/AGENTS.md +105 -68
  3. package/CHANGELOG.md +91 -0
  4. package/GLOSSARY.md +46 -0
  5. package/LICENSE +1 -1
  6. package/README.md +48 -61
  7. package/agents/cleaner.md +86 -0
  8. package/agents/critic.md +79 -0
  9. package/agents/historian.md +92 -0
  10. package/agents/maintainer.md +106 -0
  11. package/agents/ops.md +69 -0
  12. package/agents/orchestrator.md +48 -18
  13. package/agents/researcher.md +72 -0
  14. package/agents/verifier.md +84 -0
  15. package/agents/worker.md +87 -0
  16. package/bin/cli.js +349 -133
  17. package/commands/close.md +11 -0
  18. package/commands/evolve.md +11 -0
  19. package/commands/fast.md +11 -0
  20. package/commands/goal.md +11 -0
  21. package/commands/search.md +11 -0
  22. package/commands/swarm.md +11 -0
  23. package/opencode.jsonc +42 -80
  24. package/package.json +13 -6
  25. package/reference/README.md +12 -14
  26. package/reference/canon.md +71 -0
  27. package/reference/context.md +35 -0
  28. package/reference/enforcement.md +6 -0
  29. package/reference/flow.md +19 -0
  30. package/reference/gates.md +23 -0
  31. package/reference/harness.md +15 -0
  32. package/reference/hygiene.md +13 -0
  33. package/reference/memory.md +13 -0
  34. package/reference/models.md +19 -24
  35. package/reference/phases.md +23 -0
  36. package/reference/repos.md +49 -0
  37. package/reference/tools.md +35 -0
  38. package/scripts/harness-doctor.ps1 +83 -0
  39. package/skills/close/SKILL.md +36 -0
  40. package/skills/evolve/SKILL.md +76 -0
  41. package/skills/fast/SKILL.md +36 -0
  42. package/skills/goal/SKILL.md +65 -0
  43. package/skills/search/SKILL.md +68 -0
  44. package/skills/swarm/SKILL.md +69 -0
  45. package/state-seed/lessons.md +22 -0
  46. package/state-seed/template.md +12 -0
  47. package/agents/build.md +0 -20
  48. package/agents/explore.md +0 -26
  49. package/agents/general.md +0 -19
  50. package/agents/plan.md +0 -29
  51. package/agents/reviewer.md +0 -22
  52. package/agents/vault.md +0 -73
  53. package/commands/build.md +0 -7
  54. package/commands/checkpoint.md +0 -7
  55. package/commands/code-simplify.md +0 -7
  56. package/commands/gauntlet.md +0 -7
  57. package/commands/handoff.md +0 -7
  58. package/commands/keeper.md +0 -7
  59. package/commands/kill.md +0 -11
  60. package/commands/plan.md +0 -7
  61. package/commands/retro.md +0 -15
  62. package/commands/review.md +0 -7
  63. package/commands/ship.md +0 -7
  64. package/commands/spec.md +0 -7
  65. package/commands/test.md +0 -7
  66. package/commands/webperf.md +0 -7
  67. package/reference/auto-mandate.md +0 -11
  68. package/reference/backup-convention.md +0 -9
  69. package/reference/clean-mandate.md +0 -13
  70. package/reference/editor-parity.md +0 -7
  71. package/reference/gc-scripts.md +0 -8
  72. package/reference/intent-routing.md +0 -14
  73. package/reference/lifecycle.md +0 -15
  74. package/reference/model-keeper.md +0 -46
  75. package/reference/model-test.md +0 -176
  76. package/reference/oc-source-map.md +0 -162
  77. package/reference/owner-pin.md +0 -31
  78. package/reference/roster.md +0 -15
  79. package/reference/session-scope.md +0 -9
  80. package/reference/session-state.md +0 -13
  81. package/reference/swarm.md +0 -32
  82. package/scripts/backup-config.ps1 +0 -42
  83. package/scripts/gc-branch.ps1 +0 -196
  84. package/scripts/gc-bump.ps1 +0 -198
  85. package/scripts/gc-clean.ps1 +0 -648
  86. package/scripts/gc-commit.ps1 +0 -143
  87. package/scripts/gc-merge.ps1 +0 -272
  88. package/scripts/gc-pr.ps1 +0 -190
  89. package/scripts/gc-push.ps1 +0 -111
  90. package/scripts/gc-read.ps1 +0 -150
  91. package/scripts/gc-rebase.ps1 +0 -162
  92. package/scripts/gc-release.ps1 +0 -225
  93. package/scripts/gc-stage.ps1 +0 -103
  94. package/scripts/gc-status.ps1 +0 -127
  95. package/scripts/gc-sync.ps1 +0 -65
  96. package/scripts/gc.core.ps1 +0 -715
  97. package/scripts/gc.smoke.ps1 +0 -779
  98. package/scripts/interrupt-session.ps1 +0 -65
  99. package/scripts/logbook/README.md +0 -108
  100. package/scripts/logbook/logbook.test.ts +0 -440
  101. package/scripts/logbook/logbook.ts +0 -797
  102. package/scripts/pirep/README.md +0 -147
  103. package/scripts/pirep/pirep.test.ts +0 -735
  104. package/scripts/pirep/pirep.ts +0 -836
  105. package/scripts/testflight/README.md +0 -112
  106. package/scripts/testflight/testflight.test.ts +0 -512
  107. package/scripts/testflight/testflight.ts +0 -806
  108. package/skills/_shared/SOURCES.md +0 -26
  109. package/skills/_shared/references/accessibility-checklist.md +0 -160
  110. package/skills/_shared/references/definition-of-done.md +0 -67
  111. package/skills/_shared/references/observability-checklist.md +0 -92
  112. package/skills/_shared/references/orchestration-patterns.md +0 -155
  113. package/skills/_shared/references/performance-checklist.md +0 -236
  114. package/skills/_shared/references/security-checklist.md +0 -245
  115. package/skills/_shared/references/testing-patterns.md +0 -235
  116. package/skills/api-and-interface-design/SKILL.md +0 -14
  117. package/skills/browser-testing-with-devtools/SKILL.md +0 -303
  118. package/skills/code-simplification/SKILL.md +0 -14
  119. package/skills/creative-writing/SKILL.md +0 -96
  120. package/skills/debugging-and-error-recovery/SKILL.md +0 -15
  121. package/skills/flight-deck/SKILL.md +0 -17
  122. package/skills/frontend-ui-engineering/SKILL.md +0 -16
  123. package/skills/gauntlet/SKILL.md +0 -21
  124. package/skills/git-ceremony/SKILL.md +0 -27
  125. package/skills/grilling/SKILL.md +0 -18
  126. package/skills/observability-and-instrumentation/SKILL.md +0 -18
  127. package/skills/performance-optimization/SKILL.md +0 -16
  128. package/skills/pilot-report/SKILL.md +0 -18
  129. package/skills/planning-and-task-breakdown/SKILL.md +0 -16
  130. package/skills/security-and-hardening/SKILL.md +0 -18
  131. package/skills/source-driven-development/SKILL.md +0 -16
  132. package/skills/spec-driven-development/SKILL.md +0 -26
  133. package/skills/test-driven-development/SKILL.md +0 -18
  134. package/skills/test-flight/SKILL.md +0 -14
  135. package/skills/writing-for-agents/SKILL-MECHANICS.md +0 -22
  136. package/skills/writing-for-agents/SKILL.md +0 -89
@@ -0,0 +1,11 @@
1
+ ---
2
+ description: "Run the end-of-session ceremony when all work has stopped — stopped, green, clean, recorded, said."
3
+ agent: orchestrator
4
+ subagent: false
5
+ ---
6
+
7
+ # /close
8
+
9
+ Load the `close` skill; `skills/close/SKILL.md` owns the procedure. Apply it to the current session.
10
+
11
+ When a lane is live or a blocker prevents close, close does not run: name the blocker and stay `active`. A red gate is repaired, or the work is explicitly `parked` with the red named.
@@ -0,0 +1,11 @@
1
+ ---
2
+ description: "Add a skill, adopt an upstream feature, or improve the harness without bloating it."
3
+ agent: orchestrator
4
+ subagent: false
5
+ ---
6
+
7
+ # /evolve
8
+
9
+ Load the `evolve` skill; `skills/evolve/SKILL.md` owns the procedure. Apply it to `$ARGUMENTS`.
10
+
11
+ When `$ARGUMENTS` is empty, ask what capability is missing, then proceed.
@@ -0,0 +1,11 @@
1
+ ---
2
+ description: "Take the shortest safe route for one small low-risk task."
3
+ agent: orchestrator
4
+ subagent: false
5
+ ---
6
+
7
+ # /fast
8
+
9
+ Load the `fast` skill; `skills/fast/SKILL.md` owns the procedure. Apply it to `$ARGUMENTS`.
10
+
11
+ When `$ARGUMENTS` is empty, ask for the small task to shortcut first, then proceed.
@@ -0,0 +1,11 @@
1
+ ---
2
+ description: "Loop a spec or ticket to green end to end, then run the repo's full gate."
3
+ agent: orchestrator
4
+ subagent: false
5
+ ---
6
+
7
+ # /goal
8
+
9
+ Load the `goal` skill; `skills/goal/SKILL.md` owns the procedure. Apply it to `$ARGUMENTS`.
10
+
11
+ `$ARGUMENTS` is one of: a frozen SPEC, a ticket, or an issue. Empty: ask for it, then proceed.
@@ -0,0 +1,11 @@
1
+ ---
2
+ description: "Research a question from primary sources with cited synthesis."
3
+ agent: orchestrator
4
+ subagent: false
5
+ ---
6
+
7
+ # /search
8
+
9
+ Load the `search` skill; `skills/search/SKILL.md` owns the procedure. Apply it to `$ARGUMENTS`.
10
+
11
+ When `$ARGUMENTS` is empty, ask for the research question to answer first, then proceed.
@@ -0,0 +1,11 @@
1
+ ---
2
+ description: "Split work across workers with seams and one integration point."
3
+ agent: orchestrator
4
+ subagent: false
5
+ ---
6
+
7
+ # /swarm
8
+
9
+ Load the `swarm` skill; `skills/swarm/SKILL.md` owns the procedure. Apply it to `$ARGUMENTS`.
10
+
11
+ When `$ARGUMENTS` is empty, ask for the work to split across workers first, then proceed.
package/opencode.jsonc CHANGED
@@ -1,13 +1,18 @@
1
1
  {
2
- // oc-harness-setup base config: stable runtime policy lives here; behavior
3
- // lives beside it in agents/, commands/, skills/, and reference/ for
4
- // smaller, hot-reloadable artifacts. Skill loading is fail-closed to local IDs.
2
+ // oc-harness-setup base config: a general OpenCode starter. The
3
+ // orchestrator dispatches, workers own artifacts, state/ is the ledger,
4
+ // and the doctor grades 18 derived laws. Stable runtime policy lives here;
5
+ // behavior lives beside it in agents/, commands/, skills/, and reference/
6
+ // for smaller, hot-reloadable artifacts. Skill loading is fail-closed to
7
+ // the 6 local IDs.
5
8
  //
6
9
  // This is the oc-harness-setup base config; the installer preserves your
7
10
  // model/providers/mcp/plugins.
8
11
  "$schema": "https://opencode.ai/config.json",
9
12
  "default_agent": "orchestrator",
10
- "formatter": true,
13
+ // Formatting OFF (measured 2026-10-14): an object value ENABLES every built-in
14
+ // (off by default); a formatter silently rewrites bytes after write/edit/patch, so `cargo fmt` / `ruff format` stay manual.
15
+ "formatter": false,
11
16
  "compaction": {
12
17
  "auto": true,
13
18
  "keep": {
@@ -64,11 +69,7 @@
64
69
  "references": {
65
70
  "orchestration": {
66
71
  "path": "~/.config/opencode/reference",
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."
72
+ "description": "Harness references - session loop, delegation, model catalog, hygiene."
72
73
  }
73
74
  },
74
75
  "permissions": [
@@ -335,108 +336,69 @@
335
336
  },
336
337
  {
337
338
  "action": "skill",
338
- "resource": "api-and-interface-design",
339
- "effect": "allow"
340
- },
341
- {
342
- "action": "skill",
343
- "resource": "browser-testing-with-devtools",
344
- "effect": "allow"
345
- },
346
- {
347
- "action": "skill",
348
- "resource": "code-simplification",
349
- "effect": "allow"
350
- },
351
- {
352
- "action": "skill",
353
- "resource": "creative-writing",
354
- "effect": "allow"
355
- },
356
- {
357
- "action": "skill",
358
- "resource": "debugging-and-error-recovery",
359
- "effect": "allow"
360
- },
361
- {
362
- "action": "skill",
363
- "resource": "flight-deck",
364
- "effect": "allow"
365
- },
366
- {
367
- "action": "skill",
368
- "resource": "frontend-ui-engineering",
369
- "effect": "allow"
370
- },
371
- {
372
- "action": "skill",
373
- "resource": "gauntlet",
374
- "effect": "allow"
375
- },
376
- {
377
- "action": "skill",
378
- "resource": "git-ceremony",
379
- "effect": "allow"
380
- },
381
- {
382
- "action": "skill",
383
- "resource": "grilling",
339
+ "resource": "close",
384
340
  "effect": "allow"
385
341
  },
386
342
  {
387
343
  "action": "skill",
388
- "resource": "observability-and-instrumentation",
344
+ "resource": "evolve",
389
345
  "effect": "allow"
390
346
  },
391
347
  {
392
348
  "action": "skill",
393
- "resource": "performance-optimization",
349
+ "resource": "fast",
394
350
  "effect": "allow"
395
351
  },
396
352
  {
397
353
  "action": "skill",
398
- "resource": "pilot-report",
354
+ "resource": "goal",
399
355
  "effect": "allow"
400
356
  },
401
357
  {
402
358
  "action": "skill",
403
- "resource": "planning-and-task-breakdown",
359
+ "resource": "search",
404
360
  "effect": "allow"
405
361
  },
406
362
  {
407
363
  "action": "skill",
408
- "resource": "security-and-hardening",
364
+ "resource": "swarm",
409
365
  "effect": "allow"
366
+ }
367
+ ],
368
+ // Hard tool.use denies in the current V2 shape (action "tool.use",
369
+ // resource "<tool>:<glob>"). The installer owns this block outright
370
+ // (INSTALL_OWNED) so it always wins the merge — an adopter config can
371
+ // never soften it.
372
+ "policies": [
373
+ {
374
+ "action": "tool.use",
375
+ "resource": "read:*.env",
376
+ "effect": "deny"
410
377
  },
411
378
  {
412
- "action": "skill",
413
- "resource": "source-driven-development",
414
- "effect": "allow"
379
+ "action": "tool.use",
380
+ "resource": "read:*.env.*",
381
+ "effect": "deny"
415
382
  },
416
383
  {
417
- "action": "skill",
418
- "resource": "spec-driven-development",
419
- "effect": "allow"
384
+ "action": "tool.use",
385
+ "resource": "read:*secrets*",
386
+ "effect": "deny"
420
387
  },
421
388
  {
422
- "action": "skill",
423
- "resource": "test-driven-development",
424
- "effect": "allow"
389
+ "action": "tool.use",
390
+ "resource": "edit:*secrets*",
391
+ "effect": "deny"
425
392
  },
426
393
  {
427
- "action": "skill",
428
- "resource": "test-flight",
429
- "effect": "allow"
394
+ "action": "tool.use",
395
+ "resource": "edit:*.env",
396
+ "effect": "deny"
430
397
  },
431
398
  {
432
- "action": "skill",
433
- "resource": "writing-for-agents",
434
- "effect": "allow"
399
+ "action": "tool.use",
400
+ "resource": "edit:*.env.*",
401
+ "effect": "deny"
435
402
  }
436
- ],
437
- "plugins": [
438
- // Plugins are installed by name from published packages; local checkouts
439
- // and per-user plugins are preserved by the installer, not the shipped base.
440
- "oc-flight-deck"
441
403
  ]
442
404
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oc-harness-setup",
3
- "version": "0.3.2",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "oc-harness-setup": "bin/cli.js"
@@ -13,7 +13,10 @@
13
13
  "reference",
14
14
  "scripts",
15
15
  ".docs",
16
+ "state-seed",
16
17
  "AGENTS.md",
18
+ "GLOSSARY.md",
19
+ "CHANGELOG.md",
17
20
  ".gitignore",
18
21
  "opencode.jsonc",
19
22
  "README.md",
@@ -24,7 +27,7 @@
24
27
  },
25
28
  "scripts": {
26
29
  "check": "npm pack --dry-run",
27
- "test": "node --check bin/cli.js && bun test",
30
+ "test": "node --check bin/cli.js && node --test",
28
31
  "prepublishOnly": "npm run check"
29
32
  },
30
33
  "publishConfig": {
@@ -36,13 +39,17 @@
36
39
  "type": "git",
37
40
  "url": "git+https://github.com/nathwn12/oc-harness-setup.git"
38
41
  },
39
- "description": "Plug-and-play OpenCode harness: orchestrator primary, agents, commands, skills, git ceremony, doctor - installed by one explicit command.",
42
+ "description": "A general OpenCode starter for Windows: 9 agents on a dispatch loop, 6 skills, fresh-verdict research, state memory, cleanup crew, and self-extension tooling - installed by one explicit command.",
40
43
  "keywords": [
41
44
  "opencode",
42
- "harness",
43
- "orchestrator",
44
45
  "agents",
45
46
  "skills",
47
+ "loop",
48
+ "research",
49
+ "memory",
50
+ "cleanup",
51
+ "self-extension",
52
+ "starter",
46
53
  "oc-harness-setup"
47
54
  ]
48
- }
55
+ }
@@ -2,17 +2,15 @@
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
- - `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).
17
-
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.
5
+ - `canon.md` — locked research source canon and citation bar.
6
+ - `context.md` — context budget, delegation detail, mechanisms, worked examples.
7
+ - `enforcement.md` — network reach and enforcement examples.
8
+ - `flow.md` — which seat fires on which trigger, and when a new seat is earned.
9
+ - `gates.md` — the five repo-local gates the harness requires.
10
+ - `harness.md` — who writes what, what ships, how it versions.
11
+ - `hygiene.md` — scratch discipline and clean-pass proof.
12
+ - `memory.md` — session and harness memory ownership and format.
13
+ - `models.md` — bulk-vs-verdict tiering, binding, and catalog for the doctor check.
14
+ - `phases.md` — context moves at phase boundaries.
15
+ - `repos.md` — repo lifecycle, location, commits, delivery, CI policy.
16
+ - `tools.md` — host-tool registry; native only when listed here.
@@ -0,0 +1,71 @@
1
+ # Research canon
2
+
3
+ A load-bearing claim comes from the source that owns it. These are the preferred sources; the precedence rule decides when they apply.
4
+
5
+ ## Precedence
6
+
7
+ - Software, AI, LLM, harness, agent-loop, or graph work: the three preferred corpora below, in that order.
8
+ - Anything else: the primary source that owns the domain outranks all three — language reference, standard, vendor API, paper page, changelog.
9
+ - On conflict the domain owner wins. The preferred corpora are a default, not a cage.
10
+
11
+ ## Tier 1 — preferred corpora
12
+
13
+ ### Claude / Anthropic
14
+
15
+ - Claude Code docs — product docs root — https://code.claude.com/docs
16
+ - Claude API docs — platform docs root — https://platform.claude.com/docs/en/home
17
+ - Anthropic Engineering — long-form engineering posts — https://www.anthropic.com/engineering
18
+ - Anthropic Research — publication index — https://www.anthropic.com/research
19
+ - Claude Cookbooks — copyable API recipes — https://github.com/anthropics/claude-cookbooks
20
+ - Claude Code — agentic coding tool source — https://github.com/anthropics/claude-code
21
+ - Anthropic Courses — archived API and prompting courses — https://github.com/anthropics/courses
22
+
23
+ ### Andrej Karpathy
24
+
25
+ - Profile — pins the teaching repositories — https://github.com/karpathy
26
+ - nanoGPT — trains and finetunes medium GPTs simply — https://github.com/karpathy/nanoGPT
27
+ - nanochat — full ChatGPT stack for about $100 — https://github.com/karpathy/nanochat
28
+ - llm.c — trains LLMs in raw C/CUDA — https://github.com/karpathy/llm.c
29
+ - llama2.c — Llama 2 inference in one C file — https://github.com/karpathy/llama2.c
30
+ - micrograd — tiny autograd engine teaching backprop — https://github.com/karpathy/micrograd
31
+ - Blog — long-form ML essays — https://karpathy.github.io/
32
+ - microgpt.py — 200-line dependency-free GPT trainer — https://gist.github.com/karpathy/8627fe009c40f57531cb18360106ce95
33
+
34
+ ### Matt Pocock
35
+
36
+ - Profile — pins the skills repositories — https://github.com/mattpocock
37
+ - skills — composable engineering agent skills — https://github.com/mattpocock/skills
38
+ - ts-reset — fixes TypeScript built-in typings — https://github.com/mattpocock/ts-reset
39
+ - Total TypeScript — TypeScript course index — https://totaltypescript.com/
40
+ - AI Hero — AI engineering courses index — https://www.aihero.dev/
41
+
42
+ ## Tier 2 — machinery
43
+
44
+ - OpenCode V2 docs — how this harness loads, permission-checks, and hooks — https://opencode.ai/v2/docs/
45
+ - Quote the installed `opencode --version` beside any line drawn from these docs.
46
+
47
+ ## Tier 3 — everything else
48
+
49
+ Secondary by definition: blogs, summaries, forum answers, aggregators. Admitted only when Tiers 1 and 2 are silent, and labeled as secondary in the citation.
50
+
51
+ ## General-domain examples
52
+
53
+ - Python 3 docs — language and library reference — https://docs.python.org/3/
54
+ - MDN JavaScript — web JavaScript reference — https://developer.mozilla.org/en-US/docs/Web/JavaScript
55
+ - RFC 9110 — HTTP semantics — https://www.rfc-editor.org/rfc/rfc9110
56
+ - arXiv 1706.03762 — the Transformer paper page — https://arxiv.org/abs/1706.03762
57
+
58
+ ## Dissent
59
+
60
+ - Canon first, then argue with it: when Tier 1 covers a topic, name the strongest primary source that disagrees before concluding.
61
+ - A conclusion drawn from one voice is not a finding; it is a preference.
62
+ - If no dissent exists, say the search was run and name where you looked.
63
+ - Worked example: the starter's own write-single-lane rule rests on Cognition and Berkeley MAST, neither in Tier 1, while Anthropic covers the same topic from the other side. Without the dissent rule the design would have been confidently wrong. The audit is recorded in the harness build notes.
64
+
65
+ ## The bar
66
+
67
+ - A load-bearing claim cites a primary source with an inline marker and a retrievable URL.
68
+ - Never invent a number, a quote, or a marker.
69
+ - A dead, moved, or paywalled source is reported as such, never cited as read.
70
+ - Two sources disagreeing is surfaced as a contradiction, not averaged.
71
+ - Local verification is the strongest runnable check, cited beside the claim it proves.
@@ -0,0 +1,35 @@
1
+ # Context detail
2
+ Moved verbatim from AGENTS.md root — read when the working set, delegation detail, mechanisms, or worked examples matter.
3
+
4
+ <example>Good: slice names one file plus its check. Good: verify cites command plus output. Bad: two artifacts in one slice.</example>
5
+
6
+ ## Context budget
7
+ - Root ceiling is 200 lines, target 120. Quality outranks brevity: a decision belongs in the root, detail lives behind a pointer. Cut filler, never a rule.
8
+ - Skills stay <500 lines; detail sits behind pointers.
9
+ - State is markdown; load index first, detail on demand.
10
+ - Engineer the working set down; never fill the window.
11
+ <example>Good: new rule goes behind a pointer. Good: phase ends so context resets. Bad: pasting forty files into the trace.</example>
12
+
13
+ <example>Good: new network reach earns an agent. Good: new doc type reuses worker. Bad: adding a coder seat.</example>
14
+
15
+ - One write lane per artifact; parallel reads freely.
16
+ - Ten live lanes is the ceiling; past ten, queue. The seam decides whether a split is valid; the ceiling decides how many run.
17
+ - Two agents on one file is a collision, not a review. One writer per artifact, always; a second reader is free.
18
+ - Parallel writes only across disjoint file sets behind an integration point with a fresh verifier.
19
+ - Every brief carries objective, output format, tool/source guidance, task boundaries.
20
+ - Return a summary plus `file:line`; raw reads stay in the child.
21
+ - Cost: multi-agent runs ~15× single-chat tokens — spend them on isolation and review, never on parallel writes to one file.
22
+ <example>Good: forty-file sweep returns a summary. Good: two disjoint packages merge behind one verifier. Bad: two workers editing one file.</example>
23
+
24
+ ## Mechanisms
25
+ - Need automation? Prefer, in this order: an installed plugin → an installed MCP → an existing CLI or npm tool → a small plugin you write → a small MCP you write.
26
+ - A loose script is the last resort: allowed only when none of those five fit, and it must state in its header why the five failed.
27
+ - Adding a mechanism is a harness change, not a task step: it gets its own brief and its own proof, never a side effect of finishing something else.
28
+ - Whatever no mechanism can reach is an instruction, and is labeled as one — never dressed up as enforcement.
29
+ - Installing tooling is ingress — it pulls code in and sends nothing out, so the outward gate is unchanged. Name the package and the reason in the brief.
30
+ - Harness and task plumbing may still not add a script: the ladder above holds, and a script stays the last resort.
31
+ - Exception: a one-shot ceremony script under the temp session dir is a deliverable, not plumbing; a 2FA click needs a visible terminal, so the script is allowed and is deleted after the run.
32
+ - A script the owner asks for is a deliverable, not infrastructure: it is the product, it is never wired into the harness, and it carries a header saying what it is for.
33
+ <example>Good: a missing capability becomes a plugin ref in config. Good: an existing CLI does the job and gets used. Bad: a one-off script that nothing proves and nobody owns.</example>
34
+
35
+ <example>Good: `pytest -q` cited passing. Good: fresh verifier returns pass plus evidence. Bad: claiming green with no run.</example>
@@ -0,0 +1,6 @@
1
+ # Enforcement detail
2
+ Moved verbatim from AGENTS.md root — read when network reach or enforcement examples matter.
3
+
4
+ - One seat holds the web tools. `ops` may fetch through shell when a brief requires it — the one sanctioned exception. Every other agent's network shell verbs are denied. (by design)
5
+
6
+ <example>Good: `read:*.env` denied with Blocked by configuration policy. Good: worker denied `git push`. Bad: claiming a network boundary when shell is open.</example>
@@ -0,0 +1,19 @@
1
+ # Flow — which seat fires on which trigger
2
+ - Orient: `historian` reads memory; `ops` reports the live surface when a server, port, or branch is in play.
3
+ - Slice: `orchestrator`.
4
+ - Build: `worker` writes; `worker` or `verifier` runs the named commands.
5
+ - Review: `critic` reads the diff; `verifier` returns pass/fail.
6
+ - Commit: `ops` runs git mechanics in product repos; `maintainer` commits the harness; neither pushes.
7
+ - Close: `historian`, `cleaner`, `maintainer`.
8
+ - Research: `researcher`; Host: `ops`.
9
+ - Extend: `maintainer` + `evolve`.
10
+ - A trigger with no seat is a gap: report it, never improvise a seat mid-pass.
11
+ - A seat fired outside its trigger is a defect: name the trigger it should have had.
12
+
13
+ ## When a new seat is earned
14
+ - A chokepoint — one seat's reach is the queue — earns a new seat: one trigger, one reach, one artifact, one check, never a shared file.
15
+ - Slowness first gets a cheaper model, then a cleaner seam; only a missing capability earns a seat.
16
+ - Friction first gets a mechanism — an installed plugin, MCP or CLI — before any seat.
17
+ - Confusion means ownership is unclear: fix this table or name one writer, never add a seat.
18
+ - Rot means a fact aged out: `historian` dates and re-verifies it; that is maintenance, not a new seat.
19
+ - Overlap or divergence means merge the lanes or re-cut the seam; another seat makes it worse.
@@ -0,0 +1,23 @@
1
+ # Gates: the five worth having
2
+ Ship every gate in the repo it guards, never in the harness; the harness stays zero-backend and only requires each gate exist and run green.
3
+ Gate 1 (boundary validation): validate every request at the edge with a schema (Zod or TypeBox), never by hand.
4
+ OpenAPI 3.1 describes contracts; it does not validate them — the schema validator does.
5
+ Gate 2 (layout scan): hand-write it; no off-the-shelf tool detects overlap, clipping, or overflow.
6
+ Fail when `scrollWidth > clientWidth` on any element or the document (horizontal overflow).
7
+ Fail when at scroll top the first content rect is not fully below the fixed header rect.
8
+ Fail when at scroll end the last content rect is not fully above the fixed footer rect.
9
+ Never fail on mid-scroll pass-under: content passing behind fixed chrome is the design, not a defect.
10
+ Fail when `elementFromPoint` at a text node's centre returns a different, opaque element (something covers it).
11
+ Watch with `ResizeObserver` wherever a measured height feeds a CSS variable; fail on unhandled shift.
12
+ Gate 3 (axe on key pages): run axe with wcag2a/wcag2aa/wcag21a/wcag21aa/wcag22aa tags on 2–3 key pages only.
13
+ axe catches ~57% of accessibility issues (https://github.com/dequelabs/axe-core); it misses focus order, keyboard traps, and contrast over gradients/images.
14
+ Never cite an axe pass as "accessible"; treat every `incomplete` result as a manual check.
15
+ Gate 4 (screenshots at three viewports): keep one screenshot per viewport on 1–2 pages (e.g. 360px phone, 768px tablet, 1280px laptop).
16
+ Keep baselines in-repo and update only on the same OS/browser; baselines rot fastest (fonts, GPU, snapshot churn).
17
+ Cap screenshot pages strictly; a baseline set that grows gets disabled within a month.
18
+ Gate 5 (shutdown + idempotency): send `Idempotency-Key` on every non-GET that creates; same key + same body replays the stored response.
19
+ On SIGTERM stop accepting, drain in-flight, then exit (https://12factor.net/disposability).
20
+ Log to stdout as a structured event stream, one JSON line per event (https://12factor.net/logs).
21
+ Contrast bars: body text 4.5:1, large text (>=18pt, or 14pt bold) 3:1, non-text UI 3:1 (https://www.w3.org/TR/WCAG22/).
22
+ Perf bars (good @ p75): LCP <=2.5s, INP <=200ms, CLS <=0.1 (https://web.dev/articles/vitals).
23
+ Every gate must be able to go red; seed one known failure per gate before trusting it.
@@ -0,0 +1,15 @@
1
+ # Harness: who writes what, what ships, how it versions
2
+ - Let `maintainer` write harness content, `cleaner` sweep scratch, and `historian` write memory; the outward act stays with the owner.
3
+ - Split the two seats by object: `maintainer` changes what the harness is, `cleaner` removes what it left behind — content versus residue.
4
+ - Route every harness change to `maintainer`; route every scratch file to `cleaner`.
5
+ - Package publish set: `AGENTS.md`, `README.md`, `GLOSSARY.md`, `agents/`, `skills/`, `commands/`, `reference/`, plus the sanitized `opencode.jsonc` and `state-seed/`; `.docs/` records decisions like unwired routing.
6
+ - Publish never: live `state/`, personal notes, `tools/`, secrets (`*.env`, `*secrets*`, credential files), or `.git/`.
7
+ - Tag package releases as `vMAJOR.MINOR.PATCH`.
8
+ - Write one `CHANGELOG.md` line per tag naming what changed and why; create it on the first tag if absent.
9
+ - Keep `AGENTS.md` to 200 lines hard, 120 target; keep every reference to 50 lines target, 80 hard.
10
+ - Keep commands and skills 1:1; create no command without a skill and no skill without a command.
11
+ - Grant a new agent its seat only for a new reach class, never for a new craft.
12
+ - Add each new seat as one roster line, never as a new section.
13
+ - Write paths with home and temp variables, never a literal home directory; the user repo root is defined once in `reference/repos.md`.
14
+ - How it grows: `evolve` decides reference vs skill vs agent vs config; one extension at a time; commands and skills stay 1:1; a new seat needs a new reach class, never a new craft.
15
+ - Windows 10/11 only: resolve the user via `%USERPROFILE%` and `%TEMP%`, never a literal path or username.
@@ -0,0 +1,13 @@
1
+ # Hygiene — leave no trail
2
+ - Send every scratch output to `%TEMP%\opencode\<session-id>\`; write nothing scratch into a repo.
3
+ - On Windows treat as trash: agent-created untracked files, `test-results/`, `playwright-report/`, `.vite/`, traces, scratch screenshots, probe scripts, `.dev*.log`, and temp notes past their use.
4
+ - Treat as not trash: tracked files, owner-installed `node_modules`, shipped `dist/`, another session's state, and the owner's own files.
5
+ - Delete each trash file in the same turn it stops being needed; a scratch file outliving its turn is a defect.
6
+ - Stop the process writing a log before deleting that log.
7
+ - Name every deletion in the return, with paths.
8
+ - Delete only what this session created. Older scratch belongs to the session that made it: name it in the return, never sweep it.
9
+ - Name another agent's or session's artifacts before deleting any of them; never delete unnamed.
10
+ - Prove the pass clean: `git status --short` empty for every repo touched.
11
+ - Prove scratch clean: the temp session dir empty or holding only named evidence for a pass still open.
12
+ - Report a duplicate clone, a retired prototype, or a stray branch; never delete one unasked.
13
+ - Treat cleanup as a delivery step, never as a courtesy.
@@ -0,0 +1,13 @@
1
+ # Memory — historian writes, orchestrator hands over
2
+ - Only `historian` writes memory; `orchestrator` hands it the deltas in the same turn, never later.
3
+ - Session files live at explicit dynamic paths: `%USERPROFILE%\state\<session-id>\state.md`, `plan.md`, `handoff.md`; harness assets in `state/`; no literal user or home path.
4
+ - Harness memory: `state/` in the config dir holds `lessons.md` and `template.md`.
5
+ - Archive: `state/archive/<yyyy-mm>.md` holds superseded lines.
6
+ - Write `state.md` in the fixed key order: `id`, `title`, `status`, `goal`, `next`, `artifacts`, `decisions`, `open`.
7
+ - Let the user decide what a lesson says; `historian` records, dedupes, and archives it.
8
+ - Let `maintainer` own harness definition and `historian` own harness memory; neither writes the other's files.
9
+ - Stamp every recorded fact with `verified: YYYY-MM-DD`; after 30 days it is `STALE`, then re-verify or archive it.
10
+ - Keep behavioural lessons non-expiring; let facts expire. Local knowledge is not permanently right.
11
+ - Archive, never delete: move superseded lines to the monthly archive, then report each move.
12
+ - Write a repo-local handoff only when the brief names the exact path.
13
+ - Never invent an id; take it from the `session_rename` return.
@@ -1,31 +1,26 @@
1
- # OpenCode Model Catalog
1
+ # Models and cost
2
2
 
3
- > **Recheck due: `<date>` - every 3 days.** Procedure: `~/.config/opencode/reference/model-keeper.md`.
4
- > On recheck, move this date +3 days and re-verify the table below.
3
+ No model pins ship. Every seat inherits the session model until the user binds one.
5
4
 
6
- > **TEMPLATE - adopter-owned skeleton.** This file ships EMPTY of measured data by
7
- > design: seat wiring lives in the adopter's `agents` map (or agent frontmatter) and is
8
- > NOT shipped with the harness. The installer PRESERVES an existing file. Rows are
9
- > recorded per `reference/model-keeper.md` - measured routes, prices, variants, and
10
- > history are adopter evidence, never shipped.
5
+ ## Tiers
11
6
 
12
- This is an informational catalog of model IDs, provider availability, variants, and
13
- measured route windows. It routes nothing itself - seat routing lives in the adopter's
14
- `agents` map or agent frontmatter. The catalog's only machine-read contract is the table
15
- below (`scripts/harness-doctor.ps1` parses the `Model (provider/<id>)` header and the
16
- numbered backticked rows).
7
+ - **Bulk tier (cheap).** Drafting, workers, research, audits, iteration. Fan out freely; never trade speed for token anxiety here.
8
+ - **Verdict tier (costly).** Judgement only: verdicts, reviews, design audits, anything where being wrong is expensive. Never use it for bulk reading or drafting.
17
9
 
18
- Rates are USD per MTok, input / output / cache-read / cache-write. Context is
19
- input / max output. `<...>` slots are placeholders the adopter fills on first
10
+ ## How to bind
20
11
 
21
- record; rows start empty - replace the example rows, never extend the table shape.
12
+ - Bind per seat in the user `agents` map in `opencode.jsonc`, or with a `model:` line in an agent's frontmatter.
13
+ - Use only an id that resolves in the catalog below; an unresolvable id fails the doctor check.
14
+ - Keep the verdict seat on the costly tier and everything else on the cheap tier unless a brief says otherwise.
22
15
 
23
- | # | Model (provider/<id>) | Context | Rate (in/out/read/write) | Variants | Status |
24
- |---|----------------------|--------:|--------------------------|----------|--------|
25
- | 1 | `provider/example-model-1` | `<context>` | `<in>/<out>/<read>/<write>` | `<variants>` | `<status>` |
26
- | 2 | `provider/example-model-2` | `<context>` | `<in>/<out>/<read>/<write>` | `<variants>` | `<status>` |
16
+ ## Catalog
27
17
 
28
- Example rows above are structural placeholders - replace with measured rows recorded
29
- per `reference/model-keeper.md`. No fallback ladder is shipped: provider errors are
30
- reported by OpenCode; the catalog never retries, substitutes, or changes the selected
31
- model.
18
+ - List each provider model the user uses as `provider/model-id`, one per line, with its tier beside it.
19
+ - Example shape (ids are illustrative, replace with real ones):
20
+ - `provider/cheap-workhorse` — bulk tier
21
+ - `provider/costly-judge` — verdict tier
22
+ - The doctor's routing law resolves every bound id against this catalog; unwired seats skip resolution and inherit the session model.
23
+
24
+ ## Rule
25
+
26
+ - Spend the costly tier on the verdict, and the cheap tier on everything that feeds it.
@@ -0,0 +1,23 @@
1
+ # Phases — Matt Pocock, ask-matt/PHASE-BOUNDARIES.md, ~/.agents/skills, read 2026-10-20
2
+ - Decide the context move at a phase boundary, never mid-phase.
3
+ - A phase ends when you think "ok, we're done with that".
4
+ - Mid-phase: continue, or split leftover work to subagents.
5
+ - Never compact mid-phase: it loses the thread.
6
+ - Option 1 — Continue: stay in session, no context switch.
7
+ - Option 2 — Clear (/clear): empty the window, start from nothing.
8
+ - Option 3 — Handoff (/handoff): write a portable file, seed a session anywhere.
9
+ - Option 4 — Subagent: send the task to its own window, take back a report.
10
+ - Option 5 — Compact (/compact): compress context, seed a fresh session.
11
+ - Q1: Can you continue? Next phase needs this phase verbatim, or ~150k fits.
12
+ - Rule out Continue first: it costs nothing and loses nothing.
13
+ - Q2: Is this context disposable? If yes, /clear.
14
+ - Never /clear relevant context: the why never comes back from the diff.
15
+ - Q3: Must something travel? New harness, new directory, colleague, forked side task.
16
+ - If nothing travels, skip /handoff.
17
+ - Q4: Can it run AFK with no steering? If yes, use a subagent.
18
+ - Otherwise /compact with an instruction naming the next phase.
19
+ - Treat /compact as the default, never the first reach.
20
+ - Every non-Continue move turns a primary source into a lossy secondary source.
21
+ - Pay lossiness only when staying costs more than it saves.
22
+ - Ask the questions in order; the first yes wins.
23
+ - Accept taste: the same boundary can go two ways on two days.