docs: extract Features section to docs/features.md
- Create docs/features.md with full Features documentation - Update README.md with compact summary and link to docs - Update README.ja.md with localized compact summary - Update README.zh-cn.md with localized compact summary - Remove 831 lines of duplicated content across READMEs
This commit is contained in:
271
README.ja.md
271
README.ja.md
@@ -122,20 +122,6 @@
|
|||||||
- [複雑すぎますか?](#複雑すぎますか)
|
- [複雑すぎますか?](#複雑すぎますか)
|
||||||
- [アンインストール](#アンインストール)
|
- [アンインストール](#アンインストール)
|
||||||
- [機能](#機能)
|
- [機能](#機能)
|
||||||
- [Agents: あなたの新しいチームメイト](#agents-あなたの新しいチームメイト)
|
|
||||||
- [バックグラウンドエージェント: 本当のチームのように働く](#バックグラウンドエージェント-本当のチームのように働く)
|
|
||||||
- [ツール: 同僚にはもっと良い道具を](#ツール-同僚にはもっと良い道具を)
|
|
||||||
- [なぜあなただけ IDE を使っているのですか?](#なぜあなただけ-ide-を使っているのですか)
|
|
||||||
- [セッション管理](#セッション管理)
|
|
||||||
- [Context Is All You Need](#context-is-all-you-need)
|
|
||||||
- [マルチモーダルを活用し、トークンは節約する](#マルチモーダルを活用しトークンは節約する)
|
|
||||||
- [止まらないエージェントループ](#止まらないエージェントループ)
|
|
||||||
- [Claude Code 互換性: さらば Claude Code、ようこそ OpenCode](#claude-code-互換性-さらば-claude-codeようこそ-opencode)
|
|
||||||
- [Hooks 統合](#hooks-統合)
|
|
||||||
- [設定ローダー](#設定ローダー)
|
|
||||||
- [データストレージ](#データストレージ)
|
|
||||||
- [互換性トグル](#互換性トグル)
|
|
||||||
- [エージェントのためだけでなく、あなたのために](#エージェントのためだけでなくあなたのために)
|
|
||||||
- [設定](#設定)
|
- [設定](#設定)
|
||||||
- [JSONC のサポート](#jsonc-のサポート)
|
- [JSONC のサポート](#jsonc-のサポート)
|
||||||
- [Google Auth](#google-auth)
|
- [Google Auth](#google-auth)
|
||||||
@@ -497,253 +483,18 @@ oh-my-opencode を削除するには:
|
|||||||
|
|
||||||
## 機能
|
## 機能
|
||||||
|
|
||||||
### Agents: あなたの新しいチームメイト
|
当然あるべきだと思う機能がたくさんあります。一度体験したら、もう以前には戻れません。
|
||||||
|
詳細は [Features Documentation](docs/features.md) を参照してください。
|
||||||
|
|
||||||
- **Sisyphus** (`anthropic/claude-opus-4-5`): **デフォルトエージェントです。** OpenCode のための強力な AI オーケストレーターです。専門のサブエージェントを活用して、複雑なタスクを計画、委任、実行します。バックグラウンドタスクへの委任と Todo ベースのワークフローを重視します。最大の推論能力を発揮するため、Claude Opus 4.5 と拡張思考 (32k token budget) を使用します。
|
**概要:**
|
||||||
- **oracle** (`openai/gpt-5.2`): アーキテクチャ、コードレビュー、戦略立案のための専門アドバイザー。GPT-5.2 の卓越した論理的推論と深い分析能力を活用します。AmpCode からインスピレーションを得ました。
|
- **エージェント**: Sisyphus(メインエージェント)、Prometheus(プランナー)、Oracle(アーキテクチャ/デバッグ)、Librarian(ドキュメント/コード検索)、Explore(高速コードベース grep)、Frontend Engineer(UI/UX)、Document Writer、Multimodal Looker
|
||||||
- **librarian** (`opencode/glm-4.7-free`): マルチリポジトリ分析、ドキュメント検索、実装例の調査を担当。GLM-4.7 Free を使用して、深いコードベース理解と GitHub リサーチ、根拠に基づいた回答を提供します。AmpCode からインスピレーションを得ました。
|
- **バックグラウンドエージェント**: 本物の開発チームのように複数エージェントを並列実行
|
||||||
- **explore** (`opencode/grok-code`、`google/gemini-3-flash`、または `anthropic/claude-haiku-4-5`): 高速なコードベース探索、ファイルパターンマッチング。Antigravity 認証が設定されている場合は Gemini 3 Flash を使用し、Claude max20 が利用可能な場合は Haiku を使用し、それ以外は Grok を使います。Claude Code からインスピレーションを得ました。
|
- **LSP & AST ツール**: リファクタリング、リネーム、診断、AST 認識コード検索
|
||||||
- **frontend-ui-ux-engineer** (`google/gemini-3-pro-preview`): 開発者に転身したデザイナーという設定です。素晴らしい UI を作ります。美しく独創的な UI コードを生成することに長けた Gemini を使用します。
|
- **コンテキスト注入**: AGENTS.md、README.md、条件付きルールの自動注入
|
||||||
- **document-writer** (`google/gemini-3-pro-preview`): テクニカルライティングの専門家という設定です。Gemini は文筆家であり、流れるような文章を書きます。
|
- **Claude Code 互換性**: 完全なフックシステム、コマンド、スキル、エージェント、MCP
|
||||||
- **multimodal-looker** (`google/gemini-3-flash`): 視覚コンテンツ解釈のための専門エージェント。PDF、画像、図表を分析して情報を抽出します。
|
- **内蔵 MCP**: websearch (Exa)、context7 (ドキュメント)、grep_app (GitHub 検索)
|
||||||
|
- **セッションツール**: セッション履歴の一覧、読み取り、検索、分析
|
||||||
メインエージェントはこれらを自動的に呼び出しますが、明示的に呼び出すことも可能です:
|
- **生産性機能**: Ralph Loop、Todo Enforcer、Comment Checker、Think Mode など
|
||||||
|
|
||||||
```
|
|
||||||
Ask @oracle to review this design and propose an architecture
|
|
||||||
(@oracle にこの設計をレビューさせ、アーキテクチャを提案させて)
|
|
||||||
Ask @librarian how this is implemented—why does the behavior keep changing?
|
|
||||||
(@librarian にこれがどう実装されているか聞いて、なぜ挙動が変わり続けるのか教えて)
|
|
||||||
Ask @explore for the policy on this feature
|
|
||||||
(@explore にこの機能のポリシーを聞いて)
|
|
||||||
```
|
|
||||||
|
|
||||||
エージェントのモデル、プロンプト、権限は `oh-my-opencode.json` でカスタマイズ可能です。詳細は [設定](#設定) を参照してください。
|
|
||||||
|
|
||||||
### バックグラウンドエージェント: 本当のチームのように働く
|
|
||||||
|
|
||||||
上記のエージェントたちを、一瞬たりとも休ませることなく働かせられたらどうでしょうか?
|
|
||||||
|
|
||||||
- GPT にデバッグさせておいて、Claude が別のアプローチで根本原因を探るワークフロー
|
|
||||||
- Gemini がフロントエンドを書いている間に、Claude がバックエンドを書くワークフロー
|
|
||||||
- 大量の並列探索を開始し、その部分は一旦置いておいて実装を進め、探索結果が出たらそれを使って仕上げるワークフロー
|
|
||||||
|
|
||||||
これらのワークフローが OhMyOpenCode では可能です。
|
|
||||||
|
|
||||||
サブエージェントをバックグラウンドで実行できます。メインエージェントはタスクが完了すると通知を受け取ります。必要であれば結果を待つこともできます。
|
|
||||||
|
|
||||||
**エージェントが、あなたのチームのように働くようにしましょう。**
|
|
||||||
|
|
||||||
### ツール: 同僚にはもっと良い道具を
|
|
||||||
|
|
||||||
#### なぜあなただけ IDE を使っているのですか?
|
|
||||||
|
|
||||||
シンタックスハイライト、自動補完、リファクタリング、ナビゲーション、分析…そして今やエージェントがコードを書く時代です。
|
|
||||||
|
|
||||||
**なぜあなただけがそれらのツールを使っているのですか?**
|
|
||||||
**エージェントにそれらを使わせれば、彼らはレベルアップします。**
|
|
||||||
|
|
||||||
[OpenCode は LSP を提供していますが](https://opencode.ai/docs/lsp/)、あくまで分析用です。
|
|
||||||
|
|
||||||
あなたがエディタで使っているその機能、他のエージェントは触ることができません。
|
|
||||||
最高の同僚に最高の道具を渡してください。これでリファクタリングも、ナビゲーションも、分析も、エージェントが適切に行えるようになります。
|
|
||||||
|
|
||||||
- **lsp_diagnostics**: ビルド前にエラー/警告を取得
|
|
||||||
- **lsp_prepare_rename**: 名前変更操作の検証
|
|
||||||
- **lsp_rename**: ワークスペース全体でシンボル名を変更
|
|
||||||
- **ast_grep_search**: AST 認識コードパターン検索 (25言語対応)
|
|
||||||
- **ast_grep_replace**: AST 認識コード置換
|
|
||||||
|
|
||||||
#### セッション管理
|
|
||||||
|
|
||||||
OpenCode セッション履歴をナビゲートおよび検索するためのツール:
|
|
||||||
|
|
||||||
- **session_list**: 日付およびリミットでフィルタリングしながらすべての OpenCode セッションを一覧表示
|
|
||||||
- **session_read**: 特定のセッションからメッセージと履歴を読み取る
|
|
||||||
- **session_search**: セッションメッセージ全体を全文検索
|
|
||||||
- **session_info**: セッションに関するメタデータと統計情報を取得
|
|
||||||
|
|
||||||
これらのツールにより、エージェントは以前の会話を参照し、セッション間の継続性を維持できます。
|
|
||||||
|
|
||||||
- **call_omo_agent**: 専門的な explore/librarian エージェントを起動。非同期実行のための `run_in_background` パラメータをサポート。
|
|
||||||
|
|
||||||
#### Context Is All You Need
|
|
||||||
- **Directory AGENTS.md / README.md Injector**: ファイルを読み込む際、`AGENTS.md` と `README.md` の内容を自動的に注入します。ファイルディレクトリからプロジェクトルートまで遡り、パス上の **すべて** の `AGENTS.md` ファイルを収集します。ネストされたディレクトリごとの指示をサポートします:
|
|
||||||
```
|
|
||||||
project/
|
|
||||||
├── AGENTS.md # プロジェクト全体のコンテキスト
|
|
||||||
├── src/
|
|
||||||
│ ├── AGENTS.md # src 専用コンテキスト
|
|
||||||
│ └── components/
|
|
||||||
│ ├── AGENTS.md # コンポーネント専用コンテキスト
|
|
||||||
│ └── Button.tsx # このファイルを読むと上記3つの AGENTS.md がすべて注入される
|
|
||||||
```
|
|
||||||
`Button.tsx` を読むと、順序通りに注入されます:`project/AGENTS.md` → `src/AGENTS.md` → `components/AGENTS.md`。各ディレクトリのコンテキストはセッションごとに一度だけ注入されます。
|
|
||||||
- **Conditional Rules Injector**: すべてのルールが常に必要なわけではありません。条件に一致する場合にのみ、`.claude/rules/` ディレクトリからルールを注入します。
|
|
||||||
- ファイルディレクトリからプロジェクトルートまで上方向に探索し、`~/.claude/rules/` (ユーザー) パスも含みます。
|
|
||||||
- `.md` および `.mdc` ファイルをサポートします。
|
|
||||||
- Frontmatter の `globs` フィールド(glob パターン)に基づいてマッチングします。
|
|
||||||
- 常に適用されるべきルールのために `alwaysApply: true` オプションをサポートします。
|
|
||||||
- ルールファイルの例:
|
|
||||||
```markdown
|
|
||||||
---
|
|
||||||
globs: ["*.ts", "src/**/*.js"]
|
|
||||||
description: "TypeScript/JavaScript coding rules"
|
|
||||||
---
|
|
||||||
- Use PascalCase for interface names
|
|
||||||
- Use camelCase for function names
|
|
||||||
```
|
|
||||||
- **Online**: プロジェクトのルールがすべてではありません。拡張機能のための内蔵 MCP を提供します:
|
|
||||||
- **context7**: ライブラリの最新公式ドキュメントを取得
|
|
||||||
- **grep_app**: 数百万の公開 GitHub リポジトリから超高速コード検索(実装例を探すのに最適)
|
|
||||||
|
|
||||||
#### マルチモーダルを活用し、トークンは節約する
|
|
||||||
|
|
||||||
AmpCode からインスピレーションを受けた look_at ツールを、OhMyOpenCode でも提供します。
|
|
||||||
エージェントが巨大なファイルを直接読んでコンテキストを浪費する代わりに、内部的に別のエージェントを活用して必要な情報だけを抽出します。
|
|
||||||
|
|
||||||
#### 止まらないエージェントループ
|
|
||||||
- 内蔵 grep、glob ツールを置き換えます。デフォルトの実装にはタイムアウトがなく、無限にハングする可能性があります。
|
|
||||||
|
|
||||||
|
|
||||||
### Claude Code 互換性: さらば Claude Code、ようこそ OpenCode
|
|
||||||
|
|
||||||
Oh My OpenCode には Claude Code 互換レイヤーが存在します。
|
|
||||||
Claude Code を使用していた場合、既存の設定がそのまま動作します。
|
|
||||||
|
|
||||||
#### Hooks 統合
|
|
||||||
|
|
||||||
Claude Code の `settings.json` フックシステムを通じてカスタムスクリプトを実行します。
|
|
||||||
Oh My OpenCode は以下の場所からフックを読み込んで実行します:
|
|
||||||
|
|
||||||
- `~/.claude/settings.json` (ユーザー)
|
|
||||||
- `./.claude/settings.json` (プロジェクト)
|
|
||||||
- `./.claude/settings.local.json` (ローカル、git-ignored)
|
|
||||||
|
|
||||||
サポートされるフックイベント:
|
|
||||||
- **PreToolUse**: ツール実行前に実行。ブロックしたり、ツール入力を修正したりできます。
|
|
||||||
- **PostToolUse**: ツール実行後に実行。警告やコンテキストを追加できます。
|
|
||||||
- **UserPromptSubmit**: ユーザーがプロンプトを送信した時に実行。ブロックしたり、メッセージを注入したりできます。
|
|
||||||
- **Stop**: セッションがアイドル状態になった時に実行。フォローアップのプロンプトを注入できます。
|
|
||||||
|
|
||||||
`settings.json` の例:
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"hooks": {
|
|
||||||
"PostToolUse": [
|
|
||||||
{
|
|
||||||
"matcher": "Write|Edit",
|
|
||||||
"hooks": [{ "type": "command", "command": "eslint --fix $FILE" }]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
#### 設定ローダー
|
|
||||||
|
|
||||||
**Command Loader**: 4つのディレクトリからマークダウンベースのスラッシュコマンドをロードします:
|
|
||||||
- `~/.claude/commands/` (ユーザー)
|
|
||||||
- `./.claude/commands/` (プロジェクト)
|
|
||||||
- `~/.config/opencode/command/` (opencode グローバル)
|
|
||||||
- `./.opencode/command/` (opencode プロジェクト)
|
|
||||||
|
|
||||||
**Skill Loader**: `SKILL.md` があるディレクトリベースのスキルをロードします:
|
|
||||||
- `~/.claude/skills/` (ユーザー)
|
|
||||||
- `./.claude/skills/` (プロジェクト)
|
|
||||||
|
|
||||||
**Agent Loader**: マークダウンファイルからカスタムエージェント定義をロードします:
|
|
||||||
- `~/.claude/agents/*.md` (ユーザー)
|
|
||||||
- `./.claude/agents/*.md` (プロジェクト)
|
|
||||||
|
|
||||||
**MCP Loader**: `.mcp.json` ファイルから MCP サーバー設定をロードします:
|
|
||||||
- `~/.claude/.mcp.json` (ユーザー)
|
|
||||||
- `./.mcp.json` (プロジェクト)
|
|
||||||
- `./.claude/.mcp.json` (ローカル)
|
|
||||||
- 環境変数展開をサポート (`${VAR}` 構文)
|
|
||||||
|
|
||||||
#### データストレージ
|
|
||||||
|
|
||||||
**Todo 管理**: セッションの Todo が `~/.claude/todos/` に Claude Code 互換形式で保存されます。
|
|
||||||
|
|
||||||
**Transcript**: セッションのアクティビティが `~/.claude/transcripts/` に JSONL 形式で記録され、再生や分析が可能です。
|
|
||||||
|
|
||||||
#### 互換性トグル
|
|
||||||
|
|
||||||
特定の Claude Code 互換機能を無効にするには、`claude_code` 設定オブジェクトを使用できます:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"claude_code": {
|
|
||||||
"mcp": false,
|
|
||||||
"commands": false,
|
|
||||||
"skills": false,
|
|
||||||
"agents": false,
|
|
||||||
"hooks": false,
|
|
||||||
"plugins": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
| トグル | `false` の場合、ロードが無効になるパス | 影響を受けないもの |
|
|
||||||
| ---------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------- |
|
|
||||||
| `mcp` | `~/.claude/.mcp.json`, `./.mcp.json`, `./.claude/.mcp.json` | 内蔵 MCP (context7, grep_app) |
|
|
||||||
| `commands` | `~/.claude/commands/*.md`, `./.claude/commands/*.md` | `~/.config/opencode/command/`, `./.opencode/command/` |
|
|
||||||
| `skills` | `~/.claude/skills/*/SKILL.md`, `./.claude/skills/*/SKILL.md` | - |
|
|
||||||
| `agents` | `~/.claude/agents/*.md`, `./.claude/agents/*.md` | 内蔵エージェント (oracle, librarian 等) |
|
|
||||||
| `hooks` | `~/.claude/settings.json`, `./.claude/settings.json`, `./.claude/settings.local.json` | - |
|
|
||||||
| `plugins` | `~/.claude/plugins/` (Claude Code マーケットプレイスプラグイン) | - |
|
|
||||||
|
|
||||||
すべてのトグルはデフォルトで `true` (有効) です。完全な Claude Code 互換性を望む場合は `claude_code` オブジェクトを省略してください。
|
|
||||||
|
|
||||||
**特定のプラグインだけを無効化** するには `plugins_override` を使用します:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"claude_code": {
|
|
||||||
"plugins_override": {
|
|
||||||
"claude-mem@thedotmack": false,
|
|
||||||
"some-other-plugin@marketplace": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
プラグインシステム自体は有効にしたまま、特定のプラグインだけをその完全な識別子 (`plugin-name@marketplace-name`) で無効化できます。
|
|
||||||
|
|
||||||
### エージェントのためだけでなく、あなたのために
|
|
||||||
|
|
||||||
エージェントが活躍すれば、あなたも幸せになります。ですが、私はあなた自身も助けたいのです。
|
|
||||||
|
|
||||||
- **Ralph Loop**: タスクが完了するまで実行し続ける自己参照型開発ループ。Anthropic の Ralph Wiggum プラグインにインスパイアされています。**すべてのプログラミング言語をサポート。**
|
|
||||||
- `/ralph-loop "REST API を構築"` で開始するとエージェントが継続的に作業します
|
|
||||||
- `<promise>DONE</promise>` の出力で完了を検知
|
|
||||||
- 完了プロミスなしで停止すると自動再開
|
|
||||||
- 終了条件: 完了検知、最大反復回数到達(デフォルト 100)、または `/cancel-ralph`
|
|
||||||
- `oh-my-opencode.json` で設定: `{ "ralph_loop": { "enabled": true, "default_max_iterations": 100 } }`
|
|
||||||
- **Keyword Detector**: プロンプト内のキーワードを自動検知して専門モードを有効化します:
|
|
||||||
- `ultrawork` / `ulw`: 並列エージェントオーケストレーションによる最大パフォーマンスモード
|
|
||||||
- `search` / `find` / `찾아` / `検索`: 並列 explore/librarian エージェントによる検索最大化
|
|
||||||
- `analyze` / `investigate` / `분석` / `調査`: 多段階の専門家相談による深層分析モード
|
|
||||||
- **Todo Continuation Enforcer**: エージェントが停止する前にすべての TODO 項目を完了するように強制します。LLM の「中途半端に終わる」癖を防止します。
|
|
||||||
- **Comment Checker**: 学習データの影響でしょうか、LLM はコメントが多すぎます。無駄なコメントを書かないようリマインドします。BDD パターン、指示子、docstring などの有効なコメントは賢く除外し、それ以外のコメントについては正当性を求め、クリーンなコードを維持させます。
|
|
||||||
- **Think Mode**: 拡張思考 (Extended Thinking) が必要な状況を自動検知してモードを切り替えます。「深く考えて (think deeply)」「ultrathink」といった表現を検知すると、推論能力を最大化するようモデル設定を動的に調整します。
|
|
||||||
- **Context Window Monitor**: [Context Window Anxiety Management](https://agentic-patterns.com/patterns/context-window-anxiety-management/) パターンを実装しています。
|
|
||||||
- 使用率が 70% を超えると、まだ余裕があることをエージェントにリマインドし、焦って雑な仕事をすることを防ぎます。
|
|
||||||
- **Agent Usage Reminder**: 検索ツールを直接呼び出す際、バックグラウンドタスクを通じた専門エージェントの活用を推奨するリマインダーを表示します。
|
|
||||||
- **Anthropic Auto Compact**: Claude モデルがトークン制限に達すると、自動的にセッションを要約・圧縮します。手動での介入は不要です。
|
|
||||||
- **Session Recovery**: セッションエラー(ツールの結果欠落、thinking ブロックの問題、空のメッセージなど)から自動復旧します。セッションが途中でクラッシュすることはありません。もしクラッシュしても復旧します。
|
|
||||||
- **Auto Update Checker**: oh-my-opencode の新バージョンを自動でチェックし、設定を自動更新できます。現在のバージョンと Sisyphus ステータスを表示する起動トースト通知を表示します(Sisyphus 有効時は「Sisyphus on steroids is steering OpenCode」、無効時は「OpenCode is now on Steroids. oMoMoMoMo...」)。全機能を無効化するには `disabled_hooks` に `"auto-update-checker"` を、トースト通知のみ無効化するには `"startup-toast"` を追加してください。[設定 > フック](#フック) 参照。
|
|
||||||
- **Background Notification**: バックグラウンドエージェントのタスクが完了すると通知を受け取ります。
|
|
||||||
- **Session Notification**: エージェントがアイドル状態になると OS 通知を送ります。macOS、Linux、Windows で動作します—エージェントが入力を待っている時を見逃しません。
|
|
||||||
- **Empty Task Response Detector**: Task ツールが空の応答を返すと検知します。既に空の応答が返ってきているのに、いつまでも待ち続ける状況を防ぎます。
|
|
||||||
- **Empty Message Sanitizer**: 空のチャットメッセージによるAPIエラーを防止します。送信前にメッセージ内容を自動的にサニタイズします。
|
|
||||||
- **Grep Output Truncator**: grep は山のようなテキストを返すことがあります。残りのコンテキストウィンドウに応じて動的に出力を切り詰めます—50% の余裕を維持し、最大 50k トークンに制限します。
|
|
||||||
- **Tool Output Truncator**: 同じ考え方をより広範囲に適用します。Grep、Glob、LSP ツール、AST-grep の出力を切り詰めます。一度の冗長な検索がコンテキスト全体を食いつぶすのを防ぎます。
|
|
||||||
- **Preemptive Compaction**: トークン制限に達する前にセッションを事前にコンパクションします。コンテキストウィンドウ使用率85%で実行されます。**デフォルトで有効。** `disabled_hooks: ["preemptive-compaction"]`で無効化できます。
|
|
||||||
- **Compaction Context Injector**: セッションコンパクション中に重要なコンテキスト(AGENTS.md、現在のディレクトリ情報)を保持し、重要な状態を失わないようにします。
|
|
||||||
- **Thinking Block Validator**: thinking ブロックを検証し、適切なフォーマットを確保し、不正な thinking コンテンツによる API エラーを防ぎます。
|
|
||||||
- **Claude Code Hooks**: Claude Code の settings.json からフックを実行します - これは PreToolUse/PostToolUse/UserPromptSubmit/Stop フックを実行する互換性レイヤーです。
|
|
||||||
|
|
||||||
## 設定
|
## 設定
|
||||||
|
|
||||||
|
|||||||
304
README.md
304
README.md
@@ -43,7 +43,7 @@ Yes, technically possible. But I cannot recommend using it.
|
|||||||
## FULL
|
## FULL
|
||||||
|
|
||||||
> As of January 2026, Anthropic has restricted third-party OAuth access citing ToS violations.
|
> As of January 2026, Anthropic has restricted third-party OAuth access citing ToS violations.
|
||||||
>
|
>
|
||||||
> [**Anthropic has cited this project, oh-my-opencode as justification for blocking opencode.**](https://x.com/thdxr/status/2010149530486911014)
|
> [**Anthropic has cited this project, oh-my-opencode as justification for blocking opencode.**](https://x.com/thdxr/status/2010149530486911014)
|
||||||
>
|
>
|
||||||
> Indeed, some plugins that spoof Claude Code's oauth request signatures exist in the community.
|
> Indeed, some plugins that spoof Claude Code's oauth request signatures exist in the community.
|
||||||
@@ -99,6 +99,8 @@ Yes, technically possible. But I cannot recommend using it.
|
|||||||
## Contents
|
## Contents
|
||||||
|
|
||||||
- [Claude OAuth Access Notice](#claude-oauth-access-notice)
|
- [Claude OAuth Access Notice](#claude-oauth-access-notice)
|
||||||
|
- [TL;DR](#tldr)
|
||||||
|
- [FULL](#full)
|
||||||
- [Reviews](#reviews)
|
- [Reviews](#reviews)
|
||||||
- [Contents](#contents)
|
- [Contents](#contents)
|
||||||
- [Oh My OpenCode](#oh-my-opencode)
|
- [Oh My OpenCode](#oh-my-opencode)
|
||||||
@@ -130,21 +132,6 @@ Yes, technically possible. But I cannot recommend using it.
|
|||||||
- [Too Complicated?](#too-complicated)
|
- [Too Complicated?](#too-complicated)
|
||||||
- [Uninstallation](#uninstallation)
|
- [Uninstallation](#uninstallation)
|
||||||
- [Features](#features)
|
- [Features](#features)
|
||||||
- [Agents: Your Teammates](#agents-your-teammates)
|
|
||||||
- [Background Agents: Work Like a Team](#background-agents-work-like-a-team)
|
|
||||||
- [The Tools: Your Teammates Deserve Better](#the-tools-your-teammates-deserve-better)
|
|
||||||
- [Why Are You the Only One Using an IDE?](#why-are-you-the-only-one-using-an-ide)
|
|
||||||
- [Session Management](#session-management)
|
|
||||||
- [Context Is All You Need](#context-is-all-you-need)
|
|
||||||
- [Be Multimodal. Save Tokens.](#be-multimodal-save-tokens)
|
|
||||||
- [I Removed Their Blockers](#i-removed-their-blockers)
|
|
||||||
- [Skill-Embedded MCP Support](#skill-embedded-mcp-support)
|
|
||||||
- [Goodbye Claude Code. Hello Oh My OpenCode.](#goodbye-claude-code-hello-oh-my-opencode)
|
|
||||||
- [Hooks Integration](#hooks-integration)
|
|
||||||
- [Config Loaders](#config-loaders)
|
|
||||||
- [Data Storage](#data-storage)
|
|
||||||
- [Compatibility Toggles](#compatibility-toggles)
|
|
||||||
- [Not Just for the Agents](#not-just-for-the-agents)
|
|
||||||
- [Configuration](#configuration)
|
- [Configuration](#configuration)
|
||||||
- [JSONC Support](#jsonc-support)
|
- [JSONC Support](#jsonc-support)
|
||||||
- [Google Auth](#google-auth)
|
- [Google Auth](#google-auth)
|
||||||
@@ -163,7 +150,6 @@ Yes, technically possible. But I cannot recommend using it.
|
|||||||
- [Author's Note](#authors-note)
|
- [Author's Note](#authors-note)
|
||||||
- [Warnings](#warnings)
|
- [Warnings](#warnings)
|
||||||
- [Loved by professionals at](#loved-by-professionals-at)
|
- [Loved by professionals at](#loved-by-professionals-at)
|
||||||
- [Sponsors](#sponsors)
|
|
||||||
|
|
||||||
# Oh My OpenCode
|
# Oh My OpenCode
|
||||||
|
|
||||||
@@ -527,274 +513,20 @@ To remove oh-my-opencode:
|
|||||||
# Plugin should no longer be loaded
|
# Plugin should no longer be loaded
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
### Agents: Your Teammates
|
We have lots of features that you'll think should obviously exist, and once you experience them, you'll never be able to go back to how things were before.
|
||||||
|
See the full [Features Documentation](docs/features.md) for detailed information.
|
||||||
|
|
||||||
- **Sisyphus** (`anthropic/claude-opus-4-5`): **The default agent.** A powerful AI orchestrator for OpenCode. Plans, delegates, and executes complex tasks using specialized subagents with aggressive parallel execution. Emphasizes background task delegation and todo-driven workflow. Uses Claude Opus 4.5 with extended thinking (32k budget) for maximum reasoning capability.
|
**Quick Overview:**
|
||||||
- **oracle** (`openai/gpt-5.2`): Architecture, code review, strategy. Uses GPT-5.2 for its stellar logical reasoning and deep analysis. Inspired by AmpCode.
|
- **Agents**: Sisyphus (the main agent), Prometheus (planner), Oracle (architecture/debugging), Librarian (docs/code search), Explore (fast codebase grep), Frontend Engineer (UI/UX), Document Writer, Multimodal Looker
|
||||||
- **librarian** (`opencode/glm-4.7-free`): Multi-repo analysis, doc lookup, implementation examples. Uses GLM-4.7 Free for deep codebase understanding and GitHub research with evidence-based answers. Inspired by AmpCode.
|
- **Background Agents**: Run multiple agents in parallel like a real dev team
|
||||||
- **explore** (`opencode/grok-code`, `google/gemini-3-flash`, or `anthropic/claude-haiku-4-5`): Fast codebase exploration and pattern matching. Uses Gemini 3 Flash when Antigravity auth is configured, Haiku when Claude max20 is available, otherwise Grok. Inspired by Claude Code.
|
- **LSP & AST Tools**: Refactoring, rename, diagnostics, AST-aware code search
|
||||||
- **frontend-ui-ux-engineer** (`google/gemini-3-pro-preview`): A designer turned developer. Builds gorgeous UIs. Gemini excels at creative, beautiful UI code.
|
- **Context Injection**: Auto-inject AGENTS.md, README.md, conditional rules
|
||||||
- **document-writer** (`google/gemini-3-flash`): Technical writing expert. Gemini is a wordsmith—writes prose that flows.
|
- **Claude Code Compatibility**: Full hook system, commands, skills, agents, MCPs
|
||||||
- **multimodal-looker** (`google/gemini-3-flash`): Visual content specialist. Analyzes PDFs, images, diagrams to extract information.
|
- **Built-in MCPs**: websearch (Exa), context7 (docs), grep_app (GitHub search)
|
||||||
|
- **Session Tools**: List, read, search, and analyze session history
|
||||||
The main agent invokes these automatically, but you can call them explicitly:
|
- **Productivity Features**: Ralph Loop, Todo Enforcer, Comment Checker, Think Mode, and more
|
||||||
|
|
||||||
```
|
|
||||||
Ask @oracle to review this design and propose an architecture
|
|
||||||
Ask @librarian how this is implemented—why does the behavior keep changing?
|
|
||||||
Ask @explore for the policy on this feature
|
|
||||||
```
|
|
||||||
|
|
||||||
Customize agent models, prompts, and permissions in `oh-my-opencode.json`. See [Configuration](#configuration).
|
|
||||||
|
|
||||||
### Background Agents: Work Like a Team
|
|
||||||
|
|
||||||
What if you could run these agents relentlessly, never letting them idle?
|
|
||||||
|
|
||||||
- Have GPT debug while Claude tries different approaches to find the root cause
|
|
||||||
- Gemini writes the frontend while Claude handles the backend
|
|
||||||
- Kick off massive parallel searches, continue implementation on other parts, then finish using the search results
|
|
||||||
|
|
||||||
These workflows are possible with OhMyOpenCode.
|
|
||||||
|
|
||||||
Run subagents in the background. The main agent gets notified on completion. Wait for results if needed.
|
|
||||||
|
|
||||||
**Make your agents work like your team works.**
|
|
||||||
|
|
||||||
### The Tools: Your Teammates Deserve Better
|
|
||||||
|
|
||||||
#### Why Are You the Only One Using an IDE?
|
|
||||||
|
|
||||||
Syntax highlighting, autocomplete, refactoring, navigation, analysis—and now agents writing code...
|
|
||||||
|
|
||||||
**Why are you the only one with these tools?**
|
|
||||||
**Give them to your agents and watch them level up.**
|
|
||||||
|
|
||||||
[OpenCode provides LSP](https://opencode.ai/docs/lsp/), but only for analysis.
|
|
||||||
|
|
||||||
The features in your editor? Other agents can't touch them.
|
|
||||||
Hand your best tools to your best colleagues. Now they can properly refactor, navigate, and analyze.
|
|
||||||
|
|
||||||
- **lsp_diagnostics**: Get errors/warnings before build
|
|
||||||
- **lsp_prepare_rename**: Validate rename operation
|
|
||||||
- **lsp_rename**: Rename symbol across workspace
|
|
||||||
- **ast_grep_search**: AST-aware code pattern search (25 languages)
|
|
||||||
- **ast_grep_replace**: AST-aware code replacement
|
|
||||||
- **call_omo_agent**: Spawn specialized explore/librarian agents. Supports `run_in_background` parameter for async execution.
|
|
||||||
- **delegate_task**: Category-based task delegation with specialized agents. Supports pre-configured categories (visual, business-logic) or direct agent targeting. Use `background_output` to retrieve results and `background_cancel` to cancel tasks. See [Categories](#categories).
|
|
||||||
|
|
||||||
#### Session Management
|
|
||||||
|
|
||||||
Tools to navigate and search your OpenCode session history:
|
|
||||||
|
|
||||||
- **session_list**: List all OpenCode sessions with filtering by date and limit
|
|
||||||
- **session_read**: Read messages and history from a specific session
|
|
||||||
- **session_search**: Full-text search across session messages
|
|
||||||
- **session_info**: Get metadata and statistics about a session
|
|
||||||
|
|
||||||
These tools enable agents to reference previous conversations and maintain continuity across sessions.
|
|
||||||
|
|
||||||
#### Context Is All You Need
|
|
||||||
- **Directory AGENTS.md / README.md Injector**: Auto-injects `AGENTS.md` and `README.md` when reading files. Walks from file directory to project root, collecting **all** `AGENTS.md` files along the path. Supports nested directory-specific instructions:
|
|
||||||
```
|
|
||||||
project/
|
|
||||||
├── AGENTS.md # Project-wide context
|
|
||||||
├── src/
|
|
||||||
│ ├── AGENTS.md # src-specific context
|
|
||||||
│ └── components/
|
|
||||||
│ ├── AGENTS.md # Component-specific context
|
|
||||||
│ └── Button.tsx # Reading this injects all 3 AGENTS.md files
|
|
||||||
```
|
|
||||||
Reading `Button.tsx` injects in order: `project/AGENTS.md` → `src/AGENTS.md` → `components/AGENTS.md`. Each directory's context is injected once per session.
|
|
||||||
- **Conditional Rules Injector**: Not all rules apply all the time. Injects rules from `.claude/rules/` when conditions match.
|
|
||||||
- Walks upward from file directory to project root, plus `~/.claude/rules/` (user).
|
|
||||||
- Supports `.md` and `.mdc` files.
|
|
||||||
- Matches via `globs` field in frontmatter.
|
|
||||||
- `alwaysApply: true` for rules that should always fire.
|
|
||||||
- Example rule file:
|
|
||||||
```markdown
|
|
||||||
---
|
|
||||||
globs: ["*.ts", "src/**/*.js"]
|
|
||||||
description: "TypeScript/JavaScript coding rules"
|
|
||||||
---
|
|
||||||
- Use PascalCase for interface names
|
|
||||||
- Use camelCase for function names
|
|
||||||
```
|
|
||||||
- **Online**: Project rules aren't everything. Built-in MCPs for extended capabilities:
|
|
||||||
- **websearch**: Real-time web search powered by [Exa AI](https://exa.ai)
|
|
||||||
- **context7**: Official documentation lookup
|
|
||||||
- **grep_app**: Ultra-fast code search across public GitHub repos (great for finding implementation examples)
|
|
||||||
|
|
||||||
#### Be Multimodal. Save Tokens.
|
|
||||||
|
|
||||||
The look_at tool from AmpCode, now in OhMyOpenCode.
|
|
||||||
Instead of the agent reading massive files and bloating context, it internally leverages another agent to extract just what it needs.
|
|
||||||
|
|
||||||
#### I Removed Their Blockers
|
|
||||||
- Replaces built-in grep and glob tools. Default implementation has no timeout—can hang forever.
|
|
||||||
|
|
||||||
#### Skill-Embedded MCP Support
|
|
||||||
|
|
||||||
Skills can now bring their own MCP servers. Define MCP configurations directly in skill frontmatter or via `mcp.json` files:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
---
|
|
||||||
description: Browser automation skill
|
|
||||||
mcp:
|
|
||||||
playwright:
|
|
||||||
command: npx
|
|
||||||
args: ["-y", "@anthropic-ai/mcp-playwright"]
|
|
||||||
---
|
|
||||||
```
|
|
||||||
|
|
||||||
When you load a skill with embedded MCP, its tools become available automatically. The `skill_mcp` tool lets you invoke these MCP operations with full schema discovery.
|
|
||||||
|
|
||||||
**Built-in Skills:**
|
|
||||||
- **playwright**: Browser automation, web scraping, testing, and screenshots out of the box
|
|
||||||
|
|
||||||
Disable built-in skills via `disabled_skills: ["playwright"]` in your config.
|
|
||||||
|
|
||||||
### Goodbye Claude Code. Hello Oh My OpenCode.
|
|
||||||
|
|
||||||
Oh My OpenCode has a Claude Code compatibility layer.
|
|
||||||
If you were using Claude Code, your existing config just works.
|
|
||||||
|
|
||||||
#### Hooks Integration
|
|
||||||
|
|
||||||
Run custom scripts via Claude Code's `settings.json` hook system.
|
|
||||||
Oh My OpenCode reads and executes hooks from:
|
|
||||||
|
|
||||||
- `~/.claude/settings.json` (user)
|
|
||||||
- `./.claude/settings.json` (project)
|
|
||||||
- `./.claude/settings.local.json` (local, git-ignored)
|
|
||||||
|
|
||||||
Supported hook events:
|
|
||||||
- **PreToolUse**: Runs before tool execution. Can block or modify tool input.
|
|
||||||
- **PostToolUse**: Runs after tool execution. Can add warnings or context.
|
|
||||||
- **UserPromptSubmit**: Runs when user submits prompt. Can block or inject messages.
|
|
||||||
- **Stop**: Runs when session goes idle. Can inject follow-up prompts.
|
|
||||||
|
|
||||||
Example `settings.json`:
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"hooks": {
|
|
||||||
"PostToolUse": [
|
|
||||||
{
|
|
||||||
"matcher": "Write|Edit",
|
|
||||||
"hooks": [{ "type": "command", "command": "eslint --fix $FILE" }]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Config Loaders
|
|
||||||
|
|
||||||
**Command Loader**: Loads markdown-based slash commands from 4 directories:
|
|
||||||
- `~/.claude/commands/` (user)
|
|
||||||
- `./.claude/commands/` (project)
|
|
||||||
- `~/.config/opencode/command/` (opencode global)
|
|
||||||
- `./.opencode/command/` (opencode project)
|
|
||||||
|
|
||||||
**Skill Loader**: Loads directory-based skills with `SKILL.md`:
|
|
||||||
- `~/.claude/skills/` (user)
|
|
||||||
- `./.claude/skills/` (project)
|
|
||||||
|
|
||||||
**Agent Loader**: Loads custom agent definitions from markdown files:
|
|
||||||
- `~/.claude/agents/*.md` (user)
|
|
||||||
- `./.claude/agents/*.md` (project)
|
|
||||||
|
|
||||||
**MCP Loader**: Loads MCP server configs from `.mcp.json` files:
|
|
||||||
- `~/.claude/.mcp.json` (user)
|
|
||||||
- `./.mcp.json` (project)
|
|
||||||
- `./.claude/.mcp.json` (local)
|
|
||||||
- Supports environment variable expansion (`${VAR}` syntax)
|
|
||||||
|
|
||||||
#### Data Storage
|
|
||||||
|
|
||||||
**Todo Management**: Session todos stored in `~/.claude/todos/` in Claude Code compatible format.
|
|
||||||
|
|
||||||
**Transcript**: Session activity logged to `~/.claude/transcripts/` in JSONL format for replay and analysis.
|
|
||||||
|
|
||||||
#### Compatibility Toggles
|
|
||||||
|
|
||||||
Disable specific Claude Code compatibility features with the `claude_code` config object:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"claude_code": {
|
|
||||||
"mcp": false,
|
|
||||||
"commands": false,
|
|
||||||
"skills": false,
|
|
||||||
"agents": false,
|
|
||||||
"hooks": false,
|
|
||||||
"plugins": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
| Toggle | When `false`, stops loading from... | Unaffected |
|
|
||||||
| ---------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------- |
|
|
||||||
| `mcp` | `~/.claude/.mcp.json`, `./.mcp.json`, `./.claude/.mcp.json` | Built-in MCP (context7, grep_app) |
|
|
||||||
| `commands` | `~/.claude/commands/*.md`, `./.claude/commands/*.md` | `~/.config/opencode/command/`, `./.opencode/command/` |
|
|
||||||
| `skills` | `~/.claude/skills/*/SKILL.md`, `./.claude/skills/*/SKILL.md` | - |
|
|
||||||
| `agents` | `~/.claude/agents/*.md`, `./.claude/agents/*.md` | Built-in agents (oracle, librarian, etc.) |
|
|
||||||
| `hooks` | `~/.claude/settings.json`, `./.claude/settings.json`, `./.claude/settings.local.json` | - |
|
|
||||||
| `plugins` | `~/.claude/plugins/` (Claude Code marketplace plugins) | - |
|
|
||||||
|
|
||||||
All toggles default to `true` (enabled). Omit the `claude_code` object for full Claude Code compatibility.
|
|
||||||
|
|
||||||
**Selectively disable specific plugins** using `plugins_override`:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"claude_code": {
|
|
||||||
"plugins_override": {
|
|
||||||
"claude-mem@thedotmack": false,
|
|
||||||
"some-other-plugin@marketplace": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
This allows you to keep the plugin system enabled while disabling specific plugins by their full identifier (`plugin-name@marketplace-name`).
|
|
||||||
|
|
||||||
### Not Just for the Agents
|
|
||||||
|
|
||||||
When agents thrive, you thrive. But I want to help you directly too.
|
|
||||||
|
|
||||||
- **Ralph Loop**: Self-referential development loop that runs until task completion. Inspired by Anthropic's Ralph Wiggum plugin. **Supports all programming languages.**
|
|
||||||
- Start with `/ralph-loop "Build a REST API"` and let the agent work continuously
|
|
||||||
- Loop detects `<promise>DONE</promise>` to know when complete
|
|
||||||
- Auto-continues if agent stops without completion promise
|
|
||||||
- Ends when: completion detected, max iterations reached (default 100), or `/cancel-ralph`
|
|
||||||
- Configure in `oh-my-opencode.json`: `{ "ralph_loop": { "enabled": true, "default_max_iterations": 100 } }`
|
|
||||||
- **Keyword Detector**: Automatically detects keywords in your prompts and activates specialized modes:
|
|
||||||
- `ultrawork` / `ulw`: Maximum performance mode with parallel agent orchestration
|
|
||||||
- `search` / `find` / `찾아` / `検索`: Maximized search effort with parallel explore and librarian agents
|
|
||||||
- `analyze` / `investigate` / `분석` / `調査`: Deep analysis mode with multi-phase expert consultation
|
|
||||||
- **Todo Continuation Enforcer**: Makes agents finish all TODOs before stopping. Kills the chronic LLM habit of quitting halfway.
|
|
||||||
- **Comment Checker**: LLMs love comments. Too many comments. This reminds them to cut the noise. Smartly ignores valid patterns (BDD, directives, docstrings) and demands justification for the rest. Clean code wins.
|
|
||||||
- **Think Mode**: Auto-detects when extended thinking is needed and switches modes. Catches phrases like "think deeply" or "ultrathink" and dynamically adjusts model settings for maximum reasoning.
|
|
||||||
- **Context Window Monitor**: Implements [Context Window Anxiety Management](https://agentic-patterns.com/patterns/context-window-anxiety-management/).
|
|
||||||
- At 70%+ usage, reminds agents there's still headroom—prevents rushed, sloppy work.
|
|
||||||
- **Agent Usage Reminder**: When you call search tools directly, reminds you to leverage specialized agents via background tasks for better results.
|
|
||||||
- **Anthropic Auto Compact**: When Claude models hit token limits, automatically summarizes and compacts the session—no manual intervention needed.
|
|
||||||
- **Session Recovery**: Automatically recovers from session errors (missing tool results, thinking block issues, empty messages). Sessions don't crash mid-run. Even if they do, they recover.
|
|
||||||
- **Auto Update Checker**: Automatically checks for new versions of oh-my-opencode and can auto-update your configuration. Shows startup toast notifications displaying current version and Sisyphus status ("Sisyphus on steroids is steering OpenCode" when enabled, or "OpenCode is now on Steroids. oMoMoMoMo..." otherwise). Disable all features with `"auto-update-checker"` in `disabled_hooks`, or disable just toast notifications with `"startup-toast"` in `disabled_hooks`. See [Configuration > Hooks](#hooks).
|
|
||||||
- **Background Notification**: Get notified when background agent tasks complete.
|
|
||||||
- **Session Notification**: Sends OS notifications when agents go idle. Works on macOS, Linux, and Windows—never miss when your agent needs input.
|
|
||||||
- **Empty Task Response Detector**: Catches when Task tool returns nothing. Warns you about potential agent failures so you don't wait forever for a response that already came back empty.
|
|
||||||
- **Empty Message Sanitizer**: Prevents API errors from empty chat messages by automatically sanitizing message content before sending.
|
|
||||||
- **Grep Output Truncator**: Grep can return mountains of text. This dynamically truncates output based on your remaining context window—keeps 50% headroom, caps at 50k tokens.
|
|
||||||
- **Tool Output Truncator**: Same idea, broader scope. Truncates output from Grep, Glob, LSP tools, and AST-grep. Prevents one verbose search from eating your entire context.
|
|
||||||
- **Preemptive Compaction**: Compacts session proactively before hitting hard token limits. Runs at 85% context window usage. **Enabled by default.** Disable via `disabled_hooks: ["preemptive-compaction"]`.
|
|
||||||
- **Compaction Context Injector**: Preserves critical context (AGENTS.md, current directory info) during session compaction so you don't lose important state.
|
|
||||||
- **Thinking Block Validator**: Validates thinking blocks to ensure proper formatting and prevent API errors from malformed thinking content.
|
|
||||||
- **Claude Code Hooks**: Executes hooks from Claude Code's settings.json - this is the compatibility layer that runs PreToolUse/PostToolUse/UserPromptSubmit/Stop hooks.
|
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
@@ -1238,12 +970,4 @@ I have no affiliation with any project or model mentioned here. This is purely p
|
|||||||
- [Google](https://google.com)
|
- [Google](https://google.com)
|
||||||
- [Microsoft](https://microsoft.com)
|
- [Microsoft](https://microsoft.com)
|
||||||
|
|
||||||
## Sponsors
|
|
||||||
- **Numman Ali** [GitHub](https://github.com/numman-ali) [X](https://x.com/nummanali)
|
|
||||||
- The first sponsor
|
|
||||||
- **Aaron Iker** [GitHub](https://github.com/aaroniker) [X](https://x.com/aaroniker)
|
|
||||||
- **Suyeol Jeon (devxoul)** [GitHub](https://github.com/devxoul)
|
|
||||||
- The person who launched my career and inspired me deeply on how to build great agentic workflows. I learned so much about designing great systems to build great teams, and those lessons were instrumental in creating this harness.
|
|
||||||
- **Hyerin Won (devwon)** [GitHub](https://github.com/devwon)
|
|
||||||
|
|
||||||
*Special thanks to [@junhoyeo](https://github.com/junhoyeo) for this amazing hero image.*
|
*Special thanks to [@junhoyeo](https://github.com/junhoyeo) for this amazing hero image.*
|
||||||
|
|||||||
290
README.zh-cn.md
290
README.zh-cn.md
@@ -123,21 +123,6 @@
|
|||||||
- [太复杂了?](#太复杂了)
|
- [太复杂了?](#太复杂了)
|
||||||
- [卸载](#卸载)
|
- [卸载](#卸载)
|
||||||
- [功能特性](#功能特性)
|
- [功能特性](#功能特性)
|
||||||
- [智能体:你的队友](#智能体你的队友)
|
|
||||||
- [后台智能体:像团队一样工作](#后台智能体像团队一样工作)
|
|
||||||
- [工具:你的队友值得更好的](#工具你的队友值得更好的)
|
|
||||||
- [为什么只有你在用 IDE?](#为什么只有你在用-ide)
|
|
||||||
- [会话管理](#会话管理)
|
|
||||||
- [上下文就是一切](#上下文就是一切)
|
|
||||||
- [多模态化。节省 Token。](#多模态化节省-token)
|
|
||||||
- [我移除了他们的障碍](#我移除了他们的障碍)
|
|
||||||
- [内嵌技能的 MCP 支持](#内嵌技能的-mcp-支持)
|
|
||||||
- [再见 Claude Code。你好 Oh My OpenCode。](#再见-claude-code你好-oh-my-opencode)
|
|
||||||
- [钩子集成](#钩子集成)
|
|
||||||
- [配置加载器](#配置加载器)
|
|
||||||
- [数据存储](#数据存储)
|
|
||||||
- [兼容性开关](#兼容性开关)
|
|
||||||
- [不仅仅是为了智能体](#不仅仅是为了智能体)
|
|
||||||
- [配置](#配置)
|
- [配置](#配置)
|
||||||
- [JSONC 支持](#jsonc-支持)
|
- [JSONC 支持](#jsonc-支持)
|
||||||
- [Google 认证](#google-认证)
|
- [Google 认证](#google-认证)
|
||||||
@@ -526,271 +511,18 @@ gh repo star code-yeongyu/oh-my-opencode
|
|||||||
|
|
||||||
## 功能特性
|
## 功能特性
|
||||||
|
|
||||||
### 智能体:你的队友
|
我们拥有众多功能,你会觉得这些功能理所当然应该存在,一旦体验过,就再也回不去了。
|
||||||
|
详细信息请参阅 [Features Documentation](docs/features.md)。
|
||||||
|
|
||||||
- **Sisyphus** (`anthropic/claude-opus-4-5`):**默认智能体。** OpenCode 的强大 AI 编排器。使用专业子智能体进行规划、委派和执行复杂任务,采用积极的并行执行策略。强调后台任务委派和 todo 驱动的工作流程。使用 Claude Opus 4.5 配合扩展思考(32k 预算)以获得最大推理能力。
|
**概览:**
|
||||||
- **oracle** (`openai/gpt-5.2`):架构、代码审查、策略。使用 GPT-5.2 进行出色的逻辑推理和深度分析。灵感来自 AmpCode。
|
- **智能体**:Sisyphus(主智能体)、Prometheus(规划器)、Oracle(架构/调试)、Librarian(文档/代码搜索)、Explore(快速代码库 grep)、Frontend Engineer(UI/UX)、Document Writer、Multimodal Looker
|
||||||
- **librarian** (`opencode/glm-4.7-free`):多仓库分析、文档查找、实现示例。使用 GLM-4.7 Free 进行深度代码库理解和 GitHub 研究,提供基于证据的答案。灵感来自 AmpCode。
|
- **后台智能体**:像真正的开发团队一样并行运行多个智能体
|
||||||
- **explore** (`opencode/grok-code`、`google/gemini-3-flash` 或 `anthropic/claude-haiku-4-5`):快速代码库探索和模式匹配。配置 Antigravity 认证时使用 Gemini 3 Flash,有 Claude max20 时使用 Haiku,否则使用 Grok。灵感来自 Claude Code。
|
- **LSP & AST 工具**:重构、重命名、诊断、AST 感知代码搜索
|
||||||
- **frontend-ui-ux-engineer** (`google/gemini-3-pro-preview`):设计师转开发者。构建华丽的 UI。Gemini 擅长创造性的、美观的 UI 代码。
|
- **上下文注入**:自动注入 AGENTS.md、README.md、条件规则
|
||||||
- **document-writer** (`google/gemini-3-flash`):技术写作专家。Gemini 是文字大师——写出流畅的散文。
|
- **Claude Code 兼容性**:完整的钩子系统、命令、技能、智能体、MCP
|
||||||
- **multimodal-looker** (`google/gemini-3-flash`):视觉内容专家。分析 PDF、图像、图表以提取信息。
|
- **内置 MCP**:websearch (Exa)、context7 (文档)、grep_app (GitHub 搜索)
|
||||||
|
- **会话工具**:列出、读取、搜索和分析会话历史
|
||||||
主智能体会自动调用这些,但你也可以显式调用它们:
|
- **生产力功能**:Ralph Loop、Todo Enforcer、Comment Checker、Think Mode 等
|
||||||
|
|
||||||
```
|
|
||||||
让 @oracle 审查这个设计并提出架构
|
|
||||||
让 @librarian 看看这是如何实现的——为什么行为一直在变化?
|
|
||||||
让 @explore 查找这个功能的策略
|
|
||||||
```
|
|
||||||
|
|
||||||
在 `oh-my-opencode.json` 中自定义智能体模型、提示和权限。参见[配置](#配置)。
|
|
||||||
|
|
||||||
### 后台智能体:像团队一样工作
|
|
||||||
|
|
||||||
如果你能让这些智能体不知疲倦地运行,永不空闲呢?
|
|
||||||
|
|
||||||
- 让 GPT 调试的同时 Claude 尝试不同的方法来找到根本原因
|
|
||||||
- Gemini 编写前端的同时 Claude 处理后端
|
|
||||||
- 启动大规模并行搜索,继续实现其他部分,然后使用搜索结果完成
|
|
||||||
|
|
||||||
这些工作流程在 OhMyOpenCode 中都是可能的。
|
|
||||||
|
|
||||||
在后台运行子智能体。主智能体在完成时收到通知。需要时等待结果。
|
|
||||||
|
|
||||||
**让你的智能体像你的团队一样工作。**
|
|
||||||
|
|
||||||
### 工具:你的队友值得更好的
|
|
||||||
|
|
||||||
#### 为什么只有你在用 IDE?
|
|
||||||
|
|
||||||
语法高亮、自动完成、重构、导航、分析——现在还有智能体在写代码...
|
|
||||||
|
|
||||||
**为什么只有你拥有这些工具?**
|
|
||||||
**把它们给你的智能体,看它们升级。**
|
|
||||||
|
|
||||||
[OpenCode 提供 LSP](https://opencode.ai/docs/lsp/),但仅用于分析。
|
|
||||||
|
|
||||||
你编辑器中的功能?其他智能体无法触及。
|
|
||||||
把你最好的工具交给你最好的同事。现在它们可以正确地重构、导航和分析。
|
|
||||||
|
|
||||||
- **lsp_diagnostics**:在构建前获取错误/警告
|
|
||||||
- **lsp_prepare_rename**:验证重命名操作
|
|
||||||
- **lsp_rename**:在工作区中重命名符号
|
|
||||||
- **ast_grep_search**:AST 感知的代码模式搜索(25 种语言)
|
|
||||||
- **ast_grep_replace**:AST 感知的代码替换
|
|
||||||
- **call_omo_agent**:生成专业的 explore/librarian 智能体。支持 `run_in_background` 参数进行异步执行。
|
|
||||||
- **delegate_task**:基于类别的任务委派,使用专业智能体。支持预配置的类别(visual、business-logic)或直接指定智能体。使用 `background_output` 检索结果,使用 `background_cancel` 取消任务。参见[类别](#类别)。
|
|
||||||
|
|
||||||
#### 会话管理
|
|
||||||
|
|
||||||
导航和搜索 OpenCode 会话历史的工具:
|
|
||||||
|
|
||||||
- **session_list**:列出所有 OpenCode 会话,支持按日期和数量过滤
|
|
||||||
- **session_read**:从特定会话读取消息和历史
|
|
||||||
- **session_search**:在会话消息中进行全文搜索
|
|
||||||
- **session_info**:获取会话的元数据和统计信息
|
|
||||||
|
|
||||||
这些工具使智能体能够引用之前的对话并在会话之间保持连续性。
|
|
||||||
|
|
||||||
#### 上下文就是一切
|
|
||||||
- **目录 AGENTS.md / README.md 注入器**:读取文件时自动注入 `AGENTS.md` 和 `README.md`。从文件目录向上遍历到项目根目录,收集路径上的**所有** `AGENTS.md` 文件。支持嵌套的目录特定说明:
|
|
||||||
```
|
|
||||||
project/
|
|
||||||
├── AGENTS.md # 项目级上下文
|
|
||||||
├── src/
|
|
||||||
│ ├── AGENTS.md # src 特定上下文
|
|
||||||
│ └── components/
|
|
||||||
│ ├── AGENTS.md # 组件特定上下文
|
|
||||||
│ └── Button.tsx # 读取此文件会注入所有 3 个 AGENTS.md 文件
|
|
||||||
```
|
|
||||||
读取 `Button.tsx` 会按顺序注入:`project/AGENTS.md` → `src/AGENTS.md` → `components/AGENTS.md`。每个目录的上下文在每个会话中只注入一次。
|
|
||||||
- **条件规则注入器**:不是所有规则都始终适用。当条件匹配时从 `.claude/rules/` 注入规则。
|
|
||||||
- 从文件目录向上遍历到项目根目录,加上 `~/.claude/rules/`(用户级)。
|
|
||||||
- 支持 `.md` 和 `.mdc` 文件。
|
|
||||||
- 通过 frontmatter 中的 `globs` 字段匹配。
|
|
||||||
- `alwaysApply: true` 表示应始终触发的规则。
|
|
||||||
- 规则文件示例:
|
|
||||||
```markdown
|
|
||||||
---
|
|
||||||
globs: ["*.ts", "src/**/*.js"]
|
|
||||||
description: "TypeScript/JavaScript 编码规则"
|
|
||||||
---
|
|
||||||
- 接口名使用 PascalCase
|
|
||||||
- 函数名使用 camelCase
|
|
||||||
```
|
|
||||||
- **在线**:项目规则不是全部。这些是用于扩展能力的内置 MCP:
|
|
||||||
- **websearch**:由 [Exa AI](https://exa.ai) 驱动的实时网络搜索
|
|
||||||
- **context7**:官方文档查询
|
|
||||||
- **grep_app**:跨公共 GitHub 仓库的超快代码搜索(非常适合查找实现示例)
|
|
||||||
|
|
||||||
#### 多模态化。节省 Token。
|
|
||||||
|
|
||||||
来自 AmpCode 的 look_at 工具,现在在 OhMyOpenCode 中。
|
|
||||||
智能体不再需要读取大文件并膨胀上下文,它在内部利用另一个智能体只提取所需内容。
|
|
||||||
|
|
||||||
#### 我移除了他们的障碍
|
|
||||||
- 替换内置的 grep 和 glob 工具。默认实现没有超时——可能永远挂起。
|
|
||||||
|
|
||||||
#### 内嵌技能的 MCP 支持
|
|
||||||
|
|
||||||
技能现在可以携带自己的 MCP 服务器。直接在技能 frontmatter 中或通过 `mcp.json` 文件定义 MCP 配置:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
---
|
|
||||||
description: 浏览器自动化技能
|
|
||||||
mcp:
|
|
||||||
playwright:
|
|
||||||
command: npx
|
|
||||||
args: ["-y", "@anthropic-ai/mcp-playwright"]
|
|
||||||
---
|
|
||||||
```
|
|
||||||
|
|
||||||
当你加载带有内嵌 MCP 的技能时,其工具会自动可用。`skill_mcp` 工具允许你使用完整的 schema 发现来调用这些 MCP 操作。
|
|
||||||
|
|
||||||
**内置技能:**
|
|
||||||
- **playwright**:开箱即用的浏览器自动化、网页抓取、测试和截图
|
|
||||||
|
|
||||||
通过配置中的 `disabled_skills: ["playwright"]` 禁用内置技能。
|
|
||||||
|
|
||||||
### 再见 Claude Code。你好 Oh My OpenCode。
|
|
||||||
|
|
||||||
Oh My OpenCode 有一个 Claude Code 兼容层。
|
|
||||||
如果你之前使用 Claude Code,你现有的配置直接可用。
|
|
||||||
|
|
||||||
#### 钩子集成
|
|
||||||
|
|
||||||
通过 Claude Code 的 `settings.json` 钩子系统运行自定义脚本。
|
|
||||||
Oh My OpenCode 从以下位置读取和执行钩子:
|
|
||||||
|
|
||||||
- `~/.claude/settings.json`(用户级)
|
|
||||||
- `./.claude/settings.json`(项目级)
|
|
||||||
- `./.claude/settings.local.json`(本地,git 忽略)
|
|
||||||
|
|
||||||
支持的钩子事件:
|
|
||||||
- **PreToolUse**:工具执行前运行。可以阻止或修改工具输入。
|
|
||||||
- **PostToolUse**:工具执行后运行。可以添加警告或上下文。
|
|
||||||
- **UserPromptSubmit**:用户提交提示时运行。可以阻止或注入消息。
|
|
||||||
- **Stop**:会话空闲时运行。可以注入后续提示。
|
|
||||||
|
|
||||||
`settings.json` 示例:
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"hooks": {
|
|
||||||
"PostToolUse": [
|
|
||||||
{
|
|
||||||
"matcher": "Write|Edit",
|
|
||||||
"hooks": [{ "type": "command", "command": "eslint --fix $FILE" }]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
#### 配置加载器
|
|
||||||
|
|
||||||
**命令加载器**:从 4 个目录加载基于 markdown 的斜杠命令:
|
|
||||||
- `~/.claude/commands/`(用户级)
|
|
||||||
- `./.claude/commands/`(项目级)
|
|
||||||
- `~/.config/opencode/command/`(opencode 全局)
|
|
||||||
- `./.opencode/command/`(opencode 项目)
|
|
||||||
|
|
||||||
**技能加载器**:从包含 `SKILL.md` 的目录加载技能:
|
|
||||||
- `~/.claude/skills/`(用户级)
|
|
||||||
- `./.claude/skills/`(项目级)
|
|
||||||
|
|
||||||
**智能体加载器**:从 markdown 文件加载自定义智能体定义:
|
|
||||||
- `~/.claude/agents/*.md`(用户级)
|
|
||||||
- `./.claude/agents/*.md`(项目级)
|
|
||||||
|
|
||||||
**MCP 加载器**:从 `.mcp.json` 文件加载 MCP 服务器配置:
|
|
||||||
- `~/.claude/.mcp.json`(用户级)
|
|
||||||
- `./.mcp.json`(项目级)
|
|
||||||
- `./.claude/.mcp.json`(本地)
|
|
||||||
- 支持环境变量展开(`${VAR}` 语法)
|
|
||||||
|
|
||||||
#### 数据存储
|
|
||||||
|
|
||||||
**Todo 管理**:会话待办事项以 Claude Code 兼容格式存储在 `~/.claude/todos/` 中。
|
|
||||||
|
|
||||||
**转录**:会话活动以 JSONL 格式记录到 `~/.claude/transcripts/` 中,用于回放和分析。
|
|
||||||
|
|
||||||
#### 兼容性开关
|
|
||||||
|
|
||||||
使用 `claude_code` 配置对象禁用特定的 Claude Code 兼容功能:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"claude_code": {
|
|
||||||
"mcp": false,
|
|
||||||
"commands": false,
|
|
||||||
"skills": false,
|
|
||||||
"agents": false,
|
|
||||||
"hooks": false,
|
|
||||||
"plugins": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
| 开关 | 当为 `false` 时,停止从以下位置加载... | 不受影响 |
|
|
||||||
| ---------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------- |
|
|
||||||
| `mcp` | `~/.claude/.mcp.json`、`./.mcp.json`、`./.claude/.mcp.json` | 内置 MCP(context7、grep_app) |
|
|
||||||
| `commands` | `~/.claude/commands/*.md`、`./.claude/commands/*.md` | `~/.config/opencode/command/`、`./.opencode/command/` |
|
|
||||||
| `skills` | `~/.claude/skills/*/SKILL.md`、`./.claude/skills/*/SKILL.md` | - |
|
|
||||||
| `agents` | `~/.claude/agents/*.md`、`./.claude/agents/*.md` | 内置智能体(oracle、librarian 等) |
|
|
||||||
| `hooks` | `~/.claude/settings.json`、`./.claude/settings.json`、`./.claude/settings.local.json` | - |
|
|
||||||
| `plugins` | `~/.claude/plugins/`(Claude Code 市场插件) | - |
|
|
||||||
|
|
||||||
所有开关默认为 `true`(启用)。省略 `claude_code` 对象以获得完整的 Claude Code 兼容性。
|
|
||||||
|
|
||||||
**选择性禁用特定插件** 使用 `plugins_override`:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"claude_code": {
|
|
||||||
"plugins_override": {
|
|
||||||
"claude-mem@thedotmack": false,
|
|
||||||
"some-other-plugin@marketplace": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
这允许你在保持插件系统启用的同时,通过其完整标识符(`plugin-name@marketplace-name`)禁用特定插件。
|
|
||||||
|
|
||||||
### 不仅仅是为了智能体
|
|
||||||
|
|
||||||
当智能体蓬勃发展时,你也会收益。但我同时也想直接帮助你。
|
|
||||||
|
|
||||||
- **Ralph Loop**:自引用开发循环,持续运行直到任务完成。灵感来自 Anthropic 的 Ralph Wiggum 插件。**支持所有编程语言。**
|
|
||||||
- 使用 `/ralph-loop "构建一个 REST API"` 开始,让智能体持续工作
|
|
||||||
- 循环检测 `<promise>DONE</promise>` 来判断何时完成
|
|
||||||
- 如果智能体在没有完成承诺的情况下停止,会自动继续
|
|
||||||
- 结束条件:检测到完成、达到最大迭代次数(默认 100)或 `/cancel-ralph`
|
|
||||||
- 在 `oh-my-opencode.json` 中配置:`{ "ralph_loop": { "enabled": true, "default_max_iterations": 100 } }`
|
|
||||||
- **关键词检测器**:自动检测提示中的关键词并激活专门模式:
|
|
||||||
- `ultrawork` / `ulw`:最大性能模式,带并行智能体编排
|
|
||||||
- `search` / `find` / `찾아` / `検索`:最大化搜索力度,带并行 explore 和 librarian 智能体
|
|
||||||
- `analyze` / `investigate` / `분석` / `調査`:深度分析模式,带多阶段专家咨询
|
|
||||||
- **Todo 继续执行器**:让智能体在停止前完成所有 TODO。终结 LLM 中途放弃的慢性习惯。
|
|
||||||
- **注释检查器**:LLM 喜欢注释。太多注释。这提醒它们减少噪音。智能地忽略有效模式(BDD、指令、文档字符串)并要求为其余部分提供理由。整洁的代码获胜。
|
|
||||||
- **思考模式**:自动检测何时需要扩展思考并切换模式。捕获"深入思考"或"ultrathink"等短语,并动态调整模型设置以获得最大推理能力。
|
|
||||||
- **上下文窗口监控**:实现[上下文窗口焦虑管理](https://agentic-patterns.com/patterns/context-window-anxiety-management/)。
|
|
||||||
- 在使用率达到 70%+ 时,提醒智能体还有空间——防止草率、马虎的工作。
|
|
||||||
- **智能体使用提醒**:当你直接调用搜索工具时,提醒你通过后台任务利用专业智能体以获得更好的结果。
|
|
||||||
- **Anthropic 自动压缩**:当 Claude 模型达到 token 限制时,自动总结和压缩会话——无需手动干预。
|
|
||||||
- **会话恢复**:自动从会话错误中恢复(缺失的工具结果、思考块问题、空消息)。会话不会在运行中崩溃。即使崩溃,也会恢复。
|
|
||||||
- **自动更新检查器**:自动检查 oh-my-opencode 的新版本,并可以自动更新你的配置。在启动时显示 toast 通知,显示当前版本和 Sisyphus 状态(启用时显示"Sisyphus on steroids is steering OpenCode",否则显示"OpenCode is now on Steroids. oMoMoMoMo...")。通过在 `disabled_hooks` 中添加 `"auto-update-checker"` 禁用所有功能,或通过在 `disabled_hooks` 中添加 `"startup-toast"` 仅禁用 toast 通知。参见[配置 > 钩子](#钩子)。
|
|
||||||
- **后台通知**:后台智能体任务完成时收到通知。
|
|
||||||
- **会话通知**:智能体空闲时发送操作系统通知。在 macOS、Linux 和 Windows 上工作——永远不会错过智能体需要输入的时刻。
|
|
||||||
- **空任务响应检测器**:捕获 Task 工具返回空结果的情况。警告你可能的智能体失败,这样你就不会永远等待一个已经返回空的响应。
|
|
||||||
- **空消息清理器**:通过在发送前自动清理消息内容,防止空聊天消息导致的 API 错误。
|
|
||||||
- **Grep 输出截断器**:Grep 可能返回大量文本。这会根据你剩余的上下文窗口动态截断输出——保持 50% 余量,上限 50k token。
|
|
||||||
- **工具输出截断器**:同样的思路,更广的范围。截断 Grep、Glob、LSP 工具和 AST-grep 的输出。防止一次详细搜索吃掉你的整个上下文。
|
|
||||||
- **预防性压缩**:在达到硬 token 限制前主动压缩会话。在 85% 上下文窗口使用率时运行。**默认启用。** 通过 `disabled_hooks: ["preemptive-compaction"]` 禁用。
|
|
||||||
- **压缩上下文注入器**:在会话压缩期间保留关键上下文(AGENTS.md、当前目录信息),这样你不会丢失重要状态。
|
|
||||||
- **思考块验证器**:验证思考块以确保正确格式,防止格式错误的思考内容导致 API 错误。
|
|
||||||
- **Claude Code 钩子**:执行来自 Claude Code settings.json 的钩子——这是运行 PreToolUse/PostToolUse/UserPromptSubmit/Stop 钩子的兼容层。
|
|
||||||
|
|
||||||
## 配置
|
## 配置
|
||||||
|
|
||||||
|
|||||||
277
docs/features.md
Normal file
277
docs/features.md
Normal file
@@ -0,0 +1,277 @@
|
|||||||
|
# Oh-My-OpenCode Features
|
||||||
|
|
||||||
|
## Agents: Your Teammates
|
||||||
|
|
||||||
|
- **Sisyphus** (`anthropic/claude-opus-4-5`): **The default agent.** A powerful AI orchestrator for OpenCode. Plans, delegates, and executes complex tasks using specialized subagents with aggressive parallel execution. Emphasizes background task delegation and todo-driven workflow. Uses Claude Opus 4.5 with extended thinking (32k budget) for maximum reasoning capability.
|
||||||
|
- **oracle** (`openai/gpt-5.2`): Architecture, code review, strategy. Uses GPT-5.2 for its stellar logical reasoning and deep analysis. Inspired by AmpCode.
|
||||||
|
- **librarian** (`opencode/glm-4.7-free`): Multi-repo analysis, doc lookup, implementation examples. Uses GLM-4.7 Free for deep codebase understanding and GitHub research with evidence-based answers. Inspired by AmpCode.
|
||||||
|
- **explore** (`opencode/grok-code`, `google/gemini-3-flash`, or `anthropic/claude-haiku-4-5`): Fast codebase exploration and pattern matching. Uses Gemini 3 Flash when Antigravity auth is configured, Haiku when Claude max20 is available, otherwise Grok. Inspired by Claude Code.
|
||||||
|
- **frontend-ui-ux-engineer** (`google/gemini-3-pro-preview`): A designer turned developer. Builds gorgeous UIs. Gemini excels at creative, beautiful UI code.
|
||||||
|
- **document-writer** (`google/gemini-3-flash`): Technical writing expert. Gemini is a wordsmith—writes prose that flows.
|
||||||
|
- **multimodal-looker** (`google/gemini-3-flash`): Visual content specialist. Analyzes PDFs, images, diagrams to extract information.
|
||||||
|
|
||||||
|
The main agent invokes these automatically, but you can call them explicitly:
|
||||||
|
|
||||||
|
```
|
||||||
|
Ask @oracle to review this design and propose an architecture
|
||||||
|
Ask @librarian how this is implemented—why does the behavior keep changing?
|
||||||
|
Ask @explore for the policy on this feature
|
||||||
|
```
|
||||||
|
|
||||||
|
Customize agent models, prompts, and permissions in `oh-my-opencode.json`. See [Configuration](../README.md#configuration).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Background Agents: Work Like a Team
|
||||||
|
|
||||||
|
What if you could run these agents relentlessly, never letting them idle?
|
||||||
|
|
||||||
|
- Have GPT debug while Claude tries different approaches to find the root cause
|
||||||
|
- Gemini writes the frontend while Claude handles the backend
|
||||||
|
- Kick off massive parallel searches, continue implementation on other parts, then finish using the search results
|
||||||
|
|
||||||
|
These workflows are possible with OhMyOpenCode.
|
||||||
|
|
||||||
|
Run subagents in the background. The main agent gets notified on completion. Wait for results if needed.
|
||||||
|
|
||||||
|
**Make your agents work like your team works.**
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## The Tools: Your Teammates Deserve Better
|
||||||
|
|
||||||
|
### Why Are You the Only One Using an IDE?
|
||||||
|
|
||||||
|
Syntax highlighting, autocomplete, refactoring, navigation, analysis—and now agents writing code...
|
||||||
|
|
||||||
|
**Why are you the only one with these tools?**
|
||||||
|
**Give them to your agents and watch them level up.**
|
||||||
|
|
||||||
|
[OpenCode provides LSP](https://opencode.ai/docs/lsp/), but only for analysis.
|
||||||
|
|
||||||
|
The features in your editor? Other agents can't touch them.
|
||||||
|
Hand your best tools to your best colleagues. Now they can properly refactor, navigate, and analyze.
|
||||||
|
|
||||||
|
- **lsp_diagnostics**: Get errors/warnings before build
|
||||||
|
- **lsp_prepare_rename**: Validate rename operation
|
||||||
|
- **lsp_rename**: Rename symbol across workspace
|
||||||
|
- **ast_grep_search**: AST-aware code pattern search (25 languages)
|
||||||
|
- **ast_grep_replace**: AST-aware code replacement
|
||||||
|
- **call_omo_agent**: Spawn specialized explore/librarian agents. Supports `run_in_background` parameter for async execution.
|
||||||
|
- **delegate_task**: Category-based task delegation with specialized agents. Supports pre-configured categories (visual, business-logic) or direct agent targeting. Use `background_output` to retrieve results and `background_cancel` to cancel tasks. See [Categories](../README.md#categories).
|
||||||
|
|
||||||
|
### Session Management
|
||||||
|
|
||||||
|
Tools to navigate and search your OpenCode session history:
|
||||||
|
|
||||||
|
- **session_list**: List all OpenCode sessions with filtering by date and limit
|
||||||
|
- **session_read**: Read messages and history from a specific session
|
||||||
|
- **session_search**: Full-text search across session messages
|
||||||
|
- **session_info**: Get metadata and statistics about a session
|
||||||
|
|
||||||
|
These tools enable agents to reference previous conversations and maintain continuity across sessions.
|
||||||
|
|
||||||
|
### Context Is All You Need
|
||||||
|
|
||||||
|
- **Directory AGENTS.md / README.md Injector**: Auto-injects `AGENTS.md` and `README.md` when reading files. Walks from file directory to project root, collecting **all** `AGENTS.md` files along the path. Supports nested directory-specific instructions:
|
||||||
|
```
|
||||||
|
project/
|
||||||
|
├── AGENTS.md # Project-wide context
|
||||||
|
├── src/
|
||||||
|
│ ├── AGENTS.md # src-specific context
|
||||||
|
│ └── components/
|
||||||
|
│ ├── AGENTS.md # Component-specific context
|
||||||
|
│ └── Button.tsx # Reading this injects all 3 AGENTS.md files
|
||||||
|
```
|
||||||
|
Reading `Button.tsx` injects in order: `project/AGENTS.md` → `src/AGENTS.md` → `components/AGENTS.md`. Each directory's context is injected once per session.
|
||||||
|
- **Conditional Rules Injector**: Not all rules apply all the time. Injects rules from `.claude/rules/` when conditions match.
|
||||||
|
- Walks upward from file directory to project root, plus `~/.claude/rules/` (user).
|
||||||
|
- Supports `.md` and `.mdc` files.
|
||||||
|
- Matches via `globs` field in frontmatter.
|
||||||
|
- `alwaysApply: true` for rules that should always fire.
|
||||||
|
- Example rule file:
|
||||||
|
```markdown
|
||||||
|
---
|
||||||
|
globs: ["*.ts", "src/**/*.js"]
|
||||||
|
description: "TypeScript/JavaScript coding rules"
|
||||||
|
---
|
||||||
|
- Use PascalCase for interface names
|
||||||
|
- Use camelCase for function names
|
||||||
|
```
|
||||||
|
- **Online**: Project rules aren't everything. Built-in MCPs for extended capabilities:
|
||||||
|
- **websearch**: Real-time web search powered by [Exa AI](https://exa.ai)
|
||||||
|
- **context7**: Official documentation lookup
|
||||||
|
- **grep_app**: Ultra-fast code search across public GitHub repos (great for finding implementation examples)
|
||||||
|
|
||||||
|
### Be Multimodal. Save Tokens.
|
||||||
|
|
||||||
|
The look_at tool from AmpCode, now in OhMyOpenCode.
|
||||||
|
Instead of the agent reading massive files and bloating context, it internally leverages another agent to extract just what it needs.
|
||||||
|
|
||||||
|
### I Removed Their Blockers
|
||||||
|
|
||||||
|
- Replaces built-in grep and glob tools. Default implementation has no timeout—can hang forever.
|
||||||
|
|
||||||
|
### Skill-Embedded MCP Support
|
||||||
|
|
||||||
|
Skills can now bring their own MCP servers. Define MCP configurations directly in skill frontmatter or via `mcp.json` files:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
description: Browser automation skill
|
||||||
|
mcp:
|
||||||
|
playwright:
|
||||||
|
command: npx
|
||||||
|
args: ["-y", "@anthropic-ai/mcp-playwright"]
|
||||||
|
---
|
||||||
|
```
|
||||||
|
|
||||||
|
When you load a skill with embedded MCP, its tools become available automatically. The `skill_mcp` tool lets you invoke these MCP operations with full schema discovery.
|
||||||
|
|
||||||
|
**Built-in Skills:**
|
||||||
|
- **playwright**: Browser automation, web scraping, testing, and screenshots out of the box
|
||||||
|
|
||||||
|
Disable built-in skills via `disabled_skills: ["playwright"]` in your config.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Goodbye Claude Code. Hello Oh My OpenCode.
|
||||||
|
|
||||||
|
Oh My OpenCode has a Claude Code compatibility layer.
|
||||||
|
If you were using Claude Code, your existing config just works.
|
||||||
|
|
||||||
|
### Hooks Integration
|
||||||
|
|
||||||
|
Run custom scripts via Claude Code's `settings.json` hook system.
|
||||||
|
Oh My OpenCode reads and executes hooks from:
|
||||||
|
|
||||||
|
- `~/.claude/settings.json` (user)
|
||||||
|
- `./.claude/settings.json` (project)
|
||||||
|
- `./.claude/settings.local.json` (local, git-ignored)
|
||||||
|
|
||||||
|
Supported hook events:
|
||||||
|
- **PreToolUse**: Runs before tool execution. Can block or modify tool input.
|
||||||
|
- **PostToolUse**: Runs after tool execution. Can add warnings or context.
|
||||||
|
- **UserPromptSubmit**: Runs when user submits prompt. Can block or inject messages.
|
||||||
|
- **Stop**: Runs when session goes idle. Can inject follow-up prompts.
|
||||||
|
|
||||||
|
Example `settings.json`:
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"hooks": {
|
||||||
|
"PostToolUse": [
|
||||||
|
{
|
||||||
|
"matcher": "Write|Edit",
|
||||||
|
"hooks": [{ "type": "command", "command": "eslint --fix $FILE" }]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Config Loaders
|
||||||
|
|
||||||
|
**Command Loader**: Loads markdown-based slash commands from 4 directories:
|
||||||
|
- `~/.claude/commands/` (user)
|
||||||
|
- `./.claude/commands/` (project)
|
||||||
|
- `~/.config/opencode/command/` (opencode global)
|
||||||
|
- `./.opencode/command/` (opencode project)
|
||||||
|
|
||||||
|
**Skill Loader**: Loads directory-based skills with `SKILL.md`:
|
||||||
|
- `~/.claude/skills/` (user)
|
||||||
|
- `./.claude/skills/` (project)
|
||||||
|
|
||||||
|
**Agent Loader**: Loads custom agent definitions from markdown files:
|
||||||
|
- `~/.claude/agents/*.md` (user)
|
||||||
|
- `./.claude/agents/*.md` (project)
|
||||||
|
|
||||||
|
**MCP Loader**: Loads MCP server configs from `.mcp.json` files:
|
||||||
|
- `~/.claude/.mcp.json` (user)
|
||||||
|
- `./.mcp.json` (project)
|
||||||
|
- `./.claude/.mcp.json` (local)
|
||||||
|
- Supports environment variable expansion (`${VAR}` syntax)
|
||||||
|
|
||||||
|
### Data Storage
|
||||||
|
|
||||||
|
**Todo Management**: Session todos stored in `~/.claude/todos/` in Claude Code compatible format.
|
||||||
|
|
||||||
|
**Transcript**: Session activity logged to `~/.claude/transcripts/` in JSONL format for replay and analysis.
|
||||||
|
|
||||||
|
### Compatibility Toggles
|
||||||
|
|
||||||
|
Disable specific Claude Code compatibility features with the `claude_code` config object:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"claude_code": {
|
||||||
|
"mcp": false,
|
||||||
|
"commands": false,
|
||||||
|
"skills": false,
|
||||||
|
"agents": false,
|
||||||
|
"hooks": false,
|
||||||
|
"plugins": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
| Toggle | When `false`, stops loading from... | Unaffected |
|
||||||
|
| ---------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------- |
|
||||||
|
| `mcp` | `~/.claude/.mcp.json`, `./.mcp.json`, `./.claude/.mcp.json` | Built-in MCP (context7, grep_app) |
|
||||||
|
| `commands` | `~/.claude/commands/*.md`, `./.claude/commands/*.md` | `~/.config/opencode/command/`, `./.opencode/command/` |
|
||||||
|
| `skills` | `~/.claude/skills/*/SKILL.md`, `./.claude/skills/*/SKILL.md` | - |
|
||||||
|
| `agents` | `~/.claude/agents/*.md`, `./.claude/agents/*.md` | Built-in agents (oracle, librarian, etc.) |
|
||||||
|
| `hooks` | `~/.claude/settings.json`, `./.claude/settings.json`, `./.claude/settings.local.json` | - |
|
||||||
|
| `plugins` | `~/.claude/plugins/` (Claude Code marketplace plugins) | - |
|
||||||
|
|
||||||
|
All toggles default to `true` (enabled). Omit the `claude_code` object for full Claude Code compatibility.
|
||||||
|
|
||||||
|
**Selectively disable specific plugins** using `plugins_override`:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"claude_code": {
|
||||||
|
"plugins_override": {
|
||||||
|
"claude-mem@thedotmack": false,
|
||||||
|
"some-other-plugin@marketplace": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
This allows you to keep the plugin system enabled while disabling specific plugins by their full identifier (`plugin-name@marketplace-name`).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Not Just for the Agents
|
||||||
|
|
||||||
|
When agents thrive, you thrive. But I want to help you directly too.
|
||||||
|
|
||||||
|
- **Ralph Loop**: Self-referential development loop that runs until task completion. Inspired by Anthropic's Ralph Wiggum plugin. **Supports all programming languages.**
|
||||||
|
- Start with `/ralph-loop "Build a REST API"` and let the agent work continuously
|
||||||
|
- Loop detects `<promise>DONE</promise>` to know when complete
|
||||||
|
- Auto-continues if agent stops without completion promise
|
||||||
|
- Ends when: completion detected, max iterations reached (default 100), or `/cancel-ralph`
|
||||||
|
- Configure in `oh-my-opencode.json`: `{ "ralph_loop": { "enabled": true, "default_max_iterations": 100 } }`
|
||||||
|
- **Keyword Detector**: Automatically detects keywords in your prompts and activates specialized modes:
|
||||||
|
- `ultrawork` / `ulw`: Maximum performance mode with parallel agent orchestration
|
||||||
|
- `search` / `find` / `찾아` / `検索`: Maximized search effort with parallel explore and librarian agents
|
||||||
|
- `analyze` / `investigate` / `분석` / `調査`: Deep analysis mode with multi-phase expert consultation
|
||||||
|
- **Todo Continuation Enforcer**: Makes agents finish all TODOs before stopping. Kills the chronic LLM habit of quitting halfway.
|
||||||
|
- **Comment Checker**: LLMs love comments. Too many comments. This reminds them to cut the noise. Smartly ignores valid patterns (BDD, directives, docstrings) and demands justification for the rest. Clean code wins.
|
||||||
|
- **Think Mode**: Auto-detects when extended thinking is needed and switches modes. Catches phrases like "think deeply" or "ultrathink" and dynamically adjusts model settings for maximum reasoning.
|
||||||
|
- **Context Window Monitor**: Implements [Context Window Anxiety Management](https://agentic-patterns.com/patterns/context-window-anxiety-management/).
|
||||||
|
- At 70%+ usage, reminds agents there's still headroom—prevents rushed, sloppy work.
|
||||||
|
- **Agent Usage Reminder**: When you call search tools directly, reminds you to leverage specialized agents via background tasks for better results.
|
||||||
|
- **Anthropic Auto Compact**: When Claude models hit token limits, automatically summarizes and compacts the session—no manual intervention needed.
|
||||||
|
- **Session Recovery**: Automatically recovers from session errors (missing tool results, thinking block issues, empty messages). Sessions don't crash mid-run. Even if they do, they recover.
|
||||||
|
- **Auto Update Checker**: Automatically checks for new versions of oh-my-opencode and can auto-update your configuration. Shows startup toast notifications displaying current version and Sisyphus status ("Sisyphus on steroids is steering OpenCode" when enabled, or "OpenCode is now on Steroids. oMoMoMoMo..." otherwise). Disable all features with `"auto-update-checker"` in `disabled_hooks`, or disable just toast notifications with `"startup-toast"` in `disabled_hooks`. See [Configuration > Hooks](../README.md#hooks).
|
||||||
|
- **Background Notification**: Get notified when background agent tasks complete.
|
||||||
|
- **Session Notification**: Sends OS notifications when agents go idle. Works on macOS, Linux, and Windows—never miss when your agent needs input.
|
||||||
|
- **Empty Task Response Detector**: Catches when Task tool returns nothing. Warns you about potential agent failures so you don't wait forever for a response that already came back empty.
|
||||||
|
- **Empty Message Sanitizer**: Prevents API errors from empty chat messages by automatically sanitizing message content before sending.
|
||||||
|
- **Grep Output Truncator**: Grep can return mountains of text. This dynamically truncates output based on your remaining context window—keeps 50% headroom, caps at 50k tokens.
|
||||||
|
- **Tool Output Truncator**: Same idea, broader scope. Truncates output from Grep, Glob, LSP tools, and AST-grep. Prevents one verbose search from eating your entire context.
|
||||||
|
- **Preemptive Compaction**: Compacts session proactively before hitting hard token limits. Runs at 85% context window usage. **Enabled by default.** Disable via `disabled_hooks: ["preemptive-compaction"]`.
|
||||||
|
- **Compaction Context Injector**: Preserves critical context (AGENTS.md, current directory info) during session compaction so you don't lose important state.
|
||||||
|
- **Thinking Block Validator**: Validates thinking blocks to ensure proper formatting and prevent API errors from malformed thinking content.
|
||||||
|
- **Claude Code Hooks**: Executes hooks from Claude Code's settings.json - this is the compatibility layer that runs PreToolUse/PostToolUse/UserPromptSubmit/Stop hooks.
|
||||||
Reference in New Issue
Block a user