diff --git a/AGENTS.md b/AGENTS.md index abf615894..f0f44cdab 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,10 +1,10 @@ -# oh-my-opencode — OpenCode Plugin +# oh-my-opencode — O P E N C O D E Plugin -**Generated:** 2026-03-02 | **Commit:** 1c2caa09 | **Branch:** dev +**Generated:** 2026-03-06 | **Commit:** 7fe44024 | **Branch:** dev ## OVERVIEW -OpenCode plugin (npm: `oh-my-opencode`) that extends Claude Code (OpenCode fork) with multi-agent orchestration, 46 lifecycle hooks, 26 tools, skill/command/MCP systems, and Claude Code compatibility. 1243 TypeScript files, 155k LOC. +OpenCode plugin (npm: `oh-my-opencode`) that extends Claude Code (OpenCode fork) with multi-agent orchestration, 46 lifecycle hooks, 26 tools, skill/command/MCP systems, and Claude Code compatibility. 1268 TypeScript files, 160k LOC. ## STRUCTURE @@ -46,6 +46,7 @@ OhMyOpenCodePlugin(ctx) | `tool` | 26 registered tools | | `chat.message` | First-message variant, session setup, keyword detection | | `chat.params` | Anthropic effort level adjustment | +| `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) | @@ -73,6 +74,12 @@ OhMyOpenCodePlugin(ctx) Project (.opencode/oh-my-opencode.jsonc) → User (~/.config/opencode/oh-my-opencode.jsonc) → Defaults ``` +- `agents`, `categories`, `claude_code`: deep merged recursively +- `disabled_*` arrays: Set union (concatenated + deduplicated) +- All other fields: override replaces base value +- Zod `safeParse()` fills defaults for omitted fields +- `migrateConfigFile()` transforms legacy keys automatically + Fields: agents (14 overridable, 21 fields each), categories (8 built-in + custom), disabled_* arrays (agents, hooks, mcps, skills, commands, tools), 19 feature-specific configs. ## THREE-TIER MCP SYSTEM @@ -85,15 +92,19 @@ Fields: agents (14 overridable, 21 fields each), categories (8 built-in + custom ## CONVENTIONS +- **Runtime**: Bun only — never use npm/yarn +- **TypeScript**: strict mode, ESNext, bundler moduleResolution, `bun-types` (never `@types/node`) - **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 - **Factory pattern**: `createXXX()` for all tools, hooks, agents - **Hook tiers**: Session (23) → Tool-Guard (10) → Transform (4) → Continuation (7) → Skill (2) - **Agent modes**: `primary` (respects UI model) vs `subagent` (own fallback chain) vs `all` -- **Model resolution**: 3-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 - **File naming**: kebab-case for all files/directories - **Module structure**: index.ts barrel exports, no catch-all files (utils.ts, helpers.ts banned), 200 LOC soft limit - **Imports**: relative within module, barrel imports across modules (`import { log } from "./shared"`) +- **No path aliases**: no `@/` — relative imports only ## ANTI-PATTERNS @@ -101,16 +112,21 @@ Fields: agents (14 overridable, 21 fields each), categories (8 built-in + custom - Never suppress lint/type errors - Never add emojis to code/comments unless user explicitly asks - Never commit unless explicitly requested +- Never run `bun publish` directly — use GitHub Actions +- Never modify `package.json` version locally - Test: given/when/then — never use Arrange-Act-Assert comments - Comments: avoid AI-generated comment patterns (enforced by comment-checker hook) - Never create catch-all files (`utils.ts`, `helpers.ts`, `service.ts`) - Empty catch blocks `catch(e) {}` — always handle errors +- Never use em dashes (—), en dashes (–), or AI filler phrases in generated content +- index.ts is entry point ONLY — never dump business logic there ## COMMANDS ```bash bun test # Bun test suite bun run build # Build plugin (ESM + declarations + schema) +bun run build:all # Build + platform binaries bun run typecheck # tsc --noEmit bunx oh-my-opencode install # Interactive setup bunx oh-my-opencode doctor # Health diagnostics @@ -121,10 +137,12 @@ bunx oh-my-opencode run # Non-interactive session | Workflow | Trigger | Purpose | |----------|---------|---------| -| ci.yml | push/PR | Tests (split: mock-heavy isolated + batch), typecheck, build, schema auto-commit | -| publish.yml | manual | Version bump, npm publish, platform binaries, GitHub release, merge to dev | -| publish-platform.yml | called | 12 platform binaries via bun compile (darwin/linux/windows) | -| sisyphus-agent.yml | @mention | AI agent handles issues/PRs | +| ci.yml | push/PR to master/dev | Tests (split: mock-heavy isolated + batch), typecheck, build, schema auto-commit | +| publish.yml | manual dispatch | Version bump, npm publish, platform binaries, GitHub release, merge to master | +| publish-platform.yml | called by publish | 12 platform binaries via bun compile (darwin/linux/windows) | +| sisyphus-agent.yml | @mention / dispatch | AI agent handles issues/PRs | +| cla.yml | issue_comment/PR | CLA assistant for contributors | +| lint-workflows.yml | push to .github/ | actionlint + shellcheck on workflow files | ## NOTES @@ -135,3 +153,5 @@ bunx oh-my-opencode run # Non-interactive session - Config migration runs automatically on legacy keys (agent names, hook names, model versions) - Build: bun build (ESM) + tsc --emitDeclarationOnly, externals: @ast-grep/napi - Test setup: `test-setup.ts` preloaded via bunfig.toml, mock-heavy tests run in isolation in CI +- 98 barrel export files (index.ts) establish module boundaries +- Architecture rules enforced via `.sisyphus/rules/modular-code-enforcement.md` diff --git a/src/AGENTS.md b/src/AGENTS.md index b224e8be5..584c36630 100644 --- a/src/AGENTS.md +++ b/src/AGENTS.md @@ -1,21 +1,21 @@ # src/ — Plugin Source -**Generated:** 2026-03-02 +**Generated:** 2026-03-06 ## OVERVIEW -Root source directory. Entry point `index.ts` orchestrates 4-step initialization: config → managers → tools → hooks → plugin interface. +Entry point `index.ts` orchestrates 5-step initialization: loadConfig → createManagers → createTools → createHooks → createPluginInterface. ## KEY FILES | File | Purpose | |------|---------| | `index.ts` | Plugin entry, exports `OhMyOpenCodePlugin` | -| `plugin-config.ts` | JSONC parse, multi-level merge (user → project → defaults), Zod validation | +| `plugin-config.ts` | JSONC parse, multi-level merge, Zod v4 validation | | `create-managers.ts` | TmuxSessionManager, BackgroundManager, SkillMcpManager, ConfigHandler | -| `create-tools.ts` | SkillContext + AvailableCategories + ToolRegistry | -| `create-hooks.ts` | 3-tier hook composition: Core(37) + Continuation(7) + Skill(2) | -| `plugin-interface.ts` | Assembles 8 OpenCode hook handlers into PluginInterface | +| `create-tools.ts` | SkillContext + AvailableCategories + ToolRegistry (26 tools) | +| `create-hooks.ts` | 3-tier: Core(37) + Continuation(7) + Skill(2) = 46 hooks | +| `plugin-interface.ts` | 8 OpenCode hook handlers: config, tool, chat.message, chat.params, chat.headers, event, tool.execute.before, tool.execute.after | ## CONFIG LOADING @@ -33,9 +33,9 @@ loadPluginConfig(directory, ctx) ``` createHooks() ├─→ createCoreHooks() # 37 hooks - │ ├─ createSessionHooks() # 23: contextWindowMonitor, thinkMode, ralphLoop, modelFallback, runtimeFallback, noSisyphusGpt, noHephaestusNonGpt, anthropicEffort... + │ ├─ createSessionHooks() # 23: contextWindowMonitor, thinkMode, ralphLoop, modelFallback, runtimeFallback, noSisyphusGpt, noHephaestusNonGpt, anthropicEffort, intentGate... │ ├─ createToolGuardHooks() # 10: commentChecker, rulesInjector, writeExistingFileGuard, jsonErrorRecovery, hashlineReadEnhancer... │ └─ createTransformHooks() # 4: claudeCodeHooks, keywordDetector, contextInjector, thinkingBlockValidator - ├─→ createContinuationHooks() # 7: todoContinuationEnforcer, atlas, stopContinuationGuard... + ├─→ createContinuationHooks() # 7: todoContinuationEnforcer, atlas, stopContinuationGuard, ralphLoopActivator... └─→ createSkillHooks() # 2: categorySkillReminder, autoSlashCommand ``` diff --git a/src/agents/AGENTS.md b/src/agents/AGENTS.md index 5ce16f271..3f58f133a 100644 --- a/src/agents/AGENTS.md +++ b/src/agents/AGENTS.md @@ -1,6 +1,6 @@ # src/agents/ — 11 Agent Definitions -**Generated:** 2026-03-02 +**Generated:** 2026-03-06 ## OVERVIEW @@ -10,16 +10,16 @@ Agent factories following `createXXXAgent(model) → AgentConfig` pattern. Each | Agent | Model | Temp | Mode | Fallback Chain | Purpose | |-------|-------|------|------|----------------|---------| -| **Sisyphus** | claude-opus-4-6 | 0.1 | all | kimi-k2.5 → glm-5 → big-pickle | Main orchestrator, plans + delegates | -| **Hephaestus** | gpt-5.3-codex | 0.1 | all | gpt-5.2 (copilot) | Autonomous deep worker | -| **Oracle** | gpt-5.2 | 0.1 | subagent | gemini-3.1-pro → claude-opus-4-6 | Read-only consultation | -| **Librarian** | kimi-k2.5 | 0.1 | subagent | gemini-3-flash → gpt-5.2 → glm-4.6v | External docs/code search | -| **Explore** | grok-code-fast-1 | 0.1 | subagent | minimax-m2.5 → claude-haiku-4-5 → gpt-5-nano | Contextual grep | -| **Multimodal-Looker** | gemini-3-flash | 0.1 | subagent | minimax-m2.5 → big-pickle | PDF/image analysis | -| **Metis** | claude-opus-4-6 | **0.3** | subagent | gpt-5.2 → kimi-k2.5 → gemini-3.1-pro | Pre-planning consultant | -| **Momus** | gpt-5.2 | 0.1 | subagent | claude-opus-4-6 → gemini-3.1-pro | Plan reviewer | -| **Atlas** | kimi-k2.5 | 0.1 | primary | claude-sonnet-4-6 → gpt-5.2 | Todo-list orchestrator | -| **Prometheus** | claude-opus-4-6 | 0.1 | — | kimi-k2.5 → gpt-5.2 → gemini-3.1-pro | Strategic planner (internal) | +| **Sisyphus** | claude-opus-4-6 max | 0.1 | all | glm-5 → big-pickle | Main orchestrator, plans + delegates | +| **Hephaestus** | gpt-5.3-codex medium | 0.1 | all | gpt-5.2 medium (copilot) | Autonomous deep worker | +| **Oracle** | gpt-5.2 high | 0.1 | subagent | gemini-3.1-pro high → claude-opus-4-6 max | Read-only consultation | +| **Librarian** | gemini-3-flash | 0.1 | subagent | minimax-m2.5-free → big-pickle | External docs/code search | +| **Explore** | grok-code-fast-1 | 0.1 | subagent | minimax-m2.5-free → claude-haiku-4-5 → gpt-5-nano | Contextual grep | +| **Multimodal-Looker** | gpt-5.3-codex medium | 0.1 | subagent | k2p5 → gemini-3-flash → glm-4.6v → gpt-5-nano | PDF/image analysis | +| **Metis** | claude-opus-4-6 max | **0.3** | subagent | gpt-5.2 high → gemini-3.1-pro high | Pre-planning consultant | +| **Momus** | gpt-5.4 xhigh | 0.1 | subagent | claude-opus-4-6 max → gemini-3.1-pro high | Plan reviewer | +| **Atlas** | claude-sonnet-4-6 | 0.1 | primary | gpt-5.4 medium | Todo-list orchestrator | +| **Prometheus** | claude-opus-4-6 max | 0.1 | — | gpt-5.4 high → gemini-3.1-pro | Strategic planner (internal) | | **Sisyphus-Junior** | claude-sonnet-4-6 | 0.1 | all | user-configurable | Category-spawned executor | ## TOOL RESTRICTIONS @@ -70,7 +70,7 @@ const createXXXAgent: AgentFactory = (model: string) => ({ createXXXAgent.mode = "subagent" // or "primary" or "all" ``` -Model resolution: `AGENT_MODEL_REQUIREMENTS` in `shared/model-requirements.ts` defines fallback chains per agent. +Model resolution: 4-step: override → category-default → provider-fallback → system-default. Defined in `shared/model-requirements.ts`. ## MODES diff --git a/src/cli/AGENTS.md b/src/cli/AGENTS.md index 01abe527a..4ce8ddd4b 100644 --- a/src/cli/AGENTS.md +++ b/src/cli/AGENTS.md @@ -1,6 +1,6 @@ # src/cli/ — CLI: install, run, doctor, mcp-oauth -**Generated:** 2026-03-02 +**Generated:** 2026-03-06 ## OVERVIEW @@ -51,9 +51,9 @@ cli/ ## MODEL FALLBACK SYSTEM -Priority: Claude > OpenAI > Gemini > Copilot > OpenCode Zen > Z.ai > Kimi > big-pickle +No single global priority. CLI install-time resolution uses per-agent fallback chains from `model-fallback-requirements.ts`. -Agent-specific: librarian→ZAI, explore→Haiku/nano, hephaestus→requires OpenAI/Copilot +Common patterns: Claude/OpenAI/Gemini are preferred when an agent chain includes them, `librarian` prefers ZAI, `sisyphus` falls back through Kimi then GLM-5, and `hephaestus` requires OpenAI-compatible providers. ## DOCTOR CHECKS diff --git a/src/cli/config-manager/AGENTS.md b/src/cli/config-manager/AGENTS.md index 37f8c80b6..6fcd32550 100644 --- a/src/cli/config-manager/AGENTS.md +++ b/src/cli/config-manager/AGENTS.md @@ -1,6 +1,6 @@ # src/cli/config-manager/ — CLI Installation Utilities -**Generated:** 2026-03-02 +**Generated:** 2026-03-06 ## OVERVIEW diff --git a/src/cli/run/AGENTS.md b/src/cli/run/AGENTS.md index c81764a04..d15016d20 100644 --- a/src/cli/run/AGENTS.md +++ b/src/cli/run/AGENTS.md @@ -1,6 +1,6 @@ # src/cli/run/ — Non-Interactive Session Launcher -**Generated:** 2026-03-02 +**Generated:** 2026-03-06 ## OVERVIEW diff --git a/src/config/AGENTS.md b/src/config/AGENTS.md index 9b443d3c6..93c4afaf8 100644 --- a/src/config/AGENTS.md +++ b/src/config/AGENTS.md @@ -1,6 +1,6 @@ # src/config/ — Zod v4 Schema System -**Generated:** 2026-03-02 +**Generated:** 2026-03-06 ## OVERVIEW diff --git a/src/features/AGENTS.md b/src/features/AGENTS.md index 9a000826c..f0f6a51e6 100644 --- a/src/features/AGENTS.md +++ b/src/features/AGENTS.md @@ -1,6 +1,6 @@ # src/features/ — 19 Feature Modules -**Generated:** 2026-03-02 +**Generated:** 2026-03-06 ## OVERVIEW @@ -10,29 +10,29 @@ Standalone feature modules wired into plugin/ layer. Each is self-contained with | Module | Files | Complexity | Purpose | |--------|-------|------------|---------| -| **background-agent** | 49 | HIGH | Task lifecycle, concurrency (5/model), polling, spawner pattern | -| **tmux-subagent** | 27 | HIGH | Tmux pane management, grid planning, session orchestration | -| **opencode-skill-loader** | 25 | HIGH | YAML frontmatter skill loading from 4 scopes | -| **mcp-oauth** | 10 | HIGH | OAuth 2.0 + PKCE + DCR (RFC 7591) for MCP servers | -| **builtin-skills** | 10 | LOW | 6 skills: git-master, playwright, playwright-cli, agent-browser, dev-browser, frontend-ui-ux | -| **skill-mcp-manager** | 10 | MEDIUM | MCP client lifecycle per session (stdio + HTTP) | +| **opencode-skill-loader** | 33 | HIGH | YAML frontmatter skill loading from 4 scopes | +| **background-agent** | 31 | HIGH | Task lifecycle, concurrency (5/model), polling, spawner pattern | +| **tmux-subagent** | 30 | HIGH | Tmux pane management, grid planning, session orchestration | +| **mcp-oauth** | 18 | HIGH | OAuth 2.0 + PKCE + DCR (RFC 7591) for MCP servers | +| **builtin-skills** | 17 | LOW | 6 skills: git-master, playwright, playwright-cli, agent-browser, dev-browser, frontend-ui-ux | +| **skill-mcp-manager** | 12 | MEDIUM | MCP client lifecycle per session (stdio + HTTP) | | **claude-code-plugin-loader** | 10 | MEDIUM | Unified plugin discovery from .opencode/plugins/ | -| **builtin-commands** | 9 | LOW | Command templates: refactor, init-deep, handoff, etc. | -| **claude-code-mcp-loader** | 5 | MEDIUM | .mcp.json loading with ${VAR} env expansion | -| **context-injector** | 4 | MEDIUM | AGENTS.md/README.md injection into context | -| **boulder-state** | 4 | LOW | Persistent state for multi-step operations | -| **hook-message-injector** | 4 | MEDIUM | System message injection for hooks | -| **claude-tasks** | 4 | MEDIUM | Task schema + file storage + OpenCode todo sync | -| **task-toast-manager** | 3 | MEDIUM | Task progress notifications | -| **claude-code-agent-loader** | 3 | LOW | Load agents from .opencode/agents/ | -| **claude-code-command-loader** | 3 | LOW | Load commands from .opencode/commands/ | -| **claude-code-session-state** | 2 | LOW | Subagent session state tracking | +| **builtin-commands** | 11 | LOW | Command templates: refactor, init-deep, handoff, etc. | +| **claude-tasks** | 7 | MEDIUM | Task schema + file storage + OpenCode todo sync | +| **claude-code-mcp-loader** | 6 | MEDIUM | .mcp.json loading with ${VAR} env expansion | +| **context-injector** | 6 | MEDIUM | AGENTS.md/README.md injection into context | | **run-continuation-state** | 5 | LOW | Persistent state for `run` command continuation across sessions | -| **tool-metadata-store** | 2 | LOW | Tool execution metadata cache | +| **hook-message-injector** | 5 | MEDIUM | System message injection for hooks | +| **boulder-state** | 5 | LOW | Persistent state for multi-step operations | +| **task-toast-manager** | 4 | MEDIUM | Task progress notifications | +| **tool-metadata-store** | 3 | LOW | Tool execution metadata cache | +| **claude-code-session-state** | 3 | LOW | Subagent session state tracking | +| **claude-code-command-loader** | 3 | LOW | Load commands from .opencode/commands/ | +| **claude-code-agent-loader** | 3 | LOW | Load agents from .opencode/agents/ | ## KEY MODULES -### background-agent (49 files, ~10k LOC) +### background-agent (31 files, ~10k LOC) Core orchestration engine. `BackgroundManager` manages task lifecycle: - States: pending → running → completed/error/cancelled/interrupt @@ -40,7 +40,7 @@ Core orchestration engine. `BackgroundManager` manages task lifecycle: - Polling: 3s interval, completion via idle events + stability detection (10s unchanged) - spawner/: 8 focused files composing via `SpawnerContext` interface -### opencode-skill-loader (25 files, ~3.2k LOC) +### opencode-skill-loader (33 files, ~3.2k LOC) 4-scope skill discovery (project > opencode > user > global): - YAML frontmatter parsing from SKILL.md files @@ -48,7 +48,7 @@ Core orchestration engine. `BackgroundManager` manages task lifecycle: - Template resolution with variable substitution - Provider gating for model-specific skills -### tmux-subagent (27 files, ~3.6k LOC) +### tmux-subagent (30 files, ~3.6k LOC) State-first tmux integration: - `TmuxSessionManager`: pane lifecycle, grid planning diff --git a/src/features/background-agent/AGENTS.md b/src/features/background-agent/AGENTS.md index 615bb8e25..0f0fd7807 100644 --- a/src/features/background-agent/AGENTS.md +++ b/src/features/background-agent/AGENTS.md @@ -1,6 +1,6 @@ # src/features/background-agent/ — Core Orchestration Engine -**Generated:** 2026-03-02 +**Generated:** 2026-03-06 ## OVERVIEW diff --git a/src/features/claude-tasks/AGENTS.md b/src/features/claude-tasks/AGENTS.md index 9b444252f..4586cf230 100644 --- a/src/features/claude-tasks/AGENTS.md +++ b/src/features/claude-tasks/AGENTS.md @@ -1,6 +1,6 @@ # src/features/claude-tasks/ — Task Schema + Storage -**Generated:** 2026-03-02 +**Generated:** 2026-03-06 ## OVERVIEW diff --git a/src/features/mcp-oauth/AGENTS.md b/src/features/mcp-oauth/AGENTS.md index 237c62e12..1d243e0a5 100644 --- a/src/features/mcp-oauth/AGENTS.md +++ b/src/features/mcp-oauth/AGENTS.md @@ -1,6 +1,6 @@ # src/features/mcp-oauth/ — OAuth 2.0 + PKCE + DCR for MCP Servers -**Generated:** 2026-03-02 +**Generated:** 2026-03-06 ## OVERVIEW diff --git a/src/features/opencode-skill-loader/AGENTS.md b/src/features/opencode-skill-loader/AGENTS.md index 447366f0d..4da44ed19 100644 --- a/src/features/opencode-skill-loader/AGENTS.md +++ b/src/features/opencode-skill-loader/AGENTS.md @@ -1,6 +1,6 @@ # src/features/opencode-skill-loader/ — 4-Scope Skill Discovery -**Generated:** 2026-03-02 +**Generated:** 2026-03-06 ## OVERVIEW diff --git a/src/features/tmux-subagent/AGENTS.md b/src/features/tmux-subagent/AGENTS.md index 73119c9f2..9aa2be484 100644 --- a/src/features/tmux-subagent/AGENTS.md +++ b/src/features/tmux-subagent/AGENTS.md @@ -1,6 +1,6 @@ # src/features/tmux-subagent/ — Tmux Pane Management -**Generated:** 2026-03-02 +**Generated:** 2026-03-06 ## OVERVIEW diff --git a/src/hooks/AGENTS.md b/src/hooks/AGENTS.md index 277500af2..4a25ccb4b 100644 --- a/src/hooks/AGENTS.md +++ b/src/hooks/AGENTS.md @@ -1,6 +1,6 @@ # src/hooks/ — 46 Lifecycle Hooks -**Generated:** 2026-03-02 +**Generated:** 2026-03-06 ## OVERVIEW diff --git a/src/hooks/anthropic-context-window-limit-recovery/AGENTS.md b/src/hooks/anthropic-context-window-limit-recovery/AGENTS.md index 5da2ecf8f..e0dbdf693 100644 --- a/src/hooks/anthropic-context-window-limit-recovery/AGENTS.md +++ b/src/hooks/anthropic-context-window-limit-recovery/AGENTS.md @@ -1,6 +1,6 @@ # src/hooks/anthropic-context-window-limit-recovery/ — Multi-Strategy Context Recovery -**Generated:** 2026-03-02 +**Generated:** 2026-03-06 ## OVERVIEW diff --git a/src/hooks/atlas/AGENTS.md b/src/hooks/atlas/AGENTS.md index 63c9cc223..ef1efe739 100644 --- a/src/hooks/atlas/AGENTS.md +++ b/src/hooks/atlas/AGENTS.md @@ -1,6 +1,6 @@ # src/hooks/atlas/ — Master Boulder Orchestrator -**Generated:** 2026-03-02 +**Generated:** 2026-03-06 ## OVERVIEW diff --git a/src/hooks/claude-code-hooks/AGENTS.md b/src/hooks/claude-code-hooks/AGENTS.md index f9dd368bd..b1870b88b 100644 --- a/src/hooks/claude-code-hooks/AGENTS.md +++ b/src/hooks/claude-code-hooks/AGENTS.md @@ -1,6 +1,6 @@ # src/hooks/claude-code-hooks/ — Claude Code Compatibility -**Generated:** 2026-03-02 +**Generated:** 2026-03-06 ## OVERVIEW diff --git a/src/hooks/keyword-detector/AGENTS.md b/src/hooks/keyword-detector/AGENTS.md index 94b374b2b..8477df502 100644 --- a/src/hooks/keyword-detector/AGENTS.md +++ b/src/hooks/keyword-detector/AGENTS.md @@ -1,6 +1,6 @@ # src/hooks/keyword-detector/ — Mode Keyword Injection -**Generated:** 2026-03-02 +**Generated:** 2026-03-06 ## OVERVIEW diff --git a/src/hooks/ralph-loop/AGENTS.md b/src/hooks/ralph-loop/AGENTS.md index 4f94da682..679e6a578 100644 --- a/src/hooks/ralph-loop/AGENTS.md +++ b/src/hooks/ralph-loop/AGENTS.md @@ -1,6 +1,6 @@ # src/hooks/ralph-loop/ — Self-Referential Dev Loop -**Generated:** 2026-03-02 +**Generated:** 2026-03-06 ## OVERVIEW diff --git a/src/hooks/rules-injector/AGENTS.md b/src/hooks/rules-injector/AGENTS.md index f3767e222..a1c3b71ae 100644 --- a/src/hooks/rules-injector/AGENTS.md +++ b/src/hooks/rules-injector/AGENTS.md @@ -1,6 +1,6 @@ # src/hooks/rules-injector/ — Conditional Rules Injection -**Generated:** 2026-03-02 +**Generated:** 2026-03-06 ## OVERVIEW diff --git a/src/hooks/session-recovery/AGENTS.md b/src/hooks/session-recovery/AGENTS.md index ecd43ae61..9c35e7871 100644 --- a/src/hooks/session-recovery/AGENTS.md +++ b/src/hooks/session-recovery/AGENTS.md @@ -1,6 +1,6 @@ # src/hooks/session-recovery/ — Auto Session Error Recovery -**Generated:** 2026-03-02 +**Generated:** 2026-03-06 ## OVERVIEW diff --git a/src/hooks/todo-continuation-enforcer/AGENTS.md b/src/hooks/todo-continuation-enforcer/AGENTS.md index 132a16bfd..5df375c79 100644 --- a/src/hooks/todo-continuation-enforcer/AGENTS.md +++ b/src/hooks/todo-continuation-enforcer/AGENTS.md @@ -1,6 +1,6 @@ # src/hooks/todo-continuation-enforcer/ — Boulder Continuation Mechanism -**Generated:** 2026-03-02 +**Generated:** 2026-03-06 ## OVERVIEW diff --git a/src/mcp/AGENTS.md b/src/mcp/AGENTS.md index 9c728114e..acfe9d8ff 100644 --- a/src/mcp/AGENTS.md +++ b/src/mcp/AGENTS.md @@ -1,6 +1,6 @@ # src/mcp/ — 3 Built-in Remote MCPs -**Generated:** 2026-03-02 +**Generated:** 2026-03-06 ## OVERVIEW diff --git a/src/plugin-handlers/AGENTS.md b/src/plugin-handlers/AGENTS.md index 04265d5df..77fcb9a27 100644 --- a/src/plugin-handlers/AGENTS.md +++ b/src/plugin-handlers/AGENTS.md @@ -1,6 +1,6 @@ # src/plugin-handlers/ — 6-Phase Config Loading Pipeline -**Generated:** 2026-03-02 +**Generated:** 2026-03-06 ## OVERVIEW diff --git a/src/plugin/AGENTS.md b/src/plugin/AGENTS.md index d751a2fd1..d2a67a2ae 100644 --- a/src/plugin/AGENTS.md +++ b/src/plugin/AGENTS.md @@ -1,6 +1,6 @@ # src/plugin/ — 8 OpenCode Hook Handlers + Hook Composition -**Generated:** 2026-03-02 +**Generated:** 2026-03-06 ## OVERVIEW @@ -17,14 +17,13 @@ Core glue layer. 20 source files assembling the 8 OpenCode hook handlers and com | `tool-execute-after.ts` | `tool.execute.after` | Post-tool hooks (output truncation, comment checker, metadata) | | `messages-transform.ts` | `experimental.chat.messages.transform` | Context injection, thinking block validation | | `tool-registry.ts` | `tool` | 26 tools assembled from factories | +| `chat-headers.ts` | `chat.headers` | Copilot x-initiator header injection | | `skill-context.ts` | — | Skill/browser/category context for tool creation | ## HOOK COMPOSITION (hooks/ subdir) | File | Tier | Count | |------|------|-------| -| `create-session-hooks.ts` | Session | 21 | -| `create-tool-guard-hooks.ts` | Tool Guard | 10 | | `create-session-hooks.ts` | Session | 23 | | `create-tool-guard-hooks.ts` | Tool Guard | 10 | | `create-skill-hooks.ts` | Skill | 2 | @@ -42,6 +41,7 @@ Core glue layer. 20 source files assembling the 8 OpenCode hook handlers and com | `types.ts` | `PluginContext`, `PluginInterface`, `ToolsRecord`, `TmuxConfig` | | `ultrawork-model-override.ts` | Ultrawork mode model override logic | | `ultrawork-db-model-override.ts` | DB-level model override for ultrawork | +| `config-handler.ts` | Runtime config loading and caching | ## KEY PATTERNS diff --git a/src/shared/AGENTS.md b/src/shared/AGENTS.md index 18bd85fee..eb8978f0f 100644 --- a/src/shared/AGENTS.md +++ b/src/shared/AGENTS.md @@ -1,6 +1,6 @@ # src/shared/ — 95+ Utility Files in 13 Categories -**Generated:** 2026-03-02 +**Generated:** 2026-03-06 ## OVERVIEW diff --git a/src/tools/AGENTS.md b/src/tools/AGENTS.md index 48c992383..b03dc5bbe 100644 --- a/src/tools/AGENTS.md +++ b/src/tools/AGENTS.md @@ -1,6 +1,6 @@ # src/tools/ — 26 Tools Across 15 Directories -**Generated:** 2026-03-02 +**Generated:** 2026-03-06 ## OVERVIEW @@ -35,7 +35,7 @@ | Tool | Factory | Parameters | |------|---------|------------| -| `background_output` | `createBackgroundOutput` | task_id, block, timeout, full_session, include_thinking, message_limit | +| `background_output` | `createBackgroundOutput` | task_id, block, timeout, full_session, include_thinking, message_limit, since_message_id, thinking_max_chars | | `background_cancel` | `createBackgroundCancel` | taskId, all | ### LSP Refactoring (6) — Direct ToolDefinition @@ -97,7 +97,7 @@ | artistry | gemini-3.1-pro high | Creative approaches | | quick | claude-haiku-4-5 | Trivial tasks | | unspecified-low | claude-sonnet-4-6 | Moderate effort | -| unspecified-high | claude-opus-4-6 max | High effort | +| unspecified-high | gpt-5.4 high | High effort | | writing | kimi-k2p5 | Documentation | ## HOW TO ADD A TOOL diff --git a/src/tools/background-task/AGENTS.md b/src/tools/background-task/AGENTS.md index 32285831b..1c478b4b4 100644 --- a/src/tools/background-task/AGENTS.md +++ b/src/tools/background-task/AGENTS.md @@ -1,6 +1,6 @@ # src/tools/background-task/ — Background Task Tool Wrappers -**Generated:** 2026-03-02 +**Generated:** 2026-03-06 ## OVERVIEW diff --git a/src/tools/call-omo-agent/AGENTS.md b/src/tools/call-omo-agent/AGENTS.md index 1b551f304..8a8d4ba96 100644 --- a/src/tools/call-omo-agent/AGENTS.md +++ b/src/tools/call-omo-agent/AGENTS.md @@ -1,6 +1,6 @@ # src/tools/call-omo-agent/ — Direct Agent Invocation Tool -**Generated:** 2026-03-02 +**Generated:** 2026-03-06 ## OVERVIEW diff --git a/src/tools/delegate-task/AGENTS.md b/src/tools/delegate-task/AGENTS.md index 8adeedfa5..5dbbb0aac 100644 --- a/src/tools/delegate-task/AGENTS.md +++ b/src/tools/delegate-task/AGENTS.md @@ -1,10 +1,10 @@ # src/tools/delegate-task/ — Task Delegation Engine -**Generated:** 2026-03-02 +**Generated:** 2026-03-06 ## OVERVIEW -41 files. The `task` tool implementation — delegates work to subagents via background or sync sessions. Resolves categories, models, skills, and manages both async and synchronous execution flows. +49 files. The `task` tool implementation — delegates work to subagents via background or sync sessions. Resolves categories, models, skills, and manages both async and synchronous execution flows. 8+ built-in categories. ## TWO EXECUTION MODES diff --git a/src/tools/hashline-edit/AGENTS.md b/src/tools/hashline-edit/AGENTS.md index 0eb4a8233..b640ac460 100644 --- a/src/tools/hashline-edit/AGENTS.md +++ b/src/tools/hashline-edit/AGENTS.md @@ -1,6 +1,6 @@ # src/tools/hashline-edit/ — Hash-Anchored File Edit Tool -**Generated:** 2026-03-02 +**Generated:** 2026-03-06 ## OVERVIEW diff --git a/src/tools/lsp/AGENTS.md b/src/tools/lsp/AGENTS.md index ff43d92e0..7649996fa 100644 --- a/src/tools/lsp/AGENTS.md +++ b/src/tools/lsp/AGENTS.md @@ -1,10 +1,10 @@ # src/tools/lsp/ — LSP Tool Implementations -**Generated:** 2026-03-02 +**Generated:** 2026-03-06 ## OVERVIEW -32 files. Full LSP (Language Server Protocol) client stack exposed as 6 tools. Custom implementation that manages server processes, opens files, and forwards requests — does NOT delegate to OpenCode's built-in LSP. +33 files. Full LSP (Language Server Protocol) client stack exposed as 6 tools. Custom implementation that manages server processes, opens files, and forwards requests — does NOT delegate to OpenCode's built-in LSP. ## TOOL EXPOSURE