Skip to content

Instantly share code, notes, and snippets.

@udondan
Created December 10, 2025 16:22
Show Gist options
  • Select an option

  • Save udondan/0b973517d2ef37ac800bcc63bd5e31bc to your computer and use it in GitHub Desktop.

Select an option

Save udondan/0b973517d2ef37ac800bcc63bd5e31bc to your computer and use it in GitHub Desktop.
OpenCode plugin to enforce responsible-vibe-mcp
import { randomUUID } from 'crypto';
import type { Plugin } from '@opencode-ai/plugin';
export const StartDevelopmentPlugin: Plugin = async ({
project,
client,
$,
directory,
worktree,
}) => {
const firstMessagePerSession = new Set<string>();
return {
'chat.message': async (input, output) => {
const { sessionID, agent, messageID } = input;
if (agent?.toLocaleLowerCase() !== 'vibe' || !messageID) {
return;
}
// Check if this is the first message in this session
if (!firstMessagePerSession.has(sessionID)) {
firstMessagePerSession.add(sessionID);
output.parts.push({
id: randomUUID(),
sessionID,
messageID,
type: 'text',
text: `
We need to start a new development process.
IMPORTANT: Use list_workflows tool to get available workflows and select the best workflow for the given task. Then start the workflow using start_development tool.
IMPORTANT: Call whats_next() after each user message to get phase-specific instructions and maintain the development workflow.
IMPORTANT: Do NOT start development without explicit instructions from whats_next(). Do NOT even read files unless the whats_next() tool instructs you to do so!
`,
synthetic: true,
} as any);
}
},
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment