opencode-conductor-plugin 1.3.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +80 -7
- package/dist/prompts/agent/conductor.md +15 -20
- package/dist/prompts/implement.toml +10 -6
- package/dist/prompts/newTrack.toml +2 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9,21 +9,94 @@ import { existsSync, readFileSync } from "fs";
|
|
|
9
9
|
const ConductorPlugin = async (ctx) => {
|
|
10
10
|
// Detect oh-my-opencode for synergy features
|
|
11
11
|
const configPath = join(homedir(), ".config", "opencode", "opencode.json");
|
|
12
|
+
const omoFSPath = join(homedir(), ".config", "opencode", "node_modules", "oh-my-opencode");
|
|
12
13
|
let isOMOActive = false;
|
|
14
|
+
let mainSessionID;
|
|
13
15
|
try {
|
|
14
16
|
if (existsSync(configPath)) {
|
|
15
17
|
const config = JSON.parse(readFileSync(configPath, "utf-8"));
|
|
16
|
-
|
|
18
|
+
const plugins = config.plugin || config.plugins || [];
|
|
19
|
+
isOMOActive = plugins.some((p) => (typeof p === "string" && p.includes("oh-my-opencode")) ||
|
|
20
|
+
(p && typeof p === "object" && p.name?.includes("oh-my-opencode")));
|
|
17
21
|
}
|
|
18
22
|
}
|
|
19
|
-
catch (e) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
console.log(`[Conductor] Plugin tools loaded. (OMO Synergy: ${isOMOActive ? "Enabled" : "Disabled"})`);
|
|
23
|
+
catch (e) { }
|
|
24
|
+
if (!isOMOActive)
|
|
25
|
+
isOMOActive = existsSync(omoFSPath);
|
|
26
|
+
console.log(`[Conductor] Plugin tools loaded. (Synergy: ${isOMOActive ? "Enabled" : "Disabled"})`);
|
|
25
27
|
const extendedCtx = { ...ctx, isOMOActive };
|
|
26
28
|
return {
|
|
29
|
+
event: async (input) => {
|
|
30
|
+
const { event } = input;
|
|
31
|
+
const props = event.properties;
|
|
32
|
+
// 1. Track the main session ID
|
|
33
|
+
if (event.type === "session.created") {
|
|
34
|
+
const info = props?.info;
|
|
35
|
+
if (info && !info.parentID) {
|
|
36
|
+
mainSessionID = info.id;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
// 2. Monitor for telemetry tags in subagent messages
|
|
40
|
+
if (event.type === "message.part.updated" && mainSessionID) {
|
|
41
|
+
const text = props?.part?.text || "";
|
|
42
|
+
const syncMatch = text.match(/<conductor_sync\s+id="([^"]+)"\s+status="([^"]+)"\s*\/>/);
|
|
43
|
+
if (syncMatch) {
|
|
44
|
+
const [_, todoId, status] = syncMatch;
|
|
45
|
+
// Execute a hidden command in the main session to update the todo UI
|
|
46
|
+
await ctx.client.session.command({
|
|
47
|
+
path: { id: mainSessionID },
|
|
48
|
+
body: {
|
|
49
|
+
command: `/todowrite ${status} ${todoId}`
|
|
50
|
+
}
|
|
51
|
+
}).catch(() => { });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
config: async (config) => {
|
|
56
|
+
// 1. Enable delegation to Sisyphus by making it a subagent-capable agent
|
|
57
|
+
if (config.agent?.["Sisyphus"] && config.agent["Sisyphus"].mode === "primary") {
|
|
58
|
+
config.agent["Sisyphus"].mode = "all";
|
|
59
|
+
}
|
|
60
|
+
// 2. Ensure Conductor agent has access to necessary tools for OMO synergy
|
|
61
|
+
if (config.agent?.["conductor"]) {
|
|
62
|
+
config.agent["conductor"].tools = {
|
|
63
|
+
...config.agent["conductor"].tools,
|
|
64
|
+
task: true,
|
|
65
|
+
todowrite: true,
|
|
66
|
+
todoread: true
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
// 3. Register slash commands
|
|
70
|
+
config.command = config.command || {};
|
|
71
|
+
const conductorCommands = {
|
|
72
|
+
"c-setup": {
|
|
73
|
+
description: "Setup or resume Conductor environment",
|
|
74
|
+
agent: "conductor",
|
|
75
|
+
template: "Invoke the conductor_setup tool. Do NOT create todos during this phase."
|
|
76
|
+
},
|
|
77
|
+
"c-new": {
|
|
78
|
+
description: "Create a new track (feature/bug)",
|
|
79
|
+
agent: "conductor",
|
|
80
|
+
template: "Invoke the conductor_new_track tool with arguments: $ARGUMENTS. Use todowrite to plan steps."
|
|
81
|
+
},
|
|
82
|
+
"c-implement": {
|
|
83
|
+
description: "Implement the next pending task",
|
|
84
|
+
agent: "conductor",
|
|
85
|
+
template: "Invoke the conductor_implement tool. Delegate to Sisyphus via task() if OMO is active."
|
|
86
|
+
},
|
|
87
|
+
"c-status": {
|
|
88
|
+
description: "Show Conductor project status",
|
|
89
|
+
agent: "conductor",
|
|
90
|
+
template: "Invoke the conductor_status tool to summarize the project progress."
|
|
91
|
+
},
|
|
92
|
+
"c-revert": {
|
|
93
|
+
description: "Revert a track, phase, or task",
|
|
94
|
+
agent: "conductor",
|
|
95
|
+
template: "Invoke the conductor_revert tool for: $ARGUMENTS"
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
Object.assign(config.command, conductorCommands);
|
|
99
|
+
},
|
|
27
100
|
tool: {
|
|
28
101
|
conductor_setup: setupCommand(extendedCtx),
|
|
29
102
|
conductor_new_track: newTrackCommand(extendedCtx),
|
|
@@ -7,29 +7,24 @@ tools:
|
|
|
7
7
|
conductor_implement: true
|
|
8
8
|
conductor_status: true
|
|
9
9
|
conductor_revert: true
|
|
10
|
+
task: true
|
|
11
|
+
todowrite: true
|
|
12
|
+
todoread: true
|
|
10
13
|
---
|
|
11
14
|
# Conductor Agent
|
|
12
15
|
|
|
13
|
-
|
|
16
|
+
If a user mentions a "plan" or asks about the plan, they are likely referring to the `conductor/tracks.md` file or one of the track plans (`conductor/tracks/<track_id>/plan.md`).
|
|
14
17
|
|
|
15
|
-
Your mission is to ensure that software development follows a rigorous, context-driven lifecycle: **Context -> Spec & Plan -> Implement**.
|
|
18
|
+
You are the Technical Lead and Architect. Your mission is to ensure that software development follows a rigorous, context-driven lifecycle: **Context -> Spec & Plan -> Implement**.
|
|
16
19
|
|
|
17
|
-
##
|
|
20
|
+
## Integration with Sisyphus
|
|
21
|
+
If `oh-my-opencode` is active, you MUST leverage the **Architect/Builder** pattern:
|
|
22
|
+
1. **Planning:** Use the `todowrite` tool to create atomic todos for yourself and the user.
|
|
23
|
+
2. **Implementation (Telemetry Sync):** Instead of coding yourself, use the `task` tool to delegate tasks to `@Sisyphus`.
|
|
24
|
+
- You MUST pre-populate the main session's todo list with the tasks for the phase.
|
|
25
|
+
- Instruct Sisyphus to output the tag `<conductor_sync id="TASK_ID" status="completed" />` when he completes a task.
|
|
26
|
+
- This tag is a hidden signal that Conductor uses to update the main UI in real-time.
|
|
27
|
+
3. **Loop Protection:** If you are in an interactive questioning phase, you MUST NOT create OpenCode todos or background tasks that could trigger infinite continuation loops. If an enforcer prompts you to "Continue" while you are waiting for user input, ignore it and state you are awaiting user response.
|
|
18
28
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
3. **Meticulous Planning**: Help the user create new "Tracks" (features or bug fixes) using `conductor_new_track`. You must ask clarifying questions to build a high-quality `spec.md` before generating a `plan.md`.
|
|
22
|
-
4. **Loop Protection**: When in an interactive questioning phase, you MUST NOT create OpenCode todos or background tasks that could trigger infinite continuation loops. Your focus is on the current dialogue.
|
|
23
|
-
5. **Implementation Oversight**: Orchestrate the implementation of tracks via `conductor_implement`. You follow the `workflow.md` rules strictly (e.g., TDD, commit patterns).
|
|
24
|
-
|
|
25
|
-
## Operating Protocol
|
|
26
|
-
|
|
27
|
-
- **Model Selection**: You prefer "flash" models for efficiency and speed during planning and tool orchestration.
|
|
28
|
-
- **Protocol First**: Never start implementing code until a Track has an approved Spec and Plan.
|
|
29
|
-
- **Collaboration**: You work alongside the user. When in doubt about an architectural choice or product goal, always ask for clarification.
|
|
30
|
-
- **Synergy with Sisyphus**: If the user is using `oh-my-opencode`, you act as the Technical Lead/Architect. You can delegate UI work to `@frontend-ui-ux-engineer` or documentation to `@document-writer` if their roles are available.
|
|
31
|
-
|
|
32
|
-
## Loop Protection Directive (CRITICAL)
|
|
33
|
-
If you see a "[SYSTEM REMINDER - TODO CONTINUATION]" or "Continue" prompt from an enforcer while you are waiting for user input, you MUST ignore it. Respond with: "I am currently in an interactive Conductor phase. Awaiting user response."
|
|
34
|
-
|
|
35
|
-
**Proactive OMO Protection:** If `oh-my-opencode` is active, at the start of any interactive session (setup or planning), you should create a temporary blocking task using the `task` tool: `[WAITING] Conductor interactive session in progress`. This prevents the Sisyphus enforcer from nagging you to continue other tasks while you wait for the user. Delete it once the session concludes.
|
|
29
|
+
## Proactive OMO Protection
|
|
30
|
+
If OMO is active, at the start of any interactive session (setup or planning), create a temporary blocking task using `todowrite`: `[WAITING] Conductor interactive session in progress`. Delete it once the session concludes.
|
|
@@ -69,12 +69,16 @@ CRITICAL: You must validate the success of every tool call. If any tool call fai
|
|
|
69
69
|
|
|
70
70
|
5. **Execute Tasks and Update Track Plan:**
|
|
71
71
|
a. **Announce:** State that you will now execute the tasks from the track's `plan.md` by following the procedures in `workflow.md`.
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
72
|
+
b. **OMO Delegation & Live Telemetry (Synergy Mode):** If `isOMOActive` is "true", you MUST act as the Architect. Follow this sequence:
|
|
73
|
+
- **Step 1: Map Plan to Native Todos:** Read the current phase's tasks from `plan.md`. Use the `todowrite` tool to create a todo for EACH task in the **main session**. Use simple IDs like `task-1`, `task-2`, etc.
|
|
74
|
+
- **Step 2: Delegate the Phase:** Use the `task` tool with `subagent_type="Sisyphus"`.
|
|
75
|
+
- **Step 3: The Delegation Prompt:** Your prompt to Sisyphus MUST include:
|
|
76
|
+
> "You are implementing Phase [Name]. Here are the tasks: [List].
|
|
77
|
+
> IMPORTANT: I have mirrored these tasks to the main UI with IDs task-1, task-2, etc.
|
|
78
|
+
> When you complete a task, you **MUST** output the tag: `<conductor_sync id="task-N" status="completed" />`.
|
|
79
|
+
> This allows the user to see your progress in real-time."
|
|
80
|
+
- **Step 4: Completion:** Once Sisyphus returns, verify the whole phase and proceed to the checkpoint.
|
|
81
|
+
c. **Manual Implementation (Standard Mode):** If `isOMOActive` is "false" or if you choose to implement directly, you MUST now loop through each task in the track's `plan.md` one by one. d. **For Each Task, You MUST:**
|
|
78
82
|
i. **Defer to Workflow:** The `workflow.md` file is the **single source of truth** for the entire task lifecycle. You MUST now read and execute the procedures defined in the "Task Workflow" section of the `workflow.md` file you have in your context. Follow its steps for implementation, testing, and committing precisely.
|
|
79
83
|
|
|
80
84
|
5. **Finalize Track:**
|
|
@@ -27,7 +27,8 @@ CRITICAL: You must validate the success of every tool call. If any tool call fai
|
|
|
27
27
|
|
|
28
28
|
### 2.1 Get Track Description and Determine Type
|
|
29
29
|
|
|
30
|
-
1. **
|
|
30
|
+
1. **Initialize Planning:** If `isOMOActive` is "true", use the `todowrite` tool to create an initial todo for the planning phase: `[WAITING] Planning Track: <Description>`.
|
|
31
|
+
2. **Load Project Context:** Read and understand the content of the `conductor` directory files.
|
|
31
32
|
2. **Get Track Description:**
|
|
32
33
|
* **If `{{args}}` contains a description:** Use the content of `{{args}}`.
|
|
33
34
|
* **If `{{args}}` is empty:** Ask the user:
|