Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

astrbot-plugin-devastrbot 插件开发

Agent Skill

astrbot-plugin-dev 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

282

周安装

12

GitHub Stars

1

下载量

99
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/camera-2018/astrbot-plugin-dev-skill --skill astrbot-plugin-dev

简介

用于 AstrBot 插件开发与审查,确保符合硬约束与 API 规范后再编码实现。

  • 适用于编写插件时先阅读 reviewer-checklist 和 project-structure 文档,再加载核心 API 参考。
  • 使用时聚焦 imports、decorators 和 handler 签名等关键点,避免偏离当前仓库实践。
  • 安装方式为 GitHub,支持 Codex、Claude、Cursor 和 Gemini CLI,需遵循本地 dev flow 与发布预期。
  • astrbot-plugin-dev 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

AstrBot Plugin Development

Use this skill to write AstrBot plugins in a reviewer-first way: align with astr-plugin-reviewer hard checks, then follow the current AstrBot repository APIs and docs.

Start Here

Before writing code, always read these two references first:

Then load only the references you need:

Default Workflow

  1. Create or verify main.py and metadata.yaml first.
  2. Treat metadata.yaml as the source of truth for plugin identity. Prefer desc plus repo, and never keep both desc and description.
  3. In main.py, define a class that inherits Star. Prefer AstrBot's auto-discovery; do not introduce the deprecated @register decorator unless you are maintaining old code.
  4. Import filter exactly with from astrbot.api.event import filter to avoid reviewer failures and naming confusion.
  5. Import the logger exactly with from astrbot.api import logger.
  6. Keep network I/O async. Prefer httpx or aiohttp; do not use requests, blocking sleeps, or other blocking network calls.
  7. If the plugin needs persistent files, prefer StarTools.get_data_dir(). It returns a Path.
  8. If you implement LLM hooks, LLM tools, direct LLM calls, or agents, follow the exact signatures and restrictions in references/advanced-features.md.
  9. Before finishing, run a self-check against references/reviewer-checklist.md. If the user wants marketplace publishing, also ensure the publish JSON matches metadata.yaml exactly.

Minimal Template

from pathlib import Path

from astrbot.api import logger
from astrbot.api.event import AstrMessageEvent, filter
from astrbot.api.star import Context, Star, StarTools

class MyPlugin(Star):
    def __init__(self, context: Context):
        super().__init__(context)
        self.data_dir: Path = StarTools.get_data_dir()

    @filter.command("helloworld")
    async def helloworld(self, event: AstrMessageEvent):
        """回复一个简单问候。"""
        logger.info(f"helloworld triggered by {event.get_sender_id()}")
        yield event.plain_result(f"Hello, {event.get_sender_name()}!")

    async def terminate(self):
        """Called when the plugin is unloaded or disabled."""

Note: The @register decorator is deprecated in newer versions of AstrBot. Please use metadata.yaml to define plugin metadata. AstrBot automatically detects the plugin class inheriting from Star.

Core Workflows

1. Project Setup and Metadata

A complete plugin requires metadata.yaml for identification, requirements.txt for dependencies, and optionally logo.png, _conf_schema.json, and a README.md.

  • Plugin names should start with astrbot_plugin_, be lowercase, have no spaces, and be short.
  • See references/project-structure.md for mandatory files, dev environment setup, and publishing.

2. Registering Commands and Filters

Commands are registered using @filter.command(name). AstrBot auto-parses command parameters by type hints. You can also use command groups, command aliases, and filter by event type, platform, or user permission.

  • See references/core-api.md for full list of filters, hooks, the platform compatibility matrix, and event propagation control.

3. Handling Messages and Responses

AstrBot uses a message-chain system. You can respond with plain text, images, or a mix of components. Proactive messages are supported via unified_msg_origin and MessageChain.

4. Advanced Integrations

  • Configuration: Use _conf_schema.json for user settings.
  • LLM Tools: Register tools via @filter.llm_tool or FunctionTool.
  • LLM Direct Calls: Use self.context.llm_generate() to call LLMs directly.
  • Agent / Multi-Agent: Use self.context.tool_loop_agent() for tool-loop agents.
  • Stateful Interaction: Use session_waiter for multi-step prompts with custom session filters.
  • T2I: Render text or HTML/Jinja2 templates to images.
  • Conversation & Persona Managers: Access LLM conversation history and persona settings when needed.

See references/advanced-features.md for examples.

Elegant Design Patterns

Follow these patterns for robust, user-friendly plugins:

  • Use unified logging via from astrbot.api import logger.
  • Handle errors gracefully to avoid bot crashes.
  • Use KV storage or the plugin data directory for persistence.
  • Ensure all I/O operations are non-blocking.
  • Access platform instances, loaded plugins, and protocol-level APIs only when necessary.

See references/patterns.md for detailed code patterns.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.85%
按下载量换算35

Claude

29.75%
按下载量换算29

Cursor

20.06%
按下载量换算20

Gemini CLI

9.95%
按下载量换算10

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills