opencode-conductor-plugin 1.6.0 → 1.7.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,102 +9,21 @@ 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");
13
12
  let isOMOActive = false;
14
- // Track ChildSessionID -> ParentSessionID mapping
15
- const sessionMap = new Map();
16
13
  try {
17
14
  if (existsSync(configPath)) {
18
15
  const config = JSON.parse(readFileSync(configPath, "utf-8"));
19
- const plugins = config.plugin || config.plugins || [];
20
- isOMOActive = plugins.some((p) => (typeof p === "string" && p.includes("oh-my-opencode")) ||
21
- (p && typeof p === "object" && p.name?.includes("oh-my-opencode")));
16
+ isOMOActive = config.plugin?.some((p) => p.includes("oh-my-opencode"));
22
17
  }
23
18
  }
24
- catch (e) { }
25
- if (!isOMOActive)
26
- isOMOActive = existsSync(omoFSPath);
27
- console.log(`[Conductor] Plugin tools loaded. (Synergy: ${isOMOActive ? "Enabled" : "Disabled"})`);
19
+ catch (e) {
20
+ // Fallback to filesystem check if config read fails
21
+ const omoPath = join(homedir(), ".config", "opencode", "node_modules", "oh-my-opencode");
22
+ isOMOActive = existsSync(omoPath);
23
+ }
24
+ console.log(`[Conductor] Plugin tools loaded. (OMO Synergy: ${isOMOActive ? "Enabled" : "Disabled"})`);
28
25
  const extendedCtx = { ...ctx, isOMOActive };
29
26
  return {
30
- event: async (input) => {
31
- const { event } = input;
32
- const props = event.properties;
33
- // Track session hierarchy to know where to mirror tools
34
- if (event.type === "session.created") {
35
- const info = props?.info;
36
- if (info && info.parentID) {
37
- sessionMap.set(info.id, info.parentID);
38
- }
39
- }
40
- // Cleanup map on deletion
41
- if (event.type === "session.deleted") {
42
- const info = props?.info;
43
- if (info)
44
- sessionMap.delete(info.id);
45
- }
46
- },
47
- "tool.execute.before": async (input, output) => {
48
- // Intercept 'todowrite' from any subagent and mirror it to their parent session
49
- if (input.tool === "todowrite") {
50
- const parentID = sessionMap.get(input.sessionID);
51
- if (parentID) {
52
- // Re-post the todo update to the parent UI so the user can see it
53
- // We pass the exact arguments used by the subagent
54
- await ctx.client.session.command({
55
- path: { id: parentID },
56
- body: {
57
- command: `/todowrite ${JSON.stringify(output.args)}`
58
- }
59
- }).catch(() => { });
60
- }
61
- }
62
- },
63
- config: async (config) => {
64
- // 1. Enable delegation to Sisyphus by making it a subagent-capable agent
65
- if (config.agent?.["Sisyphus"] && config.agent["Sisyphus"].mode === "primary") {
66
- config.agent["Sisyphus"].mode = "all";
67
- }
68
- // 2. Ensure Conductor agent has access to necessary tools for OMO synergy
69
- if (config.agent?.["conductor"]) {
70
- config.agent["conductor"].tools = {
71
- ...config.agent["conductor"].tools,
72
- task: true,
73
- todowrite: true,
74
- todoread: true
75
- };
76
- }
77
- // 3. Register slash commands
78
- config.command = config.command || {};
79
- const conductorCommands = {
80
- "c-setup": {
81
- description: "Setup or resume Conductor environment",
82
- agent: "conductor",
83
- template: "Invoke the conductor_setup tool. Do NOT create todos during this phase."
84
- },
85
- "c-new": {
86
- description: "Create a new track (feature/bug)",
87
- agent: "conductor",
88
- template: "Invoke the conductor_new_track tool with arguments: $ARGUMENTS. Use todowrite to plan steps."
89
- },
90
- "c-implement": {
91
- description: "Implement the next pending task",
92
- agent: "conductor",
93
- template: "Invoke the conductor_implement tool. Delegate to Sisyphus via task() if OMO is active."
94
- },
95
- "c-status": {
96
- description: "Show Conductor project status",
97
- agent: "conductor",
98
- template: "Invoke the conductor_status tool to summarize the project progress."
99
- },
100
- "c-revert": {
101
- description: "Revert a track, phase, or task",
102
- agent: "conductor",
103
- template: "Invoke the conductor_revert tool for: $ARGUMENTS"
104
- }
105
- };
106
- Object.assign(config.command, conductorCommands);
107
- },
108
27
  tool: {
109
28
  conductor_setup: setupCommand(extendedCtx),
110
29
  conductor_new_track: newTrackCommand(extendedCtx),
@@ -7,21 +7,29 @@ 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
13
10
  ---
14
11
  # Conductor Agent
15
12
 
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`).
13
+ You are the **Conductor**, a specialized AI agent for project management and architectural planning using the **Conductor methodology**.
17
14
 
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**.
15
+ Your mission is to ensure that software development follows a rigorous, context-driven lifecycle: **Context -> Spec & Plan -> Implement**.
19
16
 
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`. Conductor will automatically mirror any todos Sisyphus creates to the main UI.
24
- 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.
17
+ ## Core Responsibilities
25
18
 
26
- ## Proactive OMO Protection
27
- 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.
19
+ 1. **Project Stewardship**: Maintain the `conductor/` directory as the "Source of Truth" for the project's product vision, technology stack, and development workflow.
20
+ 2. **Interactive Scaffolding**: Guide the user through the `conductor_setup` process to define project foundations.
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.
@@ -69,11 +69,12 @@ 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
- b. **OMO Delegation (Synergy Mode):** If `isOMOActive` is "true", you MUST act as the Architect.
73
- - *Action:* Use the `task` tool with `subagent_type="Sisyphus"`. Provide the phase name and reference the `plan.md` and `spec.md`.
74
- - *Action:* Instruct Sisyphus to implement the whole phase and update his internal todos as he works. Conductor will automatically mirror those updates to the main UI.
75
- - *Action:* Once Sisyphus returns, verify the whole phase and proceed to the checkpoint.
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:**
72
+ b. **OMO Delegation (Synergy Mode):** If `isOMOActive` is "true", you SHOULD consider yourself the Architect. Instead of implementing every code change yourself, you can call `@sisyphus` to handle the granular TDD loops for each task.
73
+ - *Action:* For each task, announce: "Delegating implementation of task [Name] to Sisyphus."
74
+ - *Action:* Call `@sisyphus` with the task description and reference the `spec.md` and `workflow.md`.
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.
77
+ d. **For Each Task, You MUST:**
77
78
  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.
78
79
 
79
80
  5. **Finalize Track:**
@@ -27,8 +27,7 @@ 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. **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.
30
+ 1. **Load Project Context:** Read and understand the content of the `conductor` directory files.
32
31
  2. **Get Track Description:**
33
32
  * **If `{{args}}` contains a description:** Use the content of `{{args}}`.
34
33
  * **If `{{args}}` is empty:** Ask the user:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-conductor-plugin",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "description": "Conductor plugin for OpenCode",
5
5
  "type": "module",
6
6
  "repository": "derekbar90/opencode-conductor",