

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Plugins
incomplete
2: Loading Plugins
incomplete
3: Install Plugins
incomplete
4: Plugin Transforms
incomplete
5: Plugin Hooks
incomplete
6: Plugin Tools
incomplete
7: Publishing Plugins
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Transforms let plugins change the definitions OpenCode uses for tools, agents, models, and other features. For example, a plugin can adjust a tool's description or choose a default agent.
This is useful when you're packaging a customized OpenCode experience for a team. The plugin can inspect existing definitions and apply changes in code.
Suppose you're working on a project that includes generated files. This plugin adds a reminder to the read tool's description:
import { Plugin } from "@opencode/plugin";
export default Plugin.define({
id: "bootdev.generated-files",
setup: async (ctx) => {
await ctx.tool.transform((tools) => {
tools.update("read", (tool) => {
tool.description +=
"\nFor generated files, find the source template before proposing edits.";
});
});
},
});
ctx.tool.transform() lets the plugin inspect and modify OpenCode's tool definitions. tools.update("read", ...) then finds the read tool and makes the specified changes.
Use this tool to run individual
.slopexamples when checking language behavior. Use the test suite for regression testing.
Tell OpenCode to run and submit the CLI tests from the project root.