Логотип Skill Astrbot Dev

Skill Astrbot Dev

Сообщество
xunxiing
skill-astrbot-dev

AstrBot plugin development reference and workflow guide. Use this skill when you are: - Writing AstrBot plugins, hooks, decorators, or message handlers - Implementing platform adapters, message chains, or event flows - Configuring plugin schemas, sessions, or lifecycle management - Working with Agent system (tools, subagents, personas, sandboxes, cron jobs) - Converting between AstrBot message models and platform-specific formats - Looking up AstrBot API signatures, hook inventories, or code entrypoints - Debugging plugin issues related to message routing, event handling, or provider integration Provides reference docs for: messages, platform adapters, plugin config, agent system, and core concepts.

Обзор

Издательxunxiing
РепозиторийAstrBot-Skill
Название навыкаskill-astrbot-dev
Звёзды
76
Форки
9
Файлы в комплекте
39
Ссылки
  • Инструкции в формате Markdown

    Модель загружает файл SKILL.md по мере необходимости, поэтому токены расходуются только при подходящем запросе.

  • Работает с любой большой языковой моделью

    Навыки ИИ — это обычный Markdown, а не код для конкретного поставщика, поэтому они работают с GPT, Claude, Gemini, Grok и локальными моделями.

  • Файлы в комплекте: 39

    Скрипты, шаблоны и справочные материалы, которые модель может читать во время работы. Файлы доступны только для чтения и никогда не выполняются.

  • Открытый исходный код

    Издатель навыка на GitHub — xunxiing. Перед установкой изучите исходные материалы.

Установка

Установите навык ИИ Skill Astrbot Dev в TypingMind, чтобы использовать его с любой LLM, или добавьте его в другой агент, который умеет читать SKILL.md.

1

Установка в TypingMind

TypingMind устанавливает навык прямо из его папки на GitHub: читает SKILL.md, собирает файлы ресурсов и сохраняет результат локально.

  1. Откройте приложение и перейдите в раздел «Плагины → Навыки».
  2. Выберите «Установить из GitHub».
  3. Вставьте указанную ниже ссылку на папку навыка и подтвердите установку.
    https://github.com/xunxiing/AstrBot-Skill/tree/v4/skill-astrbot-dev
  4. Включите навык в каждом чате, где хотите его использовать.
Плагины → Навыки → Добавить навык → По ссылке GitHub, затем вставьте ссылку на папку и нажмите «Продолжить».
2

Установка в другом агенте

Любой агент с поддержкой формата Agent Skills может использовать этот навык — скопируйте папку в каталог навыков этого агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/xunxiing/AstrBot-Skill.git /tmp/AstrBot-Skill
mkdir -p .claude/skills
cp -r /tmp/AstrBot-Skill/skill-astrbot-dev .claude/skills/skill-astrbot-dev
После копирования перезапустите Claude Code, чтобы загрузить новый навык.

Использование в TypingMind

Включите навык Skill Astrbot Dev в любом чате TypingMind, и дальше модель всё сделает сама. Его название и описание хранятся в системном промпте, а при появлении подходящего запроса модель сама загружает полные инструкции. Вам не нужно вызывать навык вручную, и до фактического использования он не расходует токены.

Модель сама загружает навык Skill Astrbot Dev, как только появляется подходящий для него запрос.

Работает с любой моделью ИИ

Навыки ИИ — это обычные инструкции в Markdown, а не код для конкретного поставщика, поэтому навык Skill Astrbot Dev не привязан к модели, для которой он был создан. Установите его один раз в TypingMind и используйте с GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama или локальной моделью, которую запускаете самостоятельно, — со своими ключами API.

  • Загружается только при необходимости

    Системный промпт содержит только название и описание. Инструкции загружаются при первом подходящем запросе, поэтому неиспользуемый навык не расходует токены.

  • Меняйте модели прямо в чате

    Навык состоит из инструкций, а не кода, поэтому смена модели не нарушает его работу: новая модель читает тот же файл SKILL.md.

Инструкции навыка

Это содержимое файла SKILL.md, которое загружает модель. Прочитайте его перед установкой: навык — это инструкции, которым будет следовать ваша модель.

skill-astrbot-dev

This skill provides the authoritative reference for AstrBot plugin and core development.

It covers message models, platform adapter interfaces, plugin configuration schemas, hooks/lifecycle, and the Agent system (tools, subagents, personas, sandboxes, cron).

When to use

Use this skill when you ask for help with:

  • AstrBot plugin structure, decorators/hooks, lifecycle, schema, sessions
  • Message model/event flow and message-chain conversion
  • Platform adapter interface and message conversion patterns
    • Agent topics (tools/providers/personas/subagents/sandbox/cron/context compression)
    • Context management (conversation branches, history operations, context injection, compression strategies)

