Skip to content
Skillpedia
APIs & servers (backend)19k Β· #10512

langbot-plugin-dev

What it does

This skill guides an AI agent through writing and fixing plugins for LangBot, a bot platform. It is for developers who extend LangBot with new features.

When to use it

  • βœ“When you want to create a new LangBot plugin with commands, event listeners, or tools.
  • βœ“When a LangBot plugin has a bug that needs to be fixed and tested.
  • βœ“When you want to test a plugin against a running LangBot instance.

Skill link

https://github.com/langbot-app/LangBot/blob/master/skills/skills/langbot-plugin-dev/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/langbot-app/LangBot/blob/master/skills/skills/langbot-plugin-dev/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œI want to build a LangBot plugin that adds a command to summarize chat messages.”

5 new skills a week. 1 minute to read.

How it works

The agent follows a plugin layout with a manifest, a main file, and component files for listeners, commands, and tools. It then tests the plugin with automated WebSocket checks.

Technical content (original SKILL.md)

Original text by the author, straight from 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-UI lbk_ key or the api.global_api_key from config.yaml). Manage bots, pipelines, models, knowledge bases, and skills. See the langbot-mcp-ops skill.
  • LangBot Space marketplace β€” https://space.langbot.app/mcp (auth: Personal Access Token). Search plugins / MCP servers / skills. See the langbot-space-ops skill.

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.md MUST be in English. It is the default and the fallback β€” when no per-language README matches the viewer's locale, the page serves the root README.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.yaml metadata.label / metadata.description should carry the same 8-locale i18n set (repository must 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

FAQ

What parts make up a LangBot plugin?

A plugin has a manifest file, a main file, and folders for event listeners, commands, and tools. Each component has a settings file and a code file.

Can the agent test the plugin without the web interface?

Yes. The skill describes automated WebSocket-based tests that run against a live instance.

Can the agent also manage the running instance?

Yes. The skill points to the LangBot MCP operations skill for controlling a live instance.

Details

Original description by the author

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

Popularity

GitHub stars
19k
Ranking position
#10512
License
Apache-2.0
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills