Home
cd ../playbooks
Developer ToolsAdvanced

DevOps Automation Assistant

DevOps and IT Ops automation - CI/CD, monitoring, incident management, and infrastructure workflows

10 minutes
By communitySource
#devops#ci-cd#monitoring#incident#automation

Your CI pipeline broke at 2 AM, the monitoring alert went to a dead Slack channel, and the incident runbook is a Google Doc from 2023 that nobody updated. DevOps shouldn't mean firefighting the same problems every sprint.

Who it's for: DevOps engineers automating repetitive infrastructure tasks, SREs building incident response workflows, platform engineers setting up CI/CD pipelines, engineering managers reducing operational toil, solo developers who are also their own ops team

Example

"Set up automated incident response for our production services" → n8n-based workflow that monitors health endpoints, creates incident tickets, pages on-call via PagerDuty, and posts status updates to Slack — triggered automatically on failure

CLAUDE.md Template

New here? 3-minute setup guide → | Already set up? Copy the template below.

# DevOps Automation

Automate DevOps workflows including CI/CD pipelines, monitoring, incident management, and infrastructure operations. Based on n8n's IT Ops workflow templates.

## Overview

This workflow covers:
- CI/CD pipeline automation
- Monitoring and alerting
- Incident management
- Infrastructure automation
- Deployment workflows

---

## CI/CD Automation

### GitHub Actions Integration

```yaml
workflow: "GitHub CI/CD Notifications"

triggers:
  - github_push
  - github_pull_request
  - github_workflow_run
  
on_push:
  action:
    - trigger_ci: if_main_branch
    - notify_slack:
        channel: "#deployments"
        message: |
          šŸ“¦ *New Push to {branch}*
          
          Commit: `{commit_sha_short}`
          Author: {author}
          Message: {commit_message}
          
          [View Diff]({compare_url})

on_pr_opened:
  action:
    - notify_slack:
        channel: "#code-review"
        message: |
          šŸ”€ *New Pull Request*
          
          Title: {pr_title}
          Author: {author}
          Branch: {head} → {base}
          
          [Review PR]({pr_url})
    - assign_reviewers: based_on_codeowners
    - run_ci_checks

on_workflow_complete:
  action:
    - notify_slack:
        message: |
          {status_emoji} *Build {status}*
          
          Workflow: {workflow_name}
          Branch: {branch}
          Duration: {duration}
          
          {if_failed: [View Logs]({logs_url})}
```

### Deployment Pipeline

```yaml
deployment_pipeline:
  stages:
    build:
      trigger: push_to_main
      steps:
        - checkout_code
        - install_dependencies
        - run_tests
        - build_artifact
        - push_to_registry
        
    staging:
      trigger: build_success
      steps:
        - deploy_to_staging
        - run_integration_tests
        - notify_qa
        
    production:
      trigger: manual_approval
      steps:
        - create_backup
        - deploy_to_production
        - run_smoke_tests
        - notify_team
        
  rollback:
    trigger: deployment_failed OR manual
    steps:
      - revert_to_previous
      - notify_team
      - create_incident
```

---

## Monitoring & Alerting

### Alert Routing

```yaml
alert_routing:
  sources:
    - prometheus
    - datadog
    - cloudwatch
    - new_relic
    
  severity_levels:
    critical:
      response_time: 5_minutes
      channels: [pagerduty, slack_urgent, sms]
      escalation: immediate
      
    high:
      response_time: 15_minutes
      channels: [slack_alerts, email]
      escalation: after_15_minutes
      
    medium:
      response_time: 1_hour
      channels: [slack_alerts]
      
    low:
      response_time: 24_hours
      channels: [slack_logging]
      
  routing_rules:
    - if: service == "payments"
      team: payments_oncall
      severity_boost: +1
      
    - if: service == "auth"
      team: security_oncall
      
    - default:
      team: platform_oncall
```

### Alert Templates