Mandatory workflow (use this every time)

  1. Start from a single entrypoint (avoid broad loading):
    • Workflow overview: plugin-development-workflow.md
    • Core concepts: design_standards/core_concepts.md
  2. Pick one topic folder and stay focused:
    • Agent system: agent/ (start with agent/index.md)
    • Plugin config: plugin_config/
    • Messages: messages/
    • Platform adapters: platform_adapters/
  3. For Agent Runner (v4.7.0+): agent/agent-runner.md
  4. For context management (conversation, history, compression): agent/context-management.md
  5. If the user targets a specific AstrBot version, cross-check the repo tag:
    • git -C <astrbot-repo> describe --tags
  6. If docs and code disagree, treat code as truth:
    • Core code lives under astrbotcore/astrbot/core/ (read only the needed files)

STRONGLY ADVISED: use AstrBot SDK while writing plugins

When writing plugin code, strongly advised to install AstrBot SDK locally and use it for API reference, signature lookup, and IDE auto-completion.

powershell
python -m pip install -U astrbot

Use SDK symbols first when implementing hooks, provider/context calls, and agent runner integration. This helps reduce guesswork and signature mismatch.

If AstrBot source code in this repo is available, still treat repo code as higher priority than package docs.

Plugin project structure (strongly advised)

A standard AstrBot plugin project should include:

  • main.py: entrypoint. Implement plugin startup and primary features here.
  • metadata.yaml: plugin metadata (name, version, author, repo, description).
  • README.md: installation, usage, feature overview, and dev links.
  • .gitignore: ignore Python cache (__pycache__) and IDE config files.
  • LICENSE: open-source license file.

metadata.yaml minimal template

yaml
name: astrbot_plugin_helloworld # 插件唯一识别名,最好以 astrbot_plugin_ 前缀开头
display_name: helloworld # 展示名(v4.5.0+)
desc: AstrBot 插件示例。 # 插件简短描述
version: v1.3.0 # 版本号:v1.1.1 或 v1.1
author: Soulter # 作者
repo: https://github.com/Soulter/helloworld # 插件的仓库地址
astrbot_version: ">=4.16,<5" #声明插件要求的 AstrBot 版本范围。

Code rules for plugin implementation

  • Use async def for handlers/hooks/tool functions.
  • Keep main.py focused on plugin entry and orchestration; extract complex logic into submodules.
  • Add type hints for public methods and hook signatures.
  • Do not hardcode provider IDs or secrets; expose configurable fields in _conf_schema.json.
  • Prefer small, testable functions over large monolithic handler bodies.
  • Keep README and metadata consistent with actual plugin behavior and version. -If you are writing AstrBot core code instead of plugins, you must submit a PR to https://github.com/AstrBotDevs/AstrBot-docs if the changes require doc updates (for instance: new hooks, new APIs, new features, platform adapter changes, and so on). If you don't see the docs repo, please remind the user to clone the docs-repo and add it to the workspace. Ensure that a requirements.txt file is created in the plugin directory and populated with the necessary dependencies. It's best to keep the plugin size under 32MB. For large resources like high-resolution images, it is best to use a CDN instead of hardcoring. It's better to use new hooks instead of old ones.

Hooks: avoid missing / outdated references

There are two different "hook" layers you must not mix up:

  • Plugin event hooks (decorators): agent/agent-related-hooks.md + design_standards/event_flow.md
  • Agent runner hooks (BaseAgentRunHooks): agent/agent-related-hooks.md

If you need a complete hook inventory (because context may be truncated), generate it locally:

powershell
python scripts/generate_hook_inventory.py

This writes to skill-astrbot-dev/.tmp/hook_inventory/ (gitignored). Use it as a scratchpad for writing/updating docs; do not reference .tmp paths as public documentation URLs.

High-signal code entrypoints (open only when needed)

  • Event hooks registration + signatures: astrbotcore/astrbot/core/star/register/star_handler.py
  • Event types: astrbotcore/astrbot/core/star/star_handler.py
  • Agent runners + hook call order: astrbotcore/astrbot/core/agent/runners/
  • Agent hook interface: astrbotcore/astrbot/core/agent/hooks.py
  • Main agent build (sandbox/cron/tools): astrbotcore/astrbot/core/astr_main_agent.py
  • Skills system (AstrBot runtime skills): astrbotcore/astrbot/core/skills/skill_manager.py
  • Subagents config loading: astrbotcore/astrbot/core/subagent_orchestrator.py
  • Pipeline stages: astrbotcore/astrbot/core/pipeline/ (see stage_order.py)

v4.5.7+ New Tool Definition Pattern

推荐使用 dataclass 模式定义 Tool(见 design_standards/core_concepts.md 第7节):

python
from pydantic.dataclasses import dataclass
from astrbot.api import FunctionTool

