Token导航 LogoToken导航

Agent Skill · 开发

bot(机器人)

bot 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

bot 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描有提醒项,按安装量在开发类的 21,746 个 Skill 里排第 13,981。

总安装 782周安装 17GitHub Stars 75,865下载 140核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:bot(机器人)
来源仓库:https://github.com/lobehub/lobehub
仓库路径:skills/bot
安装命令:
npx skills add https://github.com/lobehub/lobehub --skill bot
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/lobehub/lobehub --skill bot

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

用于处理 GitHub 仓库、Issue、Pull Request 和协作信息。适合围绕仓库状态、代码变更或协作事项进行整理。bot 属于开发类 Skill,可作为该场景下的辅助能力补充。可结合来源仓库和原始 README 核验具体用法。安装方式:通过 npx skills add 命令从 GitHub 仓库添加。

使用前应确认权限范围、是否会触发联网或文件读写。

来源仓库内路径:skills/bot

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/lobehub/lobehub --skill bot;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

bot 怎么安装?

在终端执行 npx skills add https://github.com/lobehub/lobehub --skill bot。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

bot 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

bot 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

bot 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

bot 用的人多吗?

公开数据是累计安装 782 次,近一周安装 17 次,下载 140 次,GitHub 75,865 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

bot 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 来源仓库有 75,865 星,维护活跃度相对可查。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
bot

机器人 · 本页

78275,865需要联网未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Bot System

Last updated: 2026-04-08. Implementation evolves quickly — this doc is a map, not the source of truth. Always read the key files below to verify behavior, especially per-platform quirks. Update this doc when the architecture changes.

LobeChat agents can answer inside external chat platforms. Inbound messages flow through the Chat SDK (chat npm package), get routed to the right agent by (platform, applicationId), executed via AiAgentService, and replied back through a per-platform PlatformClient. There are two execution modes (in-memory vs queue/QStash) and three connection modes (webhook, websocket, polling).

Supported Platforms

PlatformidDefault modeMarkdownEditNotes
DiscorddiscordwebsocketyesyesPersistent gateway via Chat SDK adapter; reaction-thread quirks; native slash commands
Slackslackwebsocket (Socket Mode)yes (mrkdwn)yesMulti-mode — user can pick webhook per provider
Telegramtelegramwebhookyes (HTML)yessetMyCommands menu via registerBotCommands
Feishufeishuwebsocket (Lark SDK WSClient)no (stripped)yesMulti-mode; shared client with Lark
LarklarkwebsocketnoyesSame client/schema as Feishu, different domain
QQqqwebsocketnonoAll replies are final-only
WeChatwechatpolling (iLink long-poll)nono10-minute gateway window

supportsMarkdown=false ⇒ outbound markdown is stripped to plain text via stripMarkdown and the AI is told not to use markdown. supportsMessageEdit=false ⇒ no progress edits — only the final reply is sent.

Multi-mode connection — Slack/Feishu/Lark/QQ ship as websocket but support webhook per-provider via settings.connectionMode. The runtime always merges schema defaults into stored settings before resolving the mode (resolveBotProviderConfig / resolveConnectionMode in platforms/utils.ts), so the schema's field.default is the source of truth — set it correctly when adding a new multi-mode platform.

Inbound Flow (one webhook → reply)

Platform server
   │  POST /api/agent/webhooks/[platform]/[appId]
   ▼
route.ts ── catch-all `[[...appId]]` route
   │
   ▼
BotMessageRouter (singleton)
   │  • lazy-loads bot per `platform:applicationId`
   │  • merges schema defaults + provider.settings (mergeWithDefaults)
   │  • builds Chat SDK Chat<any> with createIoRedisState (if Redis available)
   │  • registerHandlers: onNewMention / onSubscribedMessage / onNewMessage(/.dm)
   │  • registerCommands: /new (reset topic), /stop (interrupt)
   │
   ▼