```yaml
alert_templates:
  infrastructure:
    cpu_high:
      title: "šŸ”„ High CPU Usage"
      body: |
        Server: {host}
        CPU: {cpu_percent}%
        Duration: {duration}
        
        Threshold: {threshold}%
        
        [View Dashboard]({grafana_url})
        
    memory_critical:
      title: "šŸ’¾ Critical Memory"
      body: |
        Server: {host}
        Memory: {memory_percent}%
        Available: {available_mb}MB
        
        [SSH to Server]({ssh_link})
        
    disk_full:
      title: "šŸ’æ Disk Space Critical"
      body: |
        Server: {host}
        Disk: {disk_percent}%
        Available: {available_gb}GB
        
        Suggestion: Clean logs or expand volume
        
  application:
    error_spike:
      title: "šŸ“ˆ Error Rate Spike"
      body: |
        Service: {service}
        Error Rate: {error_rate}%
        Normal: {baseline}%
        
        Top Errors:
        {top_errors}
        
    latency_high:
      title: "🐢 High Latency"
      body: |
        Service: {service}
        P99 Latency: {p99_ms}ms
        Threshold: {threshold_ms}ms
```

---

## Incident Management

### Incident Workflow

```yaml
incident_workflow:
  detection:
    sources: [monitoring, user_report, automated_check]
    
  triage:
    auto_severity:
      - if: affects_payments
        severity: critical
      - if: affects_auth
        severity: critical
      - if: affects_api AND error_rate > 10%
        severity: high
        
  response:
    critical:
      - create_incident_channel: "#inc-{timestamp}"
      - page_oncall: immediately
      - notify_stakeholders: [engineering_lead, product]
      - start_war_room: zoom_link
      - create_status_page: incident
      
    high:
      - create_incident_channel
      - notify_oncall: slack
      - create_ticket: jira
      
  communication:
    internal:
      frequency: every_30_minutes
      channel: incident_channel
      template: |
        šŸ“Š *Incident Update*
        
        Status: {status}
        Impact: {impact}
        Next update: {next_update_time}
        
        Current actions:
        {action_items}
        
    external:
      channel: status_page
      template: customer_facing_update
      
  resolution:
    steps:
      - confirm_resolution
      - update_status_page: resolved
      - notify_stakeholders
      - schedule_postmortem
      - close_incident_channel: after_24h
```

### Postmortem Template

```yaml
postmortem_template:
  sections:
    summary:
      - incident_title
      - duration
      - severity
      - impact
      
    timeline:
      format: |
        | Time | Event |
        |------|-------|
        | {time} | {event} |
        
    root_cause:
      - what_happened
      - why_it_happened
      - contributing_factors
      
    impact:
      - users_affected
      - revenue_impact
      - sla_breach
      
    resolution:
      - how_it_was_fixed
      - time_to_detect
      - time_to_resolve
      
    action_items:
      format: |
        | Action | Owner | Due Date | Status |
        |--------|-------|----------|--------|
        
    lessons_learned:
      - what_went_well
      - what_went_poorly
      - lucky_breaks
```

---

## Infrastructure Automation

### Server Provisioning

```yaml
provisioning_workflow:
  trigger: jira_ticket OR slack_request
  
  steps:
    1. validate_request:
        check: [budget_approval, security_review]
        
    2. create_infrastructure:
        terraform:
          - vpc
          - security_groups
          - ec2_instances
          - load_balancer
          
    3. configure_server:
        ansible:
          - base_configuration
          - security_hardening
          - monitoring_agent
          - application_setup
          
    4. validate:
        - health_check
        - security_scan
        - performance_baseline
        
    5. notify:
        slack: "āœ… Server {hostname} is ready"
        include: [ssh_access, dashboard_link]
```

### Scheduled Maintenance

```yaml
maintenance_automation:
  tasks:
    certificate_renewal:
      schedule: "30 days before expiry"
      action:
        - request_new_cert: letsencrypt
        - deploy_cert
        - verify_ssl
        - notify: if_failure
        
    security_patching:
      schedule: "weekly"
      action:
        - check_updates
        - if_critical: immediate_patch
        - else: schedule_maintenance_window
        
    log_rotation:
      schedule: "daily"
      action:
        - rotate_logs
        - compress_old
        - upload_to_s3
        - delete_local: older_than_7_days
        
    backup_verification:
      schedule: "weekly"
      action:
        - restore_to_test_env
        - run_integrity_checks
        - report_status
```

---

## Kubernetes Automation

### K8s Workflows

```yaml
kubernetes_automation:
  deployment:
    trigger: docker_image_pushed
    steps:
      - update_manifest: with_new_image_tag
      - apply_to_staging
      - run_tests
      - if_success: apply_to_production
      
  scaling:
    trigger: metric_threshold
    rules:
      - if: cpu > 80%
        action: scale_up
        max_replicas: 10
      - if: cpu < 20%
        action: scale_down
        min_replicas: 2
        
  rollback:
    trigger: health_check_failed
    action:
      - kubectl_rollout_undo
      - notify_team
      - create_incident
```

