opencode-mad 0.2.0 ā 0.3.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/agents/mad-fixer.md +44 -31
- package/agents/mad-merger.md +45 -18
- package/agents/mad-tester.md +187 -224
- package/agents/orchestrator.md +510 -430
- package/install.js +86 -67
- package/package.json +1 -1
- package/plugins/mad-plugin.ts +605 -538
- package/skills/mad-workflow/SKILL.md +27 -0
package/install.js
CHANGED
|
@@ -1,67 +1,86 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* opencode-mad installer
|
|
5
|
-
*
|
|
6
|
-
* Usage:
|
|
7
|
-
* npx opencode-mad install # Install to current project (.opencode/)
|
|
8
|
-
* npx opencode-mad install -g # Install globally (~/.config/opencode/)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
`);
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* opencode-mad installer
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* npx opencode-mad install # Install to current project (.opencode/)
|
|
8
|
+
* npx opencode-mad install -g # Install globally (~/.config/opencode/)
|
|
9
|
+
* npx opencode-mad update # Update in current project (alias for install)
|
|
10
|
+
* npx opencode-mad update -g # Update globally (alias for install -g)
|
|
11
|
+
* npx opencode-mad version # Show version
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { cpSync, existsSync, mkdirSync, readFileSync } from 'fs';
|
|
15
|
+
import { join, dirname } from 'path';
|
|
16
|
+
import { fileURLToPath } from 'url';
|
|
17
|
+
import { homedir } from 'os';
|
|
18
|
+
|
|
19
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
20
|
+
|
|
21
|
+
const args = process.argv.slice(2);
|
|
22
|
+
const command = args[0];
|
|
23
|
+
const isGlobal = args.includes('-g') || args.includes('--global');
|
|
24
|
+
|
|
25
|
+
// Handle version command
|
|
26
|
+
if (command === 'version' || command === '-v' || command === '--version') {
|
|
27
|
+
const pkg = JSON.parse(readFileSync(join(__dirname, 'package.json'), 'utf-8'));
|
|
28
|
+
console.log(`opencode-mad v${pkg.version}`);
|
|
29
|
+
process.exit(0);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// 'update' is an alias for 'install'
|
|
33
|
+
if (command !== 'install' && command !== 'update') {
|
|
34
|
+
console.log(`
|
|
35
|
+
opencode-mad - Multi-Agent Dev plugin for OpenCode
|
|
36
|
+
|
|
37
|
+
Usage:
|
|
38
|
+
npx opencode-mad install Install to current project (.opencode/)
|
|
39
|
+
npx opencode-mad install -g Install globally (~/.config/opencode/)
|
|
40
|
+
npx opencode-mad update Update in current project (alias for install)
|
|
41
|
+
npx opencode-mad update -g Update globally (alias for install -g)
|
|
42
|
+
npx opencode-mad version Show version
|
|
43
|
+
|
|
44
|
+
More info: https://github.com/Nistro-dev/opencode-mad
|
|
45
|
+
`);
|
|
46
|
+
process.exit(0);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const targetDir = isGlobal
|
|
50
|
+
? join(homedir(), '.config', 'opencode')
|
|
51
|
+
: join(process.cwd(), '.opencode');
|
|
52
|
+
|
|
53
|
+
const folders = ['agents', 'commands', 'plugins', 'skills'];
|
|
54
|
+
|
|
55
|
+
// Check if it's an update (any of the folders already exist)
|
|
56
|
+
const isUpdate = folders.some(folder => existsSync(join(targetDir, folder)));
|
|
57
|
+
|
|
58
|
+
console.log(isUpdate
|
|
59
|
+
? `\nš Updating opencode-mad in ${targetDir}\n`
|
|
60
|
+
: `\nš Installing opencode-mad to ${targetDir}\n`);
|
|
61
|
+
|
|
62
|
+
for (const folder of folders) {
|
|
63
|
+
const src = join(__dirname, folder);
|
|
64
|
+
const dest = join(targetDir, folder);
|
|
65
|
+
|
|
66
|
+
if (!existsSync(src)) {
|
|
67
|
+
console.log(`ā ļø Skipping ${folder} (not found)`);
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
mkdirSync(dest, { recursive: true });
|
|
72
|
+
cpSync(src, dest, { recursive: true });
|
|
73
|
+
console.log(`ā
Copied ${folder}/`);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
console.log(`
|
|
77
|
+
š ${isUpdate ? 'Update' : 'Installation'} complete!
|
|
78
|
+
|
|
79
|
+
${isGlobal ? 'MAD is now available in all your projects.' : 'MAD is now available in this project.'}
|
|
80
|
+
|
|
81
|
+
Just start talking to the orchestrator:
|
|
82
|
+
"Create a full-stack app with Express and React"
|
|
83
|
+
|
|
84
|
+
Or use the /mad command:
|
|
85
|
+
/mad Create a Task Timer app
|
|
86
|
+
`);
|