cortexweaver
Version:
CortexWeaver is a command-line interface (CLI) tool that orchestrates a swarm of specialized AI agents, powered by Claude Code and Gemini CLI, to assist in software development. It transforms a high-level project plan (plan.md) into a series of coordinate
113 lines (108 loc) • 4.41 kB
JavaScript
;
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.PersonaTemplates = void 0;
const fs = __importStar(require("fs"));
const path = __importStar(require("path"));
/**
* PersonaTemplates handles the creation of agent persona files
*/
class PersonaTemplates {
static async createPromptsDirectory(projectRoot) {
const promptsPath = path.join(projectRoot, 'prompts');
// Create prompts directory if it doesn't exist
if (!fs.existsSync(promptsPath)) {
fs.mkdirSync(promptsPath, { recursive: true });
}
// Create agent persona files
const personaFiles = [
'orchestrator.md',
'governor.md',
'reflector.md',
'formalizer.md',
'architect.md',
'coder.md',
'quality-gatekeeper.md',
'london-tester.md',
'chicago-tester.md',
'property-tester.md',
'mutation-tester.md',
'spec-writer.md',
'guide.md',
'test-result-documenter.md',
'monitor.md',
'performance-optimizer.md',
'cognitive-canvas-navigator.md',
'code-savant.md'
];
// Copy persona files from the source prompts directory
const sourcePromptsPath = path.join(__dirname, '..', '..', 'prompts');
for (const personaFile of personaFiles) {
const sourcePath = path.join(sourcePromptsPath, personaFile);
const targetPath = path.join(promptsPath, personaFile);
// Only create if it doesn't exist
if (!fs.existsSync(targetPath)) {
if (fs.existsSync(sourcePath)) {
fs.copyFileSync(sourcePath, targetPath);
}
else {
// Fallback: create a basic template if source doesn't exist
const basicTemplate = this.createBasicPersonaTemplate(personaFile.replace('.md', ''));
fs.writeFileSync(targetPath, basicTemplate);
}
}
}
}
static createBasicPersonaTemplate(agentName) {
return `# ${agentName.charAt(0).toUpperCase() + agentName.slice(1)} Agent
## Role
${agentName.replace('-', ' ').replace(/\b\w/g, l => l.toUpperCase())} for CortexWeaver projects.
## Core Identity
You are the ${agentName.replace('-', ' ')} agent, responsible for specific tasks within the CortexWeaver ecosystem.
## Primary Responsibilities
- [Add specific responsibilities for this agent]
- [Define key tasks and outputs]
- [Specify interaction patterns with other agents]
## Guidelines
- Follow CortexWeaver's Specification-Driven Development approach
- Maintain high quality standards
- Collaborate effectively with other agents
- Document all decisions and rationale
---
*This is a basic template. Please customize based on the specific agent's role and responsibilities.*`;
}
}
exports.PersonaTemplates = PersonaTemplates;
//# sourceMappingURL=persona-templates.js.map