Logo vun Skill Astrbot Dev

Skill Astrbot Dev

Communautéit
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.

Iwwersiicht

Editeurxunxiing
RepositoryAstrBot-Skill
Skill-Nummskill-astrbot-dev
Stären
76
Forks
9
Matgeliwwert Fichieren
39
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 39 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    Vum xunxiing op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Skill Astrbot Dev an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/xunxiing/AstrBot-Skill/tree/v4/skill-astrbot-dev
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

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
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Skill Astrbot Dev an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Skill Astrbot Dev automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Skill Astrbot Dev net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

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

Matgeliwwert Fichieren

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill 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...

Firwat Skill Astrbot Dev op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Skill Astrbot Dev besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Skill Astrbot Dev an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/xunxiing/AstrBot-Skill/tree/v4/skill-astrbot-dev an. TypingMind liest d'Datei SKILL.md, bündelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Skill Astrbot Dev benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Skill Astrbot Dev benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Skill Astrbot Dev domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Skill Astrbot Dev gratis?

De Skill gëtt vum xunxiing op GitHub publizéiert. Kuckt am Repository no de Lizenzbedéngungen. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