docs: update AGENTS.md hierarchy with openclaw, runtime-fallback, skill-mcp-manager
- Add src/openclaw/AGENTS.md: bidirectional Discord/Telegram/webhook integration - Add src/hooks/runtime-fallback/AGENTS.md: reactive provider error recovery - Add src/features/skill-mcp-manager/AGENTS.md: tier-3 MCP lifecycle - Update root AGENTS.md: refresh commit hash, add openclaw/IntentGate/Hashline refs - Fix src/features/AGENTS.md: skill-mcp-manager file count 14→18, complexity MEDIUM→HIGH Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
# oh-my-opencode — O P E N C O D E Plugin
|
||||
# oh-my-opencode — OpenCode Plugin
|
||||
|
||||
**Generated:** 2026-04-08 | **Commit:** 4f196f49 | **Branch:** dev
|
||||
**Generated:** 2026-04-09 | **Commit:** dc7a4680 | **Branch:** dev
|
||||
|
||||
## OVERVIEW
|
||||
|
||||
OpenCode plugin (npm: `oh-my-opencode`) that extends Claude Code (OpenCode fork) with multi-agent orchestration, 52 lifecycle hooks, 26 tools, skill/command/MCP systems, and Claude Code compatibility. ~1602 TypeScript source files, ~214k LOC.
|
||||
OpenCode plugin (npm: `oh-my-opencode`) extending Claude Code with multi-agent orchestration, 52 lifecycle hooks, 26 tools, skill/command/MCP systems, Hashline edit tool, IntentGate classifier, and Claude Code compatibility. ~1600 TypeScript source files. Dual-published as `oh-my-opencode` + `oh-my-openagent` during transition.
|
||||
|
||||
## STRUCTURE
|
||||
|
||||
@@ -15,16 +15,19 @@ oh-my-opencode/
|
||||
│ ├── 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)
|
||||
│ ├── hooks/ # 52 lifecycle hooks across dedicated modules and standalone files
|
||||
│ ├── tools/ # 26 tools across 16 directories
|
||||
│ ├── features/ # 19 feature modules (background-agent, skill-loader, tmux, MCP-OAuth, etc.)
|
||||
│ ├── shared/ # 100+ utility files
|
||||
│ ├── tools/ # 26 tools across 16 directories (includes Hashline edit with LINE#ID content hashing)
|
||||
│ ├── features/ # 19 feature modules (background-agent, skill-loader, tmux, MCP-OAuth, skill-mcp-manager, etc.)
|
||||
│ ├── shared/ # 170+ utility files (barrel-exported, logger → /tmp/oh-my-opencode.log)
|
||||
│ ├── config/ # Zod v4 schema system (27 files)
|
||||
│ ├── cli/ # CLI: install, run, doctor, mcp-oauth (Commander.js)
|
||||
│ ├── mcp/ # 3 built-in remote MCPs (websearch, context7, grep_app)
|
||||
│ ├── plugin/ # 8 OpenCode hook handlers + 52 hook composition
|
||||
│ └── plugin-handlers/ # 6-phase config loading pipeline
|
||||
├── packages/ # Monorepo: cli-runner, 11 platform binaries
|
||||
└── local-ignore/ # Dev-only test fixtures
|
||||
│ ├── plugin/ # 10 OpenCode hook handlers + 52 hook composition
|
||||
│ ├── plugin-handlers/ # 6-phase config loading pipeline
|
||||
│ └── openclaw/ # Bidirectional external integration (Discord/Telegram/webhook/command)
|
||||
├── packages/ # 11 platform-specific compiled binaries (darwin/linux/windows, AVX2 + baseline variants)
|
||||
├── script/ # Build/publish automation (singular, not scripts/)
|
||||
├── .sisyphus/ # AI agent workspace (rules, plans, tasks, notepads)
|
||||
└── .local-ignore/ # Dev-only test fixtures + PR worktrees
|
||||
```
|
||||
|
||||
## INITIALIZATION FLOW
|
||||
@@ -44,13 +47,13 @@ OhMyOpenCodePlugin(ctx)
|
||||
|---------|---------|
|
||||
| `config` | 6-phase: provider → plugin-components → agents → tools → MCPs → commands |
|
||||
| `tool` | 26 registered tools |
|
||||
| `chat.message` | First-message variant, session setup, keyword detection |
|
||||
| `chat.params` | Anthropic effort level adjustment |
|
||||
| `chat.message` | First-message variant, session setup, keyword detection (ultrawork/search/analyze) |
|
||||
| `chat.params` | Anthropic effort level, think mode, runtime fallback override |
|
||||
| `chat.headers` | Copilot x-initiator header injection |
|
||||
| `event` | Session lifecycle (created, deleted, idle, error) |
|
||||
| `tool.execute.before` | Pre-tool hooks (file guard, label truncator, rules injector) |
|
||||
| `tool.execute.after` | Post-tool hooks (output truncation, metadata store) |
|
||||
| `experimental.chat.messages.transform` | Context injection, thinking block validation |
|
||||
| `event` | Session lifecycle (created, deleted, idle, error), openclaw dispatch, runtime fallback |
|
||||
| `tool.execute.before` | Pre-tool hooks (file guard, label truncator, rules injector, prometheus md-only) |
|
||||
| `tool.execute.after` | Post-tool hooks (output truncation, comment checker, hashline read enhancer) |
|
||||
| `experimental.chat.messages.transform` | Context injection, thinking block validation, tool pair validation |
|
||||
| `experimental.session.compacting` | Context + todo preservation during compaction |
|
||||
|
||||
## WHERE TO LOOK
|
||||
@@ -61,13 +64,16 @@ OhMyOpenCodePlugin(ctx)
|
||||
| Add new hook | `src/hooks/{name}/` + register in `src/plugin/hooks/create-*-hooks.ts` | Match event type to tier |
|
||||
| Add new tool | `src/tools/{name}/` + register in `src/plugin/tool-registry.ts` | Follow createXXXTool factory |
|
||||
| Add new feature module | `src/features/{name}/` | Standalone module, wire in plugin/ |
|
||||
| Add new MCP | `src/mcp/` + register in `createBuiltinMcps()` | Remote HTTP only |
|
||||
| Add new MCP | `src/mcp/` + register in `createBuiltinMcps()` | Remote HTTP only (tier 1 of 3) |
|
||||
| Add new skill | `src/features/builtin-skills/skills/` | Implement BuiltinSkill interface |
|
||||
| Add new command | `src/features/builtin-commands/` | Template in templates/ |
|
||||
| Add new CLI command | `src/cli/cli-program.ts` | Commander.js subcommand |
|
||||
| Add new doctor check | `src/cli/doctor/checks/` | Register in checks/index.ts |
|
||||
| Modify config schema | `src/config/schema/` + update root schema | Zod v4, add to OhMyOpenCodeConfigSchema |
|
||||
| Add new category | `src/tools/delegate-task/constants.ts` | DEFAULT_CATEGORIES + CATEGORY_MODEL_REQUIREMENTS |
|
||||
| Debug provider errors | `src/hooks/runtime-fallback/` | Reactive error recovery (distinct from model-fallback) |
|
||||
| External notifications | `src/openclaw/` | Bidirectional Discord/Telegram/webhook integration |
|
||||
| Skill-embedded MCP | `src/features/skill-mcp-manager/` | Tier 3 MCPs (stdio + HTTP, per-session) |
|
||||
|
||||
## MULTI-LEVEL CONFIG
|
||||
|
||||
@@ -153,10 +159,14 @@ bunx oh-my-opencode run # Non-interactive session
|
||||
- Background tasks: 5 concurrent per model/provider (configurable, circuit breaker support)
|
||||
- Plugin load timeout: 10s for Claude Code plugins
|
||||
- Model fallback: per-agent chains in `shared/model-requirements.ts`, not a single global priority
|
||||
- Two fallback systems: `model-fallback` (proactive, chat.params) vs `runtime-fallback` (reactive, session.error)
|
||||
- Config migration: idempotent via `_migrations` tracking, creates timestamped backups before atomic writes
|
||||
- Build: bun build (ESM) + tsc --emitDeclarationOnly, externals: @ast-grep/napi
|
||||
- Test setup: `test-setup.ts` preloaded via bunfig.toml, resets session/cache state between tests
|
||||
- Test split: `script/run-ci-tests.ts` auto-isolates files using `mock.module()` (plus `src/openclaw/__tests__/reply-listener-discord.test.ts`)
|
||||
- 104 barrel export files (index.ts) establish module boundaries
|
||||
- Architecture rules enforced via `.sisyphus/rules/modular-code-enforcement.md`
|
||||
- Windows builds run on `windows-latest` runner (not cross-compiled) to avoid Bun segfaults
|
||||
- Platform binaries detect AVX2 + libc family at runtime, fallback to baseline if needed
|
||||
- Hashline edit: every Read output tagged with `LINE#ID` content hashes; edits reject on hash mismatch
|
||||
- IntentGate: classifies user intent (research/implementation/investigation/evaluation/fix) before routing
|
||||
|
||||
Reference in New Issue
Block a user