Back to skills
SKILL.md
Octopus Plugin
ASecurityDesign, build, test, package (.octoplugin), and publish a plugin for Octopus (the cross-platform terminal & AI coding agent workbench). Use when the user wants to create or update an Octopus plugin: MCP tools/servers injected into agent launches, agent session hooks/context providers/approval guardrails, custom workbench layouts/sidebars/status bar items, terminal & UI color themes, bundled agent skills, views, panels, or editors.
- 181 stars
- 0 votes
- 0 copies
- 1 view
- Added December 4, 2026
Works with
Security analysis
100/100Pro scans all 10 files and shows the line behind each finding
npx -y skills add AIDotNet/Octopus --skill octopus-plugin --agent claude-codeAre you the author of Octopus Plugin?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/aidotnet-octopus-plugin)---
name: octopus-plugin
description: Design, build, test, package (.octoplugin), and publish a plugin for Octopus (the cross-platform terminal & AI coding agent workbench). Use when the user wants to create or update an Octopus plugin: MCP tools/servers injected into agent launches, agent session hooks/context providers/approval guardrails, custom workbench layouts/sidebars/status bar items, terminal & UI color themes, bundled agent skills, views, panels, or editors.
---
# Writing an Octopus Plugin (API v0 — Agent-First & Workbench Platform)
An Octopus plugin is a folder containing `plugin.json` and an optional ES module entry (`main.js`). Code plugins run inside Octopus's sandboxed **Jaunt** ES-module JavaScript runtime and import host capabilities directly from `'octopus'` (`import { commands, mcp, agents, sessions, statusBar, sidebar, layout, ui, ... } from 'octopus'`).
Pure declarative plugins (UI & terminal themes, icon themes, agent definitions, agent skills, prompts, layout presets, static HTTP/stdio MCP server definitions, keybindings) need **no `main.js`** and never spawn a JS engine.
Always read `references/permissions.md` and `references/api.md` before writing code. Start from one of the ready-to-run templates:
- `templates/basic-command/` — minimal command + notification plugin
- `templates/theme-pack/` — UI + full 16-color/selection terminal color theme
- `templates/agent-mcp-tools/` — hosted JS MCP tools, dynamic MCP server, pre-launch hook, `@mention` context provider, and bottom status bar item
## Package Layout
```text
<publisher>.<name>/
plugin.json # Required manifest (schema: 1)
main.js # Optional ES module exporting activate(ctx) / deactivate()
themes/*.json # Optional UI + terminal color themes
skills/<slug>/ # Optional bundled Agent Skills (each with SKILL.md)
SKILL.md
agents/*.json # Optional custom agent definitions
assets/* # Optional icons / images
README.md # Displayed in the Octopus Marketplace
```
Packaged archives are standard `.zip` files with extension `.octoplugin` (max 16 MiB upload, 64 MiB unpacked, 5,000 files, no symlinks, no `..` path entries).
## Choosing the Right Extension Pattern
| Goal | Recommended Extension Point | Needs `main.js`? |
|---|---|---|
| Give agents custom tools with zero external processes | `contributes.mcpTools` + `mcp.registerTool(...)` (hosted by Octopus's `octopus-plugins` loopback MCP gateway for both ACP & CLI!) | Yes |
| Inject an external stdio/HTTP/SSE MCP server at agent launch | `contributes.mcpServers` (+ optional `dynamic: true` with `mcp.registerServer(...)`) | Only if `dynamic: true` |
| Inject dynamic env vars, MCPs, or instructions before agent launch | `contributes.launchContributors` + `agents.registerLaunchContributor(...)` | Yes |
| Add custom `@mention` sources (`@jira`, `@k8s`, `@notes`) | `contributes.contextProviders` + `agents.registerContextProvider(...)` | Yes |
| Enforce security/audit guardrails before tool approval | `contributes.approvalHooks` + `agents.registerApprovalHook(...)` | Yes |
| Monitor or drive running agent sessions / live TPS & cache | `sessions.*` (`list`, `active`, `sendPrompt`, `cancel`, `onDid*`, `activeTelemetry`) | Yes |
| Bundle reusable Agent Skills (`SKILL.md`) | `contributes.skills` | No |
| Add bottom status bar metrics / click-to-open popover | `contributes.statusBar` + `statusBar.create(...)` | Yes |
| Customize left sidebar, project menus, or workbench presets | `contributes.sidebarLayouts`, `sidebarSections`, `menus` (`sidebar/project/context`), `layoutPresets` | Layouts/Sections: Yes; Presets/Menus: Optional |
| Theme the workbench and/or terminal (incl. `terminal.selection`) | `contributes.themes` (selectable independently for UI & Terminal) | No |
| Build rich custom tabs, right panels, or file editors | `contributes.views`, `contributes.panels`, `contributes.editors` + declarative `ui.*` | Yes |
## Step-by-Step Workflow
1. **Choose an ID**: `<publisher>.<name>` — lowercase letters, digits, hyphens, at least one dot (e.g. `acme.k8s-tools`). Never use the reserved `octopus.*` prefix.
2. **Prefix every contribution ID**: Every `id` in `contributes.*` and every `configuration.properties` key MUST equal `<plugin-id>` or start with `<plugin-id>.`.
3. **Declare minimal permissions**: Request only what the plugin genuinely needs in `permissions` (see `references/permissions.md`). Mark non-essential permissions `"optional": true` and include localized `reason` text.
4. **Use `'octopus'` ES module imports in `main.js`**:
```js
import { commands, mcp, statusBar, ui } from 'octopus';
export async function activate(ctx) {
// ctx contains: id, version, pluginPath, dataPath, tmpPath, subscriptions, globalState, projectState, log
// Host APIs are imported from 'octopus' — NOT attached on ctx!
ctx.subscriptions.push(
commands.register('acme.demo.hello', () => ui.toast('Hello!', { kind: 'success' }))
);
}
export function deactivate() {}
```
5. **Test locally**: Launch Octopus with `OCTOPUS_DEV_PLUGINS=/path/to/your-plugin` (supports multiple paths separated by `:` on macOS/Linux or `;` on Windows), or zip into `<id>-<version>.octoplugin` and install via **Settings → Plugins → Install from file…** (or the Plugin Marketplace sidebar).
6. **Verify JS syntax & manifest**: Run `node --check main.js` and test plugin activation/logs in **Settings → Plugins → Log**.
7. **Package & Publish**:
- Exclude `.git`, `node_modules`, `.DS_Store`, `*.map`.
- Web Console: `https://octoterm.si/account?view=plugins`
- CI / CLI upload:
```bash
curl -X POST https://octoterm.si/api/developer/plugins/upload?submit=1 \
-H "Authorization: Bearer octo_pat_..." \
-H "X-Content-Sha256: $(shasum -a 256 my-plugin.octoplugin | awk '{print $1}')" \
--data-binary @my-plugin.octoplugin
```
> **Critical Rules**:
> - Declare `"engines": { "api": 0, "engine": ">=2.0.0" }` in `plugin.json` whenever using v2.0.0+ capabilities (MCP tools/servers, agent launch/context/approval hooks, session control/telemetry, workbench layouts/status bar/project menus, bundled skills, terminal `selection` themes). Octopus checks `engines.engine` against its independent **Plugin Engine Version** (currently `2.1.0`, exposed to plugins as `env.engineVersion`) **both at install time and at catalog scan time**, rejecting incompatible `.octoplugin` packages before installation. Use `>=2.1.0` if the plugin requires `projects.groups()` or project icon metadata.
> - All host APIs are ES module exports from `'octopus'` (e.g. `import { mcp, agents, sessions, fs, env } from 'octopus'`). Never expect `ctx.commands` or `ctx.fs`.
> - Always push returned disposables into `ctx.subscriptions` so disable/reload cleans up cleanly.
> - Keep `activate()` fast. The host waits up to **30 seconds** for `activate()` to answer; separately, Jaunt budgets the lifecycle dispatch turn at **10 seconds / 300,000,000 instructions**. Avoid `eval()` / `new Function()`.
Files in this skill
- .skill-meta.json
- SKILL.md
- references/api.md
- references/permissions.md
- templates/agent-mcp-tools/main.js
- templates/agent-mcp-tools/plugin.json
- templates/basic-command/main.js
- templates/basic-command/plugin.json
- templates/theme-pack/plugin.json
- templates/theme-pack/themes/dark.json
Attribution
Related skills
View all in development →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.