opencode-conductor-cdd-plugin 1.0.0-beta.13 → 1.0.0-beta.15
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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import * as fs from 'fs';
|
|
3
|
+
import * as path from 'path';
|
|
4
|
+
describe('Rebrand Integration Tests', () => {
|
|
5
|
+
describe('Package Metadata', () => {
|
|
6
|
+
it('should have correct package name', () => {
|
|
7
|
+
const pkgPath = path.join(process.cwd(), 'package.json');
|
|
8
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
|
|
9
|
+
expect(pkg.name).toBe('opencode-conductor-cdd-plugin');
|
|
10
|
+
});
|
|
11
|
+
it('should have beta version', () => {
|
|
12
|
+
const pkgPath = path.join(process.cwd(), 'package.json');
|
|
13
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
|
|
14
|
+
expect(pkg.version).toMatch(/^1\.0\.0-beta\.\d+$/);
|
|
15
|
+
});
|
|
16
|
+
it('should reference new repository', () => {
|
|
17
|
+
const pkgPath = path.join(process.cwd(), 'package.json');
|
|
18
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
|
|
19
|
+
expect(pkg.repository.url).toContain('opencode-conductor-cdd');
|
|
20
|
+
expect(pkg.repository.url).not.toContain('opencode-orchestrator');
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
describe('Prompt Files Structure', () => {
|
|
24
|
+
it('should have cdd prompts directory', () => {
|
|
25
|
+
const cddPromptsPath = path.join(process.cwd(), 'src/prompts/cdd');
|
|
26
|
+
expect(fs.existsSync(cddPromptsPath)).toBe(true);
|
|
27
|
+
});
|
|
28
|
+
it('should NOT have orchestrator prompts directory', () => {
|
|
29
|
+
const orchestratorPromptsPath = path.join(process.cwd(), 'src/prompts/orchestrator');
|
|
30
|
+
expect(fs.existsSync(orchestratorPromptsPath)).toBe(false);
|
|
31
|
+
});
|
|
32
|
+
it('should have all required CDD prompt files', () => {
|
|
33
|
+
const cddPromptsPath = path.join(process.cwd(), 'src/prompts/cdd');
|
|
34
|
+
const requiredFiles = ['setup.json', 'newTrack.json', 'implement.json', 'status.json', 'revert.json'];
|
|
35
|
+
for (const file of requiredFiles) {
|
|
36
|
+
const filePath = path.join(cddPromptsPath, file);
|
|
37
|
+
expect(fs.existsSync(filePath), `${file} should exist`).toBe(true);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
it('should have cdd agent prompt file', () => {
|
|
41
|
+
const cddAgentPath = path.join(process.cwd(), 'src/prompts/agent/cdd.md');
|
|
42
|
+
expect(fs.existsSync(cddAgentPath)).toBe(true);
|
|
43
|
+
});
|
|
44
|
+
it('should NOT have orchestrator agent prompt file', () => {
|
|
45
|
+
const orchestratorAgentPath = path.join(process.cwd(), 'src/prompts/agent/orchestrator.md');
|
|
46
|
+
expect(fs.existsSync(orchestratorAgentPath)).toBe(false);
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
describe('Source Code References', () => {
|
|
50
|
+
it('should import from cdd prompts in index.ts', () => {
|
|
51
|
+
const indexPath = path.join(process.cwd(), 'src/index.ts');
|
|
52
|
+
const indexContent = fs.readFileSync(indexPath, 'utf-8');
|
|
53
|
+
expect(indexContent).toContain('./prompts/cdd/implement.json');
|
|
54
|
+
expect(indexContent).toContain('./prompts/cdd/newTrack.json');
|
|
55
|
+
expect(indexContent).toContain('./prompts/cdd/setup.json');
|
|
56
|
+
expect(indexContent).not.toContain('./prompts/orchestrator/');
|
|
57
|
+
});
|
|
58
|
+
it('should register cdd: commands in index.ts', () => {
|
|
59
|
+
const indexPath = path.join(process.cwd(), 'src/index.ts');
|
|
60
|
+
const indexContent = fs.readFileSync(indexPath, 'utf-8');
|
|
61
|
+
expect(indexContent).toContain('"cdd:implement"');
|
|
62
|
+
expect(indexContent).toContain('"cdd:newTrack"');
|
|
63
|
+
expect(indexContent).toContain('"cdd:setup"');
|
|
64
|
+
expect(indexContent).toContain('"cdd:status"');
|
|
65
|
+
expect(indexContent).toContain('"cdd:revert"');
|
|
66
|
+
expect(indexContent).not.toContain('"orchestrator:');
|
|
67
|
+
});
|
|
68
|
+
it('should reference conductor-cdd directory in index.ts', () => {
|
|
69
|
+
const indexPath = path.join(process.cwd(), 'src/index.ts');
|
|
70
|
+
const indexContent = fs.readFileSync(indexPath, 'utf-8');
|
|
71
|
+
expect(indexContent).toContain('conductor-cdd');
|
|
72
|
+
});
|
|
73
|
+
it('should use cdd agent for commands', () => {
|
|
74
|
+
const indexPath = path.join(process.cwd(), 'src/index.ts');
|
|
75
|
+
const indexContent = fs.readFileSync(indexPath, 'utf-8');
|
|
76
|
+
expect(indexContent).toContain('agent: "cdd"');
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
describe('Utility Files References', () => {
|
|
80
|
+
it('should use conductor-cdd in stateManager', () => {
|
|
81
|
+
const stateManagerPath = path.join(process.cwd(), 'src/utils/stateManager.ts');
|
|
82
|
+
const content = fs.readFileSync(stateManagerPath, 'utf-8');
|
|
83
|
+
expect(content).toContain('conductor-cdd');
|
|
84
|
+
expect(content).not.toContain('orchestrator/');
|
|
85
|
+
});
|
|
86
|
+
it('should use detectCDDConfig function name', () => {
|
|
87
|
+
const configDetectionPath = path.join(process.cwd(), 'src/utils/configDetection.ts');
|
|
88
|
+
const content = fs.readFileSync(configDetectionPath, 'utf-8');
|
|
89
|
+
expect(content).toContain('detectCDDConfig');
|
|
90
|
+
expect(content).not.toContain('detectOrchestratorConfig');
|
|
91
|
+
});
|
|
92
|
+
it('should use cdd prefix in commit messages', () => {
|
|
93
|
+
const commitMessagesPath = path.join(process.cwd(), 'src/utils/commitMessages.ts');
|
|
94
|
+
const content = fs.readFileSync(commitMessagesPath, 'utf-8');
|
|
95
|
+
expect(content).toContain('cdd(');
|
|
96
|
+
expect(content).not.toContain('orchestrator(');
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
describe('README Documentation', () => {
|
|
100
|
+
it('should reference new package name in README', () => {
|
|
101
|
+
const readmePath = path.join(process.cwd(), 'README.md');
|
|
102
|
+
const content = fs.readFileSync(readmePath, 'utf-8');
|
|
103
|
+
expect(content).toContain('opencode-conductor-cdd-plugin');
|
|
104
|
+
});
|
|
105
|
+
it('should show /cdd: commands in README', () => {
|
|
106
|
+
const readmePath = path.join(process.cwd(), 'README.md');
|
|
107
|
+
const content = fs.readFileSync(readmePath, 'utf-8');
|
|
108
|
+
expect(content).toContain('/cdd:setup');
|
|
109
|
+
expect(content).toContain('/cdd:newTrack');
|
|
110
|
+
expect(content).toContain('/cdd:implement');
|
|
111
|
+
});
|
|
112
|
+
it('should NOT reference orchestrator commands in README', () => {
|
|
113
|
+
const readmePath = path.join(process.cwd(), 'README.md');
|
|
114
|
+
const content = fs.readFileSync(readmePath, 'utf-8');
|
|
115
|
+
expect(content).not.toContain('/orchestrator:');
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
describe('Build Scripts', () => {
|
|
119
|
+
it('should reference cdd prompts in convert-legacy script', () => {
|
|
120
|
+
const scriptPath = path.join(process.cwd(), 'scripts/convert-legacy.cjs');
|
|
121
|
+
const content = fs.readFileSync(scriptPath, 'utf-8');
|
|
122
|
+
expect(content).toContain('src/prompts/cdd');
|
|
123
|
+
expect(content).not.toContain('src/prompts/orchestrator');
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-conductor-cdd-plugin",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.15",
|
|
4
4
|
"description": "Context-Driven Development (CDD) plugin for OpenCode - Transform your AI coding workflow with structured specifications, plans, and implementation tracking",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
package/scripts/postinstall.cjs
CHANGED
|
@@ -8,7 +8,7 @@ const targetAgentDir = path.join(opencodeConfigDir, 'agent');
|
|
|
8
8
|
const targetCommandDir = path.join(opencodeConfigDir, 'command');
|
|
9
9
|
|
|
10
10
|
const sourcePromptsDir = path.join(__dirname, '..', 'dist', 'prompts');
|
|
11
|
-
const sourceAgentFile = path.join(sourcePromptsDir, 'agent', '
|
|
11
|
+
const sourceAgentFile = path.join(sourcePromptsDir, 'agent', 'cdd.md');
|
|
12
12
|
const sourceCommandsDir = path.join(sourcePromptsDir, 'commands');
|
|
13
13
|
|
|
14
14
|
function ensureDir(dir) {
|
|
@@ -22,8 +22,8 @@ try {
|
|
|
22
22
|
ensureDir(targetCommandDir);
|
|
23
23
|
|
|
24
24
|
if (fs.existsSync(sourceAgentFile)) {
|
|
25
|
-
fs.copyFileSync(sourceAgentFile, path.join(targetAgentDir, '
|
|
26
|
-
console.log('[
|
|
25
|
+
fs.copyFileSync(sourceAgentFile, path.join(targetAgentDir, 'cdd.md'));
|
|
26
|
+
console.log('[CDD] Installed agent definition.');
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
if (fs.existsSync(sourceCommandsDir)) {
|
|
@@ -31,8 +31,8 @@ try {
|
|
|
31
31
|
for (const cmdFile of commands) {
|
|
32
32
|
fs.copyFileSync(path.join(sourceCommandsDir, cmdFile), path.join(targetCommandDir, cmdFile));
|
|
33
33
|
}
|
|
34
|
-
console.log('[
|
|
34
|
+
console.log('[CDD] Installed slash commands.');
|
|
35
35
|
}
|
|
36
36
|
} catch (err) {
|
|
37
|
-
console.error('[
|
|
37
|
+
console.error('[CDD] Setup failed:', err.message);
|
|
38
38
|
}
|