geneseed 5.3.0 → 5.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 (198) hide show
  1. package/CHANGELOG.md +95 -0
  2. package/README.md +23 -20
  3. package/SHIPPED.md +7 -7
  4. package/adapters/bob/README.md +31 -18
  5. package/adapters/claude-code/README.md +27 -22
  6. package/adapters/openclaude/README.md +18 -8
  7. package/adapters/opencode/HOW-OPENCODE-LOADS.md +8 -3
  8. package/adapters/opencode/README.md +3 -2
  9. package/adapters/opencode/plugins/geneseed-activity.js +20 -21
  10. package/adapters/opencode/plugins/geneseed-context.js +175 -62
  11. package/adapters/opencode/plugins/geneseed-guard.js +419 -205
  12. package/adapters/opencode/plugins/geneseed-workflow.js +3 -2
  13. package/adapters/opencode/workflows/_runtime.js +3 -2
  14. package/bin/geneseed-cli.mjs +7 -0
  15. package/bin/geneseed-hook.mjs +59 -11
  16. package/docs/PRD.md +1 -1
  17. package/docs/README.md +1 -0
  18. package/docs/concepts/agents.md +1 -1
  19. package/docs/concepts/collaboration.md +2 -2
  20. package/docs/concepts/enforcement-table.md +5 -2
  21. package/docs/concepts/exclusions.md +18 -4
  22. package/docs/concepts/footprint.md +11 -1
  23. package/docs/concepts/foreman-mode.md +1 -1
  24. package/docs/concepts/hook-gates.md +5 -5
  25. package/docs/concepts/hooks.md +4 -3
  26. package/docs/concepts/host-matrix.md +24 -6
  27. package/docs/concepts/kits.md +12 -2
  28. package/docs/concepts/loop-bricks.md +3 -3
  29. package/docs/concepts/loops.md +6 -4
  30. package/docs/concepts/ownership.md +1 -1
  31. package/docs/concepts/rules.md +2 -2
  32. package/docs/concepts/skills.md +1 -1
  33. package/docs/design-history.md +8 -0
  34. package/docs/extending.md +112 -35
  35. package/docs/guides/auto-merge.md +100 -0
  36. package/docs/guides/choose-your-setup.md +1 -1
  37. package/docs/guides/headless.md +1 -1
  38. package/docs/guides/install-bob.md +2 -2
  39. package/docs/guides/install-clone.md +1 -1
  40. package/docs/guides/install-openclaude.md +1 -1
  41. package/docs/guides/install.md +1 -1
  42. package/docs/guides/loop-finish.md +3 -3
  43. package/docs/guides/loop-running.md +4 -4
  44. package/docs/guides/project-context.md +1 -1
  45. package/docs/guides/run-a-factory.md +2 -2
  46. package/docs/guides/setup-doctrines.md +2 -2
  47. package/docs/guides/setup-footprint.md +1 -1
  48. package/docs/guides/uninstall.md +3 -3
  49. package/docs/guides/upgrade.md +1 -1
  50. package/docs/guides/verify.md +12 -0
  51. package/docs/guides/worktree.md +1 -1
  52. package/docs/reference/environment.md +5 -2
  53. package/docs/reference/plugin-activity.md +1 -1
  54. package/docs/reference/plugin-guard.md +1 -1
  55. package/docs/reference/plugin-learn.md +1 -1
  56. package/docs/reference/plugin-workflow.md +1 -1
  57. package/docs/reference/troubleshoot-doctor.md +2 -2
  58. package/docs/reference/troubleshoot-hooks.md +2 -2
  59. package/docs/reference/troubleshoot-install.md +3 -3
  60. package/docs/reference/troubleshoot-tools.md +1 -1
  61. package/docs/token-footprint.md +68 -4
  62. package/docs/understand/design-choices-hosts.md +1 -1
  63. package/docs/understand/design-choices-shape.md +1 -0
  64. package/docs/understand/enforced-vs-asked.md +2 -2
  65. package/docs/understand/machine-bob.md +1 -1
  66. package/docs/understand/machine-claude.md +2 -2
  67. package/docs/understand/on-your-machine.md +1 -1
  68. package/docs/web-ui.md +10 -5
  69. package/harness.config.json +1 -1
  70. package/js/README.md +5 -3
  71. package/js/build/args.mjs +13 -2
  72. package/js/build/driver.mjs +34 -7
  73. package/js/build/emit-claude.mjs +9 -5
  74. package/js/build/emit-opencode.mjs +13 -9
  75. package/js/build/generate.mjs +10 -165
  76. package/js/build/profile.mjs +318 -0
  77. package/js/build/render.mjs +81 -3
  78. package/js/build/retired-skills.mjs +60 -13
  79. package/js/build/source.mjs +15 -1
  80. package/js/build/stubs.mjs +4 -1
  81. package/js/cli-table.json +48 -3
  82. package/js/hosts/done-checks.mjs +6 -0
  83. package/js/hosts/geneseed-dir.mjs +3 -2
  84. package/js/hosts/gitref.mjs +5 -3
  85. package/js/hosts/hook-tap.mjs +104 -0
  86. package/js/hosts/hooks-context.mjs +4 -2
  87. package/js/hosts/hooks-done.mjs +345 -55
  88. package/js/hosts/hooks-learn.mjs +51 -19
  89. package/js/hosts/hooks-prims.mjs +5 -3
  90. package/js/hosts/hooks.mjs +172 -19
  91. package/js/hosts/hosts.mjs +80 -12
  92. package/js/hosts/installs.mjs +26 -1
  93. package/js/hosts/native.mjs +33 -7
  94. package/js/hosts/owned.mjs +7 -6
  95. package/js/hosts/ownership-gate.mjs +14 -1
  96. package/js/hosts/settings.mjs +273 -105
  97. package/js/hosts/shim.mjs +4 -4
  98. package/js/hosts/usage.mjs +9 -3
  99. package/js/inspect/checks-constitution.mjs +32 -0
  100. package/js/inspect/checks-probe.mjs +66 -5
  101. package/js/inspect/checks-repo.mjs +196 -2
  102. package/js/inspect/cost.mjs +34 -2
  103. package/js/inspect/diff.mjs +21 -3
  104. package/js/inspect/doctor.mjs +6 -1
  105. package/js/inspect/inventory.mjs +1 -1
  106. package/js/lib/machine-dir.mjs +1 -1
  107. package/js/lib/node-floor.mjs +46 -6
  108. package/js/maintain/setup.mjs +5 -1
  109. package/js/maintain/uninstall.mjs +42 -16
  110. package/js/maintain/update.mjs +4 -2
  111. package/js/web/actions.mjs +17 -12
  112. package/js/web/api.mjs +7 -2
  113. package/package.json +1 -1
  114. package/registry.json +14 -0
  115. package/src/AGENT.md.tmpl +15 -17
  116. package/src/bricks/pr-open.md +3 -2
  117. package/src/doctrines/ops.md +2 -2
  118. package/src/doctrines/process.md +40 -36
  119. package/src/factories/analysis-to-build.json +1 -1
  120. package/src/factories/bug-report-to-fix.json +1 -1
  121. package/src/factories/issue-to-pr.json +1 -1
  122. package/src/kits/terminal-tools/rules.md +10 -0
  123. package/src/kits/terminal-tools.json +13 -0
  124. package/src/licenses/herdr.txt +201 -0
  125. package/src/modes/foreman.md +6 -3
  126. package/src/skills/_self-improvement.md +9 -7
  127. package/src/skills/commit.md +17 -17
  128. package/src/skills/debug/ci.md +1 -1
  129. package/src/skills/dependencies.md +3 -3
  130. package/src/skills/document-project.md +3 -2
  131. package/src/skills/factory.md +13 -4
  132. package/src/skills/geneseed.md +4 -2
  133. package/src/skills/git-history.md +5 -7
  134. package/src/skills/herdr.md +135 -0
  135. package/src/skills/loop.md +3 -2
  136. package/src/skills/opencode-cli.md +84 -0
  137. package/src/skills/pipeline.md +1 -1
  138. package/src/skills/release.md +5 -8
  139. package/src/skills/review-response.md +4 -2
  140. package/src/skills/rule.md +27 -1
  141. package/src/skills/ship.md +54 -7
  142. package/src/skills/worktree.md +2 -2
  143. package/src/upstreams.json +7 -0
  144. package/themes/_TEMPLATE.json +2 -0
  145. package/themes/biker.json +2 -0
  146. package/themes/commentator.json +2 -0
  147. package/themes/cyberpunk.json +2 -0
  148. package/themes/gamer.json +2 -0
  149. package/themes/imperial.json +2 -0
  150. package/themes/joker.json +2 -0
  151. package/themes/marvin.json +2 -0
  152. package/themes/mean.json +2 -0
  153. package/themes/military.json +2 -0
  154. package/themes/neutral.json +2 -0
  155. package/themes/pirate.json +2 -0
  156. package/themes/sports.json +2 -0
  157. package/themes/verstappen.json +2 -0
  158. package/themes/wizard.json +2 -0
  159. package/web/dist/assets/Activity-D2kOc3yi.js +1 -0
  160. package/web/dist/assets/ActivityDetail-By3xOr21.js +1 -0
  161. package/web/dist/assets/{Bonsai-Bfpb6W-1.js → Bonsai-CBWDTBA4.js} +1 -1
  162. package/web/dist/assets/{CopyButton-ByIntFtB.js → CopyButton-BVbpriMB.js} +1 -1
  163. package/web/dist/assets/Dashboard-CIJLPHM9.js +2 -0
  164. package/web/dist/assets/{Docs-DvlMJhpu.js → Docs-CiRRIELs.js} +3 -3
  165. package/web/dist/assets/Factories-DhyK0O8d.js +1 -0
  166. package/web/dist/assets/GreenhouseView-DW3PgTPy.js +1 -0
  167. package/web/dist/assets/Installs-B6nlo-Ly.js +3 -0
  168. package/web/dist/assets/JournalView-O65qEWfp.js +1 -0
  169. package/web/dist/assets/Kits-C5U-yT6Z.js +1 -0
  170. package/web/dist/assets/Laws-CuTw_XNf.js +4 -0
  171. package/web/dist/assets/{LibRows-DEHjIoD-.js → LibRows-D6-CVa3K.js} +1 -1
  172. package/web/dist/assets/Library-CzPlerd6.js +3 -0
  173. package/web/dist/assets/Loops-CqNF_-nS.js +2 -0
  174. package/web/dist/assets/Markdown-CxkA7940.js +71 -0
  175. package/web/dist/assets/OperatorHudView-BNr8K5qj.js +1 -0
  176. package/web/dist/assets/Personal-DeDb9e8O.js +2 -0
  177. package/web/dist/assets/Settings-B8MPN_AD.js +1 -0
  178. package/web/dist/assets/{Tabs-CWeQTADL.js → Tabs-DJzAez4h.js} +1 -1
  179. package/web/dist/assets/index-BL3P-9Rg.js +6 -0
  180. package/web/dist/assets/{index-CsAZq0BQ.css → index-CRWqKxfY.css} +1 -1
  181. package/web/dist/index.html +2 -2
  182. package/adapters/claude-code/settings.json +0 -52
  183. package/web/dist/assets/Activity-CqJiquEq.js +0 -1
  184. package/web/dist/assets/ActivityDetail-BSzevynX.js +0 -1
  185. package/web/dist/assets/Dashboard-DBOEi9lQ.js +0 -2
  186. package/web/dist/assets/Factories-Bpvv7L2H.js +0 -1
  187. package/web/dist/assets/GreenhouseView-GpBsYn50.js +0 -1
  188. package/web/dist/assets/Installs-BlGmVrFK.js +0 -3
  189. package/web/dist/assets/JournalView-iLuLrOxE.js +0 -1
  190. package/web/dist/assets/Kits-DRwpxC-J.js +0 -1
  191. package/web/dist/assets/Laws-CZkiNOWQ.js +0 -4
  192. package/web/dist/assets/Library-B4K-1iNF.js +0 -3
  193. package/web/dist/assets/Loops-BWSzaW8E.js +0 -2
  194. package/web/dist/assets/Markdown-0ORz7tAc.js +0 -69
  195. package/web/dist/assets/OperatorHudView-BAXwCEvY.js +0 -1
  196. package/web/dist/assets/Personal-Bp9nV4GR.js +0 -2
  197. package/web/dist/assets/Settings-CWWuaIp-.js +0 -1
  198. package/web/dist/assets/index-How7SzDZ.js +0 -6
