用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/publieople/hermes-config-kit --skill astrbot-plugin-runtime-patching命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | astrbot-plugin-runtime-patching |
| description | QQ parsing bugs, fork drift. Hot-patch AstrBot plugins. |
Patch a running AstrBot's plugins without rebuilding the bot. This skill is for when an installed plugin behaves wrong despite correct config and the user wants a quick in-place fix (not a full reinstall).
astrbot_plugin_<name>.args_str wrong when invoked via QQ
reply.astrbot won't come up) — that's an
AstrBot core / config problem, not a plugin problem.astrbot-plugin-development; this skill is for local hot-fix only.Localise the failure: tail -F /home/po/astrbot/data/logs/astrbot.log
(rotated siblings astrbot.YYYY-MM-DD_HH-MM-SS_xxxxxx.log). Grep for
the plugin name and for ERROR / Traceback. The log line that
names a strategy / command / config key is the one to read.
Read the plugin source: /home/po/astrbot/data/plugins/<name>/.
main.py is the entry. Each provider / strategy lives in its own
file (sauce_nao_strategy.py, etc.). metadata.yaml has the version
the bot believes is installed. _conf_schema.json lists config keys.
Read AstrBot's message adapter when a command parses wrong:
/home/po/.local/share/uv/tools/astrbot/lib/python3.12/site-packages/astrbot/core/platform/sources/aiocqhttp/aiocqhttp_platform_adapter.py.
This is where event.message_str is built. If your command handler
sees "message_str contains quoted-message noise", the bug is in
your plugin's parser, not in AstrBot (see references below).
Patch in place. Use search_files to find the right line range
before patch. Don't rewrite the file from scratch — one guard
in the shared resolver is smaller diff than guards in every caller.
Reload, do not full restart. WebUI 插件页 → 重载 is enough for
pure-Python changes. Only sudo systemctl restart astrbot if the
patch changed metadata.yaml (AstrBot reads it on startup) or
dependencies (requirements.txt).
Verify. Re-trigger the failing command once and grep the log for the previous error string — if absent, patch landed.
Plugin version is cached in data/plugins.json (and
data/plugins_custom_<md5>.json for custom registries). The market
shows the cached version until MD5 mismatches. Restart does not force
refresh; the MD5 endpoint is https://api.soulter.top/astrbot/plugins-md5.
When upstream is forked and the new owner hasn't pushed to
AstrBotDevs/AstrBot_Plugins_Collection, the cache stays stale forever.
Workaround: rm -rf the plugin dir and git clone the new repo, then
reload.
metadata.yaml has no astrbot_version constraint check at
runtime (it's only a market-metadata hint). Patches that depend on
new AstrBot core APIs need a version check you write yourself.
pip install -r requirements.txt after a plugin update will trigger
pip 26.3 deprecation warnings if the plugin imports data.plugins.<x>
in an order pip doesn't expect. Safe to ignore until pip 26.3 actually
enforces it. Do not "fix" by changing import paths — that breaks
AstrBot's plugin loader.
Fork reinstalls wipe any in-place patch you made to main.py.
If you patch and the user later upgrades, re-apply or upstream the
fix. Mark ponytail: comments so future-you knows what was local.
references/onebot-reply-messagestr-pollution.md — exact bug pattern
for QQ reply-mode command parsing, with the rfind + whitelist
filter fix. Read this when the log shows 未找到策略 '图片 MSG_ID:....references/plugin-market-cache-fork-staleness.md — when plugin
market stays on old version after the upstream has moved.