docs: sync hook counts after continuation hook removal
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
10
AGENTS.md
10
AGENTS.md
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
## OVERVIEW
|
## OVERVIEW
|
||||||
|
|
||||||
OpenCode plugin (npm: `oh-my-opencode`) that extends Claude Code (OpenCode fork) with multi-agent orchestration, 45 lifecycle hooks, 26 tools, skill/command/MCP systems, and Claude Code compatibility. 1268 TypeScript files, 160k LOC.
|
OpenCode plugin (npm: `oh-my-opencode`) that extends Claude Code (OpenCode fork) with multi-agent orchestration, 48 lifecycle hooks, 26 tools, skill/command/MCP systems, and Claude Code compatibility. 1268 TypeScript files, 160k LOC.
|
||||||
|
|
||||||
## STRUCTURE
|
## STRUCTURE
|
||||||
|
|
||||||
@@ -14,14 +14,14 @@ oh-my-opencode/
|
|||||||
│ ├── index.ts # Plugin entry: loadConfig → createManagers → createTools → createHooks → createPluginInterface
|
│ ├── index.ts # Plugin entry: loadConfig → createManagers → createTools → createHooks → createPluginInterface
|
||||||
│ ├── plugin-config.ts # JSONC multi-level config: user → project → defaults (Zod v4)
|
│ ├── plugin-config.ts # JSONC multi-level config: user → project → defaults (Zod v4)
|
||||||
│ ├── agents/ # 11 agents (Sisyphus, Hephaestus, Oracle, Librarian, Explore, Atlas, Prometheus, Metis, Momus, Multimodal-Looker, Sisyphus-Junior)
|
│ ├── agents/ # 11 agents (Sisyphus, Hephaestus, Oracle, Librarian, Explore, Atlas, Prometheus, Metis, Momus, Multimodal-Looker, Sisyphus-Junior)
|
||||||
│ ├── hooks/ # 45 hooks across 44 directories + 11 standalone files
|
│ ├── hooks/ # 48 lifecycle hooks across dedicated modules and standalone files
|
||||||
│ ├── tools/ # 26 tools across 15 directories
|
│ ├── tools/ # 26 tools across 15 directories
|
||||||
│ ├── features/ # 19 feature modules (background-agent, skill-loader, tmux, MCP-OAuth, etc.)
|
│ ├── features/ # 19 feature modules (background-agent, skill-loader, tmux, MCP-OAuth, etc.)
|
||||||
│ ├── shared/ # 95+ utility files in 13 categories
|
│ ├── shared/ # 95+ utility files in 13 categories
|
||||||
│ ├── config/ # Zod v4 schema system (24 files)
|
│ ├── config/ # Zod v4 schema system (24 files)
|
||||||
│ ├── cli/ # CLI: install, run, doctor, mcp-oauth (Commander.js)
|
│ ├── cli/ # CLI: install, run, doctor, mcp-oauth (Commander.js)
|
||||||
│ ├── mcp/ # 3 built-in remote MCPs (websearch, context7, grep_app)
|
│ ├── mcp/ # 3 built-in remote MCPs (websearch, context7, grep_app)
|
||||||
│ ├── plugin/ # 8 OpenCode hook handlers + 45 hook composition
|
│ ├── plugin/ # 8 OpenCode hook handlers + 48 hook composition
|
||||||
│ └── plugin-handlers/ # 6-phase config loading pipeline
|
│ └── plugin-handlers/ # 6-phase config loading pipeline
|
||||||
├── packages/ # Monorepo: cli-runner, 12 platform binaries
|
├── packages/ # Monorepo: cli-runner, 12 platform binaries
|
||||||
└── local-ignore/ # Dev-only test fixtures
|
└── local-ignore/ # Dev-only test fixtures
|
||||||
@@ -34,7 +34,7 @@ OhMyOpenCodePlugin(ctx)
|
|||||||
├─→ loadPluginConfig() # JSONC parse → project/user merge → Zod validate → migrate
|
├─→ loadPluginConfig() # JSONC parse → project/user merge → Zod validate → migrate
|
||||||
├─→ createManagers() # TmuxSessionManager, BackgroundManager, SkillMcpManager, ConfigHandler
|
├─→ createManagers() # TmuxSessionManager, BackgroundManager, SkillMcpManager, ConfigHandler
|
||||||
├─→ createTools() # SkillContext + AvailableCategories + ToolRegistry (26 tools)
|
├─→ createTools() # SkillContext + AvailableCategories + ToolRegistry (26 tools)
|
||||||
├─→ createHooks() # 3-tier: Core(37) + Continuation(6) + Skill(2) = 45 hooks
|
├─→ createHooks() # 3-tier: Core(39) + Continuation(7) + Skill(2) = 48 hooks
|
||||||
└─→ createPluginInterface() # 8 OpenCode hook handlers → PluginInterface
|
└─→ createPluginInterface() # 8 OpenCode hook handlers → PluginInterface
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -97,7 +97,7 @@ Fields: agents (14 overridable, 21 fields each), categories (8 built-in + custom
|
|||||||
- **Test pattern**: Bun test (`bun:test`), co-located `*.test.ts`, given/when/then style (nested describe with `#given`/`#when`/`#then` prefixes)
|
- **Test pattern**: Bun test (`bun:test`), co-located `*.test.ts`, given/when/then style (nested describe with `#given`/`#when`/`#then` prefixes)
|
||||||
- **CI test split**: mock-heavy tests run in isolation (separate `bun test` processes), rest in batch
|
- **CI test split**: mock-heavy tests run in isolation (separate `bun test` processes), rest in batch
|
||||||
- **Factory pattern**: `createXXX()` for all tools, hooks, agents
|
- **Factory pattern**: `createXXX()` for all tools, hooks, agents
|
||||||
- **Hook tiers**: Session (23) → Tool-Guard (10) → Transform (4) → Continuation (6) → Skill (2)
|
- **Hook tiers**: Session (23) → Tool-Guard (12) → Transform (4) → Continuation (7) → Skill (2)
|
||||||
- **Agent modes**: `primary` (respects UI model) vs `subagent` (own fallback chain) vs `all`
|
- **Agent modes**: `primary` (respects UI model) vs `subagent` (own fallback chain) vs `all`
|
||||||
- **Model resolution**: 4-step: override → category-default → provider-fallback → system-default
|
- **Model resolution**: 4-step: override → category-default → provider-fallback → system-default
|
||||||
- **Config format**: JSONC with comments, Zod v4 validation, snake_case keys
|
- **Config format**: JSONC with comments, Zod v4 validation, snake_case keys
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ Entry point `index.ts` orchestrates 5-step initialization: loadConfig → create
|
|||||||
| `plugin-config.ts` | JSONC parse, multi-level merge, Zod v4 validation |
|
| `plugin-config.ts` | JSONC parse, multi-level merge, Zod v4 validation |
|
||||||
| `create-managers.ts` | TmuxSessionManager, BackgroundManager, SkillMcpManager, ConfigHandler |
|
| `create-managers.ts` | TmuxSessionManager, BackgroundManager, SkillMcpManager, ConfigHandler |
|
||||||
| `create-tools.ts` | SkillContext + AvailableCategories + ToolRegistry (26 tools) |
|
| `create-tools.ts` | SkillContext + AvailableCategories + ToolRegistry (26 tools) |
|
||||||
| `create-hooks.ts` | 3-tier: Core(37) + Continuation(6) + Skill(2) = 45 hooks |
|
| `create-hooks.ts` | 3-tier: Core(39) + Continuation(7) + Skill(2) = 48 hooks |
|
||||||
| `plugin-interface.ts` | 8 OpenCode hook handlers: config, tool, chat.message, chat.params, chat.headers, event, tool.execute.before, tool.execute.after |
|
| `plugin-interface.ts` | 8 OpenCode hook handlers: config, tool, chat.message, chat.params, chat.headers, event, tool.execute.before, tool.execute.after |
|
||||||
|
|
||||||
## CONFIG LOADING
|
## CONFIG LOADING
|
||||||
@@ -36,6 +36,6 @@ createHooks()
|
|||||||
│ ├─ createSessionHooks() # 23: contextWindowMonitor, thinkMode, ralphLoop, modelFallback, runtimeFallback, noSisyphusGpt, noHephaestusNonGpt, anthropicEffort, intentGate...
|
│ ├─ createSessionHooks() # 23: contextWindowMonitor, thinkMode, ralphLoop, modelFallback, runtimeFallback, noSisyphusGpt, noHephaestusNonGpt, anthropicEffort, intentGate...
|
||||||
│ ├─ createToolGuardHooks() # 10: commentChecker, rulesInjector, writeExistingFileGuard, jsonErrorRecovery, hashlineReadEnhancer...
|
│ ├─ createToolGuardHooks() # 10: commentChecker, rulesInjector, writeExistingFileGuard, jsonErrorRecovery, hashlineReadEnhancer...
|
||||||
│ └─ createTransformHooks() # 4: claudeCodeHooks, keywordDetector, contextInjector, thinkingBlockValidator
|
│ └─ createTransformHooks() # 4: claudeCodeHooks, keywordDetector, contextInjector, thinkingBlockValidator
|
||||||
├─→ createContinuationHooks() # 6: todoContinuationEnforcer, atlas, stopContinuationGuard, ralphLoopActivator...
|
├─→ createContinuationHooks() # 7: todoContinuationEnforcer, atlas, stopContinuationGuard, ralphLoopActivator...
|
||||||
└─→ createSkillHooks() # 2: categorySkillReminder, autoSlashCommand
|
└─→ createSkillHooks() # 2: categorySkillReminder, autoSlashCommand
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ config/schema/
|
|||||||
├── agent-names.ts # BuiltinAgentNameSchema (11), OverridableAgentNameSchema (14)
|
├── agent-names.ts # BuiltinAgentNameSchema (11), OverridableAgentNameSchema (14)
|
||||||
├── agent-overrides.ts # AgentOverrideConfigSchema (21 fields per agent)
|
├── agent-overrides.ts # AgentOverrideConfigSchema (21 fields per agent)
|
||||||
├── categories.ts # 8 built-in + custom categories
|
├── categories.ts # 8 built-in + custom categories
|
||||||
├── hooks.ts # HookNameSchema (45 hooks)
|
├── hooks.ts # HookNameSchema (48 hooks)
|
||||||
├── skills.ts # SkillsConfigSchema (sources, paths, recursive)
|
├── skills.ts # SkillsConfigSchema (sources, paths, recursive)
|
||||||
├── commands.ts # BuiltinCommandNameSchema
|
├── commands.ts # BuiltinCommandNameSchema
|
||||||
├── experimental.ts # Feature flags (plugin_load_timeout_ms min 1000)
|
├── experimental.ts # Feature flags (plugin_load_timeout_ms min 1000)
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
# src/hooks/ — 45 Lifecycle Hooks
|
# src/hooks/ — 48 Lifecycle Hooks
|
||||||
|
|
||||||
**Generated:** 2026-03-06
|
**Generated:** 2026-03-06
|
||||||
|
|
||||||
## OVERVIEW
|
## OVERVIEW
|
||||||
|
|
||||||
45 hooks across 44 directories + 11 standalone files. Three-tier composition: Core(37) + Continuation(6) + Skill(2). All hooks follow `createXXXHook(deps) → HookFunction` factory pattern.
|
48 hooks across dedicated modules and standalone files. Three-tier composition: Core(39) + Continuation(7) + Skill(2). All hooks follow `createXXXHook(deps) → HookFunction` factory pattern.
|
||||||
|
|
||||||
## HOOK TIERS
|
## HOOK TIERS
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@ hooks/
|
|||||||
| noHephaestusNonGpt | chat.message | Block Hephaestus from using non-GPT models |
|
| noHephaestusNonGpt | chat.message | Block Hephaestus from using non-GPT models |
|
||||||
| runtimeFallback | event | Auto-switch models on API provider errors |
|
| runtimeFallback | event | Auto-switch models on API provider errors |
|
||||||
|
|
||||||
### Tier 2: Tool Guard Hooks (10) — `create-tool-guard-hooks.ts`
|
### Tier 2: Tool Guard Hooks (12) — `create-tool-guard-hooks.ts`
|
||||||
|
|
||||||
| Hook | Event | Purpose |
|
| Hook | Event | Purpose |
|
||||||
|------|-------|---------|
|
|------|-------|---------|
|
||||||
@@ -109,7 +109,7 @@ hooks/
|
|||||||
| contextInjectorMessagesTransform | messages.transform | Inject AGENTS.md/README.md into context |
|
| contextInjectorMessagesTransform | messages.transform | Inject AGENTS.md/README.md into context |
|
||||||
| thinkingBlockValidator | messages.transform | Validate thinking block structure |
|
| thinkingBlockValidator | messages.transform | Validate thinking block structure |
|
||||||
|
|
||||||
### Tier 4: Continuation Hooks (6) — `create-continuation-hooks.ts`
|
### Tier 4: Continuation Hooks (7) — `create-continuation-hooks.ts`
|
||||||
|
|
||||||
| Hook | Event | Purpose |
|
| Hook | Event | Purpose |
|
||||||
|------|-------|---------|
|
|------|-------|---------|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
## OVERVIEW
|
## OVERVIEW
|
||||||
|
|
||||||
Core glue layer. 20 source files assembling the 8 OpenCode hook handlers and composing 45 hooks into the PluginInterface. Every handler file corresponds to one OpenCode hook type.
|
Core glue layer. 20 source files assembling the 8 OpenCode hook handlers and composing 48 hooks into the PluginInterface. Every handler file corresponds to one OpenCode hook type.
|
||||||
|
|
||||||
## HANDLER FILES
|
## HANDLER FILES
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ Core glue layer. 20 source files assembling the 8 OpenCode hook handlers and com
|
|||||||
| File | Tier | Count |
|
| File | Tier | Count |
|
||||||
|------|------|-------|
|
|------|------|-------|
|
||||||
| `create-session-hooks.ts` | Session | 23 |
|
| `create-session-hooks.ts` | Session | 23 |
|
||||||
| `create-tool-guard-hooks.ts` | Tool Guard | 10 |
|
| `create-tool-guard-hooks.ts` | Tool Guard | 12 |
|
||||||
| `create-skill-hooks.ts` | Skill | 2 |
|
| `create-skill-hooks.ts` | Skill | 2 |
|
||||||
| `create-core-hooks.ts` | Aggregator | Session + Guard + Transform = 37 |
|
| `create-core-hooks.ts` | Aggregator | Session + Guard + Transform = 37 |
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user