opencode-conductor-plugin 1.8.2 → 1.10.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/README.md CHANGED
@@ -11,12 +11,14 @@ The philosophy is simple: **control your code by controlling your context.** By
11
11
  ## 🚀 Key Features
12
12
 
13
13
  * **Specialized `@conductor` Agent**: A dedicated subagent that acts as your Project Architect and Technical Lead.
14
- * **Native Slash Commands**: Integrated shortcuts like `/c-setup`, `/c-new`, and `/c-implement` for frictionless project management.
14
+ * **Native Slash Commands**: Integrated shortcuts like `/conductor:setup`, `/conductor:newTrack`, and `/conductor:implement` for frictionless project management.
15
+ * **Modern Permissions**: Fully compatible with OpenCode v1.1.1 granular permission system.
15
16
  * **Protocol-Driven Workflow**: Automated enforcement of the **Context -> Spec -> Plan -> Implement** lifecycle.
16
17
  * **Smart Revert**: A Git-aware revert system that understands logical units of work (Tracks, Phases, Tasks) instead of just raw commit hashes.
17
18
  * **19+ Style Templates**: Built-in support for a vast range of languages including Rust, Solidity, Zig, Julia, Kotlin, Swift, and more.
18
19
  * **Zero-Config Bootstrap**: Automatically installs agents and commands to your global OpenCode configuration on first run.
19
20
  * **Sisyphus Synergy**: Optimized to work alongside [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) for a multi-agent team experience.
21
+ * **Agent Agnostic**: Commands can be invoked by any agent, giving you the freedom to choose your primary interface.
20
22
 
21
23
  ---
22
24
 
@@ -24,18 +26,18 @@ The philosophy is simple: **control your code by controlling your context.** By
24
26
 
25
27
  Conductor organizes your work into **Tracks** (features or bug fixes). Every Track follows three mandatory phases:
26
28
 
27
- ### 1. Project Initialization (`/c-setup`)
28
- Run this once per project. The `@conductor` agent will interview you to define:
29
+ ### 1. Project Initialization (`/conductor:setup`)
30
+ Run this once per project. The agent will interview you to define:
29
31
  * **Product Vision**: Target users, core goals, and primary features.
30
32
  * **Tech Stack**: Languages, frameworks, and databases.
31
33
  * **Workflow Rules**: Testing standards (e.g., TDD), commit strategies, and documentation patterns.
32
34
 
33
- ### 2. Track Planning (`/c-new`)
34
- When you're ready for a new task, tell Conductor what you want to build.
35
+ ### 2. Track Planning (`/conductor:newTrack`)
36
+ When you're ready for a new task, tell the agent what you want to build.
35
37
  * **Specification (`spec.md`)**: Conductor asks 3-5 targeted questions to clarify the "What" and "Why".
36
38
  * **Implementation Plan (`plan.md`)**: Once the spec is approved, Conductor generates a step-by-step checklist adhering to your project's workflow rules.
37
39
 
38
- ### 3. Autonomous Implementation (`/c-implement`)
40
+ ### 3. Autonomous Implementation (`/conductor:implement`)
39
41
  The agent works through the `plan.md` checklist, executing tasks, running tests, and making semantic commits automatically until the Track is complete.
40
42
 
41
43
  ---
@@ -92,11 +94,11 @@ We highly recommend pinning the `@conductor` agent to a "flash" model for optima
92
94
 
93
95
  | Command | Description |
94
96
  | :--- | :--- |
95
- | `/c-setup` | Initialize the `conductor/` directory and project "Constitution". |
96
- | `/c-new "desc"` | Start a new feature/bug Track with spec and plan generation. |
97
- | `/c-implement` | Start implementing the next pending task in the current track. |
98
- | `/c-status` | Get a high-level overview of project progress and active tracks. |
99
- | `/c-revert` | Interactively select a task, phase, or track to undo via Git. |
97
+ | `/conductor:setup` | Initialize the `conductor/` directory and project "Constitution". |
98
+ | `/conductor:newTrack "desc"` | Start a new feature/bug Track with spec and plan generation. |
99
+ | `/conductor:implement` | Start implementing the next pending task in the current track. |
100
+ | `/conductor:status` | Get a high-level overview of project progress and active tracks. |
101
+ | `/conductor:revert` | Interactively select a task, phase, or track to undo via Git. |
100
102
 
