@toolu/opencode 6.8.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 (331) hide show
  1. package/generated/GENERATED-NOTES.md +16 -0
  2. package/generated/agents/toolu--architect.md +52 -0
  3. package/generated/agents/toolu--deep-explore.md +65 -0
  4. package/generated/agents/toolu--implementer.md +50 -0
  5. package/generated/agents/toolu--quick-task.md +54 -0
  6. package/generated/agents/toolu--research-agent.md +101 -0
  7. package/generated/commands/toolu--commit.md +8 -0
  8. package/generated/commands/toolu--review-and-commit.md +8 -0
  9. package/generated/opencode.toolu.json +116 -0
  10. package/generated/skills/toolu--brainstorm/SKILL.md +57 -0
  11. package/generated/skills/toolu--brainstorm/references/design-questions.md +36 -0
  12. package/generated/skills/toolu--commit--skill/SKILL.md +11 -0
  13. package/generated/skills/toolu--debug/SKILL.md +54 -0
  14. package/generated/skills/toolu--deep-research/SKILL.md +51 -0
  15. package/generated/skills/toolu--execution/SKILL.md +77 -0
  16. package/generated/skills/toolu--orchestrator/SKILL.md +145 -0
  17. package/generated/skills/toolu--orchestrator/references/delegation-cost.md +104 -0
  18. package/generated/skills/toolu--orchestrator/references/model-routing.md +112 -0
  19. package/generated/skills/toolu--plan/SKILL.md +56 -0
  20. package/generated/skills/toolu--plan/references/ledger.md +18 -0
  21. package/generated/skills/toolu--plan-review/SKILL.md +48 -0
  22. package/generated/skills/toolu--review-and-commit--skill/SKILL.md +10 -0
  23. package/generated/skills/toolu--setup/SKILL.md +24 -0
  24. package/generated/skills/toolu--setup/scripts/setup.sh +206 -0
  25. package/generated/skills/toolu--spec/SKILL.md +67 -0
  26. package/generated/skills/toolu--spec-review/SKILL.md +50 -0
  27. package/generated/skills/toolu--test/SKILL.md +49 -0
  28. package/package.json +51 -0
  29. package/plugins/agent-browser/.claude-plugin/plugin.json +18 -0
  30. package/plugins/agent-browser/.codex-plugin/plugin.json +7 -0
  31. package/plugins/agent-browser/README.md +18 -0
  32. package/plugins/agent-browser/hooks/hooks.json +15 -0
  33. package/plugins/agent-browser/hooks/session-start.sh +42 -0
  34. package/plugins/agent-browser/skills/agent-browser/SKILL.md +77 -0
  35. package/plugins/agent-browser/skills/agent-browser/scripts/agent-browser.sh +80 -0
  36. package/plugins/ast-grep/.claude-plugin/plugin.json +18 -0
  37. package/plugins/ast-grep/.codex-plugin/plugin.json +7 -0
  38. package/plugins/ast-grep/README.md +21 -0
  39. package/plugins/ast-grep/hooks/hooks.json +15 -0
  40. package/plugins/ast-grep/hooks/post-tools.d/byte-savings.sh +67 -0
  41. package/plugins/ast-grep/hooks/pre-tools.d/search-nudge.sh +170 -0
  42. package/plugins/ast-grep/hooks/register.sh +68 -0
  43. package/plugins/ast-grep/scripts/byte-savings-report.sh +28 -0
  44. package/plugins/ast-grep/skills/ast-grep/SKILL.md +127 -0
  45. package/plugins/ast-grep/skills/ast-grep/references/ast-grep-advanced.md +44 -0
  46. package/plugins/ast-grep/skills/ast-grep/scripts/ast-grep.sh +103 -0
  47. package/plugins/context7/.claude-plugin/plugin.json +18 -0
  48. package/plugins/context7/.codex-plugin/plugin.json +7 -0
  49. package/plugins/context7/README.md +19 -0
  50. package/plugins/context7/hooks/hooks.json +15 -0
  51. package/plugins/context7/hooks/session-start.sh +42 -0
  52. package/plugins/context7/skills/context7/SKILL.md +64 -0
  53. package/plugins/context7/skills/context7/scripts/search.sh +151 -0
  54. package/plugins/exa-search/.claude-plugin/plugin.json +18 -0
  55. package/plugins/exa-search/.codex-plugin/plugin.json +7 -0
  56. package/plugins/exa-search/README.md +19 -0
  57. package/plugins/exa-search/hooks/hooks.json +15 -0
  58. package/plugins/exa-search/hooks/session-start.sh +34 -0
  59. package/plugins/exa-search/skills/exa-search/SKILL.md +91 -0
  60. package/plugins/exa-search/skills/exa-search/scripts/search.sh +221 -0
  61. package/plugins/jev/.claude-plugin/plugin.json +19 -0
  62. package/plugins/jev/.codex-plugin/plugin.json +7 -0
  63. package/plugins/jev/README.md +61 -0
  64. package/plugins/jev/hooks/hooks.json +25 -0
  65. package/plugins/jev/hooks/lib/common.sh +49 -0
  66. package/plugins/jev/hooks/session-start.sh +45 -0
  67. package/plugins/jev/hooks/user-prompt-submit.sh +41 -0
  68. package/plugins/jev/skills/jev/SKILL.md +81 -0
  69. package/plugins/jev/skills/jev/evals/README.md +98 -0
  70. package/plugins/jev/skills/jev/references/problem-solving.md +198 -0
  71. package/plugins/jev/skills/jev/scripts/jev.sh +405 -0
  72. package/plugins/jira/.claude-plugin/plugin.json +18 -0
  73. package/plugins/jira/.codex-plugin/plugin.json +7 -0
  74. package/plugins/jira/README.md +42 -0
  75. package/plugins/jira/hooks/hooks.json +15 -0
  76. package/plugins/jira/hooks/session-start.sh +34 -0
  77. package/plugins/jira/skills/jira/SKILL.md +123 -0
  78. package/plugins/jira/skills/jira/scripts/jira.sh +70 -0
  79. package/plugins/jira/skills/jira/scripts/lib/adf.sh +17 -0
  80. package/plugins/jira/skills/jira/scripts/lib/attachment.sh +94 -0
  81. package/plugins/jira/skills/jira/scripts/lib/board.sh +58 -0
  82. package/plugins/jira/skills/jira/scripts/lib/http.sh +184 -0
  83. package/plugins/jira/skills/jira/scripts/lib/issue.sh +159 -0
  84. package/plugins/jira/skills/jira/scripts/lib/paginate.sh +45 -0
  85. package/plugins/jira/skills/jira/scripts/lib/plan-parse.sh +70 -0
  86. package/plugins/jira/skills/jira/scripts/lib/plan-run.sh +115 -0
  87. package/plugins/jira/skills/jira/scripts/lib/plan-store.sh +168 -0
  88. package/plugins/jira/skills/jira/scripts/lib/plan.sh +108 -0
  89. package/plugins/jira/skills/jira/scripts/lib/project.sh +42 -0
  90. package/plugins/jira/skills/jira/scripts/lib/raw.sh +15 -0
  91. package/plugins/jira/skills/jira/scripts/lib/search.sh +41 -0
  92. package/plugins/jira/skills/jira/scripts/lib/sprint.sh +88 -0
  93. package/plugins/jira/skills/jira/scripts/lib/user.sh +45 -0
  94. package/plugins/jira/skills/jira/scripts/lib/worklog.sh +56 -0
  95. package/plugins/pr-babysit/.claude-plugin/plugin.json +25 -0
  96. package/plugins/pr-babysit/.codex-plugin/plugin.json +7 -0
  97. package/plugins/pr-babysit/README.md +38 -0
  98. package/plugins/pr-babysit/commands/babysit.md +13 -0
  99. package/plugins/pr-babysit/hooks/check-toolu.sh +20 -0
  100. package/plugins/pr-babysit/hooks/hooks.json +15 -0
  101. package/plugins/pr-babysit/scripts/babysit-tick.sh +133 -0
  102. package/plugins/pr-babysit/scripts/collect-pr.sh +224 -0
  103. package/plugins/pr-babysit/scripts/lib/common.sh +146 -0
  104. package/plugins/pr-babysit/scripts/lib/gh.sh +150 -0
  105. package/plugins/pr-babysit/scripts/lib/lock.sh +84 -0
  106. package/plugins/pr-babysit/scripts/lib/normalize.sh +98 -0
  107. package/plugins/pr-babysit/scripts/lib/state.sh +37 -0
  108. package/plugins/pr-babysit/scripts/parse-verdict.sh +171 -0
  109. package/plugins/pr-babysit/scripts/record.sh +69 -0
  110. package/plugins/pr-babysit/scripts/reduce-state.sh +245 -0
  111. package/plugins/pr-babysit/scripts/reply-thread.sh +90 -0
  112. package/plugins/pr-babysit/scripts/resolve-thread.sh +71 -0
  113. package/plugins/pr-babysit/skills/babysit/SKILL.md +31 -0
  114. package/plugins/pr-babysit/skills/babysit/references/helper.md +209 -0
  115. package/plugins/pr-babysit/workflows/babysit.md +722 -0
  116. package/plugins/python-quality/.claude-plugin/plugin.json +24 -0
  117. package/plugins/python-quality/.codex-plugin/plugin.json +6 -0
  118. package/plugins/python-quality/README.md +23 -0
  119. package/plugins/python-quality/hooks/check-toolu.sh +20 -0
  120. package/plugins/python-quality/hooks/concerns/00-preamble.sh +85 -0
  121. package/plugins/python-quality/hooks/concerns/10-size-file.sh +6 -0
  122. package/plugins/python-quality/hooks/concerns/20-tests.sh +37 -0
  123. package/plugins/python-quality/hooks/concerns/30-suppression.sh +33 -0
  124. package/plugins/python-quality/hooks/concerns/50-size-fn.sh +49 -0
  125. package/plugins/python-quality/hooks/concerns/70-no-mocks.sh +76 -0
  126. package/plugins/python-quality/hooks/concerns/90-docs.sh +52 -0
  127. package/plugins/python-quality/hooks/concerns/99-finalize.sh +36 -0
  128. package/plugins/python-quality/hooks/hooks.json +19 -0
  129. package/plugins/python-quality/hooks/register.sh +65 -0
  130. package/plugins/rust-quality/.claude-plugin/plugin.json +24 -0
  131. package/plugins/rust-quality/.codex-plugin/plugin.json +6 -0
  132. package/plugins/rust-quality/README.md +24 -0
  133. package/plugins/rust-quality/hooks/check-toolu.sh +20 -0
  134. package/plugins/rust-quality/hooks/concerns/00-preamble.sh +93 -0
  135. package/plugins/rust-quality/hooks/concerns/10-size-file.sh +10 -0
  136. package/plugins/rust-quality/hooks/concerns/20-tests.sh +84 -0
  137. package/plugins/rust-quality/hooks/concerns/30-suppression.sh +26 -0
  138. package/plugins/rust-quality/hooks/concerns/40-unsafe.sh +39 -0
  139. package/plugins/rust-quality/hooks/concerns/50-size-fn.sh +38 -0
  140. package/plugins/rust-quality/hooks/concerns/55-size-impl.sh +28 -0
  141. package/plugins/rust-quality/hooks/concerns/60-error-handling.sh +149 -0
  142. package/plugins/rust-quality/hooks/concerns/70-no-mocks.sh +139 -0
  143. package/plugins/rust-quality/hooks/concerns/90-docs.sh +32 -0
  144. package/plugins/rust-quality/hooks/concerns/99-finalize.sh +36 -0
  145. package/plugins/rust-quality/hooks/hooks.json +19 -0
  146. package/plugins/rust-quality/hooks/register.sh +65 -0
  147. package/plugins/statusline/.claude-plugin/plugin.json +19 -0
  148. package/plugins/statusline/.codex-plugin/plugin.json +7 -0
  149. package/plugins/statusline/README.md +108 -0
  150. package/plugins/statusline/commands/setup.md +30 -0
  151. package/plugins/statusline/hooks/hooks.json +15 -0
  152. package/plugins/statusline/hooks/session-start.sh +45 -0
  153. package/plugins/statusline/scripts/collect-status.sh +147 -0
  154. package/plugins/statusline/scripts/setup.sh +93 -0
  155. package/plugins/statusline/scripts/status.sh +55 -0
  156. package/plugins/statusline/skills/status/SKILL.md +13 -0
  157. package/plugins/statusline/statusline.sh +177 -0
  158. package/plugins/toolu/.claude-plugin/plugin.json +19 -0
  159. package/plugins/toolu/.codex-plugin/plugin.json +7 -0
  160. package/plugins/toolu/README.md +35 -0
  161. package/plugins/toolu/agents/.gitkeep +0 -0
  162. package/plugins/toolu/agents/architect.md +52 -0
  163. package/plugins/toolu/agents/deep-explore.md +65 -0
  164. package/plugins/toolu/agents/implementer.md +50 -0
  165. package/plugins/toolu/agents/quick-task.md +54 -0
  166. package/plugins/toolu/agents/research-agent.md +107 -0
  167. package/plugins/toolu/assets/agents/architect.toml +9 -0
  168. package/plugins/toolu/assets/agents/deep-explore.toml +9 -0
  169. package/plugins/toolu/assets/agents/implementer.toml +9 -0
  170. package/plugins/toolu/assets/agents/quick-task.toml +9 -0
  171. package/plugins/toolu/assets/agents/research-agent.toml +9 -0
  172. package/plugins/toolu/commands/.gitkeep +0 -0
  173. package/plugins/toolu/commands/commit.md +5 -0
  174. package/plugins/toolu/commands/review-and-commit.md +5 -0
  175. package/plugins/toolu/hooks/docs/gates.md +157 -0
  176. package/plugins/toolu/hooks/docs/model-routing.md +14 -0
  177. package/plugins/toolu/hooks/docs/post-compaction.md +3 -0
  178. package/plugins/toolu/hooks/docs/push-review.md +123 -0
  179. package/plugins/toolu/hooks/docs/session-start-python.md +3 -0
  180. package/plugins/toolu/hooks/docs/session-start-rust.md +4 -0
  181. package/plugins/toolu/hooks/docs/session-start-ts.md +3 -0
  182. package/plugins/toolu/hooks/docs/session-start.md +16 -0
  183. package/plugins/toolu/hooks/hooks.json +76 -0
  184. package/plugins/toolu/hooks/lib/config.sh +355 -0
  185. package/plugins/toolu/hooks/lib/detect.sh +929 -0
  186. package/plugins/toolu/hooks/lib/diff-sha.sh +32 -0
  187. package/plugins/toolu/hooks/lib/dispatch.sh +365 -0
  188. package/plugins/toolu/hooks/lib/docs-sync-config.sh +81 -0
  189. package/plugins/toolu/hooks/lib/edit-records.sh +157 -0
  190. package/plugins/toolu/hooks/lib/gate-file.sh +201 -0
  191. package/plugins/toolu/hooks/lib/gate-mode.sh +244 -0
  192. package/plugins/toolu/hooks/lib/host.sh +205 -0
  193. package/plugins/toolu/hooks/lib/permissions.sh +125 -0
  194. package/plugins/toolu/hooks/lib/plan-ledger-parse.sh +219 -0
  195. package/plugins/toolu/hooks/lib/plan-ledger-preflight.sh +137 -0
  196. package/plugins/toolu/hooks/lib/plan-ledger.sh +749 -0
  197. package/plugins/toolu/hooks/lib/push-waiver.sh +116 -0
  198. package/plugins/toolu/hooks/lib/quality-config.sh +184 -0
  199. package/plugins/toolu/hooks/lib/registry.sh +72 -0
  200. package/plugins/toolu/hooks/lib/state-sweeper.sh +194 -0
  201. package/plugins/toolu/hooks/lib/telemetry.sh +94 -0
  202. package/plugins/toolu/hooks/lib/verdict.sh +477 -0
  203. package/plugins/toolu/hooks/post-tools/mod.sh +42 -0
  204. package/plugins/toolu/hooks/post-tools/modules/gate-status.sh +140 -0
  205. package/plugins/toolu/hooks/post-tools/modules/push-waiver.sh +97 -0
  206. package/plugins/toolu/hooks/pre-compact.sh +18 -0
  207. package/plugins/toolu/hooks/pre-tools/agent-tier.sh +111 -0
  208. package/plugins/toolu/hooks/pre-tools/mod.sh +37 -0
  209. package/plugins/toolu/hooks/pre-tools/modules/bash-commands.sh +187 -0
  210. package/plugins/toolu/hooks/pre-tools/modules/code-edit-rules.sh +78 -0
  211. package/plugins/toolu/hooks/pre-tools/modules/commit-gate.sh +70 -0
  212. package/plugins/toolu/hooks/pre-tools/modules/docs-sync.sh +137 -0
  213. package/plugins/toolu/hooks/pre-tools/modules/mcp-blocker.sh +151 -0
  214. package/plugins/toolu/hooks/pre-tools/modules/plan-ledger.sh +201 -0
  215. package/plugins/toolu/hooks/pre-tools/modules/protected-files.sh +177 -0
  216. package/plugins/toolu/hooks/pre-tools/modules/push-review.sh +273 -0
  217. package/plugins/toolu/hooks/pre-tools/modules/quality-gate.sh +87 -0
  218. package/plugins/toolu/hooks/session-start.sh +379 -0
  219. package/plugins/toolu/hooks/user-prompt-submit.sh +197 -0
  220. package/plugins/toolu/scripts/context-budget.sh +111 -0
  221. package/plugins/toolu/scripts/debug-log.sh +98 -0
  222. package/plugins/toolu/scripts/debug-stack.sh +108 -0
  223. package/plugins/toolu/scripts/debug-testfail.sh +97 -0
  224. package/plugins/toolu/settings/.gitkeep +0 -0
  225. package/plugins/toolu/settings/README.md +127 -0
  226. package/plugins/toolu/settings/bash-allowlist.txt +12 -0
  227. package/plugins/toolu/settings/bash-denylist.txt +25 -0
  228. package/plugins/toolu/settings/code-edit-rules.json +67 -0
  229. package/plugins/toolu/settings/commit-prefixes.txt +12 -0
  230. package/plugins/toolu/settings/mcp-blocklist.txt +8 -0
  231. package/plugins/toolu/settings/permissions.fragment.json +36 -0
  232. package/plugins/toolu/settings/protected-files.txt +30 -0
  233. package/plugins/toolu/settings/rust-unsafe-exemptions.txt +5 -0
  234. package/plugins/toolu/settings/toolu.config.example.json +130 -0
  235. package/plugins/toolu/skills/.gitkeep +0 -0
  236. package/plugins/toolu/skills/brainstorm/SKILL.md +57 -0
  237. package/plugins/toolu/skills/brainstorm/references/design-questions.md +36 -0
  238. package/plugins/toolu/skills/commit/SKILL.md +11 -0
  239. package/plugins/toolu/skills/debug/SKILL.md +54 -0
  240. package/plugins/toolu/skills/debug/evals/README.md +17 -0
  241. package/plugins/toolu/skills/debug/evals/cases.json +24 -0
  242. package/plugins/toolu/skills/debug/evals/results.json +34 -0
  243. package/plugins/toolu/skills/deep-research/SKILL.md +51 -0
  244. package/plugins/toolu/skills/execution/SKILL.md +77 -0
  245. package/plugins/toolu/skills/orchestrator/SKILL.md +145 -0
  246. package/plugins/toolu/skills/orchestrator/references/delegation-cost.md +104 -0
  247. package/plugins/toolu/skills/orchestrator/references/model-routing.md +112 -0
  248. package/plugins/toolu/skills/plan/SKILL.md +56 -0
  249. package/plugins/toolu/skills/plan/references/ledger.md +18 -0
  250. package/plugins/toolu/skills/plan-review/SKILL.md +48 -0
  251. package/plugins/toolu/skills/review-and-commit/SKILL.md +10 -0
  252. package/plugins/toolu/skills/setup/SKILL.md +24 -0
  253. package/plugins/toolu/skills/setup/scripts/setup.sh +206 -0
  254. package/plugins/toolu/skills/spec/SKILL.md +67 -0
  255. package/plugins/toolu/skills/spec-review/SKILL.md +50 -0
  256. package/plugins/toolu/skills/test/SKILL.md +49 -0
  257. package/plugins/toolu/workflows/commit.md +21 -0
  258. package/plugins/toolu/workflows/host-mapping.md +22 -0
  259. package/plugins/toolu/workflows/review-and-commit.md +54 -0
  260. package/plugins/toolu/workflows/semantic-judgments.md +35 -0
  261. package/plugins/toolu-review/.claude-plugin/plugin.json +18 -0
  262. package/plugins/toolu-review/.codex-plugin/plugin.json +7 -0
  263. package/plugins/toolu-review/README.md +17 -0
  264. package/plugins/toolu-review/hooks/hooks.json +15 -0
  265. package/plugins/toolu-review/hooks/session-start.sh +34 -0
  266. package/plugins/toolu-review/skills/review/SKILL.md +90 -0
  267. package/plugins/toolu-review/skills/review/scripts/write-state.sh +189 -0
  268. package/plugins/ts-quality/.claude-plugin/plugin.json +24 -0
  269. package/plugins/ts-quality/.codex-plugin/plugin.json +6 -0
  270. package/plugins/ts-quality/README.md +24 -0
  271. package/plugins/ts-quality/hooks/check-toolu.sh +20 -0
  272. package/plugins/ts-quality/hooks/concerns/00-preamble.sh +123 -0
  273. package/plugins/ts-quality/hooks/concerns/10-imports.sh +33 -0
  274. package/plugins/ts-quality/hooks/concerns/15-type-as.sh +9 -0
  275. package/plugins/ts-quality/hooks/concerns/20-tests.sh +26 -0
  276. package/plugins/ts-quality/hooks/concerns/25-size-file.sh +40 -0
  277. package/plugins/ts-quality/hooks/concerns/30-size-fn.sh +53 -0
  278. package/plugins/ts-quality/hooks/concerns/35-react-hooks.sh +7 -0
  279. package/plugins/ts-quality/hooks/concerns/40-factory.sh +5 -0
  280. package/plugins/ts-quality/hooks/concerns/45-typeguard.sh +6 -0
  281. package/plugins/ts-quality/hooks/concerns/50-type-dup.sh +16 -0
  282. package/plugins/ts-quality/hooks/concerns/55-naming.sh +11 -0
  283. package/plugins/ts-quality/hooks/concerns/60-console.sh +6 -0
  284. package/plugins/ts-quality/hooks/concerns/65-suppression.sh +12 -0
  285. package/plugins/ts-quality/hooks/concerns/70-ui-confirm.sh +8 -0
  286. package/plugins/ts-quality/hooks/concerns/72-ui-radix.sh +12 -0
  287. package/plugins/ts-quality/hooks/concerns/74-react-props.sh +6 -0
  288. package/plugins/ts-quality/hooks/concerns/76-toast.sh +10 -0
  289. package/plugins/ts-quality/hooks/concerns/78-error-ast.sh +242 -0
  290. package/plugins/ts-quality/hooks/concerns/80-throw-literal.sh +23 -0
  291. package/plugins/ts-quality/hooks/concerns/85-no-mocks.sh +109 -0
  292. package/plugins/ts-quality/hooks/concerns/90-duplication.sh +30 -0
  293. package/plugins/ts-quality/hooks/concerns/92-docs.sh +36 -0
  294. package/plugins/ts-quality/hooks/concerns/94-handler.sh +15 -0
  295. package/plugins/ts-quality/hooks/concerns/99-finalize.sh +46 -0
  296. package/plugins/ts-quality/hooks/hooks.json +19 -0
  297. package/plugins/ts-quality/hooks/register.sh +65 -0
  298. package/src/adapter/__tests__/evaluate.test.ts +82 -0
  299. package/src/adapter/__tests__/permission-map.test.ts +91 -0
  300. package/src/adapter/evaluate.ts +54 -0
  301. package/src/adapter/permission-map.ts +177 -0
  302. package/src/bootstrap/__tests__/bootstrap.test.ts +148 -0
  303. package/src/bootstrap/entrypoint.ts +18 -0
  304. package/src/bootstrap/index.ts +5 -0
  305. package/src/bootstrap/readiness.ts +59 -0
  306. package/src/bootstrap/result.ts +21 -0
  307. package/src/bootstrap/runtime.ts +99 -0
  308. package/src/bootstrap/test-helpers.ts +25 -0
  309. package/src/host/__tests__/host.test.ts +37 -0
  310. package/src/host/detect.ts +46 -0
  311. package/src/host/index.ts +10 -0
  312. package/src/host/roots.ts +59 -0
  313. package/src/host/types.ts +14 -0
  314. package/src/inventory/__tests__/inventory.test.ts +69 -0
  315. package/src/inventory/index.ts +9 -0
  316. package/src/inventory/manifest.ts +46 -0
  317. package/src/inventory/scan.ts +66 -0
  318. package/src/inventory/selection.ts +92 -0
  319. package/src/inventory/types.ts +22 -0
  320. package/src/lifecycle/__tests__/lifecycle.test.ts +7 -0
  321. package/src/lifecycle/index.ts +2 -0
  322. package/src/lifecycle/table.ts +42 -0
  323. package/src/plugin/__tests__/plugin-stub.test.ts +6 -0
  324. package/src/plugin/plugin-stub.ts +7 -0
  325. package/src/plugin/toolu.ts +142 -0
  326. package/src/preflight/__tests__/preflight.test.ts +20 -0
  327. package/src/preflight/check.ts +75 -0
  328. package/src/preflight/index.ts +2 -0
  329. package/src/select/__tests__/select.test.ts +52 -0
  330. package/src/select/index.ts +2 -0
  331. package/src/select/resolve.ts +87 -0
