langbot-plugin-dev
できること
このスキルは、LangBotのプラグインを書いて修正する作業をエージェントに案内します。LangBotに新しい機能を追加する開発者向けです。
使う場面
- ✓コマンド、イベントリスナー、ツールを持つ新しいLangBotプラグインを作りたいとき。
- ✓LangBotプラグインのバグを修正し、テストする必要があるとき。
- ✓実行中のLangBotインスタンスに対して、プラグインをテストしたいとき。
スキルのリンク
https://github.com/langbot-app/LangBot/blob/master/skills/skills/langbot-plugin-dev/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“チャットメッセージを要約するコマンドを追加するLangBotプラグインを作りたいです。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、マニフェスト、メインファイル、リスナー、コマンド、ツールのコンポーネントファイルからなるプラグインの構成に従います。その後、WebSocketを使った自動チェックでプラグインをテストします。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
LangBot Plugin Development & Debugging
Controlling a running instance via MCP
Beyond writing code, you can drive a live LangBot instance over MCP — no raw
HTTP needed. Two MCP servers exist (both reuse existing API keys; see AGENTS.md):
- LangBot instance —
http://<host>:5300/mcp(auth: web-UIlbk_key or theapi.global_api_keyfromconfig.yaml). Manage bots, pipelines, models, knowledge bases, and skills. See thelangbot-mcp-opsskill. - LangBot Space marketplace —
https://space.langbot.app/mcp(auth: Personal Access Token). Search plugins / MCP servers / skills. See thelangbot-space-opsskill.
Any change to an agent-accessible HTTP API endpoint must keep the matching MCP tool and these skills in sync.
Plugin Architecture
A LangBot plugin consists of:
MyPlugin/
├── manifest.yaml # Plugin metadata, config schema
├── main.py # BasePlugin subclass (entry point, shared state)
├── components/
│ ├── event_listener/ # Hook pipeline events
│ │ ├── collector.yaml
│ │ └── collector.py
│ ├── commands/ # !command handlers
│ │ ├── mycommand.yaml
│ │ └── mycommand.py
│ └── tools/ # LLM function-call tools
│ ├── mytool.yaml
│ └── mytool.py
Each component has a .yaml (metadata) and .py (implementation).
README & i18n convention (enforced on the marketplace)
A plugin published to LangBot Space serves a localized README on its detail page.
The resolver (langbot-space PluginService.GetPluginREADME) works like this:
- Root
README.mdMUST be in English. It is the default and the fallback — when no per-language README matches the viewer's locale, the page serves the rootREADME.md. A non-English root README makes the English/default view show the wrong language. - All other languages live under
readme/README_{lang}.md— e.g.readme/README_zh_Hans.md,readme/README_ja_JP.md. The 8 supported locales:en_US, zh_Hans, zh_Hant, ja_JP, th_TH, vi_VN, es_ES, ru_RU. manifest.yamlmetadata.label/metadata.descriptionshould carry the same 8-locale i18n set (repositorymust be a real, alive URL).
MyPlugin/
├── manifest.yaml
├── README.md # English (default + fallback) — REQUIRED, must be English
└── readme/
├── README_zh_Hans.md
├── README_zh_Hant.md
├── README_ja_JP.md
├── README_th_TH.md
├── README_vi_VN.md
├── README_es_ES.md
└── README_ru_RU.md
manifest.yaml (incl. repository) is the source of truth — the marketplace
syncs from it, so edit the package and re-publish rather than patching live data.
Critical SDK Pitfalls
1. MessageChain is a RootModel — iterate directly
# ❌ WRONG — MessageChain has no .components attribute
for component in event.message_chain.components:
# ✅ CORRECT — MessageChain is a Pydantic RootModel, iterate directly
for component in event.message_chain:
2. Message.content must be list[ContentElement] or str, not a single ContentElement
from langbot_plugin.api.entities.builtin.provider import message as provider_message
# ❌ WRONG — single ContentElement
Message(role="user", content=ContentElement.from_text("hello"))
# ✅ CORRECT — list of ContentElement
Message(role="user", content=[ContentElement.from_text("hello")])
# ✅ ALSO CORRECT — plain string
Message(role="user", content="hello")
3. invoke_llm does NOT accept timeout
# ❌ WRONG
await self.invoke_llm(llm_model_uuid=uuid, messages=msgs, timeout=60)
# ✅ CORRECT
await self.invoke_llm(llm_model_uuid=uuid, messages=msgs)
4. invoke_llm response.content can be str OR list
response = await self.invoke_llm(...)
if response.content:
if isinstance(response.content, str):
return response.content
elif isinstance(response.content, list):
parts = [e.text for e in response.content if hasattr(e, "text") and e.text]
return "\n".join(parts)
5. get_llm_models() returns UUIDs
# Returns list[str] of model UUIDs
models = await self.get_llm_models()
model_uuid = models[0] # First available model UUID
Known bug (v4.9.3): The host handler may return list[dict] instead of list[str]. If you hit TypeError: unhashable type: 'dict' in invoke_llm, the fix is in LangBot/src/langbot/pkg/plugin/handler.py — change 'llm_models': llm_models to `'llm_models': [m['uuid'] for m in ll
よくある質問
LangBotプラグインはどの部品で構成されますか?
マニフェストファイル、メインファイル、イベントリスナー、コマンド、ツールのフォルダーで構成されます。各コンポーネントには設定ファイルとコードファイルがあります。
Web画面を使わずにプラグインをテストできますか?
はい。稼働中のインスタンスに対して実行される、WebSocketベースの自動テストを説明しています。
エージェントは実行中のインスタンスも管理できますか?
はい。稼働中のインスタンスを操作するために、LangBot MCP操作のスキルを案内します。
詳細
作者による元の説明
Develop, debug, and test LangBot plugins. Use when creating new LangBot plugins, fixing plugin bugs, setting up a LangBot test environment, or testing plugins via WebSocket. Covers plugin component architecture (EventListener, Command, Tool), the plugin SDK API (invoke_llm, get_llm_models, send_message, plugin storage), common pitfalls, and automated WebSocket-based testing. Triggers on "langbot plugin", "lbp", "GroupChatSummary", "plugin debug", "langbot test".
repo: langbot-app/LangBot
人気
- GitHubのスター
- 19k
- ランキング
- #10512
- ライセンス
- Apache-2.0
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
langbot-deploy
19kエージェントが、Docker、Docker Compose、またはKubernetesを使って、自前のLangBotインスタンスをデプロイし、モデルとAPIキーの設定を行うよう支援します。
langbot-env-setup
19kエージェントが、起動時のチェック、プロキシ設定、ログイン状態を保つブラウザーを含め、ローカルのLangBotテスト環境を動かせるよう支援します。
langbot-mcp-ops
19kエージェントが、組み込みのMCPサーバーを通じてLangBotインスタンスを管理し、生のWeb呼び出しなしで、ボット、パイプライン、モデル、ナレッジベースを扱えるよう支援します。
langbot-space-ops
19kエージェントが、LangBot Spaceのマーケットプレイスでプラグイン、MCPサーバー、スキルを検索し、セットアップ用にランク付けされたモデル一覧を取得できるよう支援します。
似ているスキル
api-connector-builder
280kエージェントが既存のパターンに従って、新しいAPI連携を構築します。新しい方式を作らずに、もう一つ連携を追加したいときに使います。
api-design
280kエージェントがベストプラクティスに沿ってREST APIを設計できるようにします。APIの通信方法、エラーの表示方法、データの整理方法を決めるのに役立ちます。
backend-patterns
280kエージェントのサーバーサイドのアーキテクチャパターンとデータベースの最適化を支援します。サーバー上で動くコードを作成またはレビューするときに役立ちます。