
oh-my-opencode から必要なものだけ選んで最小構成で導入する
oh-my-opencode は「OpenCode を爆速にするプラグイン」で、994 stars つけている。が、全部入れると不要なものまで入ってくる。
この記事は、実際におかわりしたものを全て公開する。コピペで動く。
なぜ全部入れないのか
oh-my-opencode は Sisyphus というオーケストレーターが中心にあって、それ専用のエージェント定義や MCP が多数入っている。自分の環境にカスタム MCP等がある場合、全部入れると被って壊れる。
結論:有用な 4 つだけ取った。
導入するもの
・playwright スキル | ブラウザ操作(テスト、スクショ、フォーム入力)
・git-master スキル | 原子的コミット、リベース、履歴考古学
・LSP 有効化 | IDE 級のリファクタリング(リネーム、参照検索)
・/init-deep コマンド | プロジェクト全体に AGENTS.md を自動生成
追加: バックグラウンドコードレビュープラグイン(モデルはご自由に)も自作した。
1. playwright スキル
`~/.config/opencode/skills/playwright/SKILL.md` を作成:
---
description: Browser automation via Playwright MCP - navigation, screenshots, form filling, web scraping, testing.
mcp:
playwright:
command: npx
args: ["@playwright/mcp@latest"]
---
# Playwright Browser Automation
Use this skill for any browser-related tasks: verification, browsing, information gathering, web scraping, testing, screenshots.
## Common Operations
### Navigation
- Navigate to URLs
- Go back/forward
- Reload pages
### Interaction
- Click elements
- Fill forms
- Select dropdowns
- Check/uncheck checkboxes
- Hover, drag and drop
### Information Gathering
- Get element text, HTML, attributes
- Take screenshots (full page or element)
- Generate PDFs
- Wait for elements, URLs, network idle
### Advanced
- Intercept/mock network requests
- Emulate devices and geolocation
- Handle dialogs and popups
- Manage cookies and storage
- Record videos2. git-master スキル
`~/.config/opencode/skills/git-master/SKILL.md` を作成:
---
description: Git operations - atomic commits, rebase/squash, history search (blame, bisect, log -S).
---
# Git Master
You are a Git expert combining three specializations:
1. **Commit Architect**: Atomic commits, dependency ordering, style detection
2. **Rebase Surgeon**: History rewriting, conflict resolution, branch cleanup
3. **History Archaeologist**: Finding when/where specific changes were introduced
## Core Rules
### Multiple Commits by Default
3+ files changed -> MUST be 2+ commits
5+ files changed -> MUST be 3+ commits
10+ files changed -> MUST be 5+ commits
Split by:
- Different directories/modules
- Different component types (model/service/view)
- Can be reverted independently
- Different concerns (UI/logic/config/test)
ONLY combine when ALL are true:
- Same atomic unit (e.g., function + its test)
- Splitting would break compilation
- Can justify WHY in one sentence
### Style Detection (First Step)
Analyze `git log -30` to detect:
- Language: Korean, English, or Mixed
- Style: Semantic (`feat:`, `fix:`), Plain, Short, or Sentence
ALWAYS match the existing repository style.
### Test Pairing
Test files MUST be in same commit as implementation:
- `test_*.py` <-> `*.py`
- `*.test.ts` <-> `*.ts`
- `*.spec.ts` <-> `*.ts`3. LSP 有効化
`~/.config/opencode/opencode.json` に追加:
{
"lsp": true
}OpenCode は TypeScript、Python、Go 等の LSP を内蔵している。有効にするだけで、エージェントがリネームや参照検索を IDE 級でできるようになる。
4. /init-deep コマンド
`~/.config/opencode/commands/init-deep.md` を作成:
# /init-deep
Generate hierarchical AGENTS.md files. Root + complexity-scored subdirectories.
## Usage
/init-deep # Update mode
/init-deep --create-new # Regenerate from scratch
/init-deep --max-depth=2 # Limit directory depth
## Workflow
1. **Discovery + Analysis** - bash structure + read existing AGENTS.md
2. **Score & Decide** - Determine AGENTS.md locations
3. **Generate** - Root first, then subdirs
4. **Review** - Deduplicate, trim, validate
## Scoring
| Score | Action |
|-------|--------|
| Root (.) | ALWAYS create |
| >15 | Create AGENTS.md |
| 8-15 | Create if distinct domain |
| <8 | Skip |5. バックグラウンドコードレビュー(おまけ)
`~/.config/opencode/plugins/code-review/index.ts` を作成:
import type { Plugin } from "@opencode-ai/plugin"
const REVIEW_PROMPT = `You are a code reviewer. Analyze the following code for:
1. Security vulnerabilities (SQL injection, XSS, CSRF, hardcoded secrets)
2. Bad dependencies or import issues
3. Potential bugs or logic errors
4. Code quality issues
Be concise. Only report actual issues.
If no issues found, respond with "No issues detected."
File:
`
export const CodeReviewPlugin: Plugin = async ({ client, $ }) => {
const reviewedFiles = new Set<string>()
return {
"file.edited": async (input) => {
const filePath = input?.filePath
if (!filePath) return
const codeExtensions = [".ts", ".tsx", ".js", ".jsx", ".py", ".go", ".rs", ".vue", ".svelte"]
if (!codeExtensions.some(ext => filePath.endsWith(ext))) return
const now = Date.now()
const lastReviewed = reviewedFiles.get(filePath)
if (lastReviewed && now - lastReviewed < 30000) return
reviewedFiles.set(filePath, now)
try {
const result = await $`cat "${filePath}"`.text()
const reviewPrompt = `${REVIEW_PROMPT}\`\`\`\n${result}\n\`\`\`\n\nFile: ${filePath}`
await client.session.create({
model: "deepseek/deepseek-chat",
prompt: reviewPrompt,
background: true,
})
} catch (error) {
// Silently ignore review errors
}
},
}
}
export default CodeReviewPlugin`opencode.json` の `plugin` 配列に追加:
{
"plugin": [
"file:///Users/you/.config/opencode/plugins/code-review/index.ts"
]
}なぜこれだけなのか
やったもの | 効果
-----------------
・playwright | ブラウザ自動化が可能に |
・git-master | コミット品質が上がる |
・LSP | リファクタリングが安全に |
・/init-deep | AGENTS.md 作成が楽に |
・code-review | セキュリティチェックが自動化 |
やらなかったもの
-----------------------
・Sisyphus オーケストレーター | 既存の MCP と被る
・oracle/explore エージェント | モデル入れ替えが必要
・MCP(Exa, Context7) | 既存で足りてる
・hooks(directory-agents-injector) | 複数プロジェクトは別々に立ち上げてる
まとめ
oh-my-opencode は凄いが、全部入れる必要はない。自分の環境に合わせて 必要なものだけ選択 するのが良いと思う。無駄に巨大(使わない機能も盛りだくさん)で全部いりみたいなのが多すぎるためこういう手法をとっている。良いかも?って思ったのは 分析して自分用に実装かけた方が勝手が良い。
全部でファイル 5 つ。設定変更 2 箇所。それだけでも、エージェントの能力はかなり上がる。