@@ -0,0 +1,157 @@
1
+ # Gates
2
+
3
+ Every toolu gate answers one question and then has to decide how forcefully to
4
+ say no. The question is the gate's own business; the answer's **delivery** is a
5
+ mode you configure.
6
+
7
+ Portable Bun/TS + OpenCode contracts (pins, decision union, bash bridge):
8
+ [`docs/portable-core.md`](../../../docs/portable-core.md).
9
+
10
+ ## Modes
11
+
12
+ | Mode | What the user sees | What happens |
13
+ |------|--------------------|--------------|
14
+ | `block` | a denial with the gate's reason | the tool call does not run |
15
+ | `ask` | a prompt with the gate's reason | the user decides |
16
+ | `advise` | the reason, as context for the agent | nothing is stopped |
17
+ | `off` | nothing | the gate is silent |
18
+
19
+ `ask` needs a host that can prompt. Codex cannot, so `ask` degrades there — to
20
+ `advise` for a judgement gate, and to **`block`** for a security guardrail
21
+ (see the warning below). The three guardrails ship on `ask`; every other gate
22
+ reaches it only via `gates.<name>.mode`.
23
+
24
+ ## Presets
25
+
26
+ `gates.preset` sets every gate at once. The default is **balanced**.
27
+
28
+ | Gate | `strict` | **`balanced`** (default) | `relaxed` |
29
+ |------|----------|--------------------------|-----------|
30
+ | `pushReview` | block | **advise** | advise |
31
+ | `qualityGate` | block | **block** | advise |
32
+ | `commitGate` | block | **advise** | off |
33
+ | `planLedger` | block | **advise** | off |
34
+ | `docsSync` | block | **advise** | off |
35
+ | `agentTier` | block | **advise** | off |
36
+ | `bashCommands` ⚠️ | block | **ask** | ask |
37
+ | `protectedFiles` ⚠️ | block | **ask** | ask |
38
+ | `mcpBlocker` ⚠️ | block | **ask** | ask |
39
+
40
+ ⚠️ = security guardrail. See the warning below.
41
+
42
+ ## ⚠️ Guardrails now ASK instead of denying — read this
43
+
44
+ > **This changed the security posture of toolu. Read it before upgrading.**
45
+ >
46
+ > `protectedFiles`, `mcpBlocker` and `bashCommands` used to be **hard denies**
47
+ > you could not get past in-session. They now **ask you**, and a yes lets the
48
+ > call through.
49
+ >
50
+ > **What that means in practice:** an agent that wants to write your `.env`,
51
+ > rewrite a toolu hook, call a blocked MCP server, or run `node -e` no longer
52
+ > hits a wall. It puts a prompt in front of **you**, and you are the control.
53
+ > If you approve without reading, nothing protects you. The old behavior is one
54
+ > config line away — see *Restoring the hard denies* below.
55
+ >
56
+ > **Why:** the hard deny was unanswerable. A user could tell the agent "yes,
57
+ > edit that `.env.example`" and the agent was still refused, with deny text
58
+ > that claimed an override existed when none did
59
+ > ([#176](https://github.com/Falconiere/toolu/issues/176)). A guardrail nobody
60
+ > can answer gets routed around — via `Bash`, which the old check never saw —
61
+ > and a bypassed guardrail protects less than an honest prompt.
62
+
63
+ The three guardrails are in the preset table above, and every mode works on
64
+ them (`block` / `ask` / `advise` / `off`). Two things stay special:
65
+
66
+ 1. **They ask at every preset except `strict`.** `relaxed` relaxes judgement
67
+ calls; it does not silence a guardrail. `relaxed` means "stop lecturing me",
68
+ not "write my `.env` without telling me".
69
+ 2. **`ask` degrades to `block`, never to `advise`,** on a host that cannot
70
+ prompt (Codex). Judgement gates degrade to `advise` — say it, don't stop the
71
+ work. A guardrail fails **closed**: the whole point is that a human decides,
72
+ so where no human can be reached the answer is no. Degrading these to
73
+ `advise` would silently disable them exactly where nobody is watching.
74
+
75
+ The prompt itself is deliberately loud — a banner, the specific path or rule,
76
+ **why that thing is guarded**, and a note that approval covers one call only.
77
+ A guardrail prompt that reads like a routine "allow this?" trains people to
78
+ wave it through.
79
+
80
+ ### Restoring the hard denies
81
+
82
+ ```json
83
+ { "gates": { "protectedFiles": { "mode": "block" },
84
+ "mcpBlocker": { "mode": "block" },
85
+ "bashCommands": { "mode": "block" } } }
86
+ ```
87
+
88
+ Or `{"gates": {"preset": "strict"}}`, which blocks everything.
89
+
90
+ ### Bash coverage
91
+
92
+ `protected-files` also inspects `Bash`/`Shell` commands for redirects, `tee`,
93
+ `sed -i`/`perl -i`, `cp`/`mv`/`install`, `dd of=`, `python -c open(..., "w")`
94
+ write targets, and command substitutions inside unquoted heredocs — so a
95
+ protected path cannot be written through Bash to dodge the prompt
96
+ (github.com/Falconiere/toolu/issues/176). Best-effort, not a full shell
97
+ grammar — see `bash_write_targets` in `hooks/lib/detect.sh`.
98
+
99
+ ## Per-gate overrides
100
+
101
+ ```json
102
+ { "gates": { "preset": "strict", "pushReview": { "mode": "ask" } } }
103
+ ```
104
+
105
+ Precedence, first hit wins:
106
+
107
+ 1. `gates.<name>.mode`
108
+ 2. the legacy top-level key (`docsSync.mode`, `agentTier.mode` only)
109
+ 3. the `gates.preset` table
110
+ 4. the built-in `balanced` preset
111
+
112
+ An unrecognized value warns on stderr and falls through to the next layer, so a
113
+ typo mis-delivers nothing.
114
+
115
+ ## The push waiver
116
+
117
+ `pushReview` in `ask` mode (opt-in) remembers a "yes":
118
+
119
+ 1. The gate asks, and records a **pending** waiver naming the diff SHA it asked
120
+ about (`.claude/tmp/push-review/<branch>.pending-waiver.json`).
121
+ 2. `post-tools/modules/push-waiver.sh` sees the push actually ran **and
122
+ succeeded**, and promotes the pending marker to
123
+ `<branch>.waiver.json`. A rejected push promotes nothing — the pending
124
+ marker survives for the retry.
125
+ 3. The next push of that same diff passes silently.
126
+ 4. A new commit changes the diff SHA, so the waiver stops applying and the gate
127
+ asks once more.
128
+
129
+ A refused prompt leaves the pending marker orphaned; the state sweeper reclaims
130
+ it. Declining is not recorded as an answer — the gate will ask again.
131
+
132
+ ## What the quality gate stops
133
+
134
+ `qualityGate` in `block` mode denies `git commit` and `git push`, and nothing
135
+ else. Reading, searching, editing, and running commands stay open while the
136
+ gate is red: a failing gate is a reason not to ship, not a reason to be unable
137
+ to work. `MY_CLAUDE_QUALITY=off` still disables it outright.
138
+
139
+ ## Interaction with host permissions
140
+
141
+ `permissions.deny` in Claude Code settings **overrides** a hook's `ask` — a
142
+ command denied there is denied, and toolu never gets to prompt about it.
143
+ `permissions.allow` does not have that power: an allowlisted command still
144
+ reaches these gates. This is why toolu's shipped
145
+ `settings/permissions.fragment.json` no longer denies `git push --force` or
146
+ `node -e` — those are gate decisions now, and a deny rule would silently
147
+ outrank them.
148
+
149
+ ## Tests
150
+
151
+ ```bash
152
+ bats plugins/toolu/hooks/lib/__tests__/gate-mode.bats
153
+ bats plugins/toolu/hooks/lib/__tests__/push-waiver.bats
154
+ bats plugins/toolu/hooks/post-tools/modules/__tests__/push-waiver.bats
155
+ bats plugins/toolu/hooks/lib/__tests__/state-sweeper.bats
156
+ bats plugins/toolu/hooks/lib/__tests__/permissions.bats
157
+ ```
@@ -0,0 +1,14 @@
1
+ ## Model routing (mandatory)
2
+
3
+ Pass `model:` on EVERY Agent call; never leave it default. Tier by work class:
4
+
5
+ - mechanical (`{{model_mechanical}}`{{effort_mechanical}}) — lookups, listings, renames, formatting.
6
+ - exploration (`{{model_exploration}}`{{effort_exploration}}) — read-only search across files.
7
+ - implementation (`{{model_implementation}}`{{effort_implementation}}) — bounded edits plus tests.
8
+ - review (`{{model_review}}`{{effort_review}}) — diff review, audits.
9
+ - synthesis (`{{model_synthesis}}`{{effort_synthesis}}) — many findings into one answer.
10
+ - architecture (`{{model_architecture}}`{{effort_architecture}}) — design, trade-offs, hard-to-reverse calls.
11
+
12
+ Escalate a tier when irreversible, cross-cutting, or undecided; drop one when
13
+ bounded and mechanical. Deciding and doing are different classes. Rubric:
14
+ `orchestrator` skill.
@@ -0,0 +1,3 @@
1
+ Context compacted. Recover memories before continuing (comemory wrapper: `skills/agent-memory/scripts/comemory.sh`):
2
+ 1) `comemory.sh summary "Goal / Accomplished / Next"`
3
+ 2) `comemory.sh search "<topic>"`
@@ -0,0 +1,123 @@
1
+ # push-review hook
2
+
3
+ PreToolUse hook on `Bash(git push)`. Gates pushes on a clean code review recorded in `<target repo root>/.claude/tmp/push-review/<branch-slug>.json`.
4
+
5
+ **How firmly it gates is a mode**, not a constant — see [gates.md](./gates.md).
6
+ At the shipped default (`balanced`) this hook **advises**: every failed check
7
+ below is reported to the agent and the push is not stopped.
8
+ `{"gates":{"pushReview":{"mode":"ask"}}}` prompts, and answering yes records
9
+ a waiver for that exact diff so the same code is never queried twice.
10
+ `block` restores the original hard deny; `off` silences it. On Codex, where
11
+ the host cannot prompt, `ask` degrades to `advise`.
12
+
13
+ ## Waivers
14
+
15
+ 1. In `ask` mode the gate writes `<branch-slug>.pending-waiver.json` naming the
16
+ diff SHA it asked about.
17
+ 2. `post-tools/modules/push-waiver.sh` promotes that marker to
18
+ `<branch-slug>.waiver.json` once the push has actually run **and succeeded**
19
+ — PostToolUse fires when a tool ran, not when it worked, and a rejected
20
+ non-fast-forward push has been reviewed by nobody.
21
+ 3. A matching waiver makes the gate pass silently (telemetry
22
+ `push_check reason_code=waived`).
23
+ 4. A new commit changes the diff SHA, the waiver stops applying, and the gate
24
+ asks again.
25
+
26
+ A refused prompt leaves the pending marker orphaned; the SessionStart state
27
+ sweeper reclaims it.
28
+
29
+ Detection lives in `lib/detect.sh:is_git_push`, which is **structural, not textual**: the command is split into statements (honouring shell quoting), each statement is tokenized, and git's real subcommand is resolved after consuming git's global options. So `git -C <path> push`, `git -c k=v push`, `git --no-pager push`, and `git --git-dir=<path> push` are all gated, while `git commit -m "push"` is a commit.
30
+
31
+ Prose is not a command. `echo "no git push rules remain"`, a grep pattern like `grep -qE "^git push" file`, or a commit message that explains the gate are all arguments, not invocations, and do not fire it — the earlier regex over the raw string did fire on every one of them. Heredoc bodies are stripped first, and `$(...)` / backtick bodies are scanned as commands in their own right, so `out=$(git push)` is still a push.
32
+
33
+ ## Flow
34
+
35
+ 1. Agent runs `git push`.
36
+ 2. Hook resolves the **target repo root** with `push_target_root`: every `-C <path>` preceding `push` in that command segment, replayed cumulatively the way git itself applies them (a `-C` belonging to another command in a `&&` chain is ignored), else the cwd's `git rev-parse --show-toplevel`, else `$CLAUDE_PROJECT_DIR`, else the cwd. Every git read below runs against that root, not the hook's cwd — a `git -C <worktree> push` is judged on the worktree's own branch, diff, and state file.
37
+ 3. Hook computes `git diff <base>...HEAD | git hash-object --stdin` in the target repo, where `<base>` is resolved dynamically via `detect_base_branch <root>` (origin/HEAD, falling back to `main`; `$PUSH_REVIEW_BASE` overrides for tests).
38
+ 4. Hook reads `<target repo root>/.claude/tmp/push-review/<branch-slug>.json`. `$STATE_DIR` overrides the directory (tests, and the `toolu-review` state writer honours the same variable).
39
+ 5. If the state file is missing, has a stale `diff_sha`, has `findings_count > 0`, or is schema `version: 1` → the check fails and delivery follows the configured mode (advise at the shipped default; `ask` / `block` are opt-in).
40
+ 6. Agent runs a reviewer against the diff and applies its findings. The gate is **reviewer-agnostic** — it accepts at least one of: \`code-review\`, \`toolu-review:review\`, \`code-review:xhigh\`, \`review\`, \`security-review\`. Use the built-in \`/code-review xhigh --fix\` skill (always available, no plugin required) or the \`toolu-review:review\` skill from the \`toolu-review\` plugin. Running extra reviewers first is allowed — the check is membership, not equality.
41
+ 7. Re-run the reviewer on the new diff and loop until it returns zero findings.
42
+ 8. Agent writes state file atomically (`<file>.tmp` then `mv`) with `findings_count: 0`, the new SHA, and `reviewed_files` set to every path the reviewer actually covered.
43
+ 9. Agent retries `git push` → a clean state file lets the check pass silently.
44
+
45
+ ## State schema (version 2)
46
+
47
+ ```json
48
+ {
49
+ "version": 2,
50
+ "branch": "feat/x",
51
+ "diff_sha": "<git-hash-object output>",
52
+ "base_branch": "main",
53
+ "reviewed_at": "<iso8601>",
54
+ "reviewers": ["code-review"],
55
+ "findings_count": 0,
56
+ "findings": [],
57
+ "review_round": 1,
58
+ "reviewed_files": ["path/a.ts", "path/b.rs"]
59
+ }
60
+ ```
61
+
62
+ `version` must normalize to `"2"` (emitted as a JSON number; the gate compares
63
+ the `jq -r`-normalized string, so a literal `"2"` string also passes). A
64
+ `version: 1` state — the pre-`reviewed_files` schema — gets a dedicated
65
+ one-time upgrade deny: *"push-review state is schema v1; harness v2 requires
66
+ reviewed_files — re-run the review to regenerate the state file"*. There is no
67
+ dual-accept: a v1 state cannot satisfy the v2 gate, because it silently waives
68
+ file coverage for whatever the v1 writer claims (see reviewer honesty note
69
+ below).
70
+
71
+ `reviewed_files` (sorted, unique) must equal sorted `git diff --name-only
72
+ <base>...HEAD` — the paths the reviewer actually covered. A mismatch denies,
73
+ naming missing paths (changed but not reviewed) and extra paths (reviewed but
74
+ not in the current diff) separately. This catches an *honestly-reported*
75
+ partial review scope; it is not adversary-proof against a reviewer that lies
76
+ about what it covered — that's a known, accepted limitation (mechanizing
77
+ coverage claims, not reviewer honesty).
78
+
79
+ `review_round` counts state-file rewrites **at the same `diff_sha`**: it starts
80
+ at 1 for a new `diff_sha` and bumps by 1 only when the diff is unchanged. A
81
+ changed diff restarts it at 1 — the earlier rounds judged different code, and
82
+ nothing resets the counter after a push, so carrying it forward made the cap
83
+ terminal for any long-lived branch. The hook treats a missing field as round 1
84
+ for backward compatibility and denies with an escalation message once the round
85
+ exceeds 5 (`MAX_ROUNDS`), so a fix→re-review loop on an unchanged diff cannot
86
+ run unbounded.
87
+
88
+ The canonical writer, `plugins/toolu-review/skills/review/scripts/write-state.sh`,
89
+ emits this v2 schema and auto-computes `reviewed_files` from `git diff
90
+ --name-only` (override with `--reviewed-files <comma-list>` for a partial or
91
+ adjusted review scope).
92
+
93
+ ## Security posture
94
+
95
+ `security-review` is **not separately enforced** by this gate (dropped in v1.2.0 per project decision) — though it is one of the accepted reviewers, so running it satisfies the gate. For diffs that touch authentication, secret handling, request parsing, or other security-sensitive code, run `/security-review` before push. The gate's reviewer catches correctness and clarity bugs but makes no security guarantees on its own.
96
+
97
+ ## Failed checks
98
+
99
+ Each of these fails the gate. What the user sees — a denial, a prompt, a note,
100
+ or nothing — is the mode's business, not this list's.
101
+
102
+ - State file missing.
103
+ - State file SHA != current diff SHA (diff changed).
104
+ - `findings_count > 0`.
105
+ - `version: 1` state file — one-time schema-upgrade deny (re-run the review to regenerate it).
106
+ - Corrupted JSON or schema drift (wrong `version`, missing `diff_sha`/`findings_count`).
107
+ - `reviewers` contains no accepted reviewer.
108
+ - `reviewed_files` does not match the diff's changed paths (missing and/or extra paths named).
109
+ - `review_round` exceeds the max (5) on an unchanged diff — escalation deny.
110
+ - Detected base branch not present locally.
111
+ - Detached HEAD.
112
+ - Empty diff against base (no-op push or force-reset branch).
113
+
114
+ ## Tests
115
+
116
+ `hooks/pre-tools/modules/__tests__/push-review.bats` covers the gate;
117
+ `hooks/lib/__tests__/detect.bats` covers `is_git_push` and `push_target_root`.
118
+ Run from the repo root with:
119
+
120
+ ```bash
121
+ bats plugins/toolu/hooks/pre-tools/modules/__tests__/push-review.bats
122
+ bats plugins/toolu/hooks/lib/__tests__/detect.bats
123
+ ```
@@ -0,0 +1,3 @@
1
+ ## Python notes
2
+ - Tests colocated: `test_<module>.py` beside the module — real data, no `unittest.mock`/`pytest-mock`.
3
+ - No bare `except:`, blanket `# noqa`, or bare `# type: ignore` — fix the cause.
@@ -0,0 +1,4 @@
1
+ ## Rust notes
2
+ - Unit tests: module-sibling `tests/` via bodyless `#[cfg(test)] mod tests;`; crate-root `tests/` = integration.
3
+ - No `#[allow(...)]`/`#[expect(...)]` outside a `tests/` file's `#![allow]` header.
4
+ - Use `cargo nextest run`; never plain `cargo test`.
@@ -0,0 +1,3 @@
1
+ ## TypeScript notes
2
+ - TS tests live in co-located `__tests__/` dirs (sibling of source, flat).
3
+ - Run typecheck (`{{node_pm}} run typecheck`) before claiming a change works.
@@ -0,0 +1,16 @@
1
+ # Session Protocol — {{project_name}}
2
+
3
+ ## Behaviour
4
+ - Evidence before claims: verify (tests/logs/runtime).
5
+ - Failed twice? STOP — change hypothesis; exhaust tools first.
6
+ - Only what's asked: no drive-by refactors or unsolicited files (gate excepted).
7
+ - Match effort to task: low + thinking off for routine work; full for hard.
8
+
9
+ ## Delegation
10
+ Inline by default. Delegate only to isolate a large read or run truly independent
11
+ units — never for small work. One question and one return shape per agent. Quiet
12
+ agent? Take it back inline.
13
+
14
+ ## Mandatory
15
+ - Quality gate: never advance while any error/warning/test failure stands, even unrelated.
16
+ - Tests use real data; no mocks hiding integration.
@@ -0,0 +1,76 @@
1
+ {
2
+ "hooks": {
3
+ "SessionStart": [
4
+ {
5
+ "matcher": "startup|resume|clear|compact",
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh"
10
+ }
11
+ ]
12
+ }
13
+ ],
14
+ "PreCompact": [
15
+ {
16
+ "matcher": "auto",
17
+ "hooks": [
18
+ {
19
+ "type": "command",
20
+ "command": "${CLAUDE_PLUGIN_ROOT}/hooks/pre-compact.sh"
21
+ }
22
+ ]
23
+ }
24
+ ],
25
+ "UserPromptSubmit": [
26
+ {
27
+ "hooks": [
28
+ {
29
+ "type": "command",
30
+ "command": "${CLAUDE_PLUGIN_ROOT}/hooks/user-prompt-submit.sh"
31
+ }
32
+ ]
33
+ }
34
+ ],
35
+ "PreToolUse": [
36
+ {
37
+ "matcher": "apply_patch|Edit|Write|MultiEdit|Bash|Shell|Grep",
38
+ "hooks": [
39
+ {
40
+ "type": "command",
41
+ "command": "${CLAUDE_PLUGIN_ROOT}/hooks/pre-tools/mod.sh"
42
+ }
43
+ ]
44
+ },
45
+ {
46
+ "matcher": "mcp__",
47
+ "hooks": [
48
+ {
49
+ "type": "command",
50
+ "command": "${CLAUDE_PLUGIN_ROOT}/hooks/pre-tools/modules/mcp-blocker.sh"
51
+ }
52
+ ]
53
+ },
54
+ {
55
+ "matcher": "spawn_agent|Agent|Task",
56
+ "hooks": [
57
+ {
58
+ "type": "command",
59
+ "command": "${CLAUDE_PLUGIN_ROOT}/hooks/pre-tools/agent-tier.sh"
60
+ }
61
+ ]
62
+ }
63
+ ],
64
+ "PostToolUse": [
65
+ {
66
+ "matcher": "apply_patch|Edit|Write|MultiEdit|Bash|Shell|Grep",
67
+ "hooks": [
68
+ {
69
+ "type": "command",
70
+ "command": "${CLAUDE_PLUGIN_ROOT}/hooks/post-tools/mod.sh"
71
+ }
72
+ ]
73
+ }
74
+ ]
75
+ }
76
+ }