Extensibility: Plugins
Relevant source files
The following files were used as context for generating this wiki page:
- apps/app/src/react-app/domains/settings/pages/plugins-view.tsx
- ee/apps/den-api/src/routes/org/plugin-system/contracts.ts
- ee/apps/den-api/src/routes/org/plugin-system/store.ts
- apps/app/src/react-app/domains/settings/state/extensions-store.ts
- ee/apps/den-web/app/(den)/dashboard/_components/plugin-data.tsx/dashboard/_components/plugin-data.tsx)
- apps/app/src/app/data/skill-creator.md
Plugins are the primary mechanism for extending OpenWork and OpenCode capabilities. A plugin acts as a bundle of reusable components—including skills, hooks, MCP servers, sub-agents, and slash commands—that extend an agent's runtime environment. The system supports local discovery through configuration files as well as cloud-based management via organization marketplaces.
Sources: ee/apps/den-web/app/(den)/dashboard/_components/plugin-data.tsx:10-23, README.md:144-150
Plugin Architecture
The architecture distinguishes between the Plugin (the container/metadata) and Config Objects (the individual components within a plugin). This separation allows for versioning components independently and sharing them across multiple plugins.
Core Components
A plugin can contain several types of functional primitives:
| Component Type | Description |
|---|---|
| Skills | Natural-language playbooks or instructions agents load on demand. |
| Hooks | Lifecycle callbacks (e.g., PreToolUse, SessionStart) for runtime intervention. |
| MCP Servers | Model Context Protocol servers exposing external tools and resources. |
| Agents | Custom sub-agents with specific system prompts and toolsets. |
| Commands | Slash-commands that shortcut common user workflows. |
Sources: ee/apps/den-web/app/(den)/dashboard/_components/plugin-data.tsx:14-20, ee/apps/den-api/src/routes/org/plugin-system/store.ts:251-267
Data Flow: Discovery to Materialization
When a connector (like GitHub) is linked, the system discovers plugin candidates and "materializes" them into the local database as plugins and config objects.
The diagram shows how remote repository structures are analyzed to create persistent records in the OpenWork system.
Sources: ee/apps/den-api/src/routes/org/plugin-system/store.ts:1335-1390
Local Plugin Management
Local plugins are managed via opencode.json (or opencode.jsonc). OpenWork supports two scopes for these plugins:
- Project Scope: Configured in
<workspace>/opencode.json. - Global Scope: Configured in
~/.config/opencode/opencode.json.
Sources: README.md:144-150, apps/app/src/react-app/domains/settings/state/extensions-store.ts:1141-1150
Extension Store Logic
The extensions-store manages the state of local plugins, handling additions, removals, and status updates by modifying the JSON configuration files.
The sequence illustrates the atomic update of the plugin array within the OpenCode configuration file.
Sources: apps/app/src/react-app/domains/settings/state/extensions-store.ts:1210-1250
Cloud and Organization Plugins
For enterprise environments, plugins are hosted in Marketplaces and managed through the den-api.
API Contracts
The plugin system exposes a comprehensive administrative API for managing the lifecycle of plugins and their components.
| Endpoint Path | Method | Description |
|---|---|---|
/v1/plugins | GET | List accessible plugins for the organization. |
/v1/plugins/:pluginId | PATCH | Update plugin metadata. |
/v1/plugins/:pluginId/config-objects | GET | List objects (skills, MCPs, etc.) in a plugin. |
/v1/config-objects | POST | Create a new component (Config Object). |
/v1/marketplaces | GET | List available marketplaces. |
Sources: ee/apps/den-api/src/routes/org/plugin-system/contracts.ts:246-350
Security and Access Grants
Access to cloud plugins is governed by a role-based grant system. Grants can be assigned to individual members, specific teams, or organization-wide. Roles include viewer, editor, and manager.
Sources: ee/apps/den-api/src/routes/org/plugin-system/store.ts:468-540
Component Implementation: Skills
Skills are a specialized type of plugin component. They are essentially folders containing a SKILL.md file with frontmatter metadata.
Skill Structure
---
name: my-skill
description: Triggers when user mentions "rotate PDF".
---
# Skill Content
Instructions for the agent go here...
Sources: apps/app/src/app/data/skill-creator.md:40-50
Skill Discovery
OpenWork searches for skills in specific directories:
.opencode/skills/.claude/skills/
Sources: apps/app/src/react-app/domains/settings/state/extensions-store.ts:1330-1345
Conclusion
The OpenWork plugin system provides a flexible, tiered approach to extensibility. Individual developers can extend their local environment by simply adding package names to a JSON config, while organizations can distribute complex, multi-component workflows through managed marketplaces and connectors. The underlying architecture of Config Objects ensures that components remain portable, versioned, and auditable across both local and cloud contexts.