VibeRune
Commands/cicd

/cicd:analyze

CI/CD Pipeline Analysis

/cicd:analyze

Claude Code

Agent: devops-engineer Skills: cicd-automation

/cicd:analyze - CI/CD Pipeline Analysis

Analyze GitHub Actions failures and identify root causes.

Usage

/cicd:analyze [run-id|url]
/cicd:analyze                    - Analyze most recent failed run
/cicd:analyze 12345678           - Analyze specific run ID
/cicd:analyze https://github.com/owner/repo/actions/runs/12345678

Execution Steps

1. Identify Target Run

# If no run specified, get most recent failure
gh run list --status failure --limit 1 --json databaseId,name,conclusion,headBranch

# If URL provided, extract run ID
# https://github.com/owner/repo/actions/runs/12345678 → 12345678

2. Fetch Run Details

# Get run information
gh run view <run-id> --json name,status,conclusion,jobs,startedAt,updatedAt

# Get failed job logs
gh run view <run-id> --log-failed

# Download artifacts if needed
gh run download <run-id> -D /tmp/artifacts

3. Analyze Failure

Parse logs for common patterns:

PatternLikely Cause
ENOSPCDisk space exhausted
ENOMEMMemory limit exceeded
npm ERR! 404Package not found
error: failed to pushGit push conflict
exit code 137OOM killed
timeoutStep exceeded time limit
Permission deniedMissing secrets/permissions

4. Generate Analysis Report

## CI/CD Failure Analysis

### Run Information
- **Workflow**: {workflow-name}
- **Run ID**: {run-id}
- **Branch**: {branch}
- **Triggered By**: {actor}
- **Failed At**: {timestamp}

### Failed Job
- **Job**: {job-name}
- **Step**: {step-name}
- **Duration**: {time}

### Root Cause
{identified-issue}

### Error Log (Relevant Section)

{error-log-snippet}


### Recommended Fix
1. {fix-step-1}
2. {fix-step-2}

### Similar Past Failures
- {link-to-similar-issue}

Agent Configuration

agent: devops-engineer
skills:
  - cicd-automation
confirmation: none  # Read-only analysis

Common Fixes Reference

Disk Space

- name: Free disk space
  run: |
    sudo rm -rf /usr/share/dotnet
    sudo rm -rf /opt/ghc

Memory Issues

env:
  NODE_OPTIONS: --max-old-space-size=4096

Flaky Tests

- name: Run tests with retry
  uses: nick-fields/retry@v2
  with:
    max_attempts: 3
    command: npm test

On this page