UNPKG

shipdeck

Version:

Ship MVPs in 48 hours. Fix bugs in 30 seconds. The command deck for developers who ship.

684 lines (581 loc) 22.1 kB
/** * Shipdeck Ultimate Manager * Premium AI agents for Claude Code */ const fs = require('fs'); const path = require('path'); const os = require('os'); const crypto = require('crypto'); class UltimateManager { constructor() { this.configPath = path.join(os.homedir(), '.shipdeck', 'ultimate.json'); this.apiUrl = process.env.SHIPDECK_API_URL || 'https://api.shipdeck.ai'; this.agents = this.loadAgents(); } loadAgents() { // Define available agents by tier return { free: [ { name: 'rapid-prototyper', description: 'Build MVPs at lightning speed' }, { name: 'test-writer', description: 'Generate comprehensive tests' }, { name: 'task-coordinator', description: 'Orchestrate parallel tasks' }, { name: 'ui-designer', description: 'Create beautiful interfaces' }, { name: 'content-creator', description: 'Generate engaging content' } ], pro: [ // All free agents plus: { name: 'backend-architect', description: 'Design scalable APIs' }, { name: 'frontend-developer', description: 'Build React/Vue/Angular apps' }, { name: 'ai-engineer', description: 'Integrate ML/AI features' }, { name: 'devops-automator', description: 'CI/CD and deployment' }, { name: 'mobile-app-builder', description: 'React Native development' }, { name: 'whimsy-injector', description: 'Add delightful animations' }, { name: 'performance-optimizer', description: 'Speed up your app' }, { name: 'security-auditor', description: 'Find vulnerabilities' }, { name: 'database-expert', description: 'Optimize queries' }, { name: 'api-tester', description: 'Test API endpoints' }, // ... 40+ more agents ], team: [ // All pro agents plus: { name: 'custom-agent-builder', description: 'Create custom agents' }, { name: 'team-coordinator', description: 'Manage team workflows' } ] }; } async handleCommand(args) { const subcommand = args[0]; if (!subcommand || subcommand === 'help') { this.showHelp(); return; } switch (subcommand) { case 'activate': await this.activate(args[1]); break; case 'status': await this.showStatus(); break; case 'ship': await this.ship(args.slice(1).join(' ')); break; case 'ship-full': await this.shipFull(args.slice(1).join(' ')); break; case 'agent': await this.runAgent(args[1], args.slice(2)); break; case 'list': await this.listAgents(); break; case 'upgrade': this.showUpgrade(); break; case 'init-project': await this.initProject(args[1], args.slice(2).join(' ')); break; case 'test-integration': await this.testIntegration(); break; case 'ideate': case 'research': case 'plan': case 'execute': case 'test': case 'polish': case 'ship-phase': case 'market': await this.runLifecyclePhase(subcommand, args.slice(1).join(' ')); break; default: console.error(`❌ Unknown ultimate command: ${subcommand}`); this.showHelp(); } } showHelp() { console.log(` ⚡ Shipdeck Ultimate - 50+ AI Agents for Claude Code Core Commands: shipdeck ultimate activate <key> Activate your license shipdeck ultimate status Show license & available agents shipdeck ultimate list List all available agents shipdeck ultimate upgrade View pricing & upgrade options shipdeck ultimate test-integration Test the integration Shipping Commands: shipdeck ultimate ship <feature> Quick ship with smart agent selection shipdeck ultimate ship-full <feature> Run full 8-phase lifecycle shipdeck ultimate agent <name> <task> Run a specific agent Lifecycle Commands: shipdeck ultimate init-project <name> Initialize project with 7-step prep shipdeck ultimate ideate <concept> Phase 1: Brainstorming & validation shipdeck ultimate research <feature> Phase 2: Market & competitor research shipdeck ultimate plan <feature> Phase 3: Task decomposition & sprint planning shipdeck ultimate execute <feature> Phase 4: Parallel building shipdeck ultimate test <feature> Phase 5: Comprehensive testing shipdeck ultimate polish <feature> Phase 6: Code quality & refactoring shipdeck ultimate ship-phase <feature> Phase 7: Deployment & CI/CD shipdeck ultimate market <feature> Phase 8: Launch & promotion Examples: shipdeck ultimate test-integration shipdeck ultimate init-project "my-app" "A social platform" shipdeck ultimate ship-full "user authentication" shipdeck ultimate execute "payment system" shipdeck ultimate agent rapid-prototyper "build a todo app" Free Tier: • 5 basic agents • Sequential execution • Community support Pro Tier ($79/mo): • 50+ specialized agents • Parallel execution • Priority support • Custom workflows Team Tier ($199/mo): • Everything in Pro • 5 team seats • Custom agents • Admin dashboard Learn more: https://shipdeck.ai/ultimate `); } async activate(key) { if (!key) { console.error('❌ Please provide a license key'); console.log(' Example: shipdeck ultimate activate SK-XXXX-XXXX-XXXX'); console.log(' Get your key at: https://shipdeck.ai/ultimate'); return; } console.log('🔐 Activating license...'); try { // Mock validation for now const mockResponse = await this.validateLicense(key); if (mockResponse.valid) { this.saveLicense({ key: key, tier: mockResponse.tier, activated: new Date().toISOString(), machineId: this.getMachineId() }); console.log(`✅ License activated successfully!`); console.log(` Tier: ${mockResponse.tier.toUpperCase()}`); console.log(` Agents: ${mockResponse.agentCount}`); console.log(` Features: ${mockResponse.features.join(', ')}`); } else { console.error('❌ Invalid license key'); console.log(' Please check your key and try again'); } } catch (error) { console.error('❌ Failed to activate license:', error.message); } } async validateLicense(key) { // Mock validation - in production, this would call the API if (key.startsWith('SK-PRO')) { return { valid: true, tier: 'pro', agentCount: 50, features: ['Parallel execution', 'All agents', 'Priority support'] }; } else if (key.startsWith('SK-TEAM')) { return { valid: true, tier: 'team', agentCount: 52, features: ['Team seats', 'Custom agents', 'Admin dashboard'] }; } else if (key.startsWith('SK-')) { return { valid: true, tier: 'free', agentCount: 5, features: ['Basic agents', 'Sequential execution'] }; } return { valid: false }; } async showStatus() { const license = this.loadLicense(); if (!license) { console.log(` 📊 Shipdeck Ultimate Status License: Not activated (Free tier) Agents: 5 basic agents available Execution: Sequential only To unlock 50+ agents and parallel execution: 1. Get a license at https://shipdeck.ai/ultimate 2. Activate with: shipdeck ultimate activate <key> `); return; } console.log(` 📊 Shipdeck Ultimate Status License: ${license.tier.toUpperCase()} tier ✅ Activated: ${new Date(license.activated).toLocaleDateString()} Machine ID: ${license.machineId.substring(0, 8)}... Available Agents: ${this.getAgentCount(license.tier)} Execution: ${license.tier === 'free' ? 'Sequential' : 'Parallel ⚡'} Support: ${license.tier === 'free' ? 'Community' : 'Priority'} Run 'shipdeck ultimate list' to see all agents `); } async ship(feature) { if (!feature) { console.error('❌ Please specify what to ship'); console.log(' Example: shipdeck ultimate ship "user authentication"'); return; } const license = this.loadLicense() || { tier: 'free' }; console.log(`\n🚀 Shipping: ${feature}\n`); if (license.tier === 'free') { console.log('📝 Using free tier (5 agents, sequential execution)'); console.log(' Upgrade to Pro for 50+ agents and 10x faster parallel execution'); console.log(''); } else { console.log(`⚡ Using ${license.tier} tier with parallel execution`); console.log(''); } // Simulate agent execution const agents = this.selectAgentsForFeature(feature, license.tier); for (const agent of agents) { console.log(`🤖 ${agent.name}: ${agent.action}`); await this.simulateWork(500); } console.log(`\n✅ Feature shipped successfully!`); if (license.tier === 'free') { console.log(`\n💡 Pro tip: This would be 10x faster with Ultimate Pro`); console.log(` Learn more: https://shipdeck.ai/ultimate`); } } selectAgentsForFeature(feature, tier) { // Smart agent selection based on feature const featureLower = feature.toLowerCase(); const agents = []; if (featureLower.includes('auth') || featureLower.includes('login')) { agents.push( { name: 'backend-architect', action: 'Designing auth flow' }, { name: 'frontend-developer', action: 'Building login UI' }, { name: 'test-writer', action: 'Writing auth tests' } ); } else if (featureLower.includes('ui') || featureLower.includes('interface')) { agents.push( { name: 'ui-designer', action: 'Creating design system' }, { name: 'frontend-developer', action: 'Implementing components' }, { name: 'whimsy-injector', action: 'Adding delightful touches' } ); } else { agents.push( { name: 'rapid-prototyper', action: 'Building MVP' }, { name: 'test-writer', action: 'Adding test coverage' }, { name: 'task-coordinator', action: 'Orchestrating tasks' } ); } // Limit agents for free tier if (tier === 'free') { return agents.slice(0, 2); } return agents; } async runAgent(agentName, args) { if (!agentName) { console.error('❌ Please specify an agent name'); console.log(' Run "shipdeck ultimate list" to see available agents'); return; } const license = this.loadLicense() || { tier: 'free' }; const availableAgents = this.getAvailableAgents(license.tier); if (!availableAgents.find(a => a.name === agentName)) { console.error(`❌ Agent "${agentName}" not available in ${license.tier} tier`); console.log(' Available agents:', availableAgents.map(a => a.name).join(', ')); if (license.tier === 'free') { console.log('\n Upgrade to Pro for 50+ agents: https://shipdeck.ai/ultimate'); } return; } const prompt = args.join(' ') || 'default task'; console.log(`\n🤖 Running ${agentName}...`); console.log(` Task: ${prompt}\n`); await this.simulateWork(1000); console.log(`✅ ${agentName} completed successfully!`); } async listAgents() { const license = this.loadLicense() || { tier: 'free' }; const agents = this.getAvailableAgents(license.tier); console.log(`\n🤖 Available Agents (${license.tier} tier)\n`); const categories = { 'Engineering': ['rapid-prototyper', 'backend-architect', 'frontend-developer'], 'Testing': ['test-writer', 'api-tester', 'performance-tester'], 'Design': ['ui-designer', 'whimsy-injector', 'ux-researcher'], 'Marketing': ['content-creator', 'growth-hacker', 'seo-optimizer'], 'Operations': ['task-coordinator', 'devops-automator', 'security-auditor'] }; for (const [category, categoryAgents] of Object.entries(categories)) { const available = agents.filter(a => categoryAgents.includes(a.name)); if (available.length > 0) { console.log(`${category}:`); available.forEach(agent => { console.log(` • ${agent.name} - ${agent.description}`); }); console.log(''); } } if (license.tier === 'free') { console.log(`📈 Unlock 45+ more agents with Ultimate Pro`); console.log(` • Parallel execution for 10x speed`); console.log(` • Advanced AI models`); console.log(` • Priority support`); console.log(`\n Upgrade: https://shipdeck.ai/ultimate`); } } showUpgrade() { console.log(` 💎 Shipdeck Ultimate Pricing FREE TIER (Current) ✓ 5 basic agents ✓ Sequential execution ✓ Community support Price: $0/month PRO TIER ⭐ Most Popular ✓ 50+ specialized agents ✓ Parallel execution (10x faster) ✓ Priority support ✓ Custom workflows Price: $79/month TEAM TIER ✓ Everything in Pro ✓ 5 team seats ✓ Custom agent creation ✓ Admin dashboard ✓ SSO & audit logs Price: $199/month ENTERPRISE ✓ Unlimited seats ✓ Self-hosted option ✓ SLA guarantee ✓ Custom training Price: Contact sales 🚀 Get started: https://shipdeck.ai/ultimate 📧 Questions? team@shipdeck.ai `); } // Helper methods loadLicense() { try { if (fs.existsSync(this.configPath)) { return JSON.parse(fs.readFileSync(this.configPath, 'utf8')); } } catch (error) { // Silently fail } return null; } saveLicense(license) { const dir = path.dirname(this.configPath); if (!fs.existsSync(dir)) { fs.mkdirSync(dir, { recursive: true }); } fs.writeFileSync(this.configPath, JSON.stringify(license, null, 2)); } getMachineId() { // Simple machine ID based on hostname and platform const hostname = os.hostname(); const platform = os.platform(); return crypto.createHash('md5') .update(hostname + platform) .digest('hex'); } getAgentCount(tier) { switch (tier) { case 'team': return 52; case 'pro': return 50; default: return 5; } } getAvailableAgents(tier) { const freeAgents = this.agents.free; const proAgents = [...this.agents.free, ...this.agents.pro]; const teamAgents = [...proAgents, ...this.agents.team]; switch (tier) { case 'team': return teamAgents; case 'pro': return proAgents; default: return freeAgents; } } async simulateWork(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } // New lifecycle methods using templates async shipFull(feature) { if (!feature) { console.error('❌ Please specify what to ship'); console.log(' Example: shipdeck ultimate ship-full "user authentication"'); return; } const AgentTemplateIntegration = require('./agent-template-integration'); const integration = new AgentTemplateIntegration(); await integration.runFullLifecycle(feature); } async initProject(name, description) { if (!name) { console.error('❌ Please provide a project name'); console.log(' Example: shipdeck ultimate init-project "my-app" "An awesome app"'); return; } const AgentTemplateIntegration = require('./agent-template-integration'); const integration = new AgentTemplateIntegration(); await integration.initializeProject(name, description || ''); } async runLifecyclePhase(phase, feature) { if (!feature) { console.error(`❌ Please specify what to ${phase}`); console.log(` Example: shipdeck ultimate ${phase} "user authentication"`); return; } // Use embedded lifecycle templates const { getPhase, getPhaseAgents } = require('./embedded-lifecycle'); // Map command names to lifecycle phase names const phaseMap = { 'ideate': 'ideation', 'research': 'research', 'plan': 'planning', 'execute': 'execution', 'test': 'testing', 'polish': 'polishing', 'ship-phase': 'shipping', 'market': 'marketing' }; const phaseName = phaseMap[phase] || phase; const phaseConfig = getPhase(phaseName); if (!phaseConfig) { console.error(`❌ Unknown phase: ${phase}`); return; } console.log(`\n🚀 Running ${phaseConfig.name}...`); console.log(`📝 ${phaseConfig.description}`); console.log(`⏱️ Duration: ${phaseConfig.duration}`); console.log(`🤖 Agents: ${phaseConfig.agents.join(', ')}`); // Show the steps that would be executed console.log('\n📌 Steps to execute:'); phaseConfig.steps.forEach((step, index) => { console.log(` ${index + 1}. ${step.name} (${step.agent})`); console.log(` ${step.description}`); if (step.parallel) { console.log(` ⚡ Can run in parallel`); } }); // Generate the actual templates for each step const contextData = { projectName: feature, description: feature }; console.log('\n🎯 Executing phase with embedded templates...'); let parallelSteps = []; for (const [index, step] of phaseConfig.steps.entries()) { if (step.template) { const content = step.template(contextData); console.log(`\n✅ Step ${index + 1}: ${step.name}`); console.log(` Agent: ${step.agent}`); console.log(` Status: Template generated and ready`); if (step.parallel) { parallelSteps.push(step.name); } } } if (parallelSteps.length > 0) { console.log(`\n⚡ Parallel execution available for: ${parallelSteps.join(', ')}`); } console.log(`\n✨ ${phaseConfig.name} ready for execution with embedded templates!`); // Also try to use the AgentTemplateIntegration if available try { const AgentTemplateIntegration = require('./agent-template-integration'); const integration = new AgentTemplateIntegration(); const command = await integration.createLifecycleCommand(phaseName); await command(feature); } catch (error) { // If AgentTemplateIntegration fails, we still showed the embedded templates console.log('\n💡 Run with actual agents to execute the generated templates'); } } async testIntegration() { console.log('\n🧪 Testing Shipdeck Ultimate Integration\n'); console.log('=' .repeat(50)); const tests = []; // Test 1: Template Processor try { const TemplateProcessor = require('./template-processor'); const tp = new TemplateProcessor(); tests.push({ name: 'TemplateProcessor', status: '✅ Loaded' }); } catch (error) { tests.push({ name: 'TemplateProcessor', status: `❌ ${error.message}` }); } // Test 2: Rule Enforcer try { const RuleEnforcer = require('./rule-enforcer'); const re = new RuleEnforcer(); const rulesCount = await re.loadRules(); tests.push({ name: 'RuleEnforcer', status: `✅ Loaded ${rulesCount} rules` }); } catch (error) { tests.push({ name: 'RuleEnforcer', status: `❌ ${error.message}` }); } // Test 3: Prep Runner try { const PrepRunner = require('./prep-runner'); const pr = new PrepRunner(); tests.push({ name: 'PrepRunner', status: '✅ Loaded (7 steps ready)' }); } catch (error) { tests.push({ name: 'PrepRunner', status: `❌ ${error.message}` }); } // Test 4: Workflow Runner try { const WorkflowRunner = require('./workflow-runner'); const wr = new WorkflowRunner(); tests.push({ name: 'WorkflowRunner', status: '✅ Loaded' }); } catch (error) { tests.push({ name: 'WorkflowRunner', status: `❌ ${error.message}` }); } // Test 5: Agent Template Integration try { const AgentTemplateIntegration = require('./agent-template-integration'); const ati = new AgentTemplateIntegration(); tests.push({ name: 'AgentTemplateIntegration', status: '✅ Loaded' }); } catch (error) { tests.push({ name: 'AgentTemplateIntegration', status: `❌ ${error.message}` }); } // Test 6: Rule Application try { const RuleEnforcer = require('./rule-enforcer'); const re = new RuleEnforcer(); await re.loadRules(); const testCode = 'function test(): any { return "test"; }'; const validation = await re.applyRules(testCode, 'test.ts'); if (!validation.passed) { tests.push({ name: 'Rule Detection', status: `✅ Found ${validation.violations.length} violations` }); } else { tests.push({ name: 'Rule Detection', status: '⚠️ No violations in test code' }); } } catch (error) { tests.push({ name: 'Rule Detection', status: `❌ ${error.message}` }); } // Display results console.log('\nTest Results:\n'); tests.forEach(test => { console.log(` ${test.name}: ${test.status}`); }); const passed = tests.filter(t => t.status.includes('✅')).length; const failed = tests.filter(t => t.status.includes('❌')).length; console.log('\n' + '-'.repeat(50)); console.log(`Summary: ${passed} passed, ${failed} failed, ${tests.length} total`); if (failed === 0) { console.log('\n🎉 All integration tests passed!'); console.log('\nYou can now use:'); console.log(' shipdeck ultimate init-project "my-app" - Initialize new project'); console.log(' shipdeck ultimate ship-full "feature" - Run full 8-phase lifecycle'); console.log(' shipdeck ultimate ideate "concept" - Run ideation phase'); console.log(' shipdeck ultimate execute "feature" - Run execution phase'); } else { console.log('\n⚠️ Some tests failed. Please check the errors above.'); } return { passed, failed, total: tests.length }; } } module.exports = UltimateManager;