101
103
  ---
102
104
 
package/dist/index.js CHANGED
@@ -1,17 +1,13 @@
1
- import { setupCommand } from "./commands/setup.js";
2
- import { newTrackCommand } from "./commands/newTrack.js";
3
- import { implementCommand } from "./commands/implement.js";
4
- import { statusCommand } from "./commands/status.js";
5
- import { revertCommand } from "./commands/revert.js";
6
1
  import { join, dirname } from "path";
7
2
  import { homedir } from "os";
8
3
  import { existsSync, readFileSync } from "fs";
9
4
  import { readFile } from "fs/promises";
10
5
  import { fileURLToPath } from "url";
6
+ import { parse } from "smol-toml";
11
7
  const __filename = fileURLToPath(import.meta.url);
12
8
  const __dirname = dirname(__filename);
13
9
  const ConductorPlugin = async (ctx) => {
14
- // Detect oh-my-opencode for synergy features
10
+ // 1. Detect oh-my-opencode for synergy features
15
11
  const configPath = join(homedir(), ".config", "opencode", "opencode.json");
16
12
  let isOMOActive = false;
17
13
  try {
@@ -21,32 +17,96 @@ const ConductorPlugin = async (ctx) => {
21
17
  }
22
18
  }
23
19
  catch (e) {
24
- // Fallback to filesystem check if config read fails
25
20
  const omoPath = join(homedir(), ".config", "opencode", "node_modules", "oh-my-opencode");
26
21
  isOMOActive = existsSync(omoPath);
27
22
  }
28
- console.log(`[Conductor] Plugin tools loaded. (OMO Synergy: ${isOMOActive ? "Enabled" : "Disabled"})`);
29
- const extendedCtx = { ...ctx, isOMOActive };
23
+ console.log(`[Conductor] Plugin loaded. (OMO Synergy: ${isOMOActive ? "Enabled" : "Disabled"})`);
24
+ // 2. Helper to load and process prompt templates
25
+ const loadPrompt = async (filename, replacements = {}) => {
26
+ const promptPath = join(__dirname, "prompts", filename);
27
+ try {
28
+ const content = await readFile(promptPath, "utf-8");
29
+ const parsed = parse(content);
30
+ let promptText = parsed.prompt;
31
+ // Default Replacements
32
+ const defaults = {
33
+ isOMOActive: isOMOActive ? "true" : "false",
34
+ templatesDir: join(dirname(__dirname), "templates")
35
+ };
36
+ const finalReplacements = { ...defaults, ...replacements };
37
+ for (const [key, value] of Object.entries(finalReplacements)) {
38
+ promptText = promptText.replaceAll(`{{${key}}}`, value || "");
39
+ }
40
+ return {
41
+ prompt: promptText,
42
+ description: parsed.description
43
+ };
44
+ }
45
+ catch (error) {
46
+ console.error(`[Conductor] Failed to load prompt ${filename}:`, error);
47
+ return { prompt: `SYSTEM ERROR: Failed to load prompt ${filename}`, description: "Error loading command" };
48
+ }
49
+ };
50
+ // 3. Load Strategies for Implement Command
51
+ let strategySection = "";
52
+ try {
53
+ const strategyFile = isOMOActive ? "delegate.md" : "manual.md";
54
+ strategySection = await readFile(join(__dirname, "prompts", "strategies", strategyFile), "utf-8");
55
+ }
56
+ catch (e) {
57
+ strategySection = "SYSTEM ERROR: Could not load execution strategy.";
58
+ }
59
+ // 4. Load all Command Prompts
60
+ // conductor:setup
61
+ const setup = await loadPrompt("setup.toml");
62
+ // conductor:newTrack
63
+ // Note: Arguments ($ARGUMENTS) are handled natively by OpenCode commands via variable injection in the template string?
64
+ // Actually, for OpenCode commands, we put the placeholder directly in the string passed to 'template'.
65
+ // Our TOML files use {{args}}, so we need to map that to "$ARGUMENTS" or "$1".
66
+ const newTrack = await loadPrompt("newTrack.toml", { args: "$ARGUMENTS" });
67
+ // conductor:implement
68
+ const implement = await loadPrompt("implement.toml", {
69
+ track_name: "$ARGUMENTS", // Map command arg to the TOML variable
70
+ strategy_section: strategySection
71
+ });
72
+ // conductor:status
73
+ const status = await loadPrompt("status.toml");
74
+ // conductor:revert
75
+ const revert = await loadPrompt("revert.toml", { target: "$ARGUMENTS" });
30
76
  return {
31
- tool: {
32
- conductor_setup: setupCommand(extendedCtx),
33
- conductor_new_track: newTrackCommand(extendedCtx),
34
- conductor_implement: implementCommand(extendedCtx),
35
- conductor_status: statusCommand(extendedCtx),
36
- conductor_revert: revertCommand(extendedCtx),
77
+ command: {
78
+ "conductor:setup": {
79
+ template: setup.prompt,
80
+ description: setup.description,
81
+ agent: "conductor",
82
+ },
83
+ "conductor:newTrack": {
84
+ template: newTrack.prompt,
85
+ description: newTrack.description,
86
+ agent: "conductor",
87
+ },
88
+ "conductor:implement": {
89
+ template: implement.prompt,
90
+ description: implement.description,
91
+ agent: "sisyphus",
92
+ },
93
+ "conductor:status": {
94
+ template: status.prompt,
95
+ description: status.description,
96
+ agent: "conductor",
97
+ },
98
+ "conductor:revert": {
99
+ template: revert.prompt,
100
+ description: revert.description,
101
+ agent: "conductor",
102
+ }
37
103
  },
104
+ // Keep the Hook for Sisyphus Synergy
38
105
  "tool.execute.before": async (input, output) => {
39
- // INTERCEPT: Sisyphus Delegation Hook
40
- // Purpose: Automatically inject the full Conductor context (Plan, Spec, Workflow, Protocol)
41
- // whenever the Conductor delegates a task to Sisyphus. This ensures Sisyphus has "Engineering Authority"
42
- // without needing the LLM to manually copy-paste huge context blocks.
43
106
  if (input.tool === "delegate_to_agent") {
44
107
  const agentName = (output.args.agent_name || output.args.agent || "").toLowerCase();
45
108
  if (agentName.includes("sisyphus")) {
46
- console.log("[Conductor] Intercepting Sisyphus delegation. Injecting Context Packet...");
47
109
  const conductorDir = join(ctx.directory, "conductor");
48
- const promptsDir = join(__dirname, "prompts");
49
- // Helper to safely read file content
50
110
  const safeRead = async (path) => {
51
111
  try {
52
112
  if (existsSync(path))
@@ -55,36 +115,22 @@ const ConductorPlugin = async (ctx) => {
55
115
  catch (e) { /* ignore */ }
56
116
  return null;
57
117
  };
58
- // 1. Read Project Context Files
59
- // We need to find the active track to get the correct spec/plan.
60
- // Since we don't know the track ID easily here, we look for the 'plan.md' that might be in the args
61
- // OR we just rely on the Conductor having already done the setup.
62
- // WAIT: We can't easily guess the track ID here.
63
- // BETTER APPROACH: We rely on the generic 'conductor/workflow.md' and 'prompts/implement.toml'.
64
- // For 'spec.md' and 'plan.md', the Conductor usually puts the path in the message.
65
- // However, to be robust, we will read the GLOBAL workflow and the IMPLEMENT prompt.
66
- // We will explicitly inject the IMPLEMENT PROMPT as requested.
67
- const implementToml = await safeRead(join(promptsDir, "implement.toml"));
118
+ // We load the raw TOML just to get the protocol text if needed, or just hardcode a reference.
119
+ // Since we already loaded 'implement' above, we could potentially reuse it, but simplicity is better here.
120
+ // Let's just grab the workflow.md
68
121
  const workflowMd = await safeRead(join(conductorDir, "workflow.md"));
69
- // Construct the injection block
70
122
  let injection = "\n\n--- [SYSTEM INJECTION: CONDUCTOR CONTEXT PACKET] ---\n";
71
123
  injection += "You are receiving this task from the Conductor Architect.\n";
72
- if (implementToml) {
73
- injection += "\n### 1. ARCHITECTURAL PROTOCOL (Reference Only)\n";
74
- injection += "Use this protocol to understand the project's rigorous standards. DO NOT restart the project management lifecycle (e.g. track selection).\n";
75
- injection += "```toml\n" + implementToml + "\n```\n";
76
- }
77
124
  if (workflowMd) {
78
- injection += "\n### 2. DEVELOPMENT WORKFLOW\n";
125
+ injection += "\n### DEVELOPMENT WORKFLOW\n";
79
126
  injection += "Follow these TDD and Commit rules precisely.\n";
80
127
  injection += "```markdown\n" + workflowMd + "\n```\n";
81
128
  }
82
- injection += "\n### 3. DELEGATED AUTHORITY\n";
129
+ injection += "\n### DELEGATED AUTHORITY\n";
83
130
  injection += "- **EXECUTE:** Implement the requested task using the Workflow.\n";
84
131
  injection += "- **REFINE:** You have authority to update `plan.md` if it is flawed.\n";
85
132
  injection += "- **ESCALATE:** If you modify the Plan or Spec, report 'PLAN_UPDATED' immediately.\n";
86
133
  injection += "--- [END INJECTION] ---\n";
87
- // Append to the objective
88
134
  output.args.objective += injection;
89
135
  }
90
136
  }
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  description: Spec-Driven Development Architect. Manages the project lifecycle using the Conductor protocol.
3
3
  mode: primary
4
- tools:
5
- conductor_setup: true
6
- conductor_new_track: true
7
- conductor_implement: true
8
- conductor_status: true
9
- conductor_revert: true
4
+ permission:
5
+ conductor_setup: allow
6
+ conductor_new_track: allow
7
+ conductor_implement: allow
8
+ conductor_status: allow
9
+ conductor_revert: allow
10
10
  ---
11
11
  # Conductor Agent
12
12
 
@@ -32,4 +32,4 @@ Your mission is to ensure that software development follows a rigorous, context-
32
32
  ## Loop Protection Directive (CRITICAL)
33
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
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.
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,24 +69,12 @@ CRITICAL: You must validate the success of every tool call. If any tool call fai
69
69
  - `conductor/workflow.md`
70
70
  c. **Error Handling:** If you fail to read any of these files, you MUST stop and inform the user of the error.
71
71
 
72
- 5. **Execute Tasks and Update Track Plan:**
73
- a. **Announce:** State that you will now execute the tasks from the track's `plan.md` by following the procedures in `workflow.md`.
74
- b. **OMO Delegation (Synergy Mode):** If `isOMOActive` is "true", you act as the **Architect**.
75
- - *Role:* You **MUST** delegate the execution of tasks to **Sisyphus**. Do not attempt to implement tasks yourself unless delegation fails.
76
- - *System Note:* When you call `@sisyphus`, the system will automatically inject the full project context (Plan, Spec, Workflow, Protocol) for you.
77
- - *Action:* For each task, call `@sisyphus` with this directive:
78
- > "I am delegating the implementation of task: '[Task Name]' to you.
79
- >
80
- > **Goal:** Execute this task. You have Engineering Authority to update `plan.md` if needed.
81
- > **Constraint:** If you modify the plan or spec, stop and report 'PLAN_UPDATED'."
82
- - *Verification:*
83
- - If Sisyphus reports 'PLAN_UPDATED', you MUST **reload** `plan.md` before proceeding.
84
- - If Sisyphus reports success, verify the task against the plan and move to the next.
85
- 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.
86
- d. **For Each Task, You MUST:**
87
- 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.
88
-
89
- 5. **Finalize Track:**
72
+ 5. **Execute Tasks and Update Track Plan:**
73
+ a. **Announce:** State that you will now execute the tasks from the track's `plan.md`.
74
+ b. **Execute Strategy:**
75
+ {{strategy_section}}
76
+
77
+ 6. **Finalize Track:**
90
78
  - After all tasks in the track's local `plan.md` are completed, you MUST update the track's status in the tracks file.
91
79
  - This requires finding the specific heading for the track (e.g., `## [~] Track: <Description>`) and replacing it with the completed status (e.g., `## [x] Track: <Description>`).
92
80
  - Announce that the track is fully complete and the tracks file has been updated.
@@ -0,0 +1,11 @@
1
+ **MODE: SYNERGY (Architectural Delegation)**
2
+ You are acting as the **Architect**. Your responsibility is to oversee the track while delegating execution to **Sisyphus**.
3
+
4
+ **DIRECTIVE:**
5
+ 1. **Do NOT implement code yourself.**
6
+ 2. **Delegate:** For each task in `plan.md`, call `@sisyphus`.
7
+ * *Note:* The system will automatically inject the full project context for you.
8
+ * *Instruction:* Tell Sisyphus: "Execute this task. You have authority to update `plan.md` if needed. Report 'PLAN_UPDATED' if you do."
9
+ 3. **Verify:**
10
+ * If Sisyphus reports 'PLAN_UPDATED', you MUST **reload** `plan.md` before the next task.
11
+ * If success, verify against the plan and proceed to the next task.
@@ -0,0 +1,9 @@
1
+ **MODE: STANDARD (Manual Implementation)**
2
+ You are acting as the **Developer**. Your responsibility is to implement the code, tests, and documentation yourself.
3
+
4
+ **DIRECTIVE:**
5
+ 1. **Implement Manually:** Loop through each task in `plan.md` one by one.
6
+ 2. **Workflow:** Follow the `workflow.md` TDD protocol precisely (Red -> Green -> Refactor).
7
+ 3. **Commits:**
8
+ * **AUTHORITY OVERRIDE:** You have explicit authority to create Git commits as defined in the workflow.
9
+ * Do not ask for further permission for the granular task commits defined in `workflow.md`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-conductor-plugin",
3
- "version": "1.8.2",
3
+ "version": "1.10.0",
4
4
  "description": "Conductor plugin for OpenCode",
5
5
  "type": "module",
6
6
  "repository": "derekbar90/opencode-conductor",
@@ -30,7 +30,7 @@
30
30
  "scripts": {
31
31
  "postinstall": "node scripts/postinstall.cjs",
32
32
  "build": "tsc && npm run copy-prompts && npm run copy-templates",
33
- "copy-prompts": "mkdir -p dist/prompts && cp src/prompts/*.toml src/prompts/*.md dist/prompts/ && mkdir -p dist/prompts/agent && cp src/prompts/agent/*.md dist/prompts/agent/ && mkdir -p dist/prompts/commands && cp src/prompts/commands/*.md dist/prompts/commands/",
33
+ "copy-prompts": "mkdir -p dist/prompts && cp src/prompts/*.toml src/prompts/*.md dist/prompts/ && mkdir -p dist/prompts/agent && cp src/prompts/agent/*.md dist/prompts/agent/ && mkdir -p dist/prompts/strategies && cp src/prompts/strategies/*.md dist/prompts/strategies/",
34
34
  "copy-templates": "mkdir -p dist/templates && cp -r src/templates/* dist/templates/",
35
35
  "prepublishOnly": "npm run build"
36
36
  },
@@ -1,2 +0,0 @@
1
- import { type ToolDefinition } from "@opencode-ai/plugin/tool";
2
- export declare const implementCommand: (ctx: any) => ToolDefinition;
@@ -1,19 +0,0 @@
1
- import { tool } from "@opencode-ai/plugin/tool";
2
- import { existsSync } from "fs";
3
- import { join } from "path";
4
- import { loadPrompt } from "../utils/promptLoader.js";
5
- export const implementCommand = (ctx) => tool({
6
- description: "Implements tasks from a Conductor track.",
7
- args: {
8
- track_name: tool.schema.string().optional().describe("Specific track to implement. If omitted, selects the next incomplete track."),
9
- },
10
- async execute(args) {
11
- const conductorDir = join(ctx.directory, "conductor");
12
- if (!existsSync(join(conductorDir, "product.md"))) {
13
- return "Conductor is not set up. Please run `conductor_setup`.";
14
- }
15
- return await loadPrompt("implement.toml", {
16
- isOMOActive: ctx.isOMOActive ? "true" : "false"
17
- });
18
- },
19
- });
@@ -1,2 +0,0 @@
1
- import { type ToolDefinition } from "@opencode-ai/plugin/tool";
2
- export declare const newTrackCommand: (ctx: any) => ToolDefinition;
@@ -1,21 +0,0 @@
1
- import { tool } from "@opencode-ai/plugin/tool";
2
- import { existsSync } from "fs";
3
- import { join } from "path";
4
- import { loadPrompt } from "../utils/promptLoader.js";
5
- export const newTrackCommand = (ctx) => tool({
6
- description: "Creates a new track (feature/bug) in the Conductor system. IMPORTANT: Do NOT create any todos using 'todowrite' or 'task' tools before or during this command, as it manages its own interactive state and will conflict with continuation enforcers.",
7
- args: {
8
- description: tool.schema.string().optional().describe("Brief description of the track."),
9
- },
10
- async execute(args) {
11
- const conductorDir = join(ctx.directory, "conductor");
12
- if (!existsSync(join(conductorDir, "product.md"))) {
13
- return "Conductor is not set up. Please run `conductor_setup`.";
14
- }
15
- // Map the description to {{args}} in the legacy TOML
16
- return await loadPrompt("newTrack.toml", {
17
- args: args.description || "",
18
- isOMOActive: ctx.isOMOActive ? "true" : "false"
19
- });
20
- },
21
- });
@@ -1,2 +0,0 @@
1
- import { type ToolDefinition } from "@opencode-ai/plugin/tool";
2
- export declare const revertCommand: (ctx: any) => ToolDefinition;
@@ -1,17 +0,0 @@
1
- import { tool } from "@opencode-ai/plugin/tool";
2
- import { existsSync } from "fs";
3
- import { join } from "path";
4
- import { loadPrompt } from "../utils/promptLoader.js";
5
- export const revertCommand = (ctx) => tool({
6
- description: "Reverts a Conductor track, phase, or task.",
7
- args: {
8
- target: tool.schema.string().optional().describe("ID or description of what to revert."),
9
- },
10
- async execute(args) {
11
- const conductorDir = join(ctx.directory, "conductor");
12
- if (!existsSync(join(conductorDir, "tracks.md"))) {
13
- return "Conductor is not set up.";
14
- }
15
- return await loadPrompt("revert.toml");
16
- },
17
- });
@@ -1,2 +0,0 @@
1
- import { type ToolDefinition } from "@opencode-ai/plugin/tool";
2
- export declare const setupCommand: (ctx: any) => ToolDefinition;
@@ -1,22 +0,0 @@
1
- import { tool } from "@opencode-ai/plugin/tool";
2
- import { StateManager } from "../utils/stateManager.js";
3
- import { loadPrompt } from "../utils/promptLoader.js";
4
- import { join, dirname } from "path";
5
- import { fileURLToPath } from "url";
6
- const __filename = fileURLToPath(import.meta.url);
7
- const __dirname = dirname(__filename);
8
- export const setupCommand = (ctx) => tool({
9
- description: "Sets up the Conductor environment for the project. Call this to start or resume the setup process. IMPORTANT: Do NOT create any todos using 'todowrite' or 'task' tools before or during this command, as it manages its own interactive state and will conflict with continuation enforcers.",
10
- args: {
11
- user_input: tool.schema.string().optional().describe("The user's response to a previous question, if applicable."),
12
- },
13
- async execute(args) {
14
- const stateManager = new StateManager(ctx.directory);
15
- // Resolve the absolute path to the templates directory in the distribution
16
- const templatesDir = join(__dirname, "../templates");
17
- return await loadPrompt("setup.toml", {
18
- templatesDir,
19
- isOMOActive: ctx.isOMOActive ? "true" : "false"
20
- });
21
- },
22
- });
@@ -1,2 +0,0 @@
1
- import { type ToolDefinition } from "@opencode-ai/plugin/tool";
2
- export declare const statusCommand: (ctx: any) => ToolDefinition;
@@ -1,15 +0,0 @@
1
- import { tool } from "@opencode-ai/plugin/tool";
2
- import { existsSync } from "fs";
3
- import { join } from "path";
4
- import { loadPrompt } from "../utils/promptLoader.js";
5
- export const statusCommand = (ctx) => tool({
6
- description: "Shows the status of Conductor tracks.",
7
- args: {},
8
- async execute(args) {
9
- const conductorDir = join(ctx.directory, "conductor");
10
- if (!existsSync(join(conductorDir, "tracks.md"))) {
11
- return "Conductor is not set up.";
12
- }
13
- return await loadPrompt("status.toml");
14
- },
15
- });
@@ -1,5 +0,0 @@
1
- ---
2
- description: Implement the next pending task
3
- agent: conductor
4
- ---
5
- Invoke the conductor_implement tool. If a track name is provided ("$ARGUMENTS"), use it; otherwise, implement the next available track.
@@ -1,5 +0,0 @@
1
- ---
2
- description: Create a new track (feature/bug)
3
- agent: conductor
4
- ---
5
- Invoke the conductor_new_track tool with description: "$ARGUMENTS". Do NOT create todos during this phase.
@@ -1,5 +0,0 @@
1
- ---
2
- description: Revert a track, phase, or task
3
- agent: conductor
4
- ---
5
- Invoke the conductor_revert tool for: "$ARGUMENTS"
@@ -1,5 +0,0 @@
1
- ---
2
- description: Setup or resume Conductor environment
3
- agent: conductor
4
- ---
5
- Invoke the conductor_setup tool to start or resume the project initialization. Do NOT create todos during this phase.
@@ -1,5 +0,0 @@
1
- ---
2
- description: Show Conductor project status
3
- agent: conductor
4
- ---
5
- Invoke the conductor_status tool to summarize the project progress.
@@ -1 +0,0 @@
1
- export declare function loadPrompt(filename: string, replacements?: Record<string, string>): Promise<string>;
@@ -1,23 +0,0 @@
1
- import { readFile } from "fs/promises";
2
- import { join, dirname } from "path";
3
- import { fileURLToPath } from "url";
4
- import { parse } from "smol-toml";
5
- const __filename = fileURLToPath(import.meta.url);
6
- const __dirname = dirname(__filename);
7
- export async function loadPrompt(filename, replacements = {}) {
8
- // Resolve path relative to this file.
9
- // Structure: dist/utils/promptLoader.js -> dist/prompts/filename.toml
10
- const promptPath = join(__dirname, "../prompts", filename);
11
- try {
12
- const content = await readFile(promptPath, "utf-8");
13
- const parsed = parse(content);
14
- let promptText = parsed.prompt;
15
- for (const [key, value] of Object.entries(replacements)) {
16
- promptText = promptText.replaceAll(`{{${key}}}`, value || "");
17
- }
18
- return promptText;
19
- }
20
- catch (error) {
21
- throw new Error(`Failed to load prompt from ${promptPath}: ${error}`);
22
- }
23
- }
@@ -1,10 +0,0 @@
1
- export interface SetupState {
2
- last_successful_step: string;
3
- }
4
- export declare class StateManager {
5
- private statePath;
6
- constructor(workDir: string);
7
- ensureConductorDir(): void;
8
- readState(): SetupState;
9
- writeState(step: string): void;
10
- }
@@ -1,30 +0,0 @@
1
- import { join } from "path";
2
- import { existsSync, readFileSync, writeFileSync, mkdirSync } from "fs";
3
- export class StateManager {
4
- statePath;
5
- constructor(workDir) {
6
- this.statePath = join(workDir, "conductor", "setup_state.json");
7
- }
8
- ensureConductorDir() {
9
- const dir = join(this.statePath, "..");
10
- if (!existsSync(dir)) {
11
- mkdirSync(dir, { recursive: true });
12
- }
13
- }
14
- readState() {
15
- if (!existsSync(this.statePath)) {
16
- return { last_successful_step: "" };
17
- }
18
- try {
19
- return JSON.parse(readFileSync(this.statePath, "utf-8"));
20
- }
21
- catch (e) {
22
- return { last_successful_step: "" };
23
- }
24
- }
25
- writeState(step) {
26
- this.ensureConductorDir();
27
- const state = { last_successful_step: step };
28
- writeFileSync(this.statePath, JSON.stringify(state, null, 2));
29
- }
30
- }