This library provides structured context for AI coding assistants to understand, build, and extend OpenCode plugins. Depending on your task, you can load specific parts of this library.
Foundational concepts of how plugins are registered and executed.
- Overview: Basic structure, registration, and context object.
- Lifecycle: Packaging, manifest, and session lifecycle.
Deep dives into specific plugin features.
- Events: Detailed list of all 25+ hookable events.
- Events: Skills Plugin: Practical example of event hooks in the Skills Plugin.
- Tools: How to build and register custom tools using Zod.
- Agents: Creating and configuring custom AI agents.
Guidelines and troubleshooting.
- Best Practices: Message injection workarounds, security, and performance.
If you are asking an AI to build a new feature:
- For a new tool: Provide
architecture/overview.mdandcapabilities/tools.md. - For reacting to events: Provide
capabilities/events.md. - For overall plugin architecture: Provide
architecture/overview.mdandarchitecture/lifecycle.md.