github-autopilot-ai-cicd
v0.1.3
Published
AI-driven CI/CD pipeline automation for GitHub projects using Claude-Flow and SPARC methodology
Maintainers
Readme
Autopilot AI-CICD
🚀 AI-driven CI/CD pipeline automation using the SPARC methodology
Autopilot AI-CICD is a comprehensive platform that automates software development workflows using artificial intelligence and the SPARC (Specification, Pseudocode, Architecture, Refinement, Completion) methodology. It provides intelligent automation for issue processing, code generation, testing, and deployment.
🌟 Features
Core Capabilities
- 🤖 AI-Driven Development: Automated issue processing and code generation
- 🔄 SPARC Methodology: Systematic 5-phase development workflow
- 🛡️ Enterprise Security: OAuth, RBAC, audit logging, and encryption
- 📊 Real-time Monitoring: Comprehensive metrics, alerting, and dashboards
- 🔌 GitHub Integration: Seamless repository and workflow management
- 💾 Persistent Memory: Hierarchical context management across sessions
- 🔐 Secrets Management: Secure handling of credentials and API keys
SPARC Workflow Phases
- Specification: Requirements analysis and acceptance criteria
- Pseudocode: Algorithm design and data structure planning
- Architecture: System design and component architecture
- Refinement: Test-driven development implementation
- Completion: Integration testing and validation
Security & Compliance
- GitHub OAuth authentication
- Role-based access control (RBAC)
- AES-256-GCM encryption for sensitive data
- Comprehensive audit logging
- Vulnerability scanning integration
- Zero-trust architecture
🚀 Quick Start
Prerequisites
- Node.js 18+
- PostgreSQL 15+ (or Supabase account)
- Redis 7+
- Docker & Docker Compose (for production)
- GitHub Personal Access Token
Installation
# Clone the repository
git clone https://github.com/autopilot/ai-cicd.git
cd autopilot-ai-cicd
# Install dependencies
npm install
# Copy environment configuration
cp deploy/production-env.template .env.development
# Configure your environment variables
# Edit .env.development with your actual valuesEnvironment Configuration
# Required environment variables
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=your-anon-key
GITHUB_TOKEN=ghp_your-github-token
JWT_SECRET=your-jwt-secret-key
MASTER_ENCRYPTION_KEY=your-encryption-keyDevelopment Setup
# Run database migrations (if using local PostgreSQL)
npm run migrate
# Start development server
npm run dev
# Run tests
npm test
# Run with test coverage
npm run test:coverage
# Type checking
npm run typecheck
# Linting
npm run lintProduction Deployment
# Build for production
npm run build
# Deploy with Docker Compose
./deploy/deploy.sh production
# Setup monitoring (optional)
./monitoring/setup-monitoring.sh production📖 Documentation
Core Documentation
- API Documentation - Complete REST API reference
- Deployment Guide - Production deployment instructions
- Security Guide - Security best practices and architecture
- Troubleshooting - Common issues and solutions
Examples and Tutorials
Architecture Documentation
🛠️ Usage Examples
Basic Repository Setup
import { AutopilotClient } from '@autopilot/sdk';
const client = new AutopilotClient({
baseUrl: 'https://api.autopilot.dev',
apiKey: process.env.AUTOPILOT_API_KEY
});
// Create repository
const repository = await client.repositories.create({
githubOwner: 'myorg',
githubRepo: 'my-project',
settings: {
autopilotEnabled: true,
sparcMode: true,
autoAssign: true
}
});
// Start SPARC workflow
const session = await client.sessions.create(repository.id, {
issueId: 'issue-123',
title: 'Implement user authentication',
sparcMode: 'tdd'
});CLI Usage
# Using Claude Code with SPARC commands
./claude-flow sparc tdd "implement user authentication system"
# Execute specific SPARC phase
./claude-flow sparc run architect "design microservice architecture"
# Check SPARC status
./claude-flow sparc modesPython SDK
from autopilot_sdk import AutopilotClient
client = AutopilotClient(
api_key='your-api-key',
base_url='https://api.autopilot.dev'
)
# Create feature issue
issue = await client.issues.create(repository_id, {
'title': 'Add payment processing',
'body': 'Implement secure payment processing...',
'labels': ['feature', 'payment']
})
# Run SPARC workflow
session = await client.sparc.run_workflow(repository_id, issue['id'])🏗️ Architecture
System Components
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Web Client │ │ Mobile App │ │ CLI Tools │
└─────────┬───────┘ └─────────┬───────┘ └─────────┬───────┘
│ │ │
└──────────────────────┼──────────────────────┘
│
┌─────────────────┴─────────────────┐
│ API Gateway │
│ (Authentication & Routing) │
└─────────────────┬─────────────────┘
│
┌────────────────────────┼────────────────────────┐
│ │ │
┌───────▼───────┐ ┌─────────▼─────────┐ ┌─────────▼─────────┐
│ Core API │ │ MCP Servers │ │ Security Layer │
│ (SPARC) │ │ (Memory/Secrets) │ │ (RBAC/Audit) │
└───────┬───────┘ └─────────┬─────────┘ └─────────┬─────────┘
│ │ │
└──────────────────────┼────────────────────────┘
│
┌────────────────▼────────────────┐
│ Data Layer │
│ (Supabase + Redis + GitHub) │
└─────────────────────────────────┘Key Technologies
- Backend: Node.js + TypeScript + Express
- Database: Supabase (PostgreSQL) + Redis
- Authentication: GitHub OAuth + JWT
- Security: AES-256-GCM encryption + RBAC
- Monitoring: Prometheus + Grafana + Alertmanager
- Deployment: Docker + Docker Compose
- Testing: Jest + Supertest (95%+ coverage)
🔌 Integration
MCP (Model Context Protocol) Servers
Autopilot includes three specialized MCP servers:
- Memory Server: Persistent context and session management
- Secrets Server: Secure credential and API key management
- GitHub Server: Repository and workflow automation
GitHub Integration
- Automatic issue synchronization
- Workflow trigger management
- Pull request automation
- Status check integration
- Webhook event processing
Claude-Flow Integration
# Available SPARC modes
./claude-flow sparc modes
# SPARC development modes
architect # System design and architecture
code # Clean, modular implementation
tdd # Test-driven development
spec-pseudocode # Requirements and algorithms
integration # System integration
# Quality assurance modes
debug # Troubleshooting and fixes
security-review # Security analysis
refinement-optimization-mode # Performance optimization📊 Monitoring & Observability
Metrics and Dashboards
- Application Health: Response times, error rates, throughput
- SPARC Workflows: Success rates, phase duration, test coverage
- Security Events: Authentication, authorization, audit trails
- Infrastructure: CPU, memory, disk, network usage
- Business Metrics: Issue processing, GitHub API usage
Alerting
- Critical Alerts: Application down, security breaches
- Warning Alerts: High latency, error rates, resource usage
- Business Alerts: Workflow failures, GitHub rate limits
Access Monitoring URLs
# Application
http://localhost:3000
# Monitoring Dashboard
http://localhost:3001 # Grafana
# Metrics
http://localhost:9090 # Prometheus
# Alerts
http://localhost:9093 # Alertmanager🧪 Testing
Test Coverage
The project maintains comprehensive test coverage across all components:
# Run all tests
npm test
# Integration tests
npm run test:integration
# End-to-end tests
npm run test:e2e
# Performance tests
npm run test:performance
# Security tests
npm run test:security
# Generate coverage report
npm run test:coverageTest Categories
- Unit Tests: Component-level testing (90%+ coverage)
- Integration Tests: System integration validation
- E2E Tests: Complete SPARC workflow testing
- Performance Tests: Load testing and benchmarks
- Security Tests: Authentication, authorization, encryption
Performance Benchmarks
# Run performance benchmarks
node test/performance/benchmark.js
# Load testing
npm run test:load
# Memory profiling
npm run test:memory🚀 Deployment
Docker Deployment
# Production deployment
./deploy/deploy.sh production
# Staging deployment
./deploy/deploy.sh staging
# Development deployment
./deploy/deploy.sh developmentMonitoring Setup
# Setup complete monitoring stack
./monitoring/setup-monitoring.sh production
# Includes:
# - Prometheus (metrics collection)
# - Grafana (dashboards)
# - Alertmanager (notifications)
# - Node Exporter (system metrics)
# - Redis/Postgres exportersScaling Configuration
# docker-compose.production.yml
services:
autopilot-app:
deploy:
replicas: 3
resources:
limits:
cpus: '2.0'
memory: 4G
reservations:
cpus: '0.5'
memory: 1G🛡️ Security
Authentication & Authorization
- OAuth Providers: GitHub (primary), Google (optional)
- JWT Tokens: 24-hour expiration with refresh capability
- API Keys: Service-to-service authentication
- RBAC: Fine-grained permission system
Data Protection
- Encryption: AES-256-GCM for sensitive data
- Key Management: Automated key rotation
- Audit Logging: Comprehensive activity tracking
- Network Security: HTTPS, CORS, rate limiting
Compliance Features
- GDPR: Data protection and privacy controls
- SOC 2: Security and availability controls
- Audit Trails: Immutable security event logs
- Access Controls: Role-based permissions
🤝 Contributing
We welcome contributions! Please see our Contributing Guide for details.
Development Workflow
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Add tests for new functionality
- Ensure all tests pass (
npm test) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
Code Standards
- TypeScript: Strict mode enabled
- Testing: 95%+ coverage required
- Linting: ESLint + Prettier
- Security: Automated vulnerability scanning
- Documentation: JSDoc for all public APIs
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🆘 Support
Getting Help
- Documentation: https://docs.autopilot.dev
- API Reference: API Documentation
- Discord Community: Join our Discord
- GitHub Issues: Report bugs or request features
Commercial Support
For enterprise support, training, and consulting:
- Email: [email protected]
- Website: https://autopilot.dev/enterprise
🗺️ Roadmap
Upcoming Features
- Multi-Cloud Support: AWS, GCP, Azure deployment options
- Advanced AI Models: GPT-4, Claude-3, local model support
- Visual Workflow Builder: Drag-and-drop SPARC configuration
- Team Collaboration: Shared workspaces and review workflows
- Plugin Ecosystem: Extensible third-party integrations
Version 2.0 Goals
- Real-time Collaboration: Live coding sessions
- Advanced Analytics: ML-powered insights and recommendations
- Mobile Application: Native iOS/Android apps
- Multi-Language Support: Python, Java, Go, Rust workflows
- Enterprise SSO: SAML, LDAP, Active Directory integration
📈 Metrics & Analytics
Usage Statistics
- Active Repositories: Track automated repositories
- SPARC Workflows: Monitor success rates and performance
- Developer Productivity: Measure time-to-completion improvements
- Quality Metrics: Track test coverage and bug reduction
Performance Benchmarks
- Response Times: API endpoint performance (< 200ms average)
- Throughput: Concurrent request handling (1000+ req/s)
- Reliability: 99.9% uptime SLA
- Scalability: Horizontal scaling to 100+ repositories
Built with ❤️ by the Autopilot Team
Website • Documentation • Discord • Twitter
