@oliverpople/agency-x
Version:
🚀 **Transform feature requests into production-ready code in seconds**
30 lines (23 loc) • 1.08 kB
text/typescript
import { createLogger } from '../utils/logger';
import { getContext, updateContext } from '../utils/contextStore';
import { getLlmClient } from '../llm/llmRouter';
import { qaEngineerPrompt } from '../utils/promptTemplates';
const logger = createLogger('qaEngineer');
export const runQaEngineer = async () => {
logger.start();
const context = getContext();
const { spec, agents = {} } = context;
// Safely access agent outputs with fallbacks
const backendOutput = agents.backendDeveloper?.output || 'No backend code generated yet';
const frontendOutput = agents.frontendDeveloper?.output || 'No frontend code generated yet';
const llmClient = getLlmClient();
const prompt = qaEngineerPrompt
.replace('{{spec}}', JSON.stringify(spec, null, 2))
.replace('{{backendCode}}', backendOutput)
.replace('{{frontendCode}}', frontendOutput);
const tests = await llmClient.generate(prompt);
updateContext({ agents: { ...agents, qaEngineer: { output: tests, completed: true } } });
logger.stop();
logger.success('Generated QA tests.');
return tests;
};