-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
34 lines (32 loc) · 1.67 KB
/
Copy pathindex.js
File metadata and controls
34 lines (32 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { tool } from "@opencode-ai/plugin";
export const ConfirmLoopPlugin = async ({ client, project }) => {
return {
tool: {
"confirm-loop": tool({
description: [
"CRITICAL ENFORCEMENT RULE — READ THIS EVERY TURN:",
"",
"You MUST use the built-in question tool (NOT type questions as text) when:",
"1. Ending a conversation or thread — before saying done/complete/finished, ask what the user wants to do next",
"2. Asking the user a question or getting a decision — which option, should I continue, do you want me to",
"3. Getting confirmation before proceeding — before implementing, before spawning subagents, before next section",
"4. Offering choices to the user — any question requiring user response",
"5. Reaching a natural stopping point — always end with a question tool call",
"",
"Not pre-approved, section-based work: discuss each item, confirm via question tool before implementing, confirm completion after, only proceed to next item after user confirms.",
"",
"NEVER type questions as text. ALWAYS invoke the question tool instead.",
"NEVER proceed to the next section without user confirmation.",
"This is IMPERATIVE and NON-NEGOTIABLE.",
"",
"This tool does nothing — it exists solely to remind you of this rule every turn.",
].join("\n"),
args: {},
async execute() {
return "Reminder: Always use the question tool when ending conversations or asking questions. Never type questions as text.";
},
}),
},
};
};
export default ConfirmLoopPlugin;