main
md 117 lines 5.33 KB
Rendered Raw
1 ---
2 name: a0-plugin-router
3 description: Main entry point for all Agent Zero plugin tasks. Routes to specialist skills for creating, reviewing, contributing, managing, or debugging plugins. Use when the user mentions plugins, asks how the plugin system works, wants to build/install/uninstall/publish/debug a plugin, or asks about the Plugin Hub.
4 version: 1.0.0
5 tags: ["plugins", "router", "meta", "create", "review", "contribute", "manage", "plugin-hub"]
6 trigger_patterns:
7 - "plugin"
8 - "create plugin"
9 - "build plugin"
10 - "review plugin"
11 - "contribute plugin"
12 - "publish plugin"
13 - "install plugin"
14 - "manage plugin"
15 - "plugin hub"
16 - "plugin index"
17 - "how does the plugin system work"
18 ---
19
20 # Agent Zero Plugin Router
21
22 ## Routing Decision
23
24 Classify the user's request and read the appropriate specialist skill immediately.
25
26 | User intent | Skill to read |
27 |---|---|
28 | Create / build / develop / write a new plugin | Read `/a0/skills/a0-create-plugin/SKILL.md` |
29 | Review / audit / validate / check a plugin | Read `/a0/skills/a0-review-plugin/SKILL.md` |
30 | Contribute / publish / submit / share to community | Read `/a0/skills/a0-contribute-plugin/SKILL.md` |
31 | Install / update / uninstall / remove / browse / scan | Read `/a0/skills/a0-manage-plugin/SKILL.md` |
32 | Plugin not working / crashing / missing / debug / troubleshoot | Read `/a0/skills/a0-debug-plugin/SKILL.md` |
33 | Explain / how does it work / architecture | Answer inline using the overview below |
34
35 If intent is ambiguous, ask one question before routing:
36 > "Are you trying to **create** a new plugin, **review** one, **contribute** it to the community, **manage** (install/update/uninstall) plugins, or **debug** a plugin that isn't working?"
37
38 If the user says "make a plugin for the community" - start with `a0-create-plugin`, then note that `a0-contribute-plugin` handles the publishing step after the plugin is built and tested.
39
40 ---
41
42 ## Plugin System Overview (for explain/explore queries)
43
44 ### Roots and Discovery
45
46 Agent Zero discovers plugins from two roots, in priority order:
47 1. `usr/plugins/<name>/` - user plugins (your custom plugins go here)
48 2. `plugins/<name>/` - core system plugins (framework-bundled, do not modify)
49
50 A plugin is valid when its directory contains a `plugin.yaml`. Directories starting with `.` are skipped.
51
52 ### Runtime Manifest (`plugin.yaml`)
53
54 Every plugin requires a `plugin.yaml` at its root:
55
56 ```yaml
57 name: my_plugin # required by CI for community plugins (^[a-z0-9_]+$)
58 title: My Plugin # UI display name
59 description: What it does.
60 version: 1.0.0
61 settings_sections: [agent] # which Settings tabs show a subsection
62 per_project_config: false # enables project-scoped settings/toggle
63 per_agent_config: false # enables agent-profile-scoped settings/toggle
64 always_enabled: false # forces ON, disables toggle (framework use only)
65 ```
66
67 `settings_sections` valid values: `agent`, `external`, `mcp`, `developer`, `backup`. Use `[]` for none.
68
69 ### What a Plugin Can Provide
70
71 | Directory/File | Purpose |
72 |---|---|
73 | `api/` | API handlers (`ApiHandler` subclasses) |
74 | `tools/` | Agent tools (`Tool` subclasses) |
75 | `extensions/python/<point>/` and `extensions/python/_functions/<module>/<qualname>/<start_or_end>/` | Backend lifecycle hooks and implicit `@extensible` hooks |
76 | `extensions/webui/<point>/` | HTML/JS injected into UI breakpoints |
77 | `webui/config.html` | Plugin settings UI |
78 | `webui/*.html`, `webui/*.js` | Full plugin pages and Alpine stores |
79 | `hooks.py` | Framework runtime hooks (install, uninstall, pre_update, cache, registration) |
80 | `execute.py` | User-triggered script (setup, maintenance, repair) |
81 | `default_config.yaml` | Settings defaults |
82 | `README.md` | Optional locally; strongly recommended for community plugins so Plugin Hub users can inspect the plugin |
83 | `agents/<profile>/agent.yaml` | Plugin-distributed agent profiles |
84 | `conf/model_providers.yaml` | Add/override model providers |
85 | `LICENSE` | Optional under `usr/plugins/`; required at the root of a plugin GitHub repo before submitting to the Plugin Index |
86
87 For `@extensible` targets, the only valid implicit hook layout is `extensions/python/_functions/<module>/<qualname>/<start|end>/`. The older flattened `extensions/python/<module>_<qualname>_<start|end>/` folders are obsolete.
88
89 ### Activation
90
91 - Global toggle: `.toggle-1` (ON) / `.toggle-0` (OFF) files in the plugin dir
92 - Scoped toggles (project/agent) available when `per_project_config` or `per_agent_config` is true
93 - Default: enabled when no toggle file exists
94 - `always_enabled: true` forces ON and hides controls (reserved for framework)
95
96 ### Settings Resolution (highest priority first)
97
98 1. `project/.a0proj/agents/<profile>/plugins/<name>/config.json`
99 2. `project/.a0proj/plugins/<name>/config.json`
100 3. `usr/agents/<profile>/plugins/<name>/config.json`
101 4. `usr/plugins/<name>/config.json`
102 5. `plugins/<name>/default_config.yaml`
103
104 ### Key API Routes
105
106 | Route | Purpose |
107 |---|---|
108 | `GET /plugins/<name>/<path>` | Serve static plugin assets |
109 | `POST /api/plugins/<name>/<handler>` | Call plugin API endpoint |
110 | `POST /api/plugins` | Management (toggle, config, docs) |
111
112 ### Deep-Dive References
113
114 - Architecture + extension points: `/a0/plugins/AGENTS.md`
115 - Developer guide: `/a0/docs/developer/plugins.md`
116 - Component system: `/a0/webui/components/AGENTS.md`
117 - Modal system: `/a0/webui/js/AGENTS.md` and `/a0/webui/css/AGENTS.md`