Complete toolkit for configuring and extending OpenCode: agent creation, custom slash commands, configuration management, plugin development, and SDK usage.
75
94%
Does it follow best practices?
Impact
—
No eval scenarios have been run
Passed
No known issues
Create an OpenCode plugin that blocks any bash command containing "rm -rf" from executing. The plugin should:
tool.execute.before hook to intercept tool execution before it runsthrow new Error(...) to block the command — never return falsePlugin type from @opencode-ai/plugintool.execute.before handler as asynctool.execute.before hook to intercept executionthrow new Error(...) to block execution, NOT return falsePlugin type from @opencode-ai/plugintool.execute.before handler is declared as asyncreturn false instead of throw new Error(...) to block execution@opencode-ai/pluginasynctool.execute.after instead)