agentic-os
AFaffaan-m/ECC278k4,046 new stars in the last 7 days
Use this skill when the user asks to create, modify, debug, validate, or scaffold a MoviePilot local plugin. Covers version-aware V3/V2 plugin development, _PluginBase implementations, package.v3.json/package.v2.json/package.json metadata, plugins.v3/plugins.v2/plugins source layout, PLUGIN_LOCAL_REPO_PATHS local plugin sources, plugin APIs, Vuetify JSON forms/pages/dashboards, Vue module federation remote components, get_render_mode, get_sidebar_nav, plugin sidebar pages, get_agent_pets assistant avatars, commands, services, workflow actions, agent tools, and local install/reload flows. Also use for Chinese requests mentioning 编写插件、本地插件源, 插件开发, V3插件, V2插件, 插件市场, 本地安装插件, 插件热加载, 前端联邦, 侧栏入口, Vue插件页面, 助手形象.
Use this skill to build or revise MoviePilot plugins that can be developed from a local plugin source and installed into the running MoviePilot instance.
app/plugins/__init__.py, especially _PluginBase.app/runtime/extensions/plugin_manager.py
and app/adapters/external/market.py.app/api/endpoints/plugin.py.docs/development-setup.md.plugins.v3/ with
package.v3.json; V2 uses plugins.v2/ with package.v2.json; legacy V1
uses plugins/ with package.json. Do not generate V2 paths for a V3 host.MoviePilot-Plugins, read its README.md,
docs/Repository_Guide.md, and the guide for the target generation:
docs/Plugin_Development.md for V3, docs/V2_Plugin_Development.md for V2.
For scenario-specific extensions, read the matching docs/faq/*.md.app.sdk.* entry points documented by the current
host and guide; do not copy old internal imports from a V2 example. Verify
extension signatures against the installed host before using a template.A request to create or fix a plugin authorizes relevant local source edits and validation. Reuse that authorization; it does not by itself authorize changing host configuration, installing/reloading the plugin, restarting, or publishing. Perform those steps when the user requested them or already approved their scope, honoring host confirmation requirements. Inspect auto-reload settings before editing a live watched plugin source; such edits can affect the runtime immediately and require that runtime effect to be within the authorized scope.
execute_command(action="run") with rg and narrow globs or paths to
locate plugin classes, extension points, tests, package entries, and directory
contents.read_file reports truncation, continue with smaller start_line and
end_line ranges until all relevant sections have been inspected..pyi/.d.ts declarations. If those are insufficient,
use search_web with the official documentation domain and browse_webpage
to read the matching version. Do not guess API signatures from memory or mix
examples from different major versions. Search the relevant package directory,
.venv, or node_modules directly with rg instead of scanning the entire
project without bounds.apply_patch when one logical change
spans multiple files, adds new files, or deletes files: submit a single patch
wrapped in *** Begin Patch / *** End Patch with *** Add File:,
*** Update File:, and *** Delete File: sections; every context and
removed line must match the current content exactly.edit_file for a single localized change in one file. Its old_text
must identify one exact location by default; add surrounding context instead
of enabling replace_all unless every match intentionally changes.write_file for one standalone new file. Existing files require
overwrite=true for a full rewrite; first call
read_file(include_metadata=true) and pass its sha256 as
expected_sha256 when replacing previously read content.execute_command(action="run") for short validation, Git, and diagnostic
commands. Use action="start" only for interactive or long-running commands,
then continue through the returned session ID.execution_outcome="succeeded"
with exit_code=0 means a completed command passed. Inspect output on
failure and output_file for a truncated log. A timeout or unknown result
does not undo side effects and must not trigger a blind retry of a write.output_until_seq and
output_until_offset as since_seq and since_offset. Start with offset 0
for partial-chunk paging; last_seq is not a consumed position. Wait for new
output in bounded intervals, and drain the remaining pages until
output_complete=true for a complete log. Report any output_lost gap.
An output_error after start/write/kill requires another read with a suitable
byte limit, not another execution of the action.MoviePilot-Frontend/docs/module-federation-guide.md,
MoviePilot-Frontend/docs/federation-troubleshooting.md,
MoviePilot-Frontend/src/utils/federationLoader.ts, and
MoviePilot-Frontend/src/pages/plugin-app.vue.MoviePilot owns runtime loading, API registration,
events, services, data, and permissions; MoviePilot-Frontend owns plugin UI
rendering, federation loading, and sidebar pages; MoviePilot-Plugins owns
plugin source, icons, package indexes, and release metadata.app/plugins/<plugin>/__init__.pymoviepilot_api with
operation_id=plugin.market when the running instance is available.operation_id=plugin.installed; its summaries
include repo_url when the source can be matched from a local plugin
repository or plugin market metadata.MoviePilot-Frontend/examples/plugin-component/.PLUGIN_LOCAL_REPO_PATHS with operation_id=config.system.get when possible.operation_id=config.system.update with setting_key="PLUGIN_LOCAL_REPO_PATHS",
the chosen source path as value, and operation="replace". A relative
path such as local-plugins resolves against the MoviePilot root.
Write the plugin under the chosen source; do not write directly into app/plugins/
unless the user explicitly asks for a runtime-only experiment.MyNotifier.mynotifier.self.__class__.__name__.MoviePilot plugin UI has exactly two implementation modes. Make the user choose one whenever the request includes configuration, detail pages, dashboards, sidebar pages, or any other plugin UI and the mode is not already explicit.
Ask a concise question like:
这个插件 UI 用哪种方式实现?
1. JSON 配置:后端返回 Vuetify JSON,适合普通配置表单、简单详情页和轻量仪表板。
2. 联邦 UI:独立 Vue 远程组件,适合复杂交互、自定义布局、侧栏全页或多页面。
Selection rules:
get_form(), get_page(), and
get_dashboard() with JSON component schemas. No frontend build or
dist/assets/remoteEntry.js is needed.get_render_mode(),
expose Vue components through Vite federation, build frontend assets into the
plugin directory, and use get_sidebar_nav() only when a sidebar page is
requested.For a verified V3 host, use this layout for new local plugins. For V2, use
package.v2.json and plugins.v2/ instead and follow its dependency contract.
<local-plugin-repo>/
├── package.v3.json
└── plugins.v3/
└── <plugin_id_lower>/
├── __init__.py
├── pyproject.toml # only when extra runtime dependencies are necessary
└── ... # helper modules, schemas, static assets
For a Vue federation plugin, the runtime requirement is the built remote assets under the plugin directory:
plugins.v3/<plugin_id_lower>/
├── __init__.py
├── dist/
│ └── assets/
│ ├── remoteEntry.js
│ └── ... # JS/CSS/assets referenced by remoteEntry
├── package.json # optional frontend build project metadata
├── vite.config.js # optional frontend build config
└── src/ # optional source, not required at runtime
Do not rely on frontend source files at runtime. If the source is kept in the
plugin repository for maintainability, still build and ship the dist/assets
files required by remoteEntry.js.
Only use the legacy layout when the user explicitly needs it:
<local-plugin-repo>/
├── package.json
└── plugins/
└── <plugin_id_lower>/
└── __init__.py
For legacy package.json entries that should work on V2, include "v2": true.
For current V3 work, use package.v3.json and plugins.v3/.
Add or update the package entry for the plugin ID. Keep the package version and
the class plugin_version synchronized.
{
"MyNotifier": {
"name": "通知示例",
"description": "根据用户配置发送示例通知。",
"labels": "消息通知",
"version": "1.0.0",
"icon": "mynotifier.png",
"author": "local",
"level": 1,
"system_version": ">=3.0.0",
"history": {
"v1.0.0": "初始版本"
}
}
}
Rules:
version must match plugin_version.name, description, icon, author, labels, and level should match
the plugin class attributes when those attributes exist (plugin_name,
plugin_desc, plugin_icon, plugin_author, plugin_label, auth_level).history should record user-readable changes for each published version.system_version when the plugin depends on a host capability introduced
in a specific MoviePilot version, including new backend APIs, helpers, events,
Vue federation behavior, sidebar nav, dashboard behavior, or agent tools."release": true only when the plugin is intentionally distributed by a
GitHub Release archive.system_version to the actual minimum version providing the APIs used;
the example is not proof that every host capability exists in 3.0.0.pyproject.toml for current V3). Dependency changes require the
host installation flow; hot reload alone does not install them.Implement all abstract methods from _PluginBase. All new functions and
methods need Chinese docstrings; public classes, public methods, and public
functions are a hard review gate.
from typing import Any, Dict, List, Optional, Tuple
from app.plugins import _PluginBase
class MyNotifier(_PluginBase):
"""通知示例插件。"""
plugin_name = "通知示例"
plugin_desc = "根据用户配置发送示例通知。"
plugin_icon = "mynotifier.png"
plugin_version = "1.0.0"
plugin_label = "消息通知"
plugin_author = "local"
plugin_config_prefix = "mynotifier_"
plugin_order = 100
auth_level = 1
_enabled = False
_message = ""
def init_plugin(self, config: dict = None) -> None:
"""根据插件配置初始化运行状态。"""
self.stop_service()
self._enabled = False
self._message = ""
if not config:
return
self._enabled = bool(config.get("enabled"))
self._message = str(config.get("message") or "")
def get_state(self) -> bool:
"""获取插件启用状态。"""
return self._enabled
@staticmethod
def get_command() -> List[Dict[str, Any]]:
"""返回插件远程命令列表。"""
return []
def get_api(self) -> List[Dict[str, Any]]:
"""返回插件 API 列表。"""
return []
def get_form(self) -> Tuple[Optional[List[dict]], Dict[str, Any]]:
"""返回插件配置表单与默认配置。"""
return [
{
"component": "VForm",
"content": [
{
"component": "VSwitch",
"props": {
"model": "enabled",
"label": "启用插件"
}
},
{
"component": "VTextField",
"props": {
"model": "message",
"label": "通知内容"
}
}
]
}
], {
"enabled": False,
"message": ""
}
def get_page(self) -> Optional[List[dict]]:
"""返回插件详情页面。"""
if not self._enabled:
return None
return [
{
"component": "VAlert",
"props": {
"type": "info",
"text": self._message or "插件已启用"
}
}
]
def stop_service(self) -> None:
"""停止插件后台服务并释放资源。"""
return None
Use only the extension points the requested plugin actually needs:
get_form() returns Vuetify form schema and default data;
init_plugin() reads config; update_config() persists internal changes.save_data(), get_data(), del_data(), and get_data_path().post_message() instead of directly calling message
modules.get_api(); default auth is apikey
when auth is omitted. Vue component APIs should normally use
auth: "bear" and be called through the api prop passed by the frontend.get_command() and dispatch
through MoviePilot events.get_service() and always clean
them up in stop_service().app.sdk.scheduler.add_plugin_once_job(plugin_id, job_id, self.method, name, delay_seconds=..., func_kwargs=...) instead of creating a
private BackgroundScheduler. It does not reset the plugin's periodic
services, replaces a pending job with the same ID, and is cleared when the
plugin is reloaded or uninstalled. Pass a bound method of the plugin
instance, and cancel pending jobs with remove_plugin_once_job() in
stop_service() when they must not run after the plugin stops.get_dashboard_meta() and get_dashboard() for homepage
widgets.get_actions(); action functions receive
ActionContent first and return (success, action_content).get_agent_tools(); each tool class must inherit
app.agent.tools.base.MoviePilotTool.get_render_mode() when Vue is the selected UI
mode. Return ("vue", "<compiled-assets-path>") and include
built frontend assets in the plugin directory.get_agent_pets() on a Vue plugin to
replace the web assistant's on-screen character. See
"Agent Assistant Avatar" below.Use Vue federation when selected in the Pre-Flight UI decision. A Vue plugin must align backend methods, built files, and federation exposes.
Backend requirements:
from typing import Any, Dict, List, Tuple
@staticmethod
def get_render_mode() -> Tuple[str, str]:
"""声明插件使用 Vue 联邦组件渲染。"""
return "vue", "dist/assets"
def get_form(self) -> Tuple[List[dict], Dict[str, Any]]:
"""Vue 模式下返回默认配置模型。"""
return [], self._current_config()
def get_page(self) -> List[dict]:
"""Vue 模式下详情页由远程 Page 组件渲染。"""
return []
When the plugin needs a main-layout sidebar page, also implement:
def get_sidebar_nav(self) -> List[Dict[str, Any]]:
"""声明插件在主界面左侧导航栏中的全页入口。"""
if not self.get_state():
return []
return [
{
"nav_key": "main",
"title": "我的插件",
"icon": "mdi-puzzle",
"section": "system",
"permission": "manage",
"order": 10,
}
]
Sidebar rules:
get_render_mode() returns "vue".section must be one of start, discovery, subscribe, organize,
system; invalid values fall back to system.permission may be subscribe, discovery, search, manage, or admin;
invalid values are ignored.nav_key defaults to main and must not contain /, ?, #, or spaces.nav_key.When the plugin provides an Agent assistant avatar (助手形象), also implement
get_agent_pets(). See "Agent Assistant Avatar" below.
Frontend federation requirements:
federation({
name: 'MyPlugin',
filename: 'remoteEntry.js',
exposes: {
'./Page': './src/components/Page.vue',
'./Config': './src/components/Config.vue',
'./Dashboard': './src/components/Dashboard.vue',
'./AppPage': './src/components/AppPage.vue',
'./AppPageSettings': './src/components/AppPageSettings.vue',
},
shared: {
vue: { requiredVersion: false, generate: false },
vuetify: { requiredVersion: false, generate: false, singleton: true },
'vuetify/styles': { requiredVersion: false, generate: false, singleton: true },
},
format: 'esm',
})
Build requirements:
build.target to esnext because federation uses top-level await.cssCodeSplit: true and scoped/component-local styles where possible.remoteEntry.js
and every JS/CSS/asset file it references under dist/assets.requirements.txt; keep frontend dependencies in the frontend build project.Component contracts:
Page renders the plugin detail dialog and may emit action, switch, and
close.Config renders plugin settings, receives initialConfig and api, and
emits save, close, and switch.Dashboard receives config and allowRefresh.AppPage renders the main-layout sidebar page and receives api, pluginId,
and navKey.nav_key=main, the frontend loads ./AppPage then ./Page.nav_key, the frontend loads ./AppPage{PascalCase(nav_key)},
then ./AppPage, then ./Page. Examples: settings -> AppPageSettings,
my_tool -> AppPageMyTool.AppPage may branch on navKey, or separate
AppPage{PascalCase} files may be exposed for specific entries.Agent Assistant Avatar:
def get_agent_pets(self) -> List[Dict[str, Any]]:
"""声明插件提供的 Agent 助手形象。"""
return [
{
"key": "girl",
"name": "看板娘",
"mode": "stage",
"component": "AgentPet",
"preview": "girl-preview.png",
"avatar": "girl-avatar.png",
}
]
GET /api/v1/plugin/agent_pets only for
enabled plugins whose get_render_mode() returns "vue".key ([a-z0-9_-]{1,32}, unique within the plugin) and
name. Optional fields are description, mode (renderer by default, or
stage), component (federation expose name, default AgentPet),
api_version (default 1), preview, avatar, bubbles (stage only,
host or self), and random_actions (renderer only).preview and avatar are paths relative to the directory that holds
remoteEntry.js (the directory returned by get_render_mode()), or
http(s):// / data: URLs. With ("vue", "dist/assets"), put
girl-preview.png next to dist/assets/remoteEntry.js and declare
"girl-preview.png". Writing "assets/girl-preview.png" would resolve to
dist/assets/assets/girl-preview.png. Relative paths must not contain .., \, or
:.key keeps the first item. One plugin may declare several avatars, each with
its own mode and component, and must expose every referenced component.agent.open({ draft }) only fills the input box.AI_AGENT_PET (<plugin_id>:<key>). Load
failures, timeouts over 8 seconds, and runtime errors fall back to the
built-in robot.MoviePilot-Frontend/docs/module-federation-guide.md for component props,
the moviepilot:agent host API, agent.* events, the renderer
action/intent mapping, the 16KB pet.storage limit, and a stage example.Vue API calls:
auth: "bear".props.api.get(\plugin/${props.pluginId}/history`)`.settings.API_TOKEN into Vue components for browser-side calls.Run this phase only within the authorized installation/runtime scope.
moviepilot_api with operation_id=plugin.market and query fields
query="<PluginID>", force_refresh=true to confirm the
local source is visible.operation_id=plugin.install, path parameter
plugin_id="<PluginID>", and query.force=true.
The install flow copies the source into app/plugins/<plugin_id_lower>/.PLUGIN_AUTO_RELOAD or development mode is enabled, Python source changes
in an installed local plugin can auto-sync and reload. If it is not enabled,
call operation_id=plugin.reload with path parameter plugin_id after
editing runtime files.force=True; reloading alone
does not install new dependencies.get_render_mode() returns
("vue", "dist/assets") or the actual built asset path, and that
dist/assets/remoteEntry.js exists.get_state() returns
True, get_sidebar_nav() returns valid items, and matching AppPage
exposes exist for all non-main nav_key values or a generic AppPage handles
them.auth: "bear" and browser code calls
them through the provided api prop.docs/rules/03-commands.md; for plugin-only repositories, follow their
own documented validation commands.GET /api/v1/plugin/remotes?token=moviepilot should include the plugin with a
URL ending in /plugin/file/<plugin_id_lower>/<dist_path>/remoteEntry.js.GET /api/v1/plugin/sidebar_nav should include sidebar entries for enabled
Vue plugins with valid nav_key, section, and permission.Module name 'vue' does not resolve to a valid URL, check
the federation shared config and use requiredVersion: false.build.target to
esnext.remoteEntry.js path, and whether the installed runtime plugin directory
actually contains the built assets.nav_key and fallbacks (AppPage{PascalCase} -> AppPage -> Page).Report:
package.v3.json,
package.v2.json, or legacy package.json).vuetify JSON or vue federation), and for Vue plugins the
exposed components and built asset path.AFaffaan-m/ECC278k4,046 new stars in the last 7 days
GAgarrytan/gstack136k883 new stars in the last 7 days
ADaddyosmani/agent-skills106k3,628 new stars in the last 7 days
NEnexu-io/open-design101k1,126 new stars in the last 7 days
NEnexu-io/open-design101k1,126 new stars in the last 7 days
THthedotmack/claude-mem100k3,024 new stars in the last 7 days