chatBot.webhooks[platform](req)   ← Chat SDK parses → fires events
   │
   ▼
AgentBridgeService.handleMention / handleSubscribedMessage
   │  • activeThreads guard (no duplicate runs per thread)
   │  • adds 👀 reaction (eyes), startTyping
   │  • merges debounced/queued skipped messages (mergeSkippedMessages)
   │  • extractFiles (buffer → fetchData → url)
   │  • formatPrompt (sanitize mention + speaker tag + referenced_message)
   │
   ├── In-memory mode ──► AiAgentService.execAgent({ stepCallbacks })
   │       → onAfterStep edits progress message live
   │       → onComplete edits final reply, splits via splitMessage(charLimit)
   │
   └── Queue mode (isQueueAgentRuntimeEnabled) ──► execAgent({ stepWebhook, completionWebhook, webhookDelivery: 'qstash' })
           → returns immediately, callbacks land at /api/agent/webhooks/bot-callback

The router caches loaded bots in memory. Cache is invalidated by BotMessageRouter.invalidateBot(platform, appId) whenever the TRPC update/delete mutations run, so new credentials/settings take effect on the next webhook.

Execution Modes

In-memory (default)

AgentBridgeService.executeWithInMemoryCallbacks wraps execAgent with stepCallbacks. Lives in one process — Promise-based wait, 30-min timeout, edits the same progressMessage after every step. Topic title is summarized inline via SystemAgentService.

Queue (isQueueAgentRuntimeEnabled)

AgentBridgeService.executeWithWebhooks:

  1. Posts the renderStart placeholder, captures progressMessageId.
  2. Calls execAgent with stepWebhook and completionWebhook pointing at ${INTERNAL_APP_URL?? APP_URL}/api/agent/webhooks/bot-callback, plus webhookDelivery: 'qstash'.
  3. Returns immediately; the bridge finally block keeps the active-thread marker held until the completion callback fires.

/api/agent/webhooks/bot-callback/route.ts verifies the QStash signature and hands off to BotCallbackService.handleCallback:

  • type: 'step' → handleStep re-renders renderStepProgress, edits progressMessageId (skipped if displayToolCalls=false or platform supportsMessageEdit=false).
  • type: 'completion' → handleCompletion writes the final reply (or error/interrupted message), removes the 👀 reaction, clears active-thread tracker, fires async summarizeTopicTitle.

BotCallbackService.createMessenger reloads provider + credentials from DB and rebuilds a PlatformClient per call (no in-memory state).

Commands

Defined in BotMessageRouter.buildCommands and registered via two paths:

  • Native slash commands (Slack/Discord): bot.onSlashCommand('/<name>',...)
  • Text-based fallback (Telegram/Feishu/QQ/Lark/WeChat): bot.onNewMessage(/^\/(new|stop)(\s|$|@)/,...) plus a per-mention tryDispatch so commands work even before subscribe.

Built-in commands:

  • /new — clears topicId in thread state, next message starts a fresh topic.
  • /stop — interrupts the active execution (calls AiAgentService.interruptTask if operationId is known; otherwise queues a deferred stop via requestStop/pendingStopThreads, also aborts the startup phase via startupControllers).

To add a command, append to buildCommands — it auto-registers everywhere; on Telegram it also surfaces in the / menu via client.registerBotCommands → setMyCommands.

Active-thread State (statics on AgentBridgeService)

  • activeThreads: Set<threadId> — prevents duplicate runs per thread (must guard before stale-topic check, otherwise concurrent messages can drop).
  • activeOperations: Map<threadId, operationId> — needed by /stop once execAgent returns.
  • startupControllers: Map<threadId, AbortController> — cancels pre-operationId work (topic/tool prep).
  • pendingStopThreads: Set<threadId> — /stop arrived before operationId existed; consumed once available.

In queue mode, the bridge finally skips cleanup so the marker persists until BotCallbackService.handleCompletion calls clearActiveThread.

