refactor: Reorganize repository structure for optimal learning path
Reorder folders based on learning dependencies, complexity, and frequency of use: - 01-slash-commands (unchanged) - Quick wins for beginners - 02-memory (was 03) - Essential foundation - 03-skills (was 05) - Auto-invoked capabilities - 04-subagents (was 02) - Task delegation - 05-mcp (was 04) - External integration - 06-hooks (was 07) - Event automation - 07-plugins (was 06) - Bundled solutions - 08-checkpoints (unchanged) - Safe experimentation - 09-advanced-features (unchanged) - Power user tools Documentation improvements: - Add LEARNING-ROADMAP.md with detailed milestones and exercises - Simplify README.md for better scannability - Consolidate Quick Start and Getting Started sections - Combine Feature Comparison and Use Case Matrix tables - Reorder README sections: Learning Path → Quick Reference → Getting Started - Update all cross-references across module READMEs 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
104
07-plugins/devops-automation/README.md
Normal file
104
07-plugins/devops-automation/README.md
Normal file
@@ -0,0 +1,104 @@
|
||||

|
||||
|
||||
# DevOps Automation Plugin
|
||||
|
||||
Complete DevOps automation for deployment, monitoring, and incident response.
|
||||
|
||||
## Features
|
||||
|
||||
✅ Automated deployments
|
||||
✅ Rollback procedures
|
||||
✅ System health monitoring
|
||||
✅ Incident response workflows
|
||||
✅ Kubernetes integration
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
/plugin install devops-automation
|
||||
```
|
||||
|
||||
## What's Included
|
||||
|
||||
### Slash Commands
|
||||
- `/deploy` - Deploy to production or staging
|
||||
- `/rollback` - Rollback to previous version
|
||||
- `/status` - Check system health
|
||||
- `/incident` - Handle production incidents
|
||||
|
||||
### Subagents
|
||||
- `deployment-specialist` - Deployment operations
|
||||
- `incident-commander` - Incident coordination
|
||||
- `alert-analyzer` - System health analysis
|
||||
|
||||
### MCP Servers
|
||||
- Kubernetes integration
|
||||
|
||||
### Scripts
|
||||
- `deploy.sh` - Deployment automation
|
||||
- `rollback.sh` - Rollback automation
|
||||
- `health-check.sh` - Health check utilities
|
||||
|
||||
### Hooks
|
||||
- `pre-deploy.js` - Pre-deployment validation
|
||||
- `post-deploy.js` - Post-deployment tasks
|
||||
|
||||
## Usage
|
||||
|
||||
### Deploy to Staging
|
||||
```
|
||||
/deploy staging
|
||||
```
|
||||
|
||||
### Deploy to Production
|
||||
```
|
||||
/deploy production
|
||||
```
|
||||
|
||||
### Rollback
|
||||
```
|
||||
/rollback production
|
||||
```
|
||||
|
||||
### Check Status
|
||||
```
|
||||
/status
|
||||
```
|
||||
|
||||
### Handle Incident
|
||||
```
|
||||
/incident
|
||||
```
|
||||
|
||||
## Requirements
|
||||
|
||||
- Claude Code 1.0+
|
||||
- Kubernetes CLI (kubectl)
|
||||
- Cluster access configured
|
||||
|
||||
## Configuration
|
||||
|
||||
Set up your Kubernetes config:
|
||||
```bash
|
||||
export KUBECONFIG=~/.kube/config
|
||||
```
|
||||
|
||||
## Example Workflow
|
||||
|
||||
```
|
||||
User: /deploy production
|
||||
|
||||
Claude:
|
||||
1. Runs pre-deploy hook (validates kubectl, cluster connection)
|
||||
2. Delegates to deployment-specialist subagent
|
||||
3. Runs deploy.sh script
|
||||
4. Monitors deployment progress via Kubernetes MCP
|
||||
5. Runs post-deploy hook (waits for pods, smoke tests)
|
||||
6. Provides deployment summary
|
||||
|
||||
Result:
|
||||
✅ Deployment complete
|
||||
📦 Version: v2.1.0
|
||||
🚀 Pods: 3/3 ready
|
||||
⏱️ Time: 2m 34s
|
||||
```
|
||||
14
07-plugins/devops-automation/agents/alert-analyzer.md
Normal file
14
07-plugins/devops-automation/agents/alert-analyzer.md
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
name: alert-analyzer
|
||||
description: Analyzes monitoring alerts and system metrics
|
||||
tools: read, grep, bash
|
||||
---
|
||||
|
||||
# Alert Analyzer
|
||||
|
||||
Analyzes system health and alerts:
|
||||
- Alert correlation
|
||||
- Trend analysis
|
||||
- Root cause identification
|
||||
- Metric visualization
|
||||
- Proactive issue detection
|
||||
14
07-plugins/devops-automation/agents/deployment-specialist.md
Normal file
14
07-plugins/devops-automation/agents/deployment-specialist.md
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
name: deployment-specialist
|
||||
description: Handles all deployment operations
|
||||
tools: read, write, bash, grep
|
||||
---
|
||||
|
||||
# Deployment Specialist
|
||||
|
||||
Expert in deployment operations:
|
||||
- Blue-green deployments
|
||||
- Canary releases
|
||||
- Rollback procedures
|
||||
- Health checks
|
||||
- Database migrations
|
||||
14
07-plugins/devops-automation/agents/incident-commander.md
Normal file
14
07-plugins/devops-automation/agents/incident-commander.md
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
name: incident-commander
|
||||
description: Coordinates incident response
|
||||
tools: read, write, bash, grep
|
||||
---
|
||||
|
||||
# Incident Commander
|
||||
|
||||
Manages incident response:
|
||||
- Severity assessment
|
||||
- Team coordination
|
||||
- Status updates
|
||||
- Resolution tracking
|
||||
- Post-mortem facilitation
|
||||
15
07-plugins/devops-automation/commands/deploy.md
Normal file
15
07-plugins/devops-automation/commands/deploy.md
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
name: Deploy
|
||||
description: Deploy application to production or staging
|
||||
---
|
||||
|
||||
# Deploy Application
|
||||
|
||||
Execute deployment workflow:
|
||||
|
||||
1. Run pre-deployment checks
|
||||
2. Build application
|
||||
3. Run tests
|
||||
4. Deploy to target environment
|
||||
5. Run health checks
|
||||
6. Notify team on Slack
|
||||
16
07-plugins/devops-automation/commands/incident.md
Normal file
16
07-plugins/devops-automation/commands/incident.md
Normal file
@@ -0,0 +1,16 @@
|
||||
---
|
||||
name: Incident Response
|
||||
description: Handle production incidents with structured response
|
||||
---
|
||||
|
||||
# Incident Response
|
||||
|
||||
Structured incident response workflow:
|
||||
|
||||
1. Create incident record
|
||||
2. Assess severity and impact
|
||||
3. Notify on-call team
|
||||
4. Gather diagnostic information
|
||||
5. Coordinate response efforts
|
||||
6. Document resolution
|
||||
7. Schedule post-mortem
|
||||
14
07-plugins/devops-automation/commands/rollback.md
Normal file
14
07-plugins/devops-automation/commands/rollback.md
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
name: Rollback
|
||||
description: Rollback to previous deployment
|
||||
---
|
||||
|
||||
# Rollback Deployment
|
||||
|
||||
Rollback to previous stable version:
|
||||
|
||||
1. Identify previous deployment
|
||||
2. Verify rollback target is healthy
|
||||
3. Execute rollback procedure
|
||||
4. Run health checks
|
||||
5. Notify team
|
||||
15
07-plugins/devops-automation/commands/status.md
Normal file
15
07-plugins/devops-automation/commands/status.md
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
name: System Status
|
||||
description: Check overall system health and status
|
||||
---
|
||||
|
||||
# System Status Check
|
||||
|
||||
Check system health across all services:
|
||||
|
||||
1. Query Kubernetes pod status
|
||||
2. Check database connections
|
||||
3. Monitor API response times
|
||||
4. Review error rates
|
||||
5. Check resource utilization
|
||||
6. Report overall health
|
||||
34
07-plugins/devops-automation/hooks/post-deploy.js
Normal file
34
07-plugins/devops-automation/hooks/post-deploy.js
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/**
|
||||
* Post-deployment hook
|
||||
* Runs after deployment completes
|
||||
*/
|
||||
|
||||
async function postDeploy() {
|
||||
console.log('Running post-deployment tasks...');
|
||||
|
||||
const { execSync } = require('child_process');
|
||||
|
||||
// Wait for pods to be ready
|
||||
console.log('Waiting for pods to be ready...');
|
||||
try {
|
||||
execSync('kubectl wait --for=condition=ready pod -l app=myapp --timeout=300s', {
|
||||
stdio: 'inherit'
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('❌ Pods failed to become ready');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// Run smoke tests
|
||||
console.log('Running smoke tests...');
|
||||
// Add your smoke test commands here
|
||||
|
||||
console.log('✅ Post-deployment tasks complete');
|
||||
}
|
||||
|
||||
postDeploy().catch(error => {
|
||||
console.error('Post-deploy hook failed:', error);
|
||||
process.exit(1);
|
||||
});
|
||||
35
07-plugins/devops-automation/hooks/pre-deploy.js
Normal file
35
07-plugins/devops-automation/hooks/pre-deploy.js
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/**
|
||||
* Pre-deployment hook
|
||||
* Validates environment and prerequisites before deployment
|
||||
*/
|
||||
|
||||
async function preDeploy() {
|
||||
console.log('Running pre-deployment checks...');
|
||||
|
||||
const { execSync } = require('child_process');
|
||||
|
||||
// Check if kubectl is installed
|
||||
try {
|
||||
execSync('which kubectl', { stdio: 'pipe' });
|
||||
} catch (error) {
|
||||
console.error('❌ kubectl not found. Please install Kubernetes CLI.');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// Check if connected to cluster
|
||||
try {
|
||||
execSync('kubectl cluster-info', { stdio: 'pipe' });
|
||||
} catch (error) {
|
||||
console.error('❌ Not connected to Kubernetes cluster');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
console.log('✅ Pre-deployment checks passed');
|
||||
}
|
||||
|
||||
preDeploy().catch(error => {
|
||||
console.error('Pre-deploy hook failed:', error);
|
||||
process.exit(1);
|
||||
});
|
||||
11
07-plugins/devops-automation/mcp/kubernetes-config.json
Normal file
11
07-plugins/devops-automation/mcp/kubernetes-config.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"mcpServers": {
|
||||
"kubernetes": {
|
||||
"command": "npx",
|
||||
"args": ["@modelcontextprotocol/server-kubernetes"],
|
||||
"env": {
|
||||
"KUBECONFIG": "${KUBECONFIG}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
31
07-plugins/devops-automation/plugin.yaml
Normal file
31
07-plugins/devops-automation/plugin.yaml
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
name: devops-automation
|
||||
version: "1.0.0"
|
||||
description: Complete DevOps automation for deployment, monitoring, and incident response
|
||||
author: Community
|
||||
license: MIT
|
||||
tags:
|
||||
- devops
|
||||
- deployment
|
||||
- monitoring
|
||||
- automation
|
||||
|
||||
requires:
|
||||
- claude-code: ">=1.0.0"
|
||||
|
||||
components:
|
||||
- type: commands
|
||||
path: commands/
|
||||
- type: agents
|
||||
path: agents/
|
||||
- type: mcp
|
||||
path: mcp/
|
||||
- type: hooks
|
||||
path: hooks/
|
||||
- type: scripts
|
||||
path: scripts/
|
||||
|
||||
config:
|
||||
auto_load: true
|
||||
enabled_by_default: true
|
||||
---
|
||||
28
07-plugins/devops-automation/scripts/deploy.sh
Normal file
28
07-plugins/devops-automation/scripts/deploy.sh
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
echo "🚀 Starting deployment..."
|
||||
|
||||
# Load environment
|
||||
ENV=${1:-staging}
|
||||
echo "📦 Target environment: $ENV"
|
||||
|
||||
# Pre-deployment checks
|
||||
echo "✓ Running pre-deployment checks..."
|
||||
npm run lint
|
||||
npm test
|
||||
|
||||
# Build
|
||||
echo "🔨 Building application..."
|
||||
npm run build
|
||||
|
||||
# Deploy
|
||||
echo "🚢 Deploying to $ENV..."
|
||||
kubectl apply -f k8s/$ENV/
|
||||
|
||||
# Health check
|
||||
echo "🏥 Running health checks..."
|
||||
sleep 10
|
||||
curl -f http://api.$ENV.example.com/health
|
||||
|
||||
echo "✅ Deployment complete!"
|
||||
30
07-plugins/devops-automation/scripts/health-check.sh
Normal file
30
07-plugins/devops-automation/scripts/health-check.sh
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "🏥 System Health Check"
|
||||
echo "===================="
|
||||
|
||||
ENV=${1:-production}
|
||||
|
||||
# Check API
|
||||
echo -n "API: "
|
||||
if curl -sf http://api.$ENV.example.com/health > /dev/null; then
|
||||
echo "✅ Healthy"
|
||||
else
|
||||
echo "❌ Unhealthy"
|
||||
fi
|
||||
|
||||
# Check Database
|
||||
echo -n "Database: "
|
||||
if pg_isready -h db.$ENV.example.com > /dev/null 2>&1; then
|
||||
echo "✅ Healthy"
|
||||
else
|
||||
echo "❌ Unhealthy"
|
||||
fi
|
||||
|
||||
# Check Pods
|
||||
echo -n "Kubernetes Pods: "
|
||||
PODS_READY=$(kubectl get pods -n $ENV --no-headers | grep "Running" | wc -l)
|
||||
PODS_TOTAL=$(kubectl get pods -n $ENV --no-headers | wc -l)
|
||||
echo "$PODS_READY/$PODS_TOTAL ready"
|
||||
|
||||
echo "===================="
|
||||
25
07-plugins/devops-automation/scripts/rollback.sh
Normal file
25
07-plugins/devops-automation/scripts/rollback.sh
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
echo "⏪ Starting rollback..."
|
||||
|
||||
ENV=${1:-staging}
|
||||
echo "📦 Target environment: $ENV"
|
||||
|
||||
# Get previous deployment
|
||||
PREVIOUS=$(kubectl rollout history deployment/app -n $ENV | tail -2 | head -1 | awk '{print $1}')
|
||||
echo "🔄 Rolling back to revision: $PREVIOUS"
|
||||
|
||||
# Execute rollback
|
||||
kubectl rollout undo deployment/app -n $ENV
|
||||
|
||||
# Wait for rollback
|
||||
echo "⏳ Waiting for rollback to complete..."
|
||||
kubectl rollout status deployment/app -n $ENV
|
||||
|
||||
# Health check
|
||||
echo "🏥 Running health checks..."
|
||||
sleep 5
|
||||
curl -f http://api.$ENV.example.com/health
|
||||
|
||||
echo "✅ Rollback complete!"
|
||||
Reference in New Issue
Block a user