@clduab11/gemini-flow
Version:
Revolutionary AI agent swarm coordination platform with Google Services integration, multimedia processing, and production-ready monitoring. Features 8 Google AI services, quantum computing capabilities, and enterprise-grade security.
334 lines (305 loc) • 9.29 kB
text/typescript
/**
* SPARC Development Modes
*
* 17 specialized development modes for systematic TDD with AI assistance
*/
export interface SparcMode {
id: string;
name: string;
description: string;
phases: string[];
agents: string[];
workflow: string;
temperature?: number;
maxTokens?: number;
}
export const SPARC_MODES: Record<string, SparcMode> = {
// Core SPARC Modes
"spec-pseudocode": {
id: "spec-pseudocode",
name: "Specification & Pseudocode",
description: "Define requirements and create algorithmic logic",
phases: ["specification", "pseudocode"],
agents: ["planner", "researcher", "architect"],
workflow: "sequential",
temperature: 0.6,
},
architect: {
id: "architect",
name: "Architecture Design",
description: "Design system architecture and component structure",
phases: ["architecture", "design"],
agents: ["architect", "planner", "reviewer"],
workflow: "collaborative",
temperature: 0.7,
},
tdd: {
id: "tdd",
name: "Test-Driven Development",
description: "Complete TDD cycle with tests first, then implementation",
phases: [
"test-design",
"test-implementation",
"code-implementation",
"refactoring",
],
agents: ["tester", "coder", "reviewer"],
workflow: "iterative",
temperature: 0.4,
},
refinement: {
id: "refinement",
name: "Code Refinement",
description: "Iterative improvement of existing code",
phases: ["analysis", "optimization", "refactoring", "validation"],
agents: ["reviewer", "coder", "performance-monitor"],
workflow: "iterative",
temperature: 0.5,
},
integration: {
id: "integration",
name: "System Integration",
description: "Integrate components and validate system behavior",
phases: [
"component-analysis",
"integration-planning",
"implementation",
"testing",
],
agents: ["integration-expert", "tester", "devops-engineer"],
workflow: "sequential",
temperature: 0.4,
},
// Development Modes
dev: {
id: "dev",
name: "Full Development Cycle",
description: "Complete development from specification to deployment",
phases: ["spec", "design", "implement", "test", "deploy"],
agents: ["planner", "coder", "tester", "devops-engineer"],
workflow: "pipeline",
temperature: 0.5,
},
api: {
id: "api",
name: "API Development",
description: "Design and implement RESTful or GraphQL APIs",
phases: ["api-design", "implementation", "documentation", "testing"],
agents: ["api-designer", "coder", "documentation-writer", "tester"],
workflow: "sequential",
temperature: 0.4,
},
ui: {
id: "ui",
name: "UI Development",
description: "User interface design and implementation",
phases: ["design", "component-creation", "styling", "testing"],
agents: ["ui-designer", "coder", "ux-researcher", "tester"],
workflow: "iterative",
temperature: 0.6,
},
test: {
id: "test",
name: "Comprehensive Testing",
description: "Create and execute comprehensive test suites",
phases: ["test-planning", "unit-tests", "integration-tests", "e2e-tests"],
agents: ["tester", "performance-monitor", "security-auditor"],
workflow: "parallel",
temperature: 0.3,
},
refactor: {
id: "refactor",
name: "Code Refactoring",
description: "Systematic code improvement without changing behavior",
phases: ["analysis", "planning", "refactoring", "validation"],
agents: ["reviewer", "coder", "tester"],
workflow: "iterative",
temperature: 0.4,
},
// Specialized Modes
security: {
id: "security",
name: "Security Hardening",
description: "Security analysis and implementation",
phases: ["audit", "vulnerability-assessment", "remediation", "validation"],
agents: ["security-auditor", "penetration-tester", "coder", "tester"],
workflow: "sequential",
temperature: 0.3,
},
performance: {
id: "performance",
name: "Performance Optimization",
description: "Analyze and optimize system performance",
phases: [
"profiling",
"bottleneck-analysis",
"optimization",
"benchmarking",
],
agents: ["performance-monitor", "bottleneck-analyzer", "coder", "tester"],
workflow: "iterative",
temperature: 0.4,
},
ml: {
id: "ml",
name: "Machine Learning Development",
description: "ML model development and deployment",
phases: ["data-analysis", "model-design", "training", "deployment"],
agents: [
"data-analyst",
"neural-architect",
"training-coordinator",
"model-deployer",
],
workflow: "pipeline",
temperature: 0.5,
},
migration: {
id: "migration",
name: "System Migration",
description: "Migrate legacy systems or upgrade technologies",
phases: ["analysis", "planning", "implementation", "validation"],
agents: ["migration-specialist", "coder", "tester", "devops-engineer"],
workflow: "sequential",
temperature: 0.4,
},
documentation: {
id: "documentation",
name: "Documentation Generation",
description: "Create comprehensive project documentation",
phases: ["analysis", "structure-planning", "writing", "review"],
agents: ["documentation-writer", "reviewer", "api-designer"],
workflow: "sequential",
temperature: 0.6,
},
quantum: {
id: "quantum",
name: "Quantum Computing",
description: "Quantum algorithm and circuit development",
phases: [
"algorithm-design",
"circuit-creation",
"simulation",
"optimization",
],
agents: [
"quantum-algorithm-specialist",
"quantum-circuit-designer",
"qubit-state-manager",
],
workflow: "specialized",
temperature: 0.4,
maxTokens: 16384,
},
consensus: {
id: "consensus",
name: "Distributed Consensus",
description: "Implement distributed consensus mechanisms",
phases: [
"protocol-selection",
"implementation",
"fault-tolerance",
"testing",
],
agents: [
"byzantine-fault-tolerant",
"raft-consensus",
"crdt-manager",
"tester",
],
workflow: "parallel",
temperature: 0.3,
},
};
// SPARC Workflow Types
export enum SparcWorkflow {
Sequential = "sequential", // Phases execute one after another
Parallel = "parallel", // Phases can execute simultaneously
Iterative = "iterative", // Phases repeat in cycles
Pipeline = "pipeline", // Continuous flow through phases
Collaborative = "collaborative", // Agents work together on phases
Specialized = "specialized", // Custom workflow for specific domains
}
// SPARC Phase Definitions
export interface SparcPhase {
id: string;
name: string;
description: string;
requiredAgents: string[];
outputs: string[];
successCriteria: string[];
}
export const SPARC_PHASES: Record<string, SparcPhase> = {
specification: {
id: "specification",
name: "Specification",
description: "Define detailed requirements and acceptance criteria",
requiredAgents: ["planner", "researcher"],
outputs: ["requirements.md", "acceptance-criteria.md"],
successCriteria: [
"Clear requirements",
"Measurable criteria",
"Stakeholder approval",
],
},
pseudocode: {
id: "pseudocode",
name: "Pseudocode",
description: "Create algorithmic logic in pseudocode",
requiredAgents: ["planner", "architect"],
outputs: ["algorithms.md", "data-structures.md"],
successCriteria: [
"Complete logic coverage",
"Optimal algorithms",
"Clear structure",
],
},
architecture: {
id: "architecture",
name: "Architecture",
description: "Design system architecture and components",
requiredAgents: ["architect", "planner"],
outputs: ["architecture.md", "component-diagram.svg"],
successCriteria: [
"Scalable design",
"Clear boundaries",
"Technology decisions",
],
},
"test-design": {
id: "test-design",
name: "Test Design",
description: "Design comprehensive test cases",
requiredAgents: ["tester", "planner"],
outputs: ["test-plan.md", "test-cases.json"],
successCriteria: ["Full coverage", "Edge cases", "Performance criteria"],
},
implementation: {
id: "implementation",
name: "Implementation",
description: "Write production code",
requiredAgents: ["coder", "reviewer"],
outputs: ["src/**/*.ts", "tests/**/*.test.ts"],
successCriteria: ["Tests pass", "Code quality", "Performance targets"],
},
refinement: {
id: "refinement",
name: "Refinement",
description: "Iterative improvement and optimization",
requiredAgents: ["reviewer", "coder", "performance-monitor"],
outputs: ["refactored-code", "performance-report.md"],
successCriteria: [
"Improved metrics",
"Maintained functionality",
"Clean code",
],
},
};
// Export SPARC mode runner
export class SparcModeRunner {
constructor(private mode: SparcMode) {}
async execute(task: string, options?: any): Promise<any> {
// Implementation will coordinate agents through the specified workflow
throw new Error("SparcModeRunner.execute() to be implemented");
}
}