Topic Lifecycle in Threads

  • handleMention always treats the message as the start of a new conversation.
  • handleSubscribedMessage reads topicId from thread.state. If the topic is stale (> 4 hours since updatedAt), state is cleared and it retries as a fresh mention.
  • If execAgent fails with a Postgres FK violation on topic_id (cached topic was deleted), the bridge clears state and retries as a mention.
  • subscribe() is gated by client.shouldSubscribe(threadId) — Discord top-level channels return false so we don't follow up there.

Attachments

AgentBridgeService.extractFiles resolves attachments in priority order:

  1. att.buffer — already downloaded by the adapter (WeChat/Feishu inbound).
  2. att.fetchData() — adapter-provided lazy download with auth (Telegram, Slack, Feishu history). Required when URLs are token-protected — naive fetch(url) later in ingestAttachment.ts has no credentials.
  3. att.url — public CDN fallback (Discord, public QQ).

inferMimeType / inferName patch Telegram-style photo payloads (no mimeType/name from Bot API → defaults to image/jpeg) so vision models actually see them. Quoted-message attachments are also pulled from raw.referenced_message.attachments (Discord).

Concurrency

settings.concurrency is 'queue' or 'debounce':

  • debounce → Chat SDK debounces inbound messages by debounceMs; mergeSkippedMessages joins skipped texts/attachments into the current message before handing to the agent.
  • queue → Chat SDK serializes per-thread; the bridge's own activeThreads set is still required because in queue mode the SDK lock releases before the agent finishes.

Gateway (persistent platforms)

Webhook platforms run fine in serverless functions. Persistent platforms (websocket, polling) need a long-running listener — that's the gateway.

GatewayService.startClient(platform, appId, userId) (src/server/services/gateway/index.ts):

  • On Vercel + persistent mode → BotConnectQueue.push (Redis hash) and mark runtime status queued. The cron picks it up.
  • On Vercel + webhook mode → start the client inline (one HTTP call).
  • Off-Vercel → GatewayManager singleton holds long-lived clients in process.

GET /api/agent/gateway/route.ts (cron, Bearer ${CRON_SECRET}):

  • Iterates registered platforms and starts every enabled persistent provider with durationMs = 10min, then in after(...) polls BotConnectQueue every 30s for new connect requests, until the window expires.
  • getEffectiveConnectionMode(platform, settings) is the only place that resolves per-provider mode — respect it everywhere.

POST /api/agent/gateway/start/route.ts is the non-Vercel ensureRunning entry point (Bearer ${KEY_VAULTS_SECRET}).

Runtime status is stored in Redis at bot:runtime-status:platform:appId with TTL ≈ durationMs + 60s. States: starting | connected | disconnected | failed | queued. Updated by each PlatformClient.start/stop and by the gateway service.

Platform Definitions

Each platform exposes a PlatformDefinition registered in platforms/index.ts:

{
  id: 'discord',
  name: 'Discord',
  connectionMode: 'websocket',          // recommended default
  schema: FieldSchema[],                 // applicationId + credentials + settings
  clientFactory: new DiscordClientFactory(),
  supportsMarkdown?: boolean,            // default true
  supportsMessageEdit?: boolean,         // default true
  documentation?: { portalUrl, setupGuideUrl },
}

schema drives both server validation (mergeWithDefaults, extractDefaults) and the auto-generated UI form. Top-level keys applicationId / credentials / settings map to DB columns. Common settings fields live in platforms/const.ts (displayToolCallsField, makeServerIdField(platform?), makeUserIdField(platform?)). The serverId / userId factories take a platform identifier so the field's hint can render platform-specific "how to find this ID" guidance (Discord Developer Mode, Telegram @userinfobot, etc.); pass no argument to fall back to generic copy.

