opencode-conductor-cdd-plugin 1.0.0-beta.13
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/LICENSE +202 -0
- package/README.md +163 -0
- package/README.test.md +51 -0
- package/dist/commands/implement.d.ts +1 -0
- package/dist/commands/implement.js +30 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +108 -0
- package/dist/index.test.d.ts +1 -0
- package/dist/index.test.js +122 -0
- package/dist/prompts/agent/cdd.md +41 -0
- package/dist/prompts/agent/implementer.md +22 -0
- package/dist/prompts/agent.md +23 -0
- package/dist/prompts/cdd/implement.json +4 -0
- package/dist/prompts/cdd/newTrack.json +4 -0
- package/dist/prompts/cdd/revert.json +4 -0
- package/dist/prompts/cdd/setup.json +4 -0
- package/dist/prompts/cdd/setup.test.d.ts +1 -0
- package/dist/prompts/cdd/setup.test.js +132 -0
- package/dist/prompts/cdd/setup.test.ts +168 -0
- package/dist/prompts/cdd/status.json +4 -0
- package/dist/prompts/strategies/delegate.md +11 -0
- package/dist/prompts/strategies/manual.md +9 -0
- package/dist/templates/code_styleguides/c.md +28 -0
- package/dist/templates/code_styleguides/cpp.md +46 -0
- package/dist/templates/code_styleguides/csharp.md +115 -0
- package/dist/templates/code_styleguides/dart.md +238 -0
- package/dist/templates/code_styleguides/general.md +23 -0
- package/dist/templates/code_styleguides/go.md +48 -0
- package/dist/templates/code_styleguides/html-css.md +49 -0
- package/dist/templates/code_styleguides/java.md +39 -0
- package/dist/templates/code_styleguides/javascript.md +51 -0
- package/dist/templates/code_styleguides/julia.md +27 -0
- package/dist/templates/code_styleguides/kotlin.md +41 -0
- package/dist/templates/code_styleguides/php.md +37 -0
- package/dist/templates/code_styleguides/python.md +37 -0
- package/dist/templates/code_styleguides/react.md +37 -0
- package/dist/templates/code_styleguides/ruby.md +39 -0
- package/dist/templates/code_styleguides/rust.md +44 -0
- package/dist/templates/code_styleguides/shell.md +35 -0
- package/dist/templates/code_styleguides/solidity.md +60 -0
- package/dist/templates/code_styleguides/sql.md +39 -0
- package/dist/templates/code_styleguides/swift.md +36 -0
- package/dist/templates/code_styleguides/typescript.md +43 -0
- package/dist/templates/code_styleguides/vue.md +38 -0
- package/dist/templates/code_styleguides/zig.md +27 -0
- package/dist/templates/workflow.md +336 -0
- package/dist/tools/background.d.ts +54 -0
- package/dist/tools/background.js +198 -0
- package/dist/tools/commands.d.ts +11 -0
- package/dist/tools/commands.js +80 -0
- package/dist/tools/commands.test.d.ts +1 -0
- package/dist/tools/commands.test.js +142 -0
- package/dist/tools/delegate.d.ts +3 -0
- package/dist/tools/delegate.js +45 -0
- package/dist/utils/autogenerateFlow.d.ts +65 -0
- package/dist/utils/autogenerateFlow.js +391 -0
- package/dist/utils/autogenerateFlow.test.d.ts +1 -0
- package/dist/utils/autogenerateFlow.test.js +610 -0
- package/dist/utils/bootstrap.d.ts +1 -0
- package/dist/utils/bootstrap.js +46 -0
- package/dist/utils/commandFactory.d.ts +11 -0
- package/dist/utils/commandFactory.js +69 -0
- package/dist/utils/commitMessages.d.ts +35 -0
- package/dist/utils/commitMessages.js +33 -0
- package/dist/utils/commitMessages.test.d.ts +1 -0
- package/dist/utils/commitMessages.test.js +79 -0
- package/dist/utils/configDetection.d.ts +7 -0
- package/dist/utils/configDetection.js +49 -0
- package/dist/utils/configDetection.test.d.ts +1 -0
- package/dist/utils/configDetection.test.js +119 -0
- package/dist/utils/contentGeneration.d.ts +10 -0
- package/dist/utils/contentGeneration.js +141 -0
- package/dist/utils/contentGeneration.test.d.ts +1 -0
- package/dist/utils/contentGeneration.test.js +147 -0
- package/dist/utils/contextAnalysis.d.ts +100 -0
- package/dist/utils/contextAnalysis.js +308 -0
- package/dist/utils/contextAnalysis.test.d.ts +1 -0
- package/dist/utils/contextAnalysis.test.js +307 -0
- package/dist/utils/gitNotes.d.ts +23 -0
- package/dist/utils/gitNotes.js +53 -0
- package/dist/utils/gitNotes.test.d.ts +1 -0
- package/dist/utils/gitNotes.test.js +105 -0
- package/dist/utils/ignoreMatcher.d.ts +9 -0
- package/dist/utils/ignoreMatcher.js +77 -0
- package/dist/utils/ignoreMatcher.test.d.ts +1 -0
- package/dist/utils/ignoreMatcher.test.js +126 -0
- package/dist/utils/stateManager.d.ts +10 -0
- package/dist/utils/stateManager.js +30 -0
- package/package.json +90 -0
- package/scripts/convert-legacy.cjs +17 -0
- package/scripts/postinstall.cjs +38 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Conductor CDD Plugin for OpenCode
|
|
2
|
+
|
|
3
|
+
> **Measure twice, code once.**
|
|
4
|
+
|
|
5
|
+
Conductor CDD is a specialized OpenCode plugin designed to enforce a rigorous, **Context-Driven Development** lifecycle. It transforms OpenCode from a reactive coding tool into a proactive project architect that follows a strict protocol to specify, plan, and implement software features and bug fixes.
|
|
6
|
+
|
|
7
|
+
Note: Slash commands use the `/cdd:*` prefix. This plugin is OpenCode-only and does not target Gemini CLI.
|
|
8
|
+
|
|
9
|
+
The philosophy is simple: **control your code by controlling your context.** By treating project requirements and plans as managed artifacts, Conductor CDD ensures every agent interaction is grounded in deep, persistent project awareness.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 🚀 Key Features
|
|
14
|
+
|
|
15
|
+
* **Specialized `@cdd` Agent**: A dedicated subagent that acts as your Project Architect and Technical Lead.
|
|
16
|
+
* **Native Slash Commands**: Integrated shortcuts like `/cdd:setup`, `/cdd:newTrack`, and `/cdd:implement` for frictionless project management.
|
|
17
|
+
* **Modern Permissions**: Fully compatible with OpenCode v1.1.1 granular permission system.
|
|
18
|
+
* **Protocol-Driven Workflow**: Automated enforcement of the **Context -> Spec -> Plan -> Implement** lifecycle.
|
|
19
|
+
* **Smart Revert**: A Git-aware revert system that understands logical units of work (Tracks, Phases, Tasks) instead of just raw commit hashes.
|
|
20
|
+
* **19+ Style Templates**: Built-in support for a vast range of languages including Rust, Solidity, Zig, Julia, Kotlin, Swift, and more.
|
|
21
|
+
* **Zero-Config Bootstrap**: Automatically installs agents and commands to your global OpenCode configuration on first run.
|
|
22
|
+
* **Sisyphus Synergy**: Optimized to work alongside [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) for a multi-agent team experience.
|
|
23
|
+
* **Agent Agnostic**: Commands can be invoked by any agent, giving you the freedom to choose your primary interface.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 🛠️ The CDD Lifecycle
|
|
28
|
+
|
|
29
|
+
Conductor CDD organizes your work into **Tracks** (features or bug fixes). Every Track follows three mandatory phases:
|
|
30
|
+
|
|
31
|
+
### 1. Project Initialization (`/cdd:setup`)
|
|
32
|
+
Run this once per project. The agent will interview you to define:
|
|
33
|
+
* **Product Vision**: Target users, core goals, and primary features.
|
|
34
|
+
* **Tech Stack**: Languages, frameworks, and databases.
|
|
35
|
+
* **Workflow Rules**: Testing standards (e.g., TDD), commit strategies, and documentation patterns.
|
|
36
|
+
|
|
37
|
+
### 2. Track Planning (`/cdd:newTrack`)
|
|
38
|
+
When you're ready for a new task, tell the agent what you want to build.
|
|
39
|
+
* **Specification (`spec.md`)**: The CDD agent asks 3-5 targeted questions to clarify the "What" and "Why".
|
|
40
|
+
* **Implementation Plan (`plan.md`)**: Once the spec is approved, the agent generates a step-by-step checklist adhering to your project's workflow rules.
|
|
41
|
+
|
|
42
|
+
### 3. Autonomous Implementation (`/cdd:implement`)
|
|
43
|
+
The agent works through the `plan.md` checklist, executing tasks, running tests, and making semantic commits automatically until the Track is complete.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## 📦 Installation
|
|
48
|
+
|
|
49
|
+
Add the plugin to your global OpenCode configuration file. OpenCode will automatically fetch and install it from NPM.
|
|
50
|
+
|
|
51
|
+
**File:** `~/.config/opencode/opencode.json`
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"plugin": [
|
|
56
|
+
"opencode-conductor-cdd-plugin"
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
*Note: Please restart OpenCode after the first run to enable the global slash commands.*
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## ⚙️ Configuration
|
|
66
|
+
|
|
67
|
+
We highly recommend pinning the `@cdd` agent to a "flash" model for optimal performance during planning phases.
|
|
68
|
+
|
|
69
|
+
### Standard OpenCode Config
|
|
70
|
+
**File:** `~/.config/opencode/opencode.json`
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"agent": {
|
|
74
|
+
"cdd": {
|
|
75
|
+
"model": "anthropic/claude-3-5-sonnet"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### OhMyOpenCode Config
|
|
82
|
+
**File:** `~/.config/opencode/oh-my-opencode.json`
|
|
83
|
+
```json
|
|
84
|
+
{
|
|
85
|
+
"agents": {
|
|
86
|
+
"cdd": {
|
|
87
|
+
"model": "anthropic/claude-3-5-sonnet"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## 📋 Commands Reference
|
|
96
|
+
|
|
97
|
+
| Command | Description |
|
|
98
|
+
| :--- | :--- |
|
|
99
|
+
| `/cdd:setup` | Initialize the `conductor-cdd/` directory and project "Constitution". |
|
|
100
|
+
| `/cdd:newTrack "desc"` | Start a new feature/bug Track with spec and plan generation. |
|
|
101
|
+
| `/cdd:implement` | Start implementing the next pending task in the current track. |
|
|
102
|
+
| `/cdd:status` | Get a high-level overview of project progress and active tracks. |
|
|
103
|
+
| `/cdd:revert` | Interactively select a task, phase, or track to undo via Git. |
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## 🤝 Synergy with OhMyOpenCode
|
|
108
|
+
|
|
109
|
+
If you use the **OhMyOpenCode** suite, `@cdd` acts as your Technical Lead. While **Sisyphus** manages the general conversation and orchestration, he can delegate complex architectural planning and protocol enforcement to the `@cdd` agent.
|
|
110
|
+
|
|
111
|
+
Conductor CDD includes built-in "Loop Protection" to ensure it never conflicts with OhMyOpenCode's continuation enforcers during interactive Q&A sessions.
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## 📈 Automated Versioning
|
|
116
|
+
|
|
117
|
+
This project follows **Conventional Commits**. Releases are automated via Semantic Release:
|
|
118
|
+
- `feat:` -> Minor version bump
|
|
119
|
+
- `fix:` -> Patch version bump
|
|
120
|
+
- `BREAKING CHANGE:` -> Major version bump
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## 🔁 Origin & Lineage
|
|
125
|
+
|
|
126
|
+
This project is part of the Context-Driven Development lineage:
|
|
127
|
+
|
|
128
|
+
- **Original Source**: [gemini-cli-extensions/conductor](https://github.com/gemini-cli-extensions/conductor) - The original Gemini CLI framework
|
|
129
|
+
- **Direct Parent**: [derekbar90/opencode-conductor](https://github.com/derekbar90/opencode-conductor) - OpenCode port
|
|
130
|
+
- **This Project**: Evolution with new command and agent conventions for OpenCode v1.1.1+
|
|
131
|
+
|
|
132
|
+
## 🔄 Relationship to Conductor
|
|
133
|
+
|
|
134
|
+
Conductor CDD brings the proven Context-Driven Development methodology from Gemini CLI to OpenCode with architectural adaptations:
|
|
135
|
+
|
|
136
|
+
### Architectural Differences
|
|
137
|
+
- **Command Format**: TOML-based Gemini CLI commands → JSON-based OpenCode plugin prompts
|
|
138
|
+
- **Execution Model**: Direct CLI invocation → Agent-based execution with `@cdd`
|
|
139
|
+
- **Permission System**: Gemini CLI native → OpenCode v1.1.1 granular permissions
|
|
140
|
+
|
|
141
|
+
### Feature Parity
|
|
142
|
+
See [Conductor Feature Parity Gap Analysis](./conductor-cdd/tracks/conductor_parity_20260118/gap-analysis.md) for a comprehensive comparison.
|
|
143
|
+
|
|
144
|
+
**Status**: ✅ **100% Feature Parity Achieved** (51/51 features)
|
|
145
|
+
|
|
146
|
+
Key highlights:
|
|
147
|
+
- ✅ All 5 core commands implemented
|
|
148
|
+
- ✅ Context → Spec → Plan → Implement lifecycle
|
|
149
|
+
- ✅ Documentation synchronization
|
|
150
|
+
- ✅ TDD workflow with Red-Green-Refactor
|
|
151
|
+
- ✅ Brownfield project support
|
|
152
|
+
- ✅ Autogenerate option for faster onboarding
|
|
153
|
+
- ✅ Phase completion verification with checkpoints
|
|
154
|
+
- ✅ Git notes integration for task tracking
|
|
155
|
+
|
|
156
|
+
### Conductor CDD Enhancements
|
|
157
|
+
- 23 code styleguide templates (vs 8 in conductor)
|
|
158
|
+
- Native OpenCode plugin system integration
|
|
159
|
+
- Multi-agent workflow support (OhMyOpenCode synergy)
|
|
160
|
+
|
|
161
|
+
## 📜 License
|
|
162
|
+
|
|
163
|
+
Distributed under the [Apache License 2.0](LICENSE).
|
package/README.test.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Testing
|
|
2
|
+
|
|
3
|
+
This project uses [Vitest](https://vitest.dev/) for testing.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
Install dependencies:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Running Tests
|
|
14
|
+
|
|
15
|
+
Run all tests:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm test
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Run tests in watch mode:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm run test:watch
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Run tests with coverage:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm run test:coverage
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Test Structure
|
|
34
|
+
|
|
35
|
+
Tests are located alongside the source files with the `.test.ts` extension:
|
|
36
|
+
|
|
37
|
+
- `src/tools/commands.test.ts` - Tests for command tools
|
|
38
|
+
|
|
39
|
+
## Writing Tests
|
|
40
|
+
|
|
41
|
+
Tests use Vitest's API with TypeScript support. Example:
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
import { describe, it, expect, vi } from "vitest"
|
|
45
|
+
|
|
46
|
+
describe("MyFeature", () => {
|
|
47
|
+
it("should work correctly", () => {
|
|
48
|
+
expect(true).toBe(true)
|
|
49
|
+
})
|
|
50
|
+
})
|
|
51
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const implementCommand: (ctx: import("@opencode-ai/plugin").PluginInput) => import("@opencode-ai/plugin/tool").ToolDefinition;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { tool } from "@opencode-ai/plugin/tool";
|
|
2
|
+
import { createCDDCommand } from "../utils/commandFactory.js";
|
|
3
|
+
import { join, dirname } from "path";
|
|
4
|
+
import { fileURLToPath } from "url";
|
|
5
|
+
import { readFile } from "fs/promises";
|
|
6
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = dirname(__filename);
|
|
8
|
+
export const implementCommand = createCDDCommand({
|
|
9
|
+
name: "cdd/implement.json",
|
|
10
|
+
description: "Implements a feature or fixes a bug following a strict Plan and Spec.",
|
|
11
|
+
args: {
|
|
12
|
+
track_name: tool.schema.string().optional().describe("Specific track to implement. If omitted, selects the next incomplete track."),
|
|
13
|
+
},
|
|
14
|
+
additionalContext: async (ctx, args) => {
|
|
15
|
+
const strategyFile = ctx.isOMOActive ? "delegate.md" : "manual.md";
|
|
16
|
+
const strategyPath = join(__dirname, "../prompts/strategies", strategyFile);
|
|
17
|
+
let strategySection = "";
|
|
18
|
+
try {
|
|
19
|
+
strategySection = await readFile(strategyPath, "utf-8");
|
|
20
|
+
}
|
|
21
|
+
catch (e) {
|
|
22
|
+
console.warn(`[CDD] Failed to load strategy ${strategyFile}:`, e);
|
|
23
|
+
strategySection = "Error: Could not load execution strategy.";
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
strategy_section: strategySection,
|
|
27
|
+
track_name: args.track_name || ""
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
});
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import * as fs from "fs";
|
|
2
|
+
import * as path from "path";
|
|
3
|
+
import ImplementPromptJson from "./prompts/cdd/implement.json" with { type: "json" };
|
|
4
|
+
import NewTrackPromptJson from "./prompts/cdd/newTrack.json" with { type: "json" };
|
|
5
|
+
import RevertPromptJson from "./prompts/cdd/revert.json" with { type: "json" };
|
|
6
|
+
import SetupPromptJson from "./prompts/cdd/setup.json" with { type: "json" };
|
|
7
|
+
import StatusPromptJson from "./prompts/cdd/status.json" with { type: "json" };
|
|
8
|
+
import { detectCDDConfig } from "./utils/configDetection.js";
|
|
9
|
+
const asPrompt = (prompt) => (typeof prompt === "string" ? prompt : "");
|
|
10
|
+
const asDescription = (description) => typeof description === "string" ? description : undefined;
|
|
11
|
+
export const MyPlugin = async ({ directory, }) => {
|
|
12
|
+
const cddPath = path.join(directory, "conductor-cdd");
|
|
13
|
+
let fileHeirarchy = "";
|
|
14
|
+
const getFilesRecursively = (dir) => {
|
|
15
|
+
let results = [];
|
|
16
|
+
if (!fs.existsSync(dir))
|
|
17
|
+
return results;
|
|
18
|
+
const list = fs.readdirSync(dir);
|
|
19
|
+
list.forEach((file) => {
|
|
20
|
+
const filePath = path.join(dir, file);
|
|
21
|
+
const stat = fs.statSync(filePath);
|
|
22
|
+
if (stat && stat.isDirectory()) {
|
|
23
|
+
results = results.concat(getFilesRecursively(filePath));
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
if (filePath.endsWith(".json") || filePath.endsWith(".md")) {
|
|
27
|
+
results.push(filePath);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
return results;
|
|
32
|
+
};
|
|
33
|
+
if (fs.existsSync(cddPath)) {
|
|
34
|
+
const files = getFilesRecursively(cddPath);
|
|
35
|
+
fileHeirarchy = files
|
|
36
|
+
.map((f) => path.relative(directory, f))
|
|
37
|
+
.join("\n ");
|
|
38
|
+
}
|
|
39
|
+
const isCDDSetup = () => {
|
|
40
|
+
const setupStatePath = path.join(cddPath, "setup_state.json");
|
|
41
|
+
return fs.existsSync(setupStatePath);
|
|
42
|
+
};
|
|
43
|
+
const setupOccurred = isCDDSetup();
|
|
44
|
+
const configDetection = detectCDDConfig();
|
|
45
|
+
return {
|
|
46
|
+
config: async (_config) => {
|
|
47
|
+
const commandDefaults = configDetection.cddModel
|
|
48
|
+
? { agent: "cdd", model: configDetection.cddModel }
|
|
49
|
+
: { agent: "cdd" };
|
|
50
|
+
_config.command = {
|
|
51
|
+
..._config.command,
|
|
52
|
+
"cdd:implement": {
|
|
53
|
+
...commandDefaults,
|
|
54
|
+
template: asPrompt(ImplementPromptJson.prompt) + `
|
|
55
|
+
Environment Details:
|
|
56
|
+
- Directory: ${directory}
|
|
57
|
+
- CDD Setup: ${setupOccurred}
|
|
58
|
+
- Synergy Active (OMO): ${configDetection.synergyActive}
|
|
59
|
+
- Current CDD Files (Location: ${directory}/conductor-cdd)
|
|
60
|
+
File Tree:
|
|
61
|
+
${fileHeirarchy}
|
|
62
|
+
`,
|
|
63
|
+
description: asDescription(ImplementPromptJson.description),
|
|
64
|
+
},
|
|
65
|
+
"cdd:newTrack": {
|
|
66
|
+
...commandDefaults,
|
|
67
|
+
template: asPrompt(NewTrackPromptJson.prompt),
|
|
68
|
+
description: asDescription(NewTrackPromptJson.description),
|
|
69
|
+
},
|
|
70
|
+
"cdd:revert": {
|
|
71
|
+
...commandDefaults,
|
|
72
|
+
template: asPrompt(RevertPromptJson.prompt),
|
|
73
|
+
description: asDescription(RevertPromptJson.description),
|
|
74
|
+
},
|
|
75
|
+
"cdd:setup": {
|
|
76
|
+
...commandDefaults,
|
|
77
|
+
template: asPrompt(SetupPromptJson.prompt) + `
|
|
78
|
+
Environment Details:
|
|
79
|
+
- Directory: ${directory}
|
|
80
|
+
- CDD Setup: ${setupOccurred}
|
|
81
|
+
- Synergy Active (OMO): ${configDetection.synergyActive}
|
|
82
|
+
- Current CDD Files (with tracks) (${directory}/conductor-cdd)
|
|
83
|
+
File Tree:
|
|
84
|
+
${fileHeirarchy}
|
|
85
|
+
|
|
86
|
+
**CRITICAL ENVIRONTMENTAL OVERRIDE:**: You are running inside OpenCode. Use ./config/opencode/node_modules/opencode-conductor-cdd-plugin for setup operations and respect .ignore (allowlist), .geminiignore, and .gitignore patterns when excluding files.
|
|
87
|
+
`,
|
|
88
|
+
description: asDescription(SetupPromptJson.description),
|
|
89
|
+
},
|
|
90
|
+
"cdd:status": {
|
|
91
|
+
...commandDefaults,
|
|
92
|
+
template: asPrompt(StatusPromptJson.prompt) + `
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
***Current Environment Details***:
|
|
96
|
+
- Current Working Directory: ${directory}
|
|
97
|
+
- CDD Setup Process Completed: ${setupOccurred}
|
|
98
|
+
- Synergy Active (OMO): ${configDetection.synergyActive}
|
|
99
|
+
- Current CDD Files (with tracks) (${directory}/conductor-cdd)
|
|
100
|
+
File Tree:
|
|
101
|
+
${fileHeirarchy}
|
|
102
|
+
`,
|
|
103
|
+
description: asDescription(StatusPromptJson.description),
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|