@@ -58,13 +58,15 @@ import {
58
58
  CLAUDE_STYLE, DISABLED_STASH, GLOBAL_MANIFEST, HOSTS, VERSION_MARKER, expanduser, isHostGlobalDir, opencodeConfigDir,
59
59
  resolvePath, settingsFile,
60
60
  } from '../hosts/hosts.mjs';
61
- import { mcpCommented, mcpLoad } from '../hosts/mcp.mjs';
61
+ import { mcpLoad } from '../hosts/mcp.mjs';
62
62
  import {
63
63
  SRC_DIRS_MARKER, bundleFiles, hashesOf, ownedState, ownedWithin, recordedDenies, recordedEdit,
64
+ recordedGates,
64
65
  } from '../hosts/owned.mjs';
65
66
  import {
66
67
  atomicWriteJson, managedBlockRead, managedBlockRemove, managedBlockWrite,
67
68
  loadJsonObject, mergeClaudeSettings, opencodeTarget, OPENCODE_SENTINEL, opencodeSentinelWrite,
69
+ OWNED_VERDICT,
68
70
  settingsIntegrityCheck, wireClaudeExcludes, unwireClaudeExcludes,
69
71
  unwireClaudeSettings, wireClaudeEnv, unwireClaudeEnv,
70
72
  } from '../hosts/settings.mjs';