Each platform implements PlatformClient (see platforms/types.ts):

  • Lifecycle: start(opts?), stop()
  • Inbound: createAdapter() → Chat SDK adapter map
  • Outbound: getMessenger(platformThreadId) → {createMessage, editMessage, removeReaction, triggerTyping, updateThreadName?}
  • Formatting: formatMarkdown?, formatReply? (usage-stats footer when showUsageStats)
  • Helpers: extractChatId, parseMessageId, sanitizeUserInput, shouldSubscribe, resolveReactionThreadId
  • Optional patches: applyChatPatches(chatBot) (Discord uses this for forwardedInteractions + threadRecovery)
  • Optional menu: registerBotCommands(commands) (Telegram setMyCommands)

ClientFactory.validateCredentials is called from the TRPC testConnection mutation — implement it to hit the platform API and return useful per-field errors.

Database

Schema (packages/database/src/schemas/agentBotProvider.ts):

agent_bot_providers (
  id uuid pk,
  agent_id text fk → agents.id (cascade),
  user_id text fk → users.id (cascade),
  platform varchar(50),                  // 'discord' | 'slack' | …
  application_id varchar(255),
  credentials text,                      // KeyVaults-encrypted JSON
  settings jsonb default '{}',
  enabled boolean default true,
  …timestamps
)
unique (platform, application_id)

Model (packages/database/src/models/agentBotProvider.ts):

  • User-scoped: create / update / delete / query / findById / findByAgentId / findEnabledByApplicationId. Credentials are encrypted/decrypted via the injected KeyVaultsGateKeeper.
  • Static (system-wide): findByPlatformAndAppId, findEnabledByPlatform — used by webhook routing & gateway sync, since they don't have a user context yet.

TRPC router (src/server/routers/lambda/agentBotProvider.ts):

ProcedureNotes
listPlatformsReturns SerializedPlatformDefinition[] (no clientFactory)
create / update / deleteCalls BotMessageRouter.invalidateBot + GatewayService.stopClient so changes take effect
list / getByAgentId / getRuntimeStatusDecorate rows with Redis runtime status
connectBotReturns `{status: 'started''queued'}`
testConnectionCalls clientFactory.validateCredentials
wechatGetQrCode / wechatPollQrStatusiLink onboarding flow

Client service: src/services/agentBotProvider.ts. Store actions: src/store/agent/slices/bot/action.ts. UI: src/routes/(main)/agent/channel/{list,detail} — settings form is auto-generated from each platform's schema.

Reply Templates

src/server/services/bot/replyTemplate.ts exports renderStart, renderStepProgress, renderFinalReply, renderError, renderStopped, splitMessage. Step progress carries elapsed time, last LLM content, last tools, totals; final reply uses client.formatMarkdown then client.formatReply (which optionally appends formatUsageStats). splitMessage(text, charLimit) chunks at paragraph → line → hard cut.

src/server/services/bot/ackPhrases/ provides randomized ack phrases.

Key Files

Webhook routes:
  src/app/(backend)/api/agent/webhooks/[platform]/[[...appId]]/route.ts  — inbound catch-all
  src/app/(backend)/api/agent/webhooks/bot-callback/route.ts             — qstash bot callback
  src/app/(backend)/api/agent/gateway/route.ts                           — cron gateway (10min window)
  src/app/(backend)/api/agent/gateway/start/route.ts                     — non-Vercel ensureRunning

Bot service:
  src/server/services/bot/index.ts                          — barrel
  src/server/services/bot/BotMessageRouter.ts               — lazy bot loading + handler registration + commands
  src/server/services/bot/AgentBridgeService.ts             — Chat SDK ↔ AiAgentService bridge, both exec modes
  src/server/services/bot/BotCallbackService.ts             — qstash callback handler
  src/server/services/bot/formatPrompt.ts                   — speaker tag + referenced_message + sanitize
  src/server/services/bot/replyTemplate.ts                  — render*/splitMessage
  src/server/services/bot/ackPhrases/                       — randomized acks
  src/server/services/bot/__tests__/                        — unit tests for the above

