

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
1# src/plugin/ -- 12 OpenCode Hook Handlers + Hook Composition23**Generated:** 2026-07-17 / 7d664b96b45## OVERVIEW67Core glue layer. Files assemble the 12 OpenCode hook handlers wired into `PluginInterface` here (an additional 2, `experimental.session.compacting` + `experimental.compaction.autocontinue`, are wired in `src/testing/create-plugin-module.ts`). Each handler file maps to one OpenCode hook type.89## HANDLER FILES1011| File | OpenCode Hook | Purpose |12|------|---------------|---------|13| `config.ts` | `config` | 6-phase config loading pipeline (delegates to `plugin-handlers/`) |14| `tool-registry.ts` | `tool` | 12-38 tools assembled with config gates (team-mode +12, monitor +4, task system +4, hashline +1, interactive_bash +1, look_at +1, goal +3); split across `tool-registry-{core-tools,team-tools,gated-tools}.ts` |15| `tool-definition.ts` | `tool.definition` | Per-tool definition transform (applies todo-description-override) |16| `chat-message.ts` | `chat.message` | First-message variant resolution, session setup, keyword detection, goal command dispatch + default goal auto-start |17| `chat-params.ts` | `chat.params` | Anthropic effort, think mode, runtime fallback model override |18| `chat-headers.ts` | `chat.headers` | Copilot `x-initiator` header injection |19| `command-execute-before.ts` | `command.execute.before` | Pre-command guards (stop-continuation, /goal dispatch, start-work, auto-slash-command) |20| `event.ts` | `event` | Session lifecycle (created/deleted/idle/error/status), openclaw dispatch, runtime fallback, 4 team-session-event handlers (when team_mode.enabled) |21| `tool-execute-before.ts` | `tool.execute.before` | Pre-tool guards (mcp_ strip, bash sleep block, task subagent resolution, skill /goal + /stop-continuation dispatch) |22| `tool-execute-after.ts` | `tool.execute.after` | Post-tool hooks (truncation, comment-checker, hashline read tagging, json-error-recovery) |23| `messages-transform.ts` | `experimental.chat.messages.transform` | Context injection, thinking-block validation, tool-pair validation, keyword detection, category-skill reminder |24| `system-transform.ts` | `experimental.chat.system.transform` | System-message-level transforms |25| `session-compacting.ts` | `experimental.session.compacting` | Context + todo preservation across compaction (registered via `create-plugin-module.ts`) |26| `skill-context.ts` | (helper) | Skill/browser/category context shared with tool creation |27| `build-team-idle-wake-hint-client.ts` | (helper) | Build the team idle-wake-hint client wired into event handlers |2829## HOOK COMPOSITION (hooks/ subdir)3031| File | Tier | Count |32|------|------|-------|33| `create-session-hooks.ts` | Session | 24 |34| `create-tool-guard-hooks.ts` | Tool Guard | 18 (incl. `team-tool-gating`, null unless team_mode) |35| `create-transform-hooks.ts` | Transform | 7 slots (2 team-gated, 1 monitor-gated; incl. `contextInjectorMessagesTransform` from `features/context-injector`) |36| `create-skill-hooks.ts` | Skill | 2 |37| `create-core-hooks.ts` | Aggregator | Session + Guard + Transform = 49 slots |3839`createContinuationHooks()` (7) lives in `src/create-hooks.ts` next to `createCoreHooks()` and `createSkillHooks()`.4041## SUPPORT FILES4243| File | Purpose |44|------|---------|45| `available-categories.ts` | Build `AvailableCategory[]` for agent prompt injection |46| `session-agent-resolver.ts` | Resolve which agent owns a session |47| `session-status-normalizer.ts` | Normalize session status across OpenCode versions |48| `recent-synthetic-idles.ts` | Dedup rapid synthetic idle events |49| `unstable-agent-babysitter.ts` | Track unstable agent behavior across sessions |50| `types.ts` | `PluginContext`, `PluginInterface`, `ToolsRecord`, `TmuxConfig` |51| `ultrawork-model-override.ts` | Ultrawork mode model override logic |52| `ultrawork-db-model-override.ts` | DB-level model override for ultrawork |53| `config-handler.ts` | Runtime config loading and caching |54| `normalize-tool-arg-schemas.ts` | Coerce tool arg schemas into a normalized shape |55| `native-skills.ts` | Native-skill loader (`createNativeSkills` / `getPluginInputNativeSkills`) feeding lazy `getLoadedSkills` discovery in skill/delegate tools |5657## TOOL REGISTRATION GATES5859```typescript60// src/plugin/tool-registry.ts61const taskToolsRecord = isTaskSystemEnabled(config) ? { task_create, task_get, task_list, task_update } : {}62const hashlineToolsRecord = config.hashline_edit ? { edit: createHashlineEditTool(ctx) } : {}63const teamModeToolsRecord = config.team_mode?.enabled ? { team_create, team_delete, team_shutdown_request, team_approve_shutdown, team_reject_shutdown, team_send_message, team_task_create, team_task_list, team_task_update, team_task_get, team_status, team_list } : {}64const lookAt = isMultimodalLookerEnabled ? { look_at: createLookAt(ctx) } : {}65const interactiveBashTool = interactiveBashEnabled ? { interactive_bash } : {}66const goalToolsRecord = pluginConfig.goal?.enabled ? { create_goal, update_goal, get_goal } : {}6768const allTools = {69 ...createGrepTools(ctx),70 ...createGlobTools(ctx),71 ...createSessionManagerTools(ctx),72 ...backgroundTools, // 2 background_*73 call_omo_agent, task,74 ...lookAt,75 skill_mcp, skill,76 ...interactiveBashTool,77 ...teamModeToolsRecord, // +12 conditional78 ...taskToolsRecord, // +4 conditional79 ...hashlineToolsRecord, // +1 conditional80 ...goalToolsRecord, // +3 conditional (config.goal.enabled)81}8283// lsp_* tools are supplied by the built-in MCP server "lsp"84```8586## KEY PATTERNS8788- Each handler exports a function receiving `(hookRecord, ctx, pluginConfig, managers)` → returns the OpenCode hook function.89- Handlers iterate over hook records, calling each hook with `(input, output)` in registration order.90- `safeHook()` wrapper isolates hook errors so one broken hook does not crash the chain.91- `filterDisabledTools(allTools, disabled_tools)` prunes tools listed in `disabled_tools` config.92- `experimental.max_tools` cap trims tool count when set (selects the highest-priority tools).93
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| code-yeongyu/oh-my-openagentpackages/omo-opencode/src/tools/look-at/AGENTS.md · 68k | AGENTS.md | arch | 68/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentassets/AGENTS.md · 68k | AGENTS.md | buildteststylearch | 88/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/AGENTS.md · 68k | AGENTS.md | buildtestlint-formatstyle+3 | 83/100 | today | |
| code-yeongyu/oh-my-openagentpackages/omo-codex/plugin/components/ultrawork/AGENTS.md · 68k | AGENTS.md | buildteststylearch+1 | 77/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/omo-opencode/src/tools/background-task/AGENTS.md · 68k | AGENTS.md | arch | 70/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/omo-opencode/src/agents/sisyphus/AGENTS.md · 68k | AGENTS.md | arch | 56/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/omo-opencode/src/hooks/ralph-loop/AGENTS.md · 68k | AGENTS.md | arch | 62/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/omo-opencode/src/hooks/rules-injector/AGENTS.md · 68k | AGENTS.md | archdo-not | 69/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/omo-opencode/src/hooks/runtime-fallback/AGENTS.md · 68k | AGENTS.md | stylearchtypes | 70/100 | 13 days ago | |
| code-yeongyu/oh-my-openagent.agents/AGENTS.md · 68k | AGENTS.md | stylearchtesting-strategydatabase | 64/100 | 13 days ago | |
| code-yeongyu/oh-my-openagent.opencode/AGENTS.md · 68k | AGENTS.md | stylearchdo-not | 71/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentAGENTS.md · 68k | AGENTS.md | setupbuildtestlint-format+11 | 84/100 | today | |
| code-yeongyu/oh-my-openagentpackages/agents-md-core/AGENTS.md · 68k | AGENTS.md | archdependenciesapi | 48/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/ast-grep-mcp/AGENTS.md · 68k | AGENTS.md | buildstylearchdependencies+1 | 78/100 | 7 days ago | |
| code-yeongyu/oh-my-openagentpackages/boulder-state/AGENTS.md · 68k | AGENTS.md | archapi | 48/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/claude-code-compat-core/AGENTS.md · 68k | AGENTS.md | archagent-behaviour | 56/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/comment-checker-core/AGENTS.md · 68k | AGENTS.md | archdependenciesapi | 48/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/delegate-core/AGENTS.md · 68k | AGENTS.md | stylearchdependenciesapi | 60/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/git-bash-mcp/AGENTS.md · 68k | AGENTS.md | buildtestlint-formatarch+1 | 82/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/hashline-core/AGENTS.md · 68k | AGENTS.md | archtypesdependenciesapi | 48/100 | 13 days ago |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| n8n-io/n8npackages/@n8n/agents/AGENTS.md · 201k | AGENTS.md | buildteststylearch+3 | 100/100 | 14 days ago | |
| aaif-goose/gooseAGENTS.md · 53k | AGENTS.md | setupbuildtestlint-format+7 | 100/100 | 8 days ago | |
| duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70 | AGENTS.md | buildteststylearch+3 | 100/100 | 14 days ago | |
| deepseek-ai/deepseek-harnessnative/landlock-run/AGENTS.md · 104k | AGENTS.md | setupteststylearch+3 | 100/100 | today | |
| code-yeongyu/oh-my-openagentpackages/web/AGENTS.md · 68k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 13 days ago | |
| TryGhost/Ghoste2e/AGENTS.md · 55k | AGENTS.md | setupteststylearch+2 | 100/100 | today | |
| mui/material-uiAGENTS.md · 99k | AGENTS.md | setupbuildtestlint-format+9 | 100/100 | 14 days ago | |
| elastic/elasticsearchx-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/AGENTS.md · 78k | AGENTS.md | buildtestlint-formatstyle+2 | 100/100 | 14 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/code-yeongyu-oh-my-openagent-packages-omo-opencode-src-plugin-agents)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.