@@ -246,12 +248,24 @@ const REVERSAL_MARKERS = [GLOBAL_MANIFEST, '.geneseed-theme', '.geneseed-emit',
246
248
  * deactivate, which removed the entry but kept the denies (PR #241 review) — so either half
247
249
  * alone is a change, and only "neither" declines.
248
250
  *
249
- * A COMMENTED `.jsonc` is not rewritten and the user is told to do it by hand — the entry AND
250
- * the recorded denies still set to `"deny"`, each named: rewriting it
251
+ * `gates` is the manifest's `bash_gates` — the `permission.bash` keys an emit itself ADDED,
252
+ * because they were absent when it ran. Uninstall once left all of them (some 45 keys:
253
+ * `"git commit*": "ask"` and the push chain) in a file whose harness was gone, although the
254
+ * record of having written them was right there. A recorded key goes only while it still reads
255
+ * the verdict Geneseed writes for it (`OWNED_VERDICT`): the same two conditions under which a
256
+ * pack-off rebuild takes one back (`reconcileOpencodePermission`), so a key the user re-scoped,
257
+ * and any key that is not in the record — theirs from the start, or from an install older than
258
+ * 5.2.0 — stays. An emptied `bash` object is dropped, as an emptied `skill` is; `permission`
259
+ * itself is left, empty or not, as those two sweeps leave it. `[]` (deactivate) sweeps nothing:
260
+ * a paused install keeps its gates, which is the fail-closed direction.
261
+ *
262
+ * A COMMENTED file — `opencode.json` or `.jsonc`, the extension does not matter — is not
263
+ * rewritten and the user is told to do it by hand — the entry, the recorded denies still set
264
+ * to `"deny"` AND the recorded gates still at Geneseed's verdict, each named: rewriting it
251
265
  * would drop the comments. That branch returns False, so the caller's `unmerged` reports
252
266
  * REALITY rather than intent.
253
267
  */
254
- export function unmergeOpencodeJson(p, entry, denyNames = [], edit = null) {
268
+ export function unmergeOpencodeJson(p, entry, denyNames = [], edit = null, gates = []) {
255
269
  const target = opencodeTarget(p);
256
270
  // Absent, unreadable (the Python's `except OSError: return False`) or not an object: decline.
257
271
  const { state, data: cfg, hadComments } = loadJsonObject(target);
@@ -267,20 +281,28 @@ export function unmergeOpencodeJson(p, entry, denyNames = [], edit = null) {
267
281
  // back only when nothing but its `"*"` is left — a key the user added since keeps the object.
268
282
  const editObj = edit && isDict(cfg.permission) && isDict(cfg.permission.edit) ? cfg.permission.edit : null;
269
283
  const asks = editObj ? edit.asks.filter((k) => editObj[k] === 'ask') : [];
270
- if (!hasEntry && !denies.length && !asks.length) return false;
271
- if (path.extname(target) === '.jsonc' && hadComments) {
284
+ const bash = isDict(cfg.permission) && isDict(cfg.permission.bash) ? cfg.permission.bash : null;
285
+ const ours = bash
286
+ ? gates.filter((k) => OWNED_VERDICT.has(k) && bash[k] === OWNED_VERDICT.get(k))
287
+ : [];
288
+ if (!hasEntry && !denies.length && !asks.length && !ours.length) return false;
289
+ if (hadComments) {
272
290
  printOut(`[uninstall] ${path.basename(target)} has comments — not rewriting it.`
273
291
  + (hasEntry ? ` Remove this from its "instructions" by hand: ${jsonDumps(entry)}` : '')
274
292
  + (denies.length ? ` Remove these from its "permission.skill" by hand: `
275
293
  + `${denies.map((n) => jsonDumps(n)).join(', ')}` : '')
276
294
  + (asks.length ? ` Remove these from its "permission.edit" by hand: `
277
295
  + `${asks.map((k) => jsonDumps(k)).join(', ')}` : '')
296
+ + (ours.length ? ` Remove these from its "permission.bash" by hand: `
297
+ + `${ours.map((k) => jsonDumps(k)).join(', ')}` : '')
278
298
  + '\n');
279
299
  return false;
280
300
  }
281
301
  if (hasEntry) cfg.instructions = instr.filter((i) => i !== entry);
282
302
  for (const name of denies) delete skill[name];
283
303
  if (skill && denies.length && !Object.keys(skill).length) delete cfg.permission.skill;
304
+ for (const k of ours) delete bash[k];
305
+ if (ours.length && !Object.keys(bash).length) delete cfg.permission.bash;
284
306
  for (const k of asks) delete editObj[k];
285
307
  if (asks.length) {
286
308
  const left = Object.keys(editObj);
@@ -324,7 +346,7 @@ export function claudeUninstall(cfg, archiveMemory, force = false) {
324
346
  if (kept.length) warnKept(kept);
325
347
  const hooks = managed.settings_hooks || [];
326
348
  const sf = settingsFile(cfg, managed);
327
- const unwired = unwireClaudeSettings(sf, hooks);
349
+ const unwired = unwireClaudeSettings(sf, hooks, cfg);
328
350
  unwireClaudeExcludes(sf, managed.settings_excludes || []);
329
351
  unwireClaudeEnv(sf, managed.settings_env);
330
352
  // The unwire is VERIFIED, not assumed: a commented settings file is never rewritten, so a
@@ -361,7 +383,8 @@ export function uninstallGlobal(target, archiveMemory, host = 'opencode', force
361
383
  if (isDir(p) && isEmptyDir(p)) rmdirQuiet(p);
362
384
  }
363
385
  const unmerged = unmergeOpencodeJson(path.join(target, 'opencode.json'),
364
- path.join(target, 'AGENT.md').split(path.sep).join('/'), recordedDenies(man), recordedEdit(man));
386
+ path.join(target, 'AGENT.md').split(path.sep).join('/'), recordedDenies(man), recordedEdit(man),
387
+ recordedGates(man));
365
388
  managedBlockRemove(path.join(target, OPENCODE_SENTINEL));
366
389
  if (failed.length) warnMarkersKept();
367
390
  else for (const m of REVERSAL_MARKERS) unlinkQuiet(path.join(target, m));
@@ -488,7 +511,8 @@ function opencodeProjectUninstall(root, force = false) {
488
511
  }
489
512
  }
490
513
  const unmerged = unmergeOpencodeJson(path.join(root, 'opencode.json'), entry,
491
- man ? recordedDenies(man) : [], man ? recordedEdit(man) : null);
514
+ man ? recordedDenies(man) : [], man ? recordedEdit(man) : null,
515
+ man ? recordedGates(man) : []);
492
516
  const result = { removed, unmerged, archived: null, userOnly };
493
517
  if (failed.length) result.failed = failed;
494
518
  if (kept.length) result.kept = kept;
@@ -1010,7 +1034,7 @@ function installMoveList(root, kind) {
1010
1034
  *
1011
1035
  * Deliberately a minimal inline re-add rather than the emit's own merge, whose side effects
1012
1036
  * (adding `permission` and `lsp: true` when absent) would clobber values the user may have
1013
- * set since the install was disabled. A commented `.jsonc` is not rewritten — the same
1037
+ * set since the install was disabled. A commented file is not rewritten — the same
1014
1038
  * refusal `unmergeOpencodeJson` makes — but here the files have ALREADY been restored, so it
1015
1039
  * tells the operator what to add rather than failing the whole reactivate. That asymmetry is
1016
1040
  * the reference's and is gated per side.
@@ -1024,7 +1048,7 @@ function installReaddEntry(target, entry) {
1024
1048
  if (state !== 'ok') return false; // unreadable (except OSError), or not an object
1025
1049
  const instr = Array.isArray(cfg.instructions) ? cfg.instructions : [];
1026
1050
  if (indexOfDeepEqual(instr, entry) >= 0) return false;
1027
- if (path.extname(target) === '.jsonc' && hadComments) {
1051
+ if (hadComments) {
1028
1052
  printOut(`[activate] ${path.basename(target)} has comments — not rewriting it. Add this `
1029
1053
  + `to its "instructions" by hand: ${jsonDumps(entry)}\n`);
1030
1054
  return false;
@@ -1138,12 +1162,14 @@ export function installDeactivate(root, host = 'opencode', scope = 'global') {
1138
1162
  }
1139
1163
  const kind = installKind(root);
1140
1164
  const target = opencodeTarget(path.join(root, 'opencode.json'));
1141
- // Caught UP FRONT, before any file moves: a commented `.jsonc` cannot be rewritten without
1142
- // dropping the user's comments, so refuse and move NOTHING.
1143
- if (mcpCommented(target)) {
1165
+ // Caught UP FRONT, before any file moves: a commented file cannot be rewritten without
1166
+ // dropping the user's comments, so refuse and move NOTHING. By comments, not by extension:
1167
+ // the unmerge below refuses a commented `opencode.json` too, and a guard that let one
1168
+ // through would move every file and leave the `instructions` entry pointing at nothing.
1169
+ if (loadJsonObject(target).hadComments) {
1144
1170
  return { ok: false,
1145
1171
  error: `${path.basename(target)} has comments — refusing to rewrite it. `
1146
- + 'Disable by hand or convert it to plain .json first.' };
1172
+ + 'Disable by hand or remove the comments first.' };
1147
1173
  }
1148
1174
  const stash = path.join(root, DISABLED_STASH);
1149
1175
  const { done, failed } = moveAll(root, stash, installMoveList(root, kind));
@@ -1275,7 +1301,7 @@ function claudeDeactivate(root, scope = 'global', host = 'claude') {
1275
1301
  cleanHostStash(cfg, host);
1276
1302
  return { ok: false, failed, rolled_back: done.length };
1277
1303
  }
1278
- unwireClaudeSettings(settingsFile(cfg, managed), managed.settings_hooks || []);
1304
+ unwireClaudeSettings(settingsFile(cfg, managed), managed.settings_hooks || [], cfg);
1279
1305
  unwireClaudeExcludes(settingsFile(cfg, managed), managed.settings_excludes || []);
1280
1306
  unwireClaudeEnv(settingsFile(cfg, managed), managed.settings_env);
1281
1307
  // The same integrity check the uninstall path runs: a deactivate that silently failed to
@@ -749,7 +749,9 @@ async function drainStdout() {
749
749
 
750
750
  /**
751
751
  * The flags that re-emit the install at `dir` on its OWN axes — footprint, posture, mode,
752
- * trust, doctrine packs, excluded rules — or `[]` when no build ever wrote a marker there.
752
+ * trust, doctrine packs, excluded rules, excluded skills, gates, kits, shared tier — or `[]`
753
+ * when no build ever wrote a marker there. Every axis the preserve guard compares
754
+ * (js/build/profile.mjs) has to be here, or `upgrade` is refused on the one it left out.
753
755
  *
754
756
  * WITHOUT THEM THE REBUILD RESETS THE INSTALL. The generator's defaults are not the install's:
755
757
  * a missing `--footprint` is `lean`, and posture, mode, packs and excluded rules come from
@@ -770,7 +772,7 @@ export async function installAxes(dir, { installProfile, setupBuildArgs }, notif
770
772
  if (!existsSync(path.join(String(dir), '.geneseed-emit'))) return [];
771
773
  const p = installProfile('opencode', 'global', String(dir), notify);
772
774
  return setupBuildArgs('', 'files', null, null, p.footprint, p.posture, p.mode, p.doctrines,
773
- undefined, p.excludeRules, p.trust, p.excludeSkills, p, p.kits).slice(4);
775
+ undefined, p.excludeRules, p.trust, p.excludeSkills, p, p.kits, p.sharedTier).slice(4);
774
776
  }
775
777
 
776
778
  /**
@@ -48,7 +48,7 @@ import {
48
48
  opencodeConfigDir, resolvePath,
49
49
  } from '../hosts/hosts.mjs';
50
50
  import {
51
- EMIT_HOST_SCOPE, doctrinesForBuild, excludedRulesOfDir, excludedSkillsOfDir, kitsOfDir, sharedTierOfDir, renderedTier,
51
+ EMIT_FOR, EMIT_HOST_SCOPE, doctrinesForBuild, excludedRulesOfDir, excludedSkillsOfDir, kitsOfDir, sharedTierOfDir, renderedTier,
52
52
  footprintOfDir, gatesOfDir,
53
53
  installState, installTargets, modeOfDir, postureOfDir, themeOfDir,
54
54
  trustOfDir,
@@ -157,7 +157,7 @@ function bodySharedTier(body, root, host) {
157
157
 
158
158
  /**
159
159
  * The gate switches across the trust boundary (`deletionGate`, `secretsGate`, `doneGate`,
160
- * `ownershipGate`, `externalGate`, `testNote`), each on its own: only a real JSON boolean counts. Anything else — a string
160
+ * `ownershipGate`, `externalGate`, `testNote`, `ownBranchPass`), each on its own: only a real JSON boolean counts. Anything else — a string
161
161
  * `"false"`, a number, absence — falls back to the install's own answer for THAT gate, so a
162
162
  * malformed or partial body can never disarm (or re-arm) a gate it did not name.
163
163
  */
@@ -563,12 +563,16 @@ export function buildActionCmds(state, body) {
563
563
  return { error: `${emit} installs into a folder you choose — use Deploy with a folder, `
564
564
  + 'not Build' };
565
565
  }
566
- return actionCommands('build', {
566
+ const [step] = actionCommands('build', {
567
567
  theme, emit, footprint: deployed(state) ? state.footprint : 'lean',
568
568
  posture: state.posture, mode: state.mode,
569
569
  trust: state.trust,
570
570
  doctrines: doctrinesForBuild(state.target),
571
571
  });
572
+ // `--reset`, as in `apiInstallCmd`: a fresh target's argv is a whole selection that elides
573
+ // axes at their defaults, so an install already there must not be refused by the preserve
574
+ // guard (js/build/profile.mjs) for every axis it did not spell.
575
+ return [[...step, '--reset']];
572
576
  }
573
577
 
574
578
  /**
@@ -716,14 +720,6 @@ export function apiRestore(state, files) {
716
720
  return { restored, deleted, errors, archive };
717
721
  }
718
722
 
719
- /** (host, scope) -> the emit name that installs it. */
720
- const EMIT_FOR = new Map([
721
- ['opencode global', 'opencode-global'], ['opencode project', 'opencode'],
722
- ['claude global', 'claude-global'], ['claude project', 'claude'],
723
- ['bob global', 'bob-global'], ['bob project', 'bob'],
724
- ['openclaude global', 'openclaude-global'], ['openclaude project', 'openclaude'],
725
- ]);
726
-
727
723
  /**
728
724
  * The build command that installs Geneseed into a DETECTED location, or re-themes an
729
725
  * already-active one (an in-place re-emit, the same command either way).
@@ -745,7 +741,7 @@ export function apiInstallCmd(state, body) {
745
741
  const emit = EMIT_FOR.get(`${host} ${scope}`);
746
742
  if (emit === undefined) return { error: `no install mode for ${host}:${scope}` };
747
743
  // Every read-back below is narrowed to `host`'s OWN carrier (host-compat B1) — see the
748
- // comment at `installProfile` in `js/build/generate.mjs`.
744
+ // comment at `installProfile` in `js/build/profile.mjs`.
749
745
  // The theme default is THIS install's own, not the viewed one's: the Kits page acts on any row.
750
746
  // An ABSENT row has no footprint of its own (`footprintOfDir` answers its no-marker `full`),
751
747
  // so a new install takes the CLI's default, lean — see `apiDeployCmd` below.
@@ -788,9 +784,16 @@ export function apiInstallCmd(state, body) {
788
784
  const argv = setupBuildArgs(theme || 'neutral', emit, out, out, fp, pos, mode, doctrines,
789
785
  PACK_ORDER, excludeRules, trust, excludedSkillsOfDir(root, host), gates,
790
786
  kits ?? kitsOfDir(root, host), sharedTier);
787
+ // `--reset`: this argv is a WHOLE selection — every axis is the body's or the install's own —
788
+ // and `setupBuildArgs` elides an axis at its default, so returning one to it (a mode back to
789
+ // direct, a gate re-armed) would otherwise trip the preserve guard (js/build/profile.mjs).
790
+ argv.push('--reset');
791
791
  // `--force` only on a literal `true`: the panel's "Replace with Geneseed's copies", which
792
792
  // names the files first. It is this one build's instruction and is never recorded.
793
793
  if (bget(body, 'force') === true) argv.push('--force');
794
+ // `--prune-gates` the same way, and only where it means something: OpenCode's opencode.json
795
+ // is the one file with `permission.bash` gates. One build's instruction, never recorded.
796
+ if (bget(body, 'pruneGates') === true && host === 'opencode') argv.push('--prune-gates');
794
797
  return { cmd: [process.execPath, path.join(ROOT, 'bin', 'build-driver.mjs'), ...argv] };
795
798
  }
796
799
 
@@ -924,5 +927,7 @@ export function apiDeployCmd(state, body) {
924
927
  const argv = setupBuildArgs(theme || 'neutral', host, root, root, fp, pos, mode, doctrines,
925
928
  PACK_ORDER, excludeRules, trust, excludedSkillsOfDir(root, host), gates, kitsOfDir(root, host),
926
929
  bodySharedTier(body, root, host));
930
+ // `--reset`, as in `apiInstallCmd`: the form's answers plus the folder's own are a whole selection.
931
+ argv.push('--reset');
927
932
  return { cmd: [process.execPath, path.join(ROOT, 'bin', 'build-driver.mjs'), ...argv] };
928
933
  }
package/js/web/api.mjs CHANGED
@@ -24,7 +24,7 @@ import { factCount } from '../hosts/memory-files.mjs';
24
24
  import { autostartState } from '../hosts/shim.mjs';
25
25
  import {
26
26
  footprintOfDir, gatesOfDir, installState, installTargets, leftoversOf, modeOfDir,
27
- trustOfDir, sharedTierOfDir,
27
+ trustOfDir, sharedTierOfDir, strandedGatesOf,
28
28
  postureOfDir, readJsonMaybe, readMaybe, themeOfDir,
29
29
  } from '../hosts/installs.mjs';
30
30
  import { PRESETS } from '../loop/score.mjs';
@@ -174,6 +174,8 @@ const driftCounts = (files) => ({
174
174
  missing: files.filter((f) => f.status === 'missing').length,
175
175
  linked: files.filter((f) => f.status === 'linked').length,
176
176
  stale: files.filter((f) => f.status === 'stale').length,
177
+ // D11: .md files keep alert tone even when kept, so don't count them in kept
178
+ kept: files.filter((f) => f.status === 'edited' && f.diverged === false && !f.rel.endsWith('.md')).length,
177
179
  });
178
180
 
179
181
  /**
@@ -243,6 +245,8 @@ export function apiInstalls(state) {
243
245
  // Files here that are the user's where Geneseed ships one, and retired leftovers: what a
244
246
  // forced rebuild would replace or remove (`leftoversOf`). Read off the emit's own record.
245
247
  leftovers: leftoversOf(root, host, scope),
248
+ // OpenCode only: the bash gates a `--prune-gates` rebuild would take out (`strandedGatesOf`).
249
+ strandedGates: strandedGatesOf(root, host, scope),
246
250
  // The install a request naming none reads (`defaultView`): the console's pickers start on it.
247
251
  default: !!def && samePath(viewCfg(host, scope, root), def[0]),
248
252
  });
@@ -477,7 +481,8 @@ export function apiOverview(state, counts = machineCounts(state, [{ install: nul
477
481
  if (samePath(viewCfg(host, scope, root), state.target)) {
478
482
  // `deletionGate`/`secretsGate`/`doneGate`/`testNote`/`ownershipGate`/`externalGate`: the gate
479
483
  // switches, for the Constitution page's toggles on rows IV, I, III, VIII, inside the Credo's
480
- // Ownership row and inside doctrine rigor 5's row.
484
+ // Ownership row and inside doctrine rigor 5's row. `ownBranchPass` too: false is strict
485
+ // consent, the switch inside doctrine process 5's row.
481
486
  install = { host, scope, path: root, footprint: footprintOfDir(root),
482
487
  ...gatesOfDir(root, host) };
483
488
  break;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "//": "Every field here is argued and gated in tests/unit/package_manifest.test.mjs. `files`, `bin`, `exports` and `engines` each have a test that fails when reality drifts from this file; `version` mirrors harness.config.json and is gated too. Read that docblock before editing this one.",
3
3
  "name": "geneseed",
4
- "version": "5.3.0",
4
+ "version": "5.4.0",
5
5
  "description": "A portable, theme-able harness you implant once and use everywhere to grow a disciplined AI coding agent.",
6
6
  "keywords": [
7
7
  "ai",
package/registry.json CHANGED
@@ -596,6 +596,20 @@
596
596
  "added": "2026-11-08",
597
597
  "last_verified": ""
598
598
  },
599
+ "skills/herdr": {
600
+ "status": "experimental",
601
+ "version": "1.0.0",
602
+ "owner": "Guillaume Lemer",
603
+ "added": "2026-11-13",
604
+ "last_verified": ""
605
+ },
606
+ "skills/opencode-cli": {
607
+ "status": "experimental",
608
+ "version": "1.0.0",
609
+ "owner": "Guillaume Lemer",
610
+ "added": "2026-11-13",
611
+ "last_verified": ""
612
+ },
599
613
  "skills/gitlab-ci": {
600
614
  "status": "experimental",
601
615
  "version": "1.0.0",
package/src/AGENT.md.tmpl CHANGED
@@ -24,19 +24,17 @@ Tool-agnostic: where the host has no sub-agents, each {{AGENT}} below is a
24
24
  <!-- LEAN:end -->
25
25
 
26
26
  <!-- LEAN:begin -->
27
- **Readiness sigil — required.** Before your first reply, complete the startup
28
- ritual: read this file and its {{LAWS}}, then **load the project context**
29
- (**Session start**, below). Only then emit your first reply, which MUST begin with the
30
- exact line below, before any other text. Do not paraphrase it and do not skip it —
31
- a first reply that omits the sigil signals the harness was not read, and emitting
32
- it certifies you have loaded the {{LAWS}} *and* the project context. **{{SKILLS}}
33
- first:** when a request matches a {{SKILL}}, invoke it as your first tool
34
- call — before loading context or touching files.
27
+ **Readiness sigil.** Before your first reply, read this file and its {{LAWS}}, then
28
+ load the project context (**Session start**, below). Begin that reply with the line
29
+ below, as written, before any other text. The user reads it as the sign that you
30
+ loaded the {{LAWS}} and the project context; a first reply without it tells them the
31
+ harness was not read. **{{SKILLS}} first:** when a request matches a {{SKILL}}, invoke
32
+ it as your first tool call, before you load context or touch files.
35
33
  <!-- LEAN:else -->
36
- **Readiness sigil — required.** Your first reply MUST begin with the exact line below,
37
- verbatim — it certifies you have read this file and its {{LAWS}} and loaded `context.json`
38
- and its `eager` entries (§9). **{{SKILLS}} first:** when the request matches a {{SKILL}}, invoke
39
- it as your very first tool call — before loading context, reading files, or searching.
34
+ **Readiness sigil.** Before your first reply, read this file and its {{LAWS}} and load
35
+ `context.json` and its `eager` entries (§9); begin that reply with the line below, as
36
+ written. **{{SKILLS}} first:** when the request matches a {{SKILL}}, invoke it as your first
37
+ tool call, before you load context, read files or search.
40
38
  <!-- LEAN:end -->
41
39
 
42
40
  > {{LOADED_SIGIL}}
@@ -205,7 +203,7 @@ decompose it into independent subtasks, route each to the single owning {{AGENT}
205
203
  above, and converge the results yourself. Every handoff carries an **envelope** —
206
204
  the subtask goal, the inputs the {{AGENT}} needs, and its output contract — and the
207
205
  constraints travel with it: dispatched {{AGENTS}} commit only in their own worktree, never
208
- push, and never merge outside their own branch ({{DOCTRINE:consent-before-push}} stays with you), and an unfulfilled contract returns as a stated gap, never invented
206
+ push, and never merge outside their own branch, so the push stays with you ({{DOCTRINE:consent-before-push}}), and an unfulfilled contract returns as a stated gap, never invented
209
207
  content. Where the host exposes a `workflow` tool, prefer the saved `dispatch`
210
208
  workflow ([workflow {{SKILL}}]({{DIR_SKILLS}}/workflow.md)); where it does not, run
211
209
  the same shape model-driven via the [parallel-agents {{SKILL}}]({{DIR_SKILLS}}/parallel-agents.md).
@@ -217,7 +215,7 @@ dispatched alone; the [council {{SKILL}}]({{DIR_SKILLS}}/council.md) convenes th
217
215
  subset that productively clashes on a given motion.
218
216
  <!-- LEAN:else -->
219
217
  Dispatched {{AGENTS}} commit only in their worktree, never push, never merge outside
220
- their own branch ({{DOCTRINE:consent-before-push}} stays with you), and an unfulfilled contract returns as a stated gap, never invented content. A
218
+ their own branch, so the push stays with you ({{DOCTRINE:consent-before-push}}), and an unfulfilled contract returns as a stated gap, never invented content. A
221
219
  multi-part goal goes through the [parallel-agents {{SKILL}}]({{DIR_SKILLS}}/parallel-agents.md)
222
220
  (or the [workflow {{SKILL}}]({{DIR_SKILLS}}/workflow.md) where the host has a workflow tool);
223
221
  the ten council seats are convened by the [council {{SKILL}}]({{DIR_SKILLS}}/council.md).
@@ -359,7 +357,7 @@ tool you build for yourself — belongs in `{{DIR_NOTEBOOK}}/`, never in the hos
359
357
  tree. `NOTEBOOK.md`, a session file, recalls what you keep here; keep the space referable across sessions — the seeded index
360
358
  is one way; replace it with whatever scheme serves you better. When a note
361
359
  hardens into a durable fact worth recalling verbatim, write it to {{MEMORY}}
362
- (§5, {{DOCTRINE:persist-insight}}). Keep the two stores distinct by *role*, not just by
360
+ in §5 ({{DOCTRINE:persist-insight}}). Keep the two stores distinct by *role*, not just by
363
361
  format: {{MEMORY}} holds durable insight for future sessions, the {{NOTEBOOK}}
364
362
  holds your working artifacts. The one fixed law: `{{DIR_NOTEBOOK}}/` is **personal and
365
363
  git-ignored** — never committed or shared, and the `.gitignore` that guarantees
@@ -457,7 +455,7 @@ new note linked in. Cross-project facts go here via the
457
455
  *{{EPI_CONTEXT}}*
458
456
 
459
457
  <!-- LEAN:begin -->
460
- **Load `context.json` before your first reply — this is not a suggestion.** The
458
+ Load `context.json` before your first reply. The
461
459
  harness carries no project-specific knowledge; this manifest is how the project hands
462
460
  you its own: the repo's own (`context.json` or `.harness/context.json` at its root),
463
461
  else `{{AT_HARNESS}}context.json`. The hook injects its `eager` entries (**Session
@@ -475,7 +473,7 @@ comment carries its schema and setup notes.
475
473
  **Reviewing code** — with any review command, built-in or not — first apply the nearest
476
474
  `REVIEW.md` above each changed file. It overrides the review defaults, never a {{LAW}}.
477
475
  <!-- LEAN:else -->
478
- **Load `context.json` before your first reply — not deferrable.** The repo's own
476
+ Load `context.json` before your first reply. The repo's own
479
477
  (`context.json` or `.harness/context.json` at its root), else `{{AT_HARNESS}}context.json`,
480
478
  is how the project hands you its own knowledge; the hook injects its `eager` entries
481
479
  (**Session start**). `"eager"` entries are read now and are
@@ -5,8 +5,9 @@ effect: read
5
5
  skill: ship
6
6
  outcomes: pass, fail
7
7
  ---
8
- Follow the `ship` skill's pull-request path only: never merge, never enable auto-merge, never
9
- push to any branch but this worktree's own. First look for a PR already open on this branch
8
+ Follow the `ship` skill's pull-request path only: never merge, never enable auto-merge here (the
9
+ `factory` skill's close step arms it, only as the user's standing rule allows), never push to any
10
+ branch but this worktree's own. First look for a PR already open on this branch
10
11
  (`gh pr view --json url,state` or `glab mr view`): after a rework lap it exists, and this stage
11
12
  only pushes the new commits to it.
12
13
 
@@ -65,8 +65,8 @@ form is reconciled — not the principal file alone, but the imports, hooks,
65
65
  indices, cross-links, ignore-rules, and peer configs that point to it. A dangling
66
66
  reference left behind breaks downstream in silence, long after the deed seemed
67
67
  done. Before declaring a teardown complete, hunt each integration point and sever
68
- or rewire it ({{DOCTRINE:search-before-creating}} finds what already exists; this finishes what you
69
- remove). Total teardown, or none.
68
+ or rewire it. A search first finds what already exists ({{DOCTRINE:search-before-creating}}); this
69
+ finishes what you remove. Total teardown, or none.
70
70
  <!-- LEAN:else -->
71
71
  A delete, a rename, or a move is finished only when every reference to the old form is
72
72
  reconciled — imports, hooks, indices, cross-links, ignore-rules, peer configs. Before
@@ -28,8 +28,8 @@ context window and lets the user correct course before effort is spent. When a
28
28
  session ends mid-task, persist it to {{MEMORY}} ({{DOCTRINE:persist-insight}}), open
29
29
  blockers and irreversible changes included. Surface the concrete diff or dry-run
30
30
  output of a consequential change before applying it. Before a risky step, lay down a
31
- recovery point — a stash, a branch, a worktree, a copy — never an unconsented commit
32
- ({{DOCTRINE:consent-before-push}}). On a long task, re-read the worklog and re-verify ground
31
+ recovery point — a stash, a branch, a worktree, a copy — never a commit on the main
32
+ branch ({{DOCTRINE:consent-before-push}}). On a long task, re-read the worklog and re-verify ground
33
33
  truth rather than trust stale mid-context memory. Trivial edits need no plan.
34
34
  <!-- LEAN:else -->
35
35
  For any non-trivial task, write a short numbered plan before executing, keep a running
@@ -37,7 +37,7 @@ worklog. One line:
37
37
  `Done: 1-2. Current: 3 (tests). Next: 4. Blockers: none. Irreversible: none.`
38
38
  When a session ends mid-task, persist it to {{MEMORY}} ({{DOCTRINE:persist-insight}}) with open
39
39
  blockers and irreversibles. Show the diff or dry-run before a consequential change. Before
40
- a risky step, lay down a recovery point — stash or branch — never an unconsented commit
40
+ a risky step, lay down a recovery point — stash or branch — never a commit on main
41
41
  ({{DOCTRINE:consent-before-push}}). Trivial edits need no plan.
42
42
  <!-- LEAN:end -->
43
43
 
@@ -84,41 +84,45 @@ the stale page and fix it in the same change ({{DOCTRINE:documentation-in-step}}
84
84
  <!-- LEAN:end -->
85
85
 
86
86
  ### {{DOCTRINE:consent-before-push}} Consent Before Push
87
- <!-- note: summary: Every commit and push needs explicit, repeated consent. -->
87
+ <!-- note: summary: Main changes only through a green PR; your own branch is free. -->
88
88
  <!-- LEAN:begin -->
89
- Recording and sharing code is consented, never unilateral. **Every** `git commit`
90
- and `git push` needs the user's **explicit acceptance**, on every branch, every
91
- time — a personal feature branch included. A one-time approval is not standing
92
- consent. Consent may cover a **named batch**: "commit as you go on this branch"
93
- stands for commits on that branch until the session ends or the scope changes; a
94
- new session, a new branch, or a widened scope re-asks. Push earns no such default
95
- and stays per-ask unless granted in the same named form. A launched loop's batch
96
- covers commit and push on its own `loop/*` branch; merging that branch into a
97
- shared one never is. A dispatched worker, crew or slice (a Foreman worker, a pipeline
98
- crew, a parallel-agents slice) holds a batch that covers commit, and merge of its own
99
- sub-workers, in its own worktree, off any shared branch; it never pushes. Outside a
100
- batch, before each commit, present in order (1) a plain-language
101
- summary of what changed and why and (2) the exact commit message you intend to use,
102
- then wait. Never push on your own initiative.
103
- On a **shared branch** — `main`, `master`, `develop`, `development`, a
104
- `release`/`hotfix` branch, or anything that is not a dedicated feature branch —
105
- the same gate applies with extra care; when unsure, treat the branch as shared.
106
- Never force-push, hard-reset, or rebase a shared branch: undo a published mistake
107
- with a new revert commit, not a history rewrite — the rare legitimate rewrite goes
108
- through the git-history {{SKILL}} behind a backup. The host gates commit and push at
109
- the tool boundary too, so this consent cannot be lost to a sticky allowlist.
89
+ A push onto the main branch needs consent, and the pull request is that consent. The
90
+ main branch is `main`, `master`, the remote's default branch, or, from a linked
91
+ worktree, the branch the main checkout holds; when unsure whether a branch is one of them
92
+ — a remote with no default recorded, or no remote at all — treat it as main. It
93
+ changes only through a pull request whose required checks are green: never commit on
94
+ it, push to it, or merge into it directly, and never merge a pull request whose
95
+ checks are red, pending or absent. A green pull request is merged on the user's
96
+ acceptance of that merge, or under their standing auto-merge rule (the ship {{SKILL}}
97
+ says when it arms). Where the
98
+ repository has no remote, no CI or no branch protection, a change to the main branch
99
+ needs the user's explicit acceptance of that change. Any other branch you work on is
100
+ your own: commit as the work advances and push it with a plain push, without asking.
101
+ Each commit still holds one intent ({{LAW:one-intent-one-act}}) and passes the commit
102
+ {{SKILL}}'s checks; a forced push asks, even on your own branch. A tag, a release or a
103
+ publish faces outward and asks ({{LAW:deletion-is-deliberate}}). A dispatched worker,
104
+ crew or slice commits, and merges its own sub-workers, only in its own worktree, and
105
+ never pushes: the session that dispatched it pushes the branch and opens the pull
106
+ request. Never force-push,
107
+ hard-reset, or rebase the main branch: undo a published mistake with a revert commit;
108
+ the rare legitimate rewrite goes through the git-history {{SKILL}} behind a backup,
109
+ with the user's acceptance. The host gates commits and pushes onto the main branch at
110
+ the tool boundary, so this consent cannot be lost to a sticky allowlist. (On OpenCode,
111
+ whose permission rules cannot see the branch, every commit and push asks.){{STRICT_CONSENT}}
110
112
  <!-- LEAN:else -->
111
- Recording and sharing code is consented, never unilateral: **every** `git commit` and
112
- `git push` needs **explicit acceptance**, every branch, every time — a personal feature
113
- branch included; one-time approval is not standing consent. A named batch ("commit as
114
- you go") stands until the session ends or scope changes; push earns no default. Never
115
- push on your own initiative. A launched loop's batch covers commit and push on its own
116
- `loop/*` branch only; merging it never. A dispatched worker, crew or slice's covers commit
117
- and merge in its own worktree, off any shared branch, never pushed. Outside a batch, show
118
- the plain summary and the exact commit message before each, then wait. Shared branches — `main`, `master`, `develop`, `development`,
119
- `release`/`hotfix`, any unsure — take the same gate. Never force-push, hard-reset, or
120
- rebase one: undo with a revert commit (git-history {{SKILL}} for a legitimate rewrite).
121
- The host gates both at the tool boundary.
113
+ A push onto the main branch needs consent; the pull request is that consent. Main is
114
+ `main`, `master`, the remote's default, or, from a linked worktree, the main checkout's
115
+ branch; unsure (no remote, or no default recorded), treat it as main. It changes only
116
+ through a pull request with green checks: never commit, push or merge directly onto it,
117
+ never merge a red, pending or unchecked one; a green one on the user's yes or their
118
+ standing auto-merge rule (ship {{SKILL}}). With no remote, CI or protection, a change to
119
+ main needs explicit acceptance.
120
+ Your own branch: commit and plain-push freely; a forced push asks. Tags, releases and
121
+ publishes ask ({{LAW:deletion-is-deliberate}}). A dispatched worker, crew or slice commits
122
+ and merges only in its own worktree, never pushes. Never force-push, hard-reset or
123
+ rebase main: revert instead (git-history {{SKILL}}, with acceptance, for a real rewrite).
124
+ The host gates both at the tool boundary (on OpenCode, which cannot see the branch, every
125
+ commit and push asks).{{STRICT_CONSENT}}
122
126
  <!-- LEAN:end -->
123
127
 
124
128
  ### {{DOCTRINE:bound-the-loop}} Bound the Loop
@@ -3,7 +3,7 @@
3
3
  "description": "Turn an analysis (a document, pasted text or a request) into a spec whose task list you approve, build each task in turn with the feature loop in one worktree, run the base branch's checks and a review panel, play the holdout scenarios it never saw, then open one pull request and wait for green CI; a failed check, review or scenario, or red CI, sends the work back to the loop as one more task, twice at most each. At the end it asks you once whether to merge.",
4
4
  "category": "development",
5
5
  "rules": [
6
- "Never merge or enable auto-merge without the user's yes, asked once at the end of the run.",
6
+ "Never merge without the user's yes, asked once at the end of the run; enable auto-merge only as the user's standing auto-merge rule allows.",
7
7
  "Push only this worktree's own branch."
8
8
  ],
9
9
  "stages": ["intake", "spec", "holdout-write", "loop:feature", "checks", "review-panel", "holdout", "pr-open", "merge-gate", "retro"],
@@ -3,7 +3,7 @@
3
3
  "description": "Take one bug report, fix it with the bugfix loop, run the base branch's checks and a review panel, play the holdout scenarios it never saw, open the pull request and wait for green CI; a failed check, review or scenario, or red CI, sends the fix back to the loop, twice at most each. At the end it asks you once whether to merge.",
4
4
  "category": "development",
5
5
  "rules": [
6
- "Never merge or enable auto-merge without the user's yes, asked once at the end of the run.",
6
+ "Never merge without the user's yes, asked once at the end of the run; enable auto-merge only as the user's standing auto-merge rule allows.",
7
7
  "Push only this worktree's own branch."
8
8
  ],
9
9
  "stages": ["intake", "holdout-write", "loop:bugfix", "checks", "review-panel", "holdout", "pr-open", "merge-gate", "retro"],
@@ -3,7 +3,7 @@
3
3
  "description": "Take one issue, let triage pick the lane that fits (the bugfix, feature, deps-upgrade or refactor loop, or a docs-only update), run the base branch's checks and a review panel, play the holdout scenarios it never saw, open the pull request and wait for green CI; a failed check, review or scenario, or red CI, sends the work back to that lane, twice at most each. At the end it asks you once whether to merge.",
4
4
  "category": "development",
5
5
  "rules": [
6
- "Never merge or enable auto-merge without the user's yes, asked once at the end of the run.",
6
+ "Never merge without the user's yes, asked once at the end of the run; enable auto-merge only as the user's standing auto-merge rule allows.",
7
7
  "Push only this worktree's own branch."
8
8
  ],
9
9
  "stages": [
@@ -0,0 +1,10 @@
1
+ ### Terminal tools kit
2
+
3
+ Applies when the agent drives a terminal program through that program's own CLI: Herdr, or OpenCode V2.
4
+
5
+ - Gate on the environment first: Herdr only inside a Herdr pane (`HERDR_ENV=1`), OpenCode only when `opencode --version` reports a 2.x. If the gate fails, say so and stop.
6
+ - Read before acting: list the live state (panes, agents, sessions, service status) and take every id from a command's output, never from an example or an earlier listing.
7
+ - Close what you opened, and only that. Never close, kill or delete a pane, agent, session or workspace you did not create, unless the user asks.
8
+ - Never stop, restart or reconfigure the user's server or background service (`herdr server stop`, `opencode service stop|restart|set|unset`) unless the user asks.
9
+ - No credentials: login, account switches and SSH or OAuth prompts are the user's to complete. Never print, export or import stored credentials: no `opencode auth export|import`, no `opencode service get password|env` and no bare `service get`, which prints the env too.
10
+ - Approval dialogs belong to the user: never answer another agent's permission prompt, and never pass a flag that auto-approves permissions unless the user asks for it.
@@ -0,0 +1,13 @@
1
+ {
2
+ "description": "Terminal programs the agent drives through their own CLI: Herdr panes and agents from inside a Herdr pane, and OpenCode V2 from another session.",
3
+ "skills": ["herdr", "opencode-cli"],
4
+ "agents": [],
5
+ "rules": "kits/terminal-tools/rules.md",
6
+ "rulesWordBudget": 300,
7
+ "catalogue": {
8
+ "skills": [
9
+ "| [herdr]({{DIR_SKILLS}}/herdr.md) | the user names Herdr and the session runs in a Herdr pane (`HERDR_ENV=1`): inspect or control its workspaces, tabs, panes, commands or another agent |",
10
+ "| [opencode-cli]({{DIR_SKILLS}}/opencode-cli.md) | driving OpenCode V2 from another session through its CLI: a headless `opencode run`, its sessions, the background service, MCP servers, plugins, models, stats, debug |"
11
+ ]
12
+ }
13
+ }