opencode-conductor-plugin 1.3.0 → 1.4.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
CHANGED
|
@@ -9,21 +9,75 @@ 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;
|
|
13
14
|
try {
|
|
14
15
|
if (existsSync(configPath)) {
|
|
15
16
|
const config = JSON.parse(readFileSync(configPath, "utf-8"));
|
|
16
|
-
|
|
17
|
+
// Check both "plugin" and "plugins" keys for robustness
|
|
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
23
|
catch (e) {
|
|
20
|
-
//
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
// Silent fail on JSON parse
|
|
25
|
+
}
|
|
26
|
+
// Double check filesystem if config check didn't find it
|
|
27
|
+
if (!isOMOActive) {
|
|
28
|
+
isOMOActive = existsSync(omoFSPath);
|
|
29
|
+
}
|
|
30
|
+
console.log(`[Conductor] Plugin tools loaded. (Synergy: ${isOMOActive ? "Enabled" : "Disabled"})`);
|
|
31
|
+
if (!isOMOActive) {
|
|
32
|
+
console.log(`[Conductor] Debug: Checked ${configPath} and ${omoFSPath}`);
|
|
23
33
|
}
|
|
24
|
-
console.log(`[Conductor] Plugin tools loaded. (OMO Synergy: ${isOMOActive ? "Enabled" : "Disabled"})`);
|
|
25
34
|
const extendedCtx = { ...ctx, isOMOActive };
|
|
26
35
|
return {
|
|
36
|
+
config: async (config) => {
|
|
37
|
+
// 1. Enable delegation to Sisyphus by making it a subagent-capable agent
|
|
38
|
+
if (config.agent?.["Sisyphus"] && config.agent["Sisyphus"].mode === "primary") {
|
|
39
|
+
config.agent["Sisyphus"].mode = "all";
|
|
40
|
+
}
|
|
41
|
+
// 2. Ensure Conductor agent has access to necessary tools for OMO synergy
|
|
42
|
+
if (config.agent?.["conductor"]) {
|
|
43
|
+
config.agent["conductor"].tools = {
|
|
44
|
+
...config.agent["conductor"].tools,
|
|
45
|
+
task: true,
|
|
46
|
+
todowrite: true,
|
|
47
|
+
todoread: true
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
// 3. Register slash commands
|
|
51
|
+
config.command = config.command || {};
|
|
52
|
+
const conductorCommands = {
|
|
53
|
+
"c-setup": {
|
|
54
|
+
description: "Setup or resume Conductor environment",
|
|
55
|
+
agent: "conductor",
|
|
56
|
+
template: "Invoke the conductor_setup tool. Do NOT create todos during this phase."
|
|
57
|
+
},
|
|
58
|
+
"c-new": {
|
|
59
|
+
description: "Create a new track (feature/bug)",
|
|
60
|
+
agent: "conductor",
|
|
61
|
+
template: "Invoke the conductor_new_track tool with arguments: $ARGUMENTS. Use todowrite to plan steps."
|
|
62
|
+
},
|
|
63
|
+
"c-implement": {
|
|
64
|
+
description: "Implement the next pending task",
|
|
65
|
+
agent: "conductor",
|
|
66
|
+
template: "Invoke the conductor_implement tool. Delegate to Sisyphus via task() if OMO is active."
|
|
67
|
+
},
|
|
68
|
+
"c-status": {
|
|
69
|
+
description: "Show Conductor project status",
|
|
70
|
+
agent: "conductor",
|
|
71
|
+
template: "Invoke the conductor_status tool to summarize the project progress."
|
|
72
|
+
},
|
|
73
|
+
"c-revert": {
|
|
74
|
+
description: "Revert a track, phase, or task",
|
|
75
|
+
agent: "conductor",
|
|
76
|
+
template: "Invoke the conductor_revert tool for: $ARGUMENTS"
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
Object.assign(config.command, conductorCommands);
|
|
80
|
+
},
|
|
27
81
|
tool: {
|
|
28
82
|
conductor_setup: setupCommand(extendedCtx),
|
|
29
83
|
conductor_new_track: newTrackCommand(extendedCtx),
|
|
@@ -7,29 +7,22 @@ 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:** Instead of coding yourself, use the `task` tool to delegate tasks to `@Sisyphus`.
|
|
24
|
+
- *Example:* `task(subagent_type="Sisyphus", prompt="Implement feature X using spec in file Y. Follow workflow Z.")`
|
|
25
|
+
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
26
|
|
|
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.
|
|
27
|
+
## Proactive OMO Protection
|
|
28
|
+
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,11 @@ 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
|
-
d. **For Each Task, You MUST:**
|
|
72
|
+
b. **OMO Delegation (Synergy Mode):** If `isOMOActive` is "true", you SHOULD consider yourself the Architect. Instead of implementing every code change yourself, you MUST delegate the granular TDD loops for each task to Sisyphus using the `task` tool.
|
|
73
|
+
- *Action:* For each task, announce: "Delegating implementation of task [Name] to Sisyphus."
|
|
74
|
+
- *Action:* Use the `task` tool with `subagent_type="Sisyphus"`. Provide the task description and reference the `spec.md` and `workflow.md` in the prompt.
|
|
75
|
+
- *Action:* Once Sisyphus completes the task, you verify it against the plan and move to the next.
|
|
76
|
+
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
77
|
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
78
|
|
|
80
79
|
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:
|