
AutoBangumi Plugins
Writes, tests and packs AutoBangumi plugins with the ab_sdk and ab-plugin CLI.
Install
npx skills add EstrellaXD/Auto_Bangumi --skill autobangumi-plugin -g -a claude-code -y- Repository
- EstrellaXD/Auto_Bangumi8.3k
- Category
- Engineering
- Updated
- 9d ago
- License
- MIT
- Context cost
- Lightabout 1,449 tokens
- Runs scripts
- No, instructions only
What it does
Write, test, pack and debug AutoBangumi (AB) 4.0 plugins with the ab_sdk Python SDK and the ab-plugin CLI. Use when the user asks to "write an AutoBangumi plugin", "add a downloader / notifier / search site / rename strategy / RSS site to AutoBangumi", "hook into AutoBangumi", mentions ab_sdk, ab-plugin, plugin.toml, @provider, @hook, @subscribe, secret_field, or wants a custom rename template, webhook on torrent.organized, nfo writer, private tracker Cookie, or a plugin web component for the AutoBangumi WebUI.
AutoBangumi plugin authoring
AB plugins are Python packages (optional Web Component UI) that run inside the AB process. They import only ab_sdk, never module.*. SDK is 0.x during 4.0: pin sdk = ">=0.5,<1" in the manifest.
Workflow
- Pick the extension point (table below). If unsure, read
references/extension-points.md. - Scaffold:
ab-plugin new <id> --kind rename|notifier|search(ids: lowercase, digits, hyphens;coreandlocalare reserved). For other points, copy the closest example fromexamples/plugins/in the AB repo. - Write the plugin: one
Plugin[Options]subclass,config_model = Options, decorated methods. - Test first:
uv run pytest. Provider points have contract suites inab_sdk.testing(subclass, implementcreate()). Other behavior:create_plugin(Cls, options)plusasyncio.run. ab-plugin validate .thenab-plugin dev .(links intoconfig/plugins/local/, enables hot reload; restart AB once) thenab-plugin pack ..
Install the tooling from the GitHub release wheel (autobangumi_sdk-<ver>-py3-none-any.whl), not PyPI.
Skeleton
from pydantic import BaseModel, Field
from ab_sdk import Plugin, points, provider, hook, subscribe, secret_field
class Options(BaseModel):
url: str = Field("", title="URL") # title/description become the WebUI form labels
token: str = secret_field(title="Token") # password box; masked on read
class MyPlugin(Plugin[Options]):
config_model = Options # self.config is a validated Options
@provider(points.NOTIFIER, id="my-push") # Provider: the thing the user selects by id
def channel(self): ...
@hook(points.TORRENT_FILTER, priority=50) # Hook: runs in the AB pipeline
def check(self, torrent, release, bangumi): ...
@subscribe("torrent.organized", timeout=600) # Event subscriber ("*" = all events)
async def on_organized(self, event): ...