---

## Output Example

**Request**: "Set up deployment notifications for GitHub Actions"

**Output**:

```markdown
# GitHub Actions Deployment Notifications

## n8n Workflow

```yaml
trigger: GitHub Webhook
events: [workflow_run]
```

## Notification Templates

**Build Started:**
```
šŸš€ *Deployment Started*

Branch: main
Commit: abc1234
Author: @developer
Triggered by: Push

[View Workflow](https://github.com/...)
```

**Build Success:**
```
āœ… *Deployment Successful*

Environment: Production
Duration: 3m 42s
Version: v1.2.3

Changes:
• Feature X
• Bug fix Y

[View Deployment](https://app.example.com)
```

**Build Failed:**
```
āŒ *Deployment Failed*

Stage: Test
Error: npm test failed

[View Logs](https://github.com/...)
[Retry](https://github.com/...)
```

## Slack Integration

```yaml
channel: "#deployments"
mention_on_failure: "@oncall"
thread_replies: true
```
```

---

*DevOps Automation Workflow - Part of Claude Code*
README.md

What This Does

Automate DevOps workflows including CI/CD pipelines, monitoring, incident management, and infrastructure operations. Based on n8n's IT Ops workflow templates.


Quick Start

Step 1: Create a Project Folder

mkdir -p ~/Documents/DevopsAutomation

Step 2: Download the Template

Click Download above, then:

mv ~/Downloads/CLAUDE.md ~/Documents/DevopsAutomation/

Step 3: Start Working

cd ~/Documents/DevopsAutomation
claude

$Related Playbooks

Developer Tools

Discord Bot Builder

Discord bot development - community management, moderation, notifications, and AI integration

10 minutes
Advanced
Developer Tools

Composio SDK with Claude Code: Connect 250+ APIs in Minutes

Connect Claude Code to 250+ APIs using Composio SDK. Build AI agents that send emails, create GitHub issues, and post to Slack — not just generate text.

15 minutes
Advanced
Developer Tools

Network Issue Debugging

Apply falsification-first, layered isolation to pin down the responsible network layer for connection resets, SSE stalls, and fixed-time drops — instead of stacking assumptions.

20 minutes
Advanced
Developer Tools

Database Sync Manager

Automate database synchronization, replication, migration, and cross-platform data integration

10 minutes
Advanced
Developer Tools

DevOps Server Manager

Manage servers, Docker containers, VMs, and network infrastructure through Claude Code via SSH. Keep your entire infrastructure documented in markdown files.

15 minutes
Advanced
Developer Tools

Docker Containerization

Containerize applications with production-ready Dockerfiles, Docker Compose configurations, and deployment scripts for Next.js, React, and Node.js projects.

15 minutes
Intermediate
Developer Tools

ETL Pipeline Builder

Design and automate Extract, Transform, Load data pipelines for data integration and analytics

10 minutes
Advanced
Developer Tools

Error Message Explainer — Decode Any Error in Plain English

Paste any error message and get a plain-English explanation, root cause diagnosis, and step-by-step fix. Works with Python, JavaScript, Docker, Git, and any CLI error.

5 minutes
Beginner
Developer Tools

Explanatory Coding Mode

Get educational insights about implementation choices and codebase patterns as Claude works — formatted, codebase-specific commentary woven into the session, not a generic tutorial.

2 minutes
Beginner
Developer Tools

7-Phase Feature Development Workflow

Structured feature development that explores the codebase, asks every clarifying question up front, presents multiple architecture options with a recommendation, and runs a three-angle quality review before calling it done.

5 minutes
Intermediate
Developer Tools

Frontend UX Pattern Library

Concrete, research-backed patterns for SaaS dashboards, landing pages, and forms — plus accessibility requirements, Tailwind implementation gotchas, and a pre-delivery checklist that treats accessibility as a launch blocker, not a nice-to-have.

5 minutes
Intermediate
Developer Tools

Git Commit & PR Automation

Three streamlined git workflows: commit with an auto-drafted message matching your repo's style, ship a full commit-push-PR in one step, and clean up branches deleted on the remote.

5 minutes
Beginner

Browse all Developer Tools playbooks →