@dataclass
class MyTool(FunctionTool):
    name: str = "my_tool"
    description: str = "工具描述"
    parameters: dict = {...}

    async def call(self, context, **kwargs) -> str:
        return "结果"

注册:self.context.add_llm_tools(MyTool())

装饰器方式仍然支持,但推荐新项目使用 dataclass 模式。

AstrBot supports project debugging using OpenAPI. Please ask the user for their API key and the URL/address of their AstrBot instance. Additionally, retrieve the full OpenAPI documentation at [https://docs.astrbot.app/scalar.html](https://docs.astrbot.app/scalar.html). Further requirements regarding autonomous debugging can be found in Guidelines_Testing.md

AstrBot offers a simple KV storage interface for plugins—ideal for saving configurations, lightweight states, or user data.Consider using it where appropriate. Call these directly inside your plugin class (inheriting from Star):

  • await self.put_kv_data(key: str, value: Any): Store data
  • await self.get_kv_data(key: str, default: Any = None) -> Any: Get data
  • await self.delete_kv_data(key: str): Delete data

Файлы в комплекте

Модель читает эти файлы по мере необходимости, пока навык загружен. Они доступны только для чтения и никогда не выполняются.

Часто задаваемые вопросы

Что делает навык ИИ Skill Astrbot Dev?

AstrBot plugin development reference and workflow guide. Use this skill when you are: - Writing AstrBot plugins, hooks, decorators, or message handlers - Implementing platform adapters, message chains, or event flows - Configuring plugin schemas, sessions, or lifecycle management - Working with Agent system (tools, subagents, personas, sandboxes, cron jobs) - Converting between AstrBot message models and platform-specific formats - Looking up AstrBot API signatures, hook inventories, or code entrypoints - Debugging plugin issues related to message routing, event handling, or provider integr...

Зачем использовать Skill Astrbot Dev в TypingMind?

Потому что вы устанавливаете навык один раз и используете его с любой моделью. Skill Astrbot Dev — это обычный текст в формате Markdown, а не код для конкретного поставщика, поэтому один и тот же навык работает с GPT-5, Claude, Gemini, Grok или локальной моделью. Вы можете менять модель прямо во время чата, и навык продолжит работать. TypingMind использует ваши собственные ключи API, поэтому вы платите поставщикам напрямую, а не оформляете подписку с оплатой за каждое место. Ваши навыки и чаты остаются в вашем собственном хранилище.

Как установить Skill Astrbot Dev в TypingMind?

В TypingMind откройте «Плагины → Навыки → Установить из GitHub» и вставьте https://github.com/xunxiing/AstrBot-Skill/tree/v4/skill-astrbot-dev. TypingMind прочитает файл SKILL.md, включит сопутствующие файлы в пакет и установит навык, который можно включать отдельно для каждого чата.

Какие модели ИИ могут использовать Skill Astrbot Dev?

Любая модель, которую вы подключите в TypingMind. Навыки ИИ — это обычные инструкции в формате Markdown, а не код для конкретного поставщика, поэтому GPT, Claude, Gemini, Grok и локальные модели могут загружать этот навык, когда запрос ему соответствует.

Со сколькими моделями ИИ можно использовать Skill Astrbot Dev?

С любым количеством. В TypingMind вы можете использовать Skill Astrbot Dev с любой моделью, которая поддерживает навыки, в том числе с GPT, Claude, Gemini, Grok, DeepSeek, Mistral и Llama. Для этого вы используете собственные ключи API.

Бесплатен ли навык ИИ Skill Astrbot Dev?

Навык опубликован на GitHub. Издатель — xunxiing. Условия лицензии можно найти в репозитории. Вы платите только своему поставщику ИИ за использованные токены.

Что такое навыки ИИ?

Навык ИИ — это набор инструкций, которыми модель ИИ может пользоваться каждый раз, когда ей нужно выполнить конкретную задачу. Он соответствует открытому формату Agent Skills: файл SKILL.md с названием и описанием, а также любые скрипты, шаблоны или справочные файлы, которые могут понадобиться модели. Модель читает инструкции, только когда ваш запрос соответствует навыку, поэтому установленный навык ничего не стоит, пока не используется.

Чем навыки ИИ отличаются от плагинов и серверов MCP?

Плагин или сервер MCP даёт модели новые инструменты, которые она может вызывать: при вызове где-то выполняется код и возвращает результат. Навык ИИ, напротив, даёт модели знания и описывает порядок действий: как подойти к задаче, какие шаги выполнить и каким должен быть хороший результат. Навыки — это обычный текст в формате Markdown, поэтому им не нужны сервер, ключ API или среда выполнения, и они работают с любой моделью.

Все

Создайте своё рабочее пространство с ИИ прямо сейчас

Подпишитесь на нашу рассылку, чтобы узнавать о новых функциях и предстоящих розыгрышах 👇