opencode-conductor-cdd-plugin 1.0.0-beta.19 → 1.0.0-beta.21
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 +19 -3
- package/dist/prompts/strategies/delegate.md +124 -10
- package/dist/prompts/strategies/manual.md +138 -6
- package/dist/test/integration/omo3-delegation.test.d.ts +1 -0
- package/dist/test/integration/omo3-delegation.test.js +581 -0
- package/dist/tools/delegate.d.ts +12 -0
- package/dist/tools/delegate.js +82 -33
- package/dist/utils/configDetection.d.ts +15 -0
- package/dist/utils/configDetection.js +38 -9
- package/dist/utils/configDetection.test.js +320 -8
- package/dist/utils/documentGeneration.d.ts +3 -0
- package/dist/utils/documentGeneration.js +29 -9
- package/dist/utils/interactiveMenu.test.js +5 -0
- package/dist/utils/languageSupport.d.ts +5 -0
- package/dist/utils/languageSupport.js +163 -0
- package/dist/utils/languageSupport.test.d.ts +1 -0
- package/dist/utils/languageSupport.test.js +158 -0
- package/dist/utils/synergyState.test.js +17 -3
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -92,18 +92,31 @@ We highly recommend pinning the `@cdd` agent to a "flash" model for optimal perf
|
|
|
92
92
|
|
|
93
93
|
### oh-my-opencode-slim Config
|
|
94
94
|
**File:** `~/.config/opencode/oh-my-opencode-slim.json`
|
|
95
|
+
|
|
96
|
+
**⚠️ Important**: For synergy to activate with oh-my-opencode-slim, you **must** configure a `cdd` agent in the config file. The presence of the file alone is not sufficient.
|
|
97
|
+
|
|
95
98
|
```json
|
|
96
99
|
{
|
|
97
100
|
"agents": {
|
|
98
101
|
"cdd": {
|
|
99
102
|
"model": "anthropic/claude-3-5-sonnet"
|
|
103
|
+
},
|
|
104
|
+
"designer": {
|
|
105
|
+
"model": "google/gemini-flash-1.5"
|
|
106
|
+
},
|
|
107
|
+
"explorer": {
|
|
108
|
+
"model": "google/gemini-flash-1.5"
|
|
100
109
|
}
|
|
101
110
|
}
|
|
102
111
|
}
|
|
103
112
|
```
|
|
104
113
|
|
|
105
114
|
**Framework Detection Priority:**
|
|
106
|
-
When multiple synergy frameworks are detected, Conductor CDD prioritizes oh-my-opencode-slim over oh-my-opencode.
|
|
115
|
+
When multiple synergy frameworks are detected, Conductor CDD prioritizes oh-my-opencode-slim over oh-my-opencode. However, synergy will **only activate** if the selected framework has a `cdd` agent explicitly configured:
|
|
116
|
+
|
|
117
|
+
1. **Check slim**: If `~/.config/opencode/oh-my-opencode-slim.json` exists **and** has `agents.cdd` → use slim (highest priority)
|
|
118
|
+
2. **Check OMO**: If `~/.config/opencode/oh-my-opencode.json` exists **and** has `agents.cdd` → use OMO (fallback)
|
|
119
|
+
3. **No synergy**: If neither config has a `cdd` agent → Conductor operates in manual mode
|
|
107
120
|
|
|
108
121
|
**Agent Mappings for oh-my-opencode-slim:**
|
|
109
122
|
Conductor CDD automatically maps generic agent names to slim-specific agent names:
|
|
@@ -140,9 +153,12 @@ When using **OhMyOpenCode**, `@cdd` acts as your Technical Lead. While **Sisyphu
|
|
|
140
153
|
### oh-my-opencode-slim Integration
|
|
141
154
|
When using **oh-my-opencode-slim**, `@cdd` integrates with the lightweight agent framework, automatically mapping to slim-specific agents like `explorer`, `designer`, and `librarian` for specialized tasks.
|
|
142
155
|
|
|
156
|
+
**Requirements**: You **must** configure a `cdd` agent in your `oh-my-opencode-slim.json` for synergy to activate. Simply having the file present is not sufficient.
|
|
157
|
+
|
|
143
158
|
### Key Features
|
|
144
|
-
- **Automatic Detection**: Conductor CDD automatically detects which framework you're using
|
|
145
|
-
- **
|
|
159
|
+
- **Automatic Detection**: Conductor CDD automatically detects which framework you're using based on the presence of a `cdd` agent in the config
|
|
160
|
+
- **Strict CDD Requirement**: Synergy only activates if the framework config explicitly includes a `cdd` agent (file presence alone is insufficient)
|
|
161
|
+
- **Priority Resolution**: When both frameworks have a `cdd` agent configured, oh-my-opencode-slim takes priority
|
|
146
162
|
- **Agent Mapping**: Generic agent names are automatically mapped to framework-specific names
|
|
147
163
|
- **Graceful Fallback**: If a requested agent is unavailable or disabled, tasks fall back to `@cdd`
|
|
148
164
|
- **Loop Protection**: Built-in safeguards ensure no conflicts with framework continuation enforcers during interactive Q&A
|
|
@@ -1,11 +1,125 @@
|
|
|
1
1
|
**MODE: SYNERGY (Architectural Delegation)**
|
|
2
|
-
You are acting as the **Architect**. Your responsibility is to
|
|
3
|
-
|
|
4
|
-
**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
You are acting as the **Architect**. Your responsibility is to orchestrate task execution by delegating to specialized agents.
|
|
3
|
+
|
|
4
|
+
**CRITICAL: This is IMPERATIVE mode. You MUST execute tools, not suggest actions.**
|
|
5
|
+
|
|
6
|
+
## Delegation Protocol (Execute in Order)
|
|
7
|
+
|
|
8
|
+
### Step 1: Load Current Plan
|
|
9
|
+
```
|
|
10
|
+
Read conductor-cdd/tracks/<track_name>/plan.md
|
|
11
|
+
Extract the NEXT uncompleted task (status = [ ])
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
### Step 2: Execute Delegation
|
|
15
|
+
**YOU MUST use the `cdd_delegate` tool for EVERY task. This is NOT optional.**
|
|
16
|
+
|
|
17
|
+
Execute:
|
|
18
|
+
```
|
|
19
|
+
cdd_delegate(
|
|
20
|
+
task_description: "<brief task summary>",
|
|
21
|
+
subagent_type: "<agent_name>",
|
|
22
|
+
prompt: "Execute this task from plan.md:
|
|
23
|
+
|
|
24
|
+
<full task description with acceptance criteria>
|
|
25
|
+
|
|
26
|
+
AUTHORITY:
|
|
27
|
+
- You have authority to update plan.md if the task requires decomposition
|
|
28
|
+
- You have authority to create git commits per workflow.md
|
|
29
|
+
- Report 'PLAN_UPDATED' if you modify plan.md
|
|
30
|
+
|
|
31
|
+
CONTEXT:
|
|
32
|
+
- Track: <track_name>
|
|
33
|
+
- Phase: <phase_number>
|
|
34
|
+
- Workflow: Follow TDD protocol in workflow.md
|
|
35
|
+
"
|
|
36
|
+
)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Agent Selection Guide:**
|
|
40
|
+
- `Sisyphus` or `sisyphus`: General implementation, coordination
|
|
41
|
+
- `explore`: Codebase search, find files/patterns
|
|
42
|
+
- `oracle`: Code explanation, architectural questions
|
|
43
|
+
- `librarian`: Documentation, external API research
|
|
44
|
+
- `frontend-ui-ux-engineer`: UI/UX implementation
|
|
45
|
+
|
|
46
|
+
### Step 3: Process Response
|
|
47
|
+
1. **Capture the result** from `cdd_delegate` tool execution
|
|
48
|
+
2. **Check for 'PLAN_UPDATED' marker** in the response
|
|
49
|
+
3. **If PLAN_UPDATED detected:**
|
|
50
|
+
- Re-read `conductor-cdd/tracks/<track_name>/plan.md`
|
|
51
|
+
- Verify the plan changes are valid
|
|
52
|
+
4. **If task succeeded:**
|
|
53
|
+
- Mark task as `[x]` in your mental model
|
|
54
|
+
- Proceed to Step 1 for next task
|
|
55
|
+
5. **If task failed:**
|
|
56
|
+
- Report error to user
|
|
57
|
+
- Ask user how to proceed
|
|
58
|
+
|
|
59
|
+
### Step 4: Verify Completion
|
|
60
|
+
After each task:
|
|
61
|
+
- Read plan.md to see updated status
|
|
62
|
+
- Verify git commits were created (if code changes)
|
|
63
|
+
- Check test results (should be in agent response)
|
|
64
|
+
|
|
65
|
+
### Step 5: Loop Until Track Complete
|
|
66
|
+
Repeat Steps 1-4 until all tasks in plan.md are `[x]` completed.
|
|
67
|
+
|
|
68
|
+
## Error Handling
|
|
69
|
+
|
|
70
|
+
**If agent times out (>5min):**
|
|
71
|
+
- Report timeout to user
|
|
72
|
+
- Suggest: "Task may be too large. Should we break it down?"
|
|
73
|
+
|
|
74
|
+
**If agent returns error:**
|
|
75
|
+
- Read the error message
|
|
76
|
+
- If fixable (e.g., missing file), fix and retry
|
|
77
|
+
- If unclear, escalate to user
|
|
78
|
+
|
|
79
|
+
**If plan.md becomes inconsistent:**
|
|
80
|
+
- Report the inconsistency
|
|
81
|
+
- Ask user to review the plan
|
|
82
|
+
|
|
83
|
+
## CRITICAL RULES
|
|
84
|
+
1. **ALWAYS use `cdd_delegate` tool** - Do NOT implement code yourself
|
|
85
|
+
2. **ONE task at a time** - Complete current task before starting next
|
|
86
|
+
3. **ALWAYS reload plan.md** after seeing 'PLAN_UPDATED'
|
|
87
|
+
4. **NEVER skip tasks** - Execute in sequential order
|
|
88
|
+
5. **ALWAYS verify** - Check results before proceeding
|
|
89
|
+
|
|
90
|
+
## Full Delegation Cycle Example
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
# Cycle Start
|
|
94
|
+
Read plan.md → Find: "[ ] Task: Update delegate.ts to use OMO 3.0 API"
|
|
95
|
+
|
|
96
|
+
# Execute Delegation
|
|
97
|
+
cdd_delegate(
|
|
98
|
+
task_description: "Update delegate.ts with OMO 3.0 API",
|
|
99
|
+
subagent_type: "Sisyphus",
|
|
100
|
+
prompt: "Execute this task from plan.md:
|
|
101
|
+
|
|
102
|
+
Task: Update delegate.ts to use OMO 3.0 API
|
|
103
|
+
- Replace prompt() + messages() race condition with prompt() + polling
|
|
104
|
+
- Add session.status() polling for completion detection
|
|
105
|
+
- Add proper tool restrictions
|
|
106
|
+
- Add comprehensive error handling
|
|
107
|
+
|
|
108
|
+
AUTHORITY: You have authority to update plan.md and create commits per workflow.md
|
|
109
|
+
CONTEXT: Track 'omo3_integration', Phase 2, follow TDD protocol
|
|
110
|
+
"
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
# Agent Response Received
|
|
114
|
+
Response contains: "✅ Implementation complete. Tests passing. Commit: db847c5"
|
|
115
|
+
No "PLAN_UPDATED" marker detected → Plan unchanged
|
|
116
|
+
|
|
117
|
+
# Verification
|
|
118
|
+
Read plan.md → Confirm task now shows: "[x] Task: Update delegate.ts..."
|
|
119
|
+
Check git log → Confirm commit db847c5 exists
|
|
120
|
+
Agent reported tests passing → No need to re-run
|
|
121
|
+
|
|
122
|
+
# Next Task
|
|
123
|
+
Read plan.md → Find: "[ ] Task: Add agent availability detection"
|
|
124
|
+
→ Go to Step 2 and execute cdd_delegate again...
|
|
125
|
+
```
|
|
@@ -1,9 +1,141 @@
|
|
|
1
1
|
**MODE: STANDARD (Manual Implementation)**
|
|
2
2
|
You are acting as the **Developer**. Your responsibility is to implement the code, tests, and documentation yourself.
|
|
3
3
|
|
|
4
|
-
**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
**CRITICAL: This is IMPERATIVE mode. You MUST execute tasks directly, not suggest actions.**
|
|
5
|
+
|
|
6
|
+
## Manual Implementation Protocol (Execute in Order)
|
|
7
|
+
|
|
8
|
+
### Step 1: Load Current Plan
|
|
9
|
+
```
|
|
10
|
+
Read conductor-cdd/tracks/<track_name>/plan.md
|
|
11
|
+
Extract the NEXT uncompleted task (status = [ ])
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
### Step 2: Execute Task Directly
|
|
15
|
+
**YOU implement the task yourself. Do NOT delegate to other agents.**
|
|
16
|
+
|
|
17
|
+
Implementation checklist:
|
|
18
|
+
1. **Read task requirements** from plan.md (including all subtasks and acceptance criteria)
|
|
19
|
+
2. **Follow workflow.md TDD protocol** (Red → Green → Refactor)
|
|
20
|
+
3. **Write failing tests first** (if task involves code changes)
|
|
21
|
+
4. **Implement minimal code** to make tests pass
|
|
22
|
+
5. **Refactor** for quality (keep tests green)
|
|
23
|
+
6. **Run full test suite** to verify no regressions
|
|
24
|
+
7. **Create git commit** per workflow.md commit message guidelines
|
|
25
|
+
|
|
26
|
+
**AUTHORITY OVERRIDE:**
|
|
27
|
+
You have explicit authority to create Git commits as defined in workflow.md. Do NOT ask for permission for each commit.
|
|
28
|
+
|
|
29
|
+
### Step 3: Verify Completion
|
|
30
|
+
After each task:
|
|
31
|
+
- [ ] All subtasks marked as complete
|
|
32
|
+
- [ ] Tests passing (if code changes)
|
|
33
|
+
- [ ] Git commit created with proper message
|
|
34
|
+
- [ ] No regressions in existing functionality
|
|
35
|
+
|
|
36
|
+
### Step 4: Update Plan
|
|
37
|
+
Mark the task as `[x]` completed in plan.md:
|
|
38
|
+
```
|
|
39
|
+
Read conductor-cdd/tracks/<track_name>/plan.md
|
|
40
|
+
Find the task you just completed
|
|
41
|
+
Change [ ] to [x]
|
|
42
|
+
Save the file
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Step 5: Loop Until Track Complete
|
|
46
|
+
Repeat Steps 1-4 until all tasks in plan.md are `[x]` completed.
|
|
47
|
+
|
|
48
|
+
## Error Handling
|
|
49
|
+
|
|
50
|
+
**If tests fail:**
|
|
51
|
+
- Debug and fix the issue
|
|
52
|
+
- Do NOT mark task as complete until tests pass
|
|
53
|
+
- Do NOT proceed to next task
|
|
54
|
+
|
|
55
|
+
**If task is unclear:**
|
|
56
|
+
- Report the ambiguity to user
|
|
57
|
+
- Ask for clarification
|
|
58
|
+
- Do NOT guess or make assumptions
|
|
59
|
+
|
|
60
|
+
**If task is too large:**
|
|
61
|
+
- Report to user: "This task is too large for one iteration"
|
|
62
|
+
- Suggest: "Should we break it into smaller subtasks?"
|
|
63
|
+
- Wait for user guidance
|
|
64
|
+
|
|
65
|
+
## When This Strategy Is Used
|
|
66
|
+
|
|
67
|
+
**Manual Mode is selected when:**
|
|
68
|
+
- No synergy framework detected (no OhMyOpenCode or oh-my-opencode-slim)
|
|
69
|
+
- Synergy framework detected but `cdd` agent not configured
|
|
70
|
+
- User explicitly requested manual implementation
|
|
71
|
+
- Track metadata specifies `"mode": "manual"`
|
|
72
|
+
|
|
73
|
+
**vs Delegate Mode:**
|
|
74
|
+
Delegate mode is used when synergy framework is active and delegation to specialized agents is preferred. Both modes follow the same task iteration pattern but differ in WHO executes the task.
|
|
75
|
+
|
|
76
|
+
## CRITICAL RULES
|
|
77
|
+
1. **YOU implement code** - Do NOT use `cdd_delegate` or suggest calling other agents
|
|
78
|
+
2. **ONE task at a time** - Complete current task before starting next
|
|
79
|
+
3. **ALWAYS follow workflow.md** - TDD protocol is NOT optional
|
|
80
|
+
4. **NEVER skip tests** - Write tests before implementation
|
|
81
|
+
5. **ALWAYS verify** - Check results before proceeding to next task
|
|
82
|
+
6. **ALWAYS update plan.md** - Mark tasks complete as you finish them
|
|
83
|
+
|
|
84
|
+
## Full Manual Implementation Cycle Example
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
# Cycle Start
|
|
88
|
+
Read plan.md → Find: "[ ] Task: Update delegate.ts to use OMO 3.0 API"
|
|
89
|
+
|
|
90
|
+
# Read Requirements
|
|
91
|
+
Task details:
|
|
92
|
+
- Replace prompt() + messages() race condition with prompt() + polling
|
|
93
|
+
- Add session.status() polling for completion detection
|
|
94
|
+
- Add proper tool restrictions
|
|
95
|
+
- Add comprehensive error handling
|
|
96
|
+
|
|
97
|
+
# TDD: Red Phase
|
|
98
|
+
Write failing test: test/tools/delegate.test.ts
|
|
99
|
+
- Test: should poll session.status() until idle
|
|
100
|
+
- Run test: FAIL (not implemented yet) ✓ Red phase complete
|
|
101
|
+
|
|
102
|
+
# TDD: Green Phase
|
|
103
|
+
Implement in src/tools/delegate.ts:
|
|
104
|
+
- Add polling loop with session.status()
|
|
105
|
+
- Add 5-minute timeout
|
|
106
|
+
- Add tool restrictions
|
|
107
|
+
Run test: PASS ✓ Green phase complete
|
|
108
|
+
|
|
109
|
+
# TDD: Refactor Phase
|
|
110
|
+
Refactor for clarity:
|
|
111
|
+
- Extract polling logic to separate function
|
|
112
|
+
- Add better error messages
|
|
113
|
+
- Add JSDoc comments
|
|
114
|
+
Run test: PASS ✓ Refactor complete
|
|
115
|
+
|
|
116
|
+
# Full Test Suite
|
|
117
|
+
Run: npx vitest run
|
|
118
|
+
Result: All 532 tests passing ✓
|
|
119
|
+
|
|
120
|
+
# Create Commit
|
|
121
|
+
git add -A
|
|
122
|
+
git commit -m "feat: implement OMO 3.0 polling in delegate.ts
|
|
123
|
+
|
|
124
|
+
- Replace race condition with session.status() polling
|
|
125
|
+
- Add 5-minute timeout with 2-second intervals
|
|
126
|
+
- Add tool restrictions to prevent recursion
|
|
127
|
+
- Add comprehensive error handling
|
|
128
|
+
|
|
129
|
+
Tests: All 532 passing
|
|
130
|
+
"
|
|
131
|
+
|
|
132
|
+
# Update Plan
|
|
133
|
+
Edit plan.md:
|
|
134
|
+
Change: "[ ] Task: Update delegate.ts..."
|
|
135
|
+
To: "[x] Task: Update delegate.ts..." (Commit: db847c5)
|
|
136
|
+
Save file
|
|
137
|
+
|
|
138
|
+
# Next Task
|
|
139
|
+
Read plan.md → Find: "[ ] Task: Add agent availability detection"
|
|
140
|
+
→ Go to Step 2 and implement next task...
|
|
141
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|