creating-opencode-plugins

Create OpenCode plugins that intercept and customize AI events.

121|16|Updated Oct 10, 2025
One-click install
npx skills add https://github.com/pr-pm/prpm --skill creating-opencode-plugins
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: creating-opencode-plugins
Source: https://github.com/pr-pm/prpm/tree/main/.claude/skills/creating-opencode-plugins
Command: npx skills add https://github.com/pr-pm/prpm --skill creating-opencode-plugins

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the complexity of building custom integrations for OpenCode by providing structured patterns and APIs for intercepting and responding to 25+ different events across the development lifecycle.

Core Features & Use Cases

  • Event-Driven Architecture: Hook into command execution, file operations, LSP diagnostics, permission requests, and UI interactions.
  • Security & Monitoring: Create plugins that prevent credential leaks, monitor system activities, and enforce security policies.
  • Use Case: Imagine you need to prevent developers from accidentally sharing .env files. Use this Skill to build a plugin that automatically blocks read/share operations on sensitive files and sends warnings when they're edited.

Quick Start

Create an OpenCode plugin that monitors file edits and warns when sensitive files like .env are modified.

Frequently Asked Questions about creating-opencode-plugins

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build event-driven plugins to intercept OpenCode AI operations?

Event-driven plugins intercept and respond to 25+ OpenCode events like file edits, command execution, and LSP diagnostics. Export an async function from a JavaScript/TypeScript module that receives a context object and returns an event handler routing on event.type, paired with a manifest describing supported hooks and events.

Can I use plugins to prevent sensitive files like .env from being shared accidentally?

Yes. Build a plugin that hooks into file.edited and read/share operations to monitor and block access to sensitive files, then emit warnings when .env or credential files are modified, enforcing security policies at the event layer.

What events can OpenCode plugins intercept?

Plugins can intercept file operations, command executions, LSP diagnostics, permission requests, session lifecycle events, tool registrations, and TUI interactions. Each event type (file.edited, permission.replied, command.executed, lsp.client.diagnostics, tool.execute.before/after) routes through the handler for validation, logging, or custom policy enforcement.

Do I need TypeScript to write OpenCode plugins?

No. Plugins are JavaScript/TypeScript modules exporting an async function; you can write in either language. TypeScript provides type safety for the context object and event handler, but plain JavaScript works equally well.

How do plugins enable custom security policies and monitoring?

Plugins hook into command, file, and permission events to validate, log, and enforce policies before execution. Use event handlers to detect risky operations, prevent credential leaks, and send warnings, creating a validation layer across the development lifecycle.

What dependencies or setup do OpenCode plugins require?

Plugins require only a manifest file describing hooks and supported events, plus a JavaScript/TypeScript module. No external dependencies are mandated; the plugin receives a context object providing project, client, directory, and worktree access for event handling.