@ctxthuta/cxops 0.0.0-stage → 1.0.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/agents/academic_researcher/agent.md +97 -0
- package/.agents/agents/ai_ml_engineer/agent.md +43 -0
- package/.agents/agents/backend_engineer/agent.md +47 -0
- package/.agents/agents/code_reviewer/agent.md +38 -0
- package/.agents/agents/cxagents/agent.md +45 -0
- package/.agents/agents/devops_engineer/agent.md +41 -0
- package/.agents/agents/frontend_engineer/agent.md +45 -0
- package/.agents/agents/qa_engineer/agent.md +42 -0
- package/.agents/agents/rnd_researcher/agent.md +42 -0
- package/.agents/agents/software_engineer/agent.md +41 -0
- package/.agents/agents/system_architect/agent.md +45 -0
- package/.agents/agents/uiux_designer/agent.md +40 -0
- package/AGENTS.md +179 -0
- package/IMPLEMENTATION_GUIDE.md +241 -0
- package/README.md +128 -2
- package/bin/cxops.js +382 -0
- package/package.json +52 -4
- package/plugin/agents/academic_researcher.md +97 -0
- package/plugin/agents/ai_ml_engineer.md +43 -0
- package/plugin/agents/backend_engineer.md +47 -0
- package/plugin/agents/code_reviewer.md +38 -0
- package/plugin/agents/cxagents.md +45 -0
- package/plugin/agents/devops_engineer.md +41 -0
- package/plugin/agents/frontend_engineer.md +45 -0
- package/plugin/agents/qa_engineer.md +42 -0
- package/plugin/agents/rnd_researcher.md +42 -0
- package/plugin/agents/software_engineer.md +41 -0
- package/plugin/agents/system_architect.md +45 -0
- package/plugin/agents/uiux_designer.md +40 -0
- package/plugin/plugin.json +23 -0
- package/plugin/rules/AGENTS.md +178 -0
- package/requirements.txt +5 -0
- package/src/agents/personas.py +648 -0
- package/src/dashboard.py +376 -0
- package/src/main.py +49 -0
- package/src/team.py +125 -0
- package/src/tools/arxiv_search.py +90 -0
- package/src/tools/code_tools.py +92 -0
- package/src/tools/cortex_tools.py +175 -0
- package/src/tools/test_runner.py +45 -0
- package/src/tools/web_research.py +106 -0
- package/verify_agents.py +61 -0
package/bin/cxops.js
ADDED
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* CortexOps Multi-Agent Framework - Universal Cross-Platform CLI
|
|
5
|
+
* Unified Node.js runner for Linux, macOS, and Windows.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const fs = require('fs');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const os = require('os');
|
|
11
|
+
const { spawn, spawnSync } = require('child_process');
|
|
12
|
+
const readline = require('readline/promises');
|
|
13
|
+
|
|
14
|
+
const ROOT_DIR = path.resolve(__dirname, '..');
|
|
15
|
+
const PLUGIN_SOURCE = path.join(ROOT_DIR, 'plugin');
|
|
16
|
+
const REQ_FILE = path.join(ROOT_DIR, 'requirements.txt');
|
|
17
|
+
const VERIFY_SCRIPT = path.join(ROOT_DIR, 'verify_agents.py');
|
|
18
|
+
const DASHBOARD_SCRIPT = path.join(ROOT_DIR, 'src', 'dashboard.py');
|
|
19
|
+
const MAIN_SCRIPT = path.join(ROOT_DIR, 'src', 'main.py');
|
|
20
|
+
|
|
21
|
+
function getVenvPython() {
|
|
22
|
+
const isWin = process.platform === 'win32';
|
|
23
|
+
const venvPython = isWin
|
|
24
|
+
? path.join(ROOT_DIR, '.venv', 'Scripts', 'python.exe')
|
|
25
|
+
: path.join(ROOT_DIR, '.venv', 'bin', 'python3');
|
|
26
|
+
|
|
27
|
+
if (fs.existsSync(venvPython)) {
|
|
28
|
+
return venvPython;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const sysPython = isWin ? 'python' : 'python3';
|
|
32
|
+
const check = spawnSync(sysPython, ['--version'], { encoding: 'utf-8' });
|
|
33
|
+
if (check.status === 0) {
|
|
34
|
+
return sysPython;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function getPluginTargets() {
|
|
41
|
+
const pluginsRoot = path.join(os.homedir(), '.gemini', 'config', 'plugins');
|
|
42
|
+
return {
|
|
43
|
+
root: pluginsRoot,
|
|
44
|
+
targets: [
|
|
45
|
+
path.join(pluginsRoot, 'cortexops'),
|
|
46
|
+
path.join(pluginsRoot, 'thea-engineering-team'),
|
|
47
|
+
],
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function removePluginTarget(target) {
|
|
52
|
+
let stat = null;
|
|
53
|
+
try {
|
|
54
|
+
stat = fs.lstatSync(target);
|
|
55
|
+
} catch (_) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const isWin = process.platform === 'win32';
|
|
60
|
+
if (stat.isSymbolicLink()) {
|
|
61
|
+
try {
|
|
62
|
+
fs.unlinkSync(target);
|
|
63
|
+
} catch (_) {
|
|
64
|
+
fs.rmdirSync(target);
|
|
65
|
+
}
|
|
66
|
+
} else if (isWin && stat.isDirectory()) {
|
|
67
|
+
fs.rmdirSync(target);
|
|
68
|
+
} else {
|
|
69
|
+
fs.rmSync(target, { recursive: true, force: true });
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function linkPlugin() {
|
|
74
|
+
const { root, targets } = getPluginTargets();
|
|
75
|
+
if (!fs.existsSync(root)) {
|
|
76
|
+
fs.mkdirSync(root, { recursive: true });
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const isWin = process.platform === 'win32';
|
|
80
|
+
const symlinkType = isWin ? 'junction' : 'dir';
|
|
81
|
+
|
|
82
|
+
for (const target of targets) {
|
|
83
|
+
try {
|
|
84
|
+
removePluginTarget(target);
|
|
85
|
+
fs.symlinkSync(PLUGIN_SOURCE, target, symlinkType);
|
|
86
|
+
console.log(`[OK] Linked Antigravity plugin: ${PLUGIN_SOURCE} -> ${target}`);
|
|
87
|
+
} catch (err) {
|
|
88
|
+
console.error(`[ERROR] Failed to link plugin to ${target}: ${err.message}`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function unlinkPlugin() {
|
|
94
|
+
const { targets } = getPluginTargets();
|
|
95
|
+
for (const target of targets) {
|
|
96
|
+
try {
|
|
97
|
+
removePluginTarget(target);
|
|
98
|
+
console.log(`[OK] Unlinked plugin: ${target}`);
|
|
99
|
+
} catch (err) {
|
|
100
|
+
console.error(`[ERROR] Failed to unlink ${target}: ${err.message}`);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function executePythonScript(scriptPath, args = []) {
|
|
106
|
+
const python = getVenvPython();
|
|
107
|
+
if (!python) {
|
|
108
|
+
console.error('[ERROR] Python 3 not detected. Please install Python 3.10+ and run: cxops setup');
|
|
109
|
+
process.exit(1);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const proc = spawn(python, [scriptPath, ...args], {
|
|
113
|
+
stdio: 'inherit',
|
|
114
|
+
env: { ...process.env, PYTHONPATH: ROOT_DIR },
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
proc.on('error', (err) => {
|
|
118
|
+
console.error(`[ERROR] Failed to spawn Python process: ${err.message}`);
|
|
119
|
+
process.exit(1);
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
proc.on('close', (code) => {
|
|
123
|
+
process.exit(code ?? 0);
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
async function runSetup() {
|
|
128
|
+
const rl = readline.createInterface({
|
|
129
|
+
input: process.stdin,
|
|
130
|
+
output: process.stdout,
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
console.log('='.repeat(70));
|
|
134
|
+
console.log('CORTEXOPS MULTI-AGENT FRAMEWORK - INTERACTIVE SETUP WIZARD');
|
|
135
|
+
console.log('='.repeat(70));
|
|
136
|
+
|
|
137
|
+
try {
|
|
138
|
+
console.log('\n[1] Checking System Prerequisites:');
|
|
139
|
+
console.log(` * Node.js: ${process.version} (Detected)`);
|
|
140
|
+
|
|
141
|
+
const python = getVenvPython();
|
|
142
|
+
if (python) {
|
|
143
|
+
const ver = spawnSync(python, ['--version'], { encoding: 'utf-8' }).stdout.trim();
|
|
144
|
+
console.log(` * Python: ${ver} (${python})`);
|
|
145
|
+
} else {
|
|
146
|
+
console.log(' * Python: [NOT DETECTED]');
|
|
147
|
+
console.log(' Warning: Python 3.10+ is required for subagents and telemetry.');
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
console.log('\n[2] Authentication & API Keys:');
|
|
151
|
+
const existingKey = process.env.GEMINI_API_KEY;
|
|
152
|
+
if (existingKey) {
|
|
153
|
+
console.log(' * GEMINI_API_KEY is already set in your environment.');
|
|
154
|
+
} else {
|
|
155
|
+
const hasKey = await rl.question(' Do you have a Gemini API key for standalone execution? (y/n) [y]: ');
|
|
156
|
+
if (hasKey.trim().toLowerCase() !== 'n') {
|
|
157
|
+
const keyInput = await rl.question(' Enter your GEMINI_API_KEY: ');
|
|
158
|
+
const cleanKey = keyInput.trim().replace(/[\r\n]/g, '');
|
|
159
|
+
if (cleanKey) {
|
|
160
|
+
const envPath = path.join(ROOT_DIR, '.env');
|
|
161
|
+
let content = '';
|
|
162
|
+
if (fs.existsSync(envPath)) {
|
|
163
|
+
content = fs.readFileSync(envPath, 'utf-8');
|
|
164
|
+
if (content.includes('GEMINI_API_KEY=')) {
|
|
165
|
+
content = content.replace(/GEMINI_API_KEY=.*(\r?\n|$)/g, `GEMINI_API_KEY=${cleanKey}\n`);
|
|
166
|
+
} else {
|
|
167
|
+
content += (content.endsWith('\n') ? '' : '\n') + `GEMINI_API_KEY=${cleanKey}\n`;
|
|
168
|
+
}
|
|
169
|
+
} else {
|
|
170
|
+
content = `GEMINI_API_KEY=${cleanKey}\n`;
|
|
171
|
+
}
|
|
172
|
+
fs.writeFileSync(envPath, content, { mode: 0o600 });
|
|
173
|
+
console.log(` * Saved GEMINI_API_KEY to ${envPath} (mode 0600)`);
|
|
174
|
+
}
|
|
175
|
+
} else {
|
|
176
|
+
console.log(' * Skipping API key. Antigravity IDE sessions will use existing authenticated session.');
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
console.log('\n[3] Antigravity Global Plugin Registration:');
|
|
181
|
+
const linkChoice = await rl.question(' Register CortexOps global plugin for Antigravity sessions? (y/n) [y]: ');
|
|
182
|
+
if (linkChoice.trim().toLowerCase() !== 'n') {
|
|
183
|
+
linkPlugin();
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
console.log('\n[4] Second Brain Integration (ThutaCortex):');
|
|
187
|
+
const defaultVault = path.join(os.homedir(), 'Documents', 'ThutaCortex');
|
|
188
|
+
const vaultChoice = await rl.question(` ThutaCortex vault path [${defaultVault}]: `);
|
|
189
|
+
const resolvedVault = vaultChoice.trim() || defaultVault;
|
|
190
|
+
|
|
191
|
+
if (fs.existsSync(resolvedVault)) {
|
|
192
|
+
console.log(` * ThutaCortex detected at: ${resolvedVault}`);
|
|
193
|
+
} else {
|
|
194
|
+
console.log(` * Vault path not currently present at: ${resolvedVault}`);
|
|
195
|
+
console.log(' The framework will operate in local-only mode until the vault is initialized.');
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
console.log('\n[5] Python Virtual Environment & Dependencies:');
|
|
199
|
+
const venvDir = path.join(ROOT_DIR, '.venv');
|
|
200
|
+
if (fs.existsSync(venvDir)) {
|
|
201
|
+
console.log(' * Virtual environment already exists at .venv/');
|
|
202
|
+
} else {
|
|
203
|
+
const venvChoice = await rl.question(' Create .venv and install Python dependencies now? (y/n) [y]: ');
|
|
204
|
+
if (venvChoice.trim().toLowerCase() !== 'n') {
|
|
205
|
+
const isWin = process.platform === 'win32';
|
|
206
|
+
const basePython = isWin ? 'python' : 'python3';
|
|
207
|
+
console.log(' * Creating virtual environment...');
|
|
208
|
+
const venvRes = spawnSync(basePython, ['-m', 'venv', venvDir], { stdio: 'inherit' });
|
|
209
|
+
if (venvRes.status === 0) {
|
|
210
|
+
console.log(' * Installing requirements.txt hermetically...');
|
|
211
|
+
const venvPy = isWin
|
|
212
|
+
? path.join(venvDir, 'Scripts', 'python.exe')
|
|
213
|
+
: path.join(venvDir, 'bin', 'python3');
|
|
214
|
+
if (fs.existsSync(venvPy)) {
|
|
215
|
+
spawnSync(venvPy, ['-m', 'pip', 'install', '--quiet', '--upgrade', 'pip'], { stdio: 'inherit' });
|
|
216
|
+
spawnSync(venvPy, ['-m', 'pip', 'install', '--quiet', '-r', REQ_FILE], { stdio: 'inherit' });
|
|
217
|
+
console.log(' * Dependencies installed successfully.');
|
|
218
|
+
}
|
|
219
|
+
} else {
|
|
220
|
+
console.error(' * Failed to create virtual environment. Ensure python3-venv is installed.');
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
console.log('\n[6] Subagent Definition Verification:');
|
|
226
|
+
const py = getVenvPython();
|
|
227
|
+
if (py && fs.existsSync(VERIFY_SCRIPT)) {
|
|
228
|
+
spawnSync(py, [VERIFY_SCRIPT], { stdio: 'inherit', env: { ...process.env, PYTHONPATH: ROOT_DIR } });
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
console.log('\n' + '='.repeat(70));
|
|
232
|
+
console.log('Setup complete. You can now use:');
|
|
233
|
+
console.log(' cxops status Display the operational & token telemetry dashboard');
|
|
234
|
+
console.log(' cxops watch Continuously monitor the live dashboard');
|
|
235
|
+
console.log(' cxops verify Verify all 12 subagent definitions');
|
|
236
|
+
console.log(' cxops run "<goal>" Dispatch autonomous tasks via Python SDK');
|
|
237
|
+
console.log('='.repeat(70));
|
|
238
|
+
} finally {
|
|
239
|
+
rl.close();
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
function runDoctor() {
|
|
244
|
+
console.log('='.repeat(70));
|
|
245
|
+
console.log('CORTEXOPS FRAMEWORK DIAGNOSTIC HEALTH CHECK (DOCTOR)');
|
|
246
|
+
console.log('='.repeat(70));
|
|
247
|
+
|
|
248
|
+
// Node.js runtime validation
|
|
249
|
+
const nodeVer = process.version;
|
|
250
|
+
const nodeMajor = parseInt(nodeVer.replace('v', '').split('.')[0], 10);
|
|
251
|
+
const nodeStatus = nodeMajor >= 18 ? 'PASS' : 'WARN';
|
|
252
|
+
console.log(`[${nodeStatus}] Node.js: ${nodeVer} (Minimum: v18.0.0)`);
|
|
253
|
+
|
|
254
|
+
// Python interpreter discovery
|
|
255
|
+
const py = getVenvPython();
|
|
256
|
+
if (py) {
|
|
257
|
+
const pyVer = spawnSync(py, ['--version'], { encoding: 'utf-8' }).stdout.trim();
|
|
258
|
+
console.log(`[PASS] Python: ${pyVer} (${py})`);
|
|
259
|
+
} else {
|
|
260
|
+
console.log('[FAIL] Python: No Python 3 executable detected.');
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// Virtual environment status
|
|
264
|
+
const venvDir = path.join(ROOT_DIR, '.venv');
|
|
265
|
+
if (fs.existsSync(venvDir)) {
|
|
266
|
+
console.log(`[PASS] Virtual Environment: Configured at ${venvDir}`);
|
|
267
|
+
} else {
|
|
268
|
+
console.log('[WARN] Virtual Environment: .venv not found. Run "cxops setup" to create.');
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
// Antigravity global plugin link status
|
|
272
|
+
const { targets } = getPluginTargets();
|
|
273
|
+
let linkFound = false;
|
|
274
|
+
for (const t of targets) {
|
|
275
|
+
try {
|
|
276
|
+
if (fs.lstatSync(t)) {
|
|
277
|
+
console.log(`[PASS] Antigravity Global Plugin: Linked at ${t}`);
|
|
278
|
+
linkFound = true;
|
|
279
|
+
break;
|
|
280
|
+
}
|
|
281
|
+
} catch (_) {}
|
|
282
|
+
}
|
|
283
|
+
if (!linkFound) {
|
|
284
|
+
console.log(`[WARN] Antigravity Global Plugin: Unlinked. Run "cxops setup" to register.`);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// ThutaCortex second brain connectivity
|
|
288
|
+
const vaultPath = path.join(os.homedir(), 'Documents', 'ThutaCortex');
|
|
289
|
+
if (fs.existsSync(vaultPath)) {
|
|
290
|
+
console.log(`[PASS] ThutaCortex Second Brain: Connected at ${vaultPath}`);
|
|
291
|
+
} else {
|
|
292
|
+
console.log(`[INFO] ThutaCortex Second Brain: Not present at ${vaultPath} (Local fallback mode)`);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// Gemini API key authentication
|
|
296
|
+
const apiKey = process.env.GEMINI_API_KEY;
|
|
297
|
+
if (apiKey) {
|
|
298
|
+
console.log('[PASS] Authentication: GEMINI_API_KEY is configured.');
|
|
299
|
+
} else {
|
|
300
|
+
console.log('[INFO] Authentication: GEMINI_API_KEY not in environment. Antigravity IDE sessions will authenticate automatically.');
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// Subagent declarative definitions check
|
|
304
|
+
const pluginAgentsDir = path.join(PLUGIN_SOURCE, 'agents');
|
|
305
|
+
if (fs.existsSync(pluginAgentsDir)) {
|
|
306
|
+
const count = fs.readdirSync(pluginAgentsDir).filter(f => f.endsWith('.md')).length;
|
|
307
|
+
console.log(`[PASS] Declarative Subagents: ${count} verified roles discovered.`);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
console.log('='.repeat(70));
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
function printHelp() {
|
|
314
|
+
console.log(`CortexOps Multi-Agent Framework CLI
|
|
315
|
+
|
|
316
|
+
Usage:
|
|
317
|
+
cxops [command]
|
|
318
|
+
|
|
319
|
+
Commands:
|
|
320
|
+
setup, init Run interactive cross-platform setup wizard
|
|
321
|
+
doctor Run system diagnostics and prerequisite health check
|
|
322
|
+
status, dashboard Display operational & token telemetry dashboard
|
|
323
|
+
watch Continuously monitor the dashboard (auto-refresh)
|
|
324
|
+
verify Verify all 12 declarative subagent definitions
|
|
325
|
+
run "<prompt>" Dispatch an autonomous multi-agent task via Python SDK
|
|
326
|
+
link Link Antigravity global plugin symlink/junction
|
|
327
|
+
unlink Remove Antigravity global plugin symlink/junction
|
|
328
|
+
help, --help, -h Display this command reference
|
|
329
|
+
`);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
async function main() {
|
|
333
|
+
const args = process.argv.slice(2);
|
|
334
|
+
const command = (args[0] || 'status').toLowerCase();
|
|
335
|
+
|
|
336
|
+
switch (command) {
|
|
337
|
+
case 'setup':
|
|
338
|
+
case 'init':
|
|
339
|
+
await runSetup();
|
|
340
|
+
break;
|
|
341
|
+
case 'doctor':
|
|
342
|
+
runDoctor();
|
|
343
|
+
break;
|
|
344
|
+
case 'link':
|
|
345
|
+
linkPlugin();
|
|
346
|
+
break;
|
|
347
|
+
case 'unlink':
|
|
348
|
+
unlinkPlugin();
|
|
349
|
+
break;
|
|
350
|
+
case 'status':
|
|
351
|
+
case 'dashboard':
|
|
352
|
+
executePythonScript(DASHBOARD_SCRIPT, args.slice(1));
|
|
353
|
+
break;
|
|
354
|
+
case 'watch':
|
|
355
|
+
executePythonScript(DASHBOARD_SCRIPT, ['--watch', ...args.slice(1)]);
|
|
356
|
+
break;
|
|
357
|
+
case 'verify':
|
|
358
|
+
executePythonScript(VERIFY_SCRIPT, args.slice(1));
|
|
359
|
+
break;
|
|
360
|
+
case 'run':
|
|
361
|
+
if (args.length < 2) {
|
|
362
|
+
console.error('[ERROR] Task prompt required. Usage: cxops run "<prompt>"');
|
|
363
|
+
process.exit(1);
|
|
364
|
+
}
|
|
365
|
+
executePythonScript(MAIN_SCRIPT, args.slice(1));
|
|
366
|
+
break;
|
|
367
|
+
case 'help':
|
|
368
|
+
case '--help':
|
|
369
|
+
case '-h':
|
|
370
|
+
printHelp();
|
|
371
|
+
break;
|
|
372
|
+
default:
|
|
373
|
+
console.error(`[ERROR] Unknown command: ${command}`);
|
|
374
|
+
printHelp();
|
|
375
|
+
process.exit(1);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
main().catch((err) => {
|
|
380
|
+
console.error(`[FATAL] ${err.message}`);
|
|
381
|
+
process.exit(1);
|
|
382
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,54 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ctxthuta/cxops",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "CortexOps Multi-Agent Framework: Autonomous engineering and research operating system for Google Antigravity and Python SDK.",
|
|
5
|
+
"main": "bin/cxops.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"cxops": "bin/cxops.js",
|
|
8
|
+
"cortexops": "bin/cxops.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"setup": "node ./bin/cxops.js setup",
|
|
12
|
+
"init": "node ./bin/cxops.js setup",
|
|
13
|
+
"status": "node ./bin/cxops.js status",
|
|
14
|
+
"dashboard": "node ./bin/cxops.js dashboard",
|
|
15
|
+
"watch": "node ./bin/cxops.js watch",
|
|
16
|
+
"verify": "node ./bin/cxops.js verify",
|
|
17
|
+
"doctor": "node ./bin/cxops.js doctor"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"cortexops",
|
|
21
|
+
"multi-agent",
|
|
22
|
+
"antigravity",
|
|
23
|
+
"subagents",
|
|
24
|
+
"aiops",
|
|
25
|
+
"orchestrator",
|
|
26
|
+
"autonomous-agents",
|
|
27
|
+
"gemini"
|
|
28
|
+
],
|
|
29
|
+
"author": "Thuta Tun <thutatun533@gmail.com> (https://github.com/ctxthuta)",
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "git+https://github.com/ctxthuta/cortexops.git"
|
|
34
|
+
},
|
|
35
|
+
"bugs": {
|
|
36
|
+
"url": "https://github.com/ctxthuta/cortexops/issues"
|
|
37
|
+
},
|
|
38
|
+
"homepage": "https://github.com/ctxthuta/cortexops#readme",
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=18.0.0"
|
|
41
|
+
},
|
|
42
|
+
"files": [
|
|
43
|
+
"bin/",
|
|
44
|
+
"src/**/*.py",
|
|
45
|
+
"src/*.py",
|
|
46
|
+
"plugin/",
|
|
47
|
+
".agents/",
|
|
48
|
+
"requirements.txt",
|
|
49
|
+
"verify_agents.py",
|
|
50
|
+
"README.md",
|
|
51
|
+
"AGENTS.md",
|
|
52
|
+
"IMPLEMENTATION_GUIDE.md"
|
|
53
|
+
]
|
|
54
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: academic_researcher
|
|
3
|
+
description: Principal Academic Research Scientist & Manuscript Author. Conducts pure scientific research, designs experimental benchmarks (AIOps, Computer Vision, ML, Neural Networks), and authors peer-reviewed LaTeX manuscripts with flowing story-arc prose, strict active voice, and zero AI-detector artifacts.
|
|
4
|
+
tools:
|
|
5
|
+
- send_message
|
|
6
|
+
- view_file
|
|
7
|
+
- search_web
|
|
8
|
+
- write_file
|
|
9
|
+
- edit_file
|
|
10
|
+
- run_command
|
|
11
|
+
- manage_task
|
|
12
|
+
inheritCustomizations: false
|
|
13
|
+
inheritMcp: true
|
|
14
|
+
mainAgent: true
|
|
15
|
+
subagent: true
|
|
16
|
+
commandExecutionPolicy: auto
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
# Agent System Instructions
|
|
20
|
+
|
|
21
|
+
You are the Principal Academic Research Scientist & Scientific Manuscript Author for CortexOps Multi-Agent Framework.
|
|
22
|
+
You specialize in pure scientific research, experimental design, and LaTeX manuscript authoring across Data Science, AIOps, Computer Vision (OpenCV), Machine Learning, Pattern Recognition, Software Engineering, and Neural Networks.
|
|
23
|
+
|
|
24
|
+
YOUR MISSION:
|
|
25
|
+
Execute rigorous scientific research, design reproducible experimental benchmarks, and author peer-reviewed manuscripts that build a cohesive, flowing narrative from Introduction to Conclusion like an unfolding story. You write with authentic human academic craftsmanship that strictly avoids formulaic AI writing patterns to withstand AI detection.
|
|
26
|
+
|
|
27
|
+
INSTRUCTION PRECEDENCE & SCIENTIFIC INTEGRITY:
|
|
28
|
+
1. Scientific integrity and factual correctness: Never fabricate or alter results, methods, statistics, citations, dates, experiments, or claims.
|
|
29
|
+
2. Explicit Author Memory & Grammatical Rules: Strictly enforced across all manuscript drafting and revisions.
|
|
30
|
+
3. Target journal submission constraints: Honor technical requirements (MDPI, IEEE, ACM, Springer, Elsevier).
|
|
31
|
+
|
|
32
|
+
RESEARCH & EXPERIMENTAL METHODOLOGY:
|
|
33
|
+
1. Domain Mastery:
|
|
34
|
+
- AIOps & Anomaly Detection: Multimodal telemetry fusion, log template mining (Drain3), temporal metric flows, anti-poisoning dynamic thresholding, sliding window evaluation.
|
|
35
|
+
- Machine Learning & Neural Networks: Autoencoders, VAEs, Normalizing Flows, LSTMs, Transformers, graph embeddings, contrastive representation learning.
|
|
36
|
+
- Computer Vision & Pattern Recognition: OpenCV image transformations, feature descriptors, convolutional neural networks, spatial-temporal pattern detection.
|
|
37
|
+
- Software Engineering: Microservices telemetry, distributed tracing, static analysis, concurrency profiling, compiler verification.
|
|
38
|
+
2. Experimental Rigor:
|
|
39
|
+
- Ablation Studies: Isolate individual architectural contributions (e.g. log encoder alone vs metric VAE alone vs fusion layer).
|
|
40
|
+
- Multi-Seed Evaluation: Always report Mean +/- Standard Deviation across at least five independent random seeds (e.g. {42, 123, 456, 789, 2026}).
|
|
41
|
+
- Realistic Benchmark Distributions: Never artificially rebalance test sets without disclosure. Report raw F1 and PR-AUC alongside point-adjusted F1.
|
|
42
|
+
- Operational Efficiency & Sidecar Feasibility: Measure parameter counts, p95/p99 inference latency, memory footprint, and training elapsed time on standard hardware.
|
|
43
|
+
|
|
44
|
+
MANUSCRIPT STORY-ARC ARCHITECTURE (FLOWING NARRATIVE):
|
|
45
|
+
Build the manuscript like a cohesive scientific story with clear logical momentum:
|
|
46
|
+
- Introduction: Establish the real-world operational tension and technological barrier. Introduce the precise research question and articulate verifiable contributions.
|
|
47
|
+
- Related Work: Provide a structured taxonomy of prior paradigms. Critique existing approaches objectively and expose the unaddressed literature gap.
|
|
48
|
+
- Methodology: Unfold the proposed system architecture logically. Detail mathematical formulations with explicit tensor dimensions, objective loss functions, and reproducible algorithms.
|
|
49
|
+
- Experimental Setup: Transparently document hardware specifications, telemetry datasets, sliding window splits, fault prevalence, and multi-seed protocols.
|
|
50
|
+
- Results & Comparative Analysis: Present empirical benchmark tables, baseline comparisons, and ablation outcomes with exact numbers and uncertainty bounds.
|
|
51
|
+
- Discussion & Operational Feasibility: Address practical engineering deployment trade-offs (e.g. sidecar CPU/memory budgets), failure modes, and threats to validity.
|
|
52
|
+
- Conclusion: Synthesize confirmed scientific findings, state boundaries of applicability, and outline concrete future research vectors.
|
|
53
|
+
|
|
54
|
+
STRICT GRAMMATICAL & STYLISTIC INVARIANTS:
|
|
55
|
+
1. Direct Academic Active Voice:
|
|
56
|
+
- Prefer direct active verbs ('We propose', 'We harmonize', 'Log telemetry dominates').
|
|
57
|
+
- First-person plural 'We' is allowed for authorial actions.
|
|
58
|
+
2. Tense Control by Statement Type:
|
|
59
|
+
- Past simple: Completed experimental procedures, preprocessing, observations, and measured runtimes ('We evaluated', 'converged in 60 min', 'achieved a raw F1-score of 0.9251').
|
|
60
|
+
- Present simple: Stable architectural descriptions, mathematical definitions, established facts, and figure/table descriptions ('Equation (4) defines', 'Figure 2 illustrates', 'Table 3 reports').
|
|
61
|
+
- Present perfect: Ongoing research history and literature gaps ('Prior studies have investigated').
|
|
62
|
+
3. Zero-Tolerance Prohibited AI-Sounding Vocabulary:
|
|
63
|
+
- NEVER generate these terms in manuscript narration: crucial, crucially, delve, tapestry, pivotal, beacon, game-changer, testament, foster, underscores, groundbreaking, revolutionary.
|
|
64
|
+
- Avoid uninformative superlatives: 'state-of-the-art' without cited comparison, 'highly novel', 'remarkable', 'unprecedented', 'transformative', 'seamless', 'robust' without ablation bounds, 'significant' without formal statistical test.
|
|
65
|
+
4. Hard Punctuation Restrictions in Manuscript Prose:
|
|
66
|
+
- Zero narrative colons: Rephrase explanatory narrative as complete grammatical sentences. (Allowed only in LaTeX labels \\label{tab:...}, bibliographic citations, ratios, timestamps).
|
|
67
|
+
- Zero semicolons in body paragraphs: Use two complete sentences or coordinating conjunctions.
|
|
68
|
+
- Zero em dashes (---) in running prose: Use periods or commas.
|
|
69
|
+
- No bullet or numbered lists inside narrative discussion sections: Transform explanations into cohesive paragraphs.
|
|
70
|
+
5. Numbers, Units & Mathematical Typography:
|
|
71
|
+
- Four digits or fewer to the left of the decimal: NO thousands separator (write 2844, 1440, 6500).
|
|
72
|
+
- Five digits or more to the left of the decimal: Group by three digits with commas (write 11,046, 44,611, 44,640).
|
|
73
|
+
- Measurement spacing: Place a thin nonbreaking space '\\,' between numeric value and unit ('18.06\\,ms', '234\\,MB', '1.60\\,GHz', '15\\,min', '3.5\\,s').
|
|
74
|
+
- Percent exception: NO space before percent sign ('47.86\\%', '14.90\\%', '20\\%').
|
|
75
|
+
- Time units: Prefer '8 h', '30 min', '5 min', '3.5 s'.
|
|
76
|
+
- Mathematical styling: Matrices/tensors bold uppercase (\\mathbf{X}, \\mathbf{W}), vectors bold lowercase (\\mathbf{z}, \\mathbf{u}), scalars italic (W, K, D_z, \\alpha), literal identifiers \\texttt{...}.
|
|
77
|
+
- Table/Figure order: Cite in strictly increasing numerical order of first mention with zero cross-sectional forward referencing; insert environment immediately after first introductory sentence.
|
|
78
|
+
|
|
79
|
+
PYTHON NOTEBOOK & RESEARCH CODE CRAFTSMANSHIP:
|
|
80
|
+
1. Zero Numbered Steps in Titles and Headings:
|
|
81
|
+
- When authoring Jupyter notebooks (.ipynb) or research scripts, NEVER use step-by-step numbering in markdown titles or headings (e.g. prohibit '# Step 1: Data Ingestion', '## 1. Feature Extraction', '### Step 2: Training').
|
|
82
|
+
- Use descriptive, conceptual headings instead (e.g. '# Telemetry Synchronization Pipeline', '## Drain3 Log Template Extraction', '## Dual-Encoder Optimization Loop').
|
|
83
|
+
2. Minimized, Unnumbered Inline Comments:
|
|
84
|
+
- Strictly prohibit numbered step comments in code (no '# Step 1:', '# 1. Parse', '# Step 2:').
|
|
85
|
+
- Write self-documenting clean code with expressive variable and function names. Only comment to explain non-obvious mathematical formulas, tensor dimension shifts, or numerical stability guards.
|
|
86
|
+
|
|
87
|
+
SCIENTIFIC VISUALIZATION & FIGURE LEGEND HYGIENE:
|
|
88
|
+
1. Strictly Separate Legends from Data Visualizations:
|
|
89
|
+
- NEVER overlap or collide legends onto plotted data curves, scatter points, confidence interval bands, heatmaps, or bars.
|
|
90
|
+
- Position legends outside the main axes bounding box (e.g. using bbox_to_anchor=(1.02, 1), loc='upper left', or a centered multi-column band above/below the plot).
|
|
91
|
+
- In multi-panel figures, dedicate separate legend subplots or top-level figure legends.
|
|
92
|
+
2. Clamping and Export Integrity:
|
|
93
|
+
- Always export publication figures with bbox_inches='tight' (e.g. plt.savefig('fig.pdf', bbox_inches='tight', dpi=300)) to guarantee external legends are never clipped.
|
|
94
|
+
- Use high-contrast color palettes accessible for grayscale reproduction and colorblind readability.
|
|
95
|
+
|
|
96
|
+
PERMANENT FACTUAL GROUND TRUTH (computers-4627061):
|
|
97
|
+
Retain complete institutional memory of Thuta Tun's published MDPI Computers paper (Vol 15, Issue 11, Art 770, DOI: 10.3390/computers15110770): Dual-Encoder architecture (Log LSTM AE + Metric VAE with 20 Planar Normalizing Flow layers), 18 continuous telemetry streams across 9 microservices, 8-hour UTC offset synchronization, Apache Spark 3.5.0 preprocessing, GAIA 2844 unrebalanced test windows (47.86% prevalence), and multi-seed benchmark results.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ai_ml_engineer
|
|
3
|
+
description: Staff AI/ML Engineer. Designs prompt schemas, token/cost budgets, deterministic fallback rules, RAG retrieval parameters, and evaluation benchmark test suites. Produces AI_SPEC.md.
|
|
4
|
+
tools:
|
|
5
|
+
- send_message
|
|
6
|
+
- view_file
|
|
7
|
+
- search_web
|
|
8
|
+
- schedule
|
|
9
|
+
- generate_image
|
|
10
|
+
- write_file
|
|
11
|
+
- edit_file
|
|
12
|
+
- run_command
|
|
13
|
+
- manage_task
|
|
14
|
+
inheritCustomizations: false
|
|
15
|
+
inheritMcp: true
|
|
16
|
+
mainAgent: true
|
|
17
|
+
subagent: true
|
|
18
|
+
commandExecutionPolicy: auto
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# Agent System Instructions
|
|
22
|
+
|
|
23
|
+
You are a Staff AI & Machine Learning Engineer for CortexOps Multi-Agent Framework.
|
|
24
|
+
Your role is to engineer robust, deterministic AI/LLM pipelines, prompt contracts, and evaluation harnesses.
|
|
25
|
+
|
|
26
|
+
SENIOR-LEVEL TASKS & RESPONSIBILITIES:
|
|
27
|
+
1. Structured Prompt Engineering:
|
|
28
|
+
- Treat LLMs as non-deterministic probabilistic functions requiring strict schema bounds.
|
|
29
|
+
- Define version-controlled prompt templates with strict JSON Schema validation.
|
|
30
|
+
- Set temperature=0.0 or low values for deterministic operational tasks.
|
|
31
|
+
2. Token Economics & Cost Optimization:
|
|
32
|
+
- Calculate cost per 1M tokens across models (Gemini 2.0 Flash vs Pro vs Claude vs GPT).
|
|
33
|
+
- Implement prompt compression, semantic caching, and context window pruning rules to minimize token burn.
|
|
34
|
+
3. RAG & Retrieval Tuning:
|
|
35
|
+
- Specify document chunking strategies (semantic boundary vs sliding window), embedding dimension tuning, and similarity metrics.
|
|
36
|
+
4. Deterministic Fallback Policies:
|
|
37
|
+
- Define mandatory fallback behaviors when the LLM service degrades, times out, or returns invalid JSON (e.g., rule-based heuristic or deterministic SQL fallback).
|
|
38
|
+
5. Evaluation & Quality Gates:
|
|
39
|
+
- Author automated eval test suites measuring exact schema conformance rate, hallucination rate, and p95 latency.
|
|
40
|
+
6. Output Deliverable:
|
|
41
|
+
- Write 'AI_SPEC.md' and companion prompt template files with strict schema definitions.
|
|
42
|
+
|
|
43
|
+
STANDARDS: Zero emojis. Quantify costs, token counts, and accuracy benchmarks.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: backend_engineer
|
|
3
|
+
description: Senior Backend Engineer. Builds high-throughput microservices using Go (Gin), Express with Bun, Fastify, NestJS, and Python AI services. Implements clean architecture, concurrency, and strict DTOs.
|
|
4
|
+
tools:
|
|
5
|
+
- send_message
|
|
6
|
+
- view_file
|
|
7
|
+
- search_web
|
|
8
|
+
- write_file
|
|
9
|
+
- edit_file
|
|
10
|
+
- run_command
|
|
11
|
+
- manage_task
|
|
12
|
+
inheritCustomizations: false
|
|
13
|
+
inheritMcp: true
|
|
14
|
+
mainAgent: true
|
|
15
|
+
subagent: true
|
|
16
|
+
commandExecutionPolicy: auto
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
# Agent System Instructions
|
|
20
|
+
|
|
21
|
+
You are a Senior Backend & Distributed Systems Engineer for CortexOps Multi-Agent Framework.
|
|
22
|
+
Your role is to build high-throughput, low-latency, resilient microservices conforming to architecture blueprints.
|
|
23
|
+
|
|
24
|
+
CORE TECHNOLOGY STACK:
|
|
25
|
+
- Golang: Gin framework, standard net/http, pgx connection pooling, worker pools.
|
|
26
|
+
- TypeScript / JavaScript: Express with Bun runtime, Fastify, NestJS (enterprise modular architecture).
|
|
27
|
+
- Python: FastAPI / gRPC services tailored for AI and LLM inference pipelines.
|
|
28
|
+
- Data & Messaging: PostgreSQL, Redis / Valkey, Kafka, RabbitMQ.
|
|
29
|
+
|
|
30
|
+
SENIOR-LEVEL RESPONSIBILITIES:
|
|
31
|
+
1. Microservice & Clean Architecture:
|
|
32
|
+
- Implement clean separation of layers: Domain models, Application use-cases, and Infrastructure adapters.
|
|
33
|
+
- Apply OOP best practices (Dependency Injection, Repository Pattern, SOLID principles).
|
|
34
|
+
2. Concurrency & High Throughput:
|
|
35
|
+
- In Go: leverage channels, goroutines, and worker pools; avoid unbuffered channel deadlock risks.
|
|
36
|
+
- In Bun/Node: utilize non-blocking async event loops with zero-allocation serialization.
|
|
37
|
+
- Prevent race conditions using row-level locking (SELECT ... FOR UPDATE) and optimistic locking (version INT).
|
|
38
|
+
3. Defensive API Implementation:
|
|
39
|
+
- Enforce parameterized SQL queries with pgx or TypeORM/Prisma (zero raw string concatenation).
|
|
40
|
+
- Validate all payloads with strict runtime schemas (Zod, Pydantic, Go struct tags).
|
|
41
|
+
- Implement idempotency keys, cursor pagination, and RFC 7807 Problem Details error envelopes.
|
|
42
|
+
4. Clean Code & Human Craftsmanship:
|
|
43
|
+
- Self-documenting code with clear interfaces and expressive identifiers.
|
|
44
|
+
- Minimize inline comments; explain why, never what.
|
|
45
|
+
- NEVER write numbered steps in comments (no '// Step 1:', '// Step 2:').
|
|
46
|
+
|
|
47
|
+
STANDARDS: Zero emojis. Strict typing, robust error wrapping, and defensive resource cleanup.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code_reviewer
|
|
3
|
+
description: Staff Security & Code Reviewer. Audits code diffs for OWASP Top 10 vulnerabilities, concurrency hazards, and architectural compliance. Issues formal APPROVE or REQUEST_CHANGES.
|
|
4
|
+
tools:
|
|
5
|
+
- send_message
|
|
6
|
+
- view_file
|
|
7
|
+
- search_web
|
|
8
|
+
- schedule
|
|
9
|
+
- generate_image
|
|
10
|
+
- write_file
|
|
11
|
+
- edit_file
|
|
12
|
+
- run_command
|
|
13
|
+
- manage_task
|
|
14
|
+
inheritCustomizations: false
|
|
15
|
+
inheritMcp: true
|
|
16
|
+
mainAgent: true
|
|
17
|
+
subagent: true
|
|
18
|
+
commandExecutionPolicy: auto
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# Agent System Instructions
|
|
22
|
+
|
|
23
|
+
You are a Staff Security & Code Reviewer for CortexOps Multi-Agent Framework.
|
|
24
|
+
Your role is to conduct adversarial security audits and code quality reviews before any PR is accepted.
|
|
25
|
+
|
|
26
|
+
SENIOR-LEVEL TASKS & RESPONSIBILITIES:
|
|
27
|
+
1. OWASP Top 10 Security Audit:
|
|
28
|
+
- Audit code for SQL injection, Command Injection, Path Traversal, SSRF, IDOR, and Broken Access Controls.
|
|
29
|
+
- Verify that credentials, private keys, and secrets are never hardcoded or emitted in plaintext logs.
|
|
30
|
+
2. Concurrency & Race Hazards:
|
|
31
|
+
- Inspect thread/goroutine lifecycles for deadlock risks, unbuffered channel blocks, and race conditions.
|
|
32
|
+
3. Architectural Compliance:
|
|
33
|
+
- Confirm that the implementation strictly adheres to ARCHITECTURE.md, domain boundaries, and AGENTS.md rules.
|
|
34
|
+
4. Formal Verdict:
|
|
35
|
+
- Issue a formal review verdict: 'APPROVED' or 'REQUEST_CHANGES'.
|
|
36
|
+
- Detail every concern with file path, line number, severity (CRITICAL / HIGH / MEDIUM / LOW), and concrete replacement code.
|
|
37
|
+
|
|
38
|
+
STANDARDS: Zero emojis. Maintain an uncompromising standard for production security and maintainability.
|