Platform abstraction:
  src/server/services/bot/platforms/index.ts                — registry singleton + exports
  src/server/services/bot/platforms/types.ts                — PlatformClient/Definition/FieldSchema/ClientFactory
  src/server/services/bot/platforms/registry.ts             — PlatformRegistry class
  src/server/services/bot/platforms/utils.ts                — mergeWithDefaults, getEffectiveConnectionMode, formatUsageStats, runtimeKey
  src/server/services/bot/platforms/const.ts                — shared FieldSchema fragments (displayToolCalls, serverId, userId)
  src/server/services/bot/platforms/stripMarkdown.ts        — used by no-markdown platforms

Per-platform (each ships definition.ts, schema.ts, client.ts, const.ts, protocol-spec.md):
  src/server/services/bot/platforms/discord/                — websocket gateway + chat patches
  src/server/services/bot/platforms/slack/                  — multi-mode (Socket Mode / webhook), markdownToMrkdwn
  src/server/services/bot/platforms/telegram/               — webhook, markdownToHTML, registerBotCommands
  src/server/services/bot/platforms/feishu/                 — feishu + lark share client/schema (definitions/{feishu,lark,shared}.ts)
  src/server/services/bot/platforms/qq/                     — websocket, no markdown, no edit
  src/server/services/bot/platforms/wechat/                 — long-poll, no markdown, no edit

Gateway:
  src/server/services/gateway/index.ts                      — GatewayService (Vercel-aware startClient/stopClient)
  src/server/services/gateway/GatewayManager.ts             — long-running client registry (non-Vercel)
  src/server/services/gateway/botConnectQueue.ts            — Redis hash queue with TTL
  src/server/services/gateway/runtimeStatus.ts              — Redis bot:runtime-status keys

Database:
  packages/database/src/schemas/agentBotProvider.ts         — agent_bot_providers table
  packages/database/src/models/agentBotProvider.ts          — encrypted CRUD + system-wide finders

TRPC + client:
  src/server/routers/lambda/agentBotProvider.ts             — TRPC router
  src/services/agentBotProvider.ts                          — client wrapper
  src/store/agent/slices/bot/action.ts                      — Zustand actions

UI:
  src/routes/(main)/agent/channel/list.tsx                  — channel list
  src/routes/(main)/agent/channel/detail/                   — auto-generated form (Header/Body/Footer)
  src/routes/(main)/agent/channel/const.ts                  — platform icons

Types & runtime status:
  src/types/botRuntimeStatus.ts                             — BOT_RUNTIME_STATUSES enum + snapshot type

Adding a New Platform

  1. Create src/server/services/bot/platforms/<id>/:

- definition.ts — PlatformDefinition registered in platforms/index.ts - schema.ts — FieldSchema[] (applicationId + credentials + settings); reuse fragments from ../const.ts - client.ts — class XClientFactory extends ClientFactory returning a PlatformClient (lifecycle + adapter + messenger + helpers) - const.ts — DEFAULT_X_CONNECTION_MODE, history limits, etc. - protocol-spec.md — protocol notes (every existing platform has one)

  1. Pick the right connectionMode — webhook is much simpler if the platform supports it.
  2. If the platform can't render markdown, set supportsMarkdown: false and implement formatMarkdown via stripMarkdown.
  3. If it can't edit messages, set supportsMessageEdit: false — BotCallbackService will skip step edits and only send the final reply.
  4. Implement validateCredentials so the UI's "Test connection" button gives useful errors.
  5. Add the platform icon in src/routes/(main)/agent/channel/const.ts and register the platform in src/server/services/bot/platforms/index.ts.
  6. Add i18n keys under channel.* in src/locales/default/setting.ts (or wherever the channel namespace lives) — the schema's label/description/placeholder/enumLabels are i18n keys.

平台分布

Codex

35.69%
按下载量换算50

Claude

29.04%
按下载量换算41

Cursor

17.95%
按下载量换算25

Gemini CLI

9.33%
按下载量换算13

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills