opencode-plugin

Develop custom OpenCode CLI plugins with ESM, Zod, and BunShell.

1|1|Updated Jun 11, 2026
One-click install
npx skills add https://github.com/valtterimelkko/agent-workflow-skills --skill opencode-plugin-valtterimelkko
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: opencode-plugin
Source: https://github.com/valtterimelkko/agent-workflow-skills/tree/main/skills/opencode-plugin
Command: npx skills add https://github.com/valtterimelkko/agent-workflow-skills --skill opencode-plugin-valtterimelkko

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @opencode-ai/plugin, zod.

What problem does it solve?

This skill provides a comprehensive framework for extending the OpenCode CLI, allowing developers to build custom tools, automate agent workflows, and inject persistent context into LLM sessions.

Core Features & Use Cases

  • Custom Tool Registration: Define and register bespoke tools that the LLM can invoke to perform specific actions like file management or API interactions.
  • Lifecycle Hook Integration: Intercept agent events, modify system prompts, and manage shell environments to tailor agent behavior to specific project needs.
  • State Management: Implement persistent storage and session-aware logic to ensure agent continuity across multiple interactions.

Quick Start

Use the opencode-plugin skill to guide the creation of a new plugin that registers a custom tool for project documentation.

Frequently Asked Questions about opencode-plugin

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

FAQPage Schema
How do I develop and integrate custom tools for the OpenCode CLI?

To develop custom OpenCode CLI tools, you create an ESM-based module that registers bespoke tools for the LLM to invoke, enabling project-specific actions like file management or API interactions.

Can I use lifecycle hooks to manage agent behavior and shell environments in OpenCode?

Yes, OpenCode plugin development supports lifecycle hook integration, allowing you to intercept agent events, modify system prompts, and manage shell environments to tailor agent behavior to specific project needs.

How do I handle persistent session state and context injection for LLM agents?

You handle persistent session state by implementing persistent storage and session-aware logic within your OpenCode plugin, ensuring agent continuity and injecting persistent context across multiple interactions.

Do I need Zod and ESM modules to build OpenCode CLI plugins?

Yes, building OpenCode CLI plugins requires ESM-based module development for the architecture and Zod-based schema validation to ensure structured data handling and tool registration.

What is the best way to automate agent workflows and execute shell commands in OpenCode?

The best way to automate agent workflows is by developing a custom plugin that utilizes BunShell-based command execution, enabling tailored shell environment management and automated agent tasks.