DE

debugging-workflows

This skill processes GitHub Actions logs to diagnose workflow failures and performance bottlenecks.

Install

mkdir -p .claude/skills/debugging-workflows && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/3224" && unzip -o skill.zip -d .claude/skills/debugging-workflows && rm skill.zip

Installs to .claude/skills/debugging-workflows

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Debug gh-aw workflows using run logs, audits, and failure triage.
65 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Download workflow run logs and artifacts
  • Audit specific GitHub Actions workflow runs
  • Generate JSON summaries of workflow performance
  • Parse agent logs into Markdown reports
  • Visualize tool usage with Mermaid graphs

How it works

The skill interfaces with the GitHub CLI to fetch run artifacts and logs, then processes them to generate diagnostic reports and performance summaries.

Inputs & outputs

You give it
GitHub Actions run ID or URL
You get back
Audit report containing error logs, tool usage, and execution metrics

When to use debugging-workflows

  • Downloading logs for failed workflow runs
  • Auditing specific GitHub Actions executions
  • Identifying bottlenecks in agentic workflows
  • Troubleshooting workflow configuration issues

About this skill

Debugging GitHub Agentic Workflows

Use this guide to debug GitHub Agentic Workflows: download and analyze logs, audit runs, and trace workflow behavior.

Table of Contents

Quick Start

Download Logs from Recent Runs

# Download logs from the last 24 hours
gh aw logs --start-date -1d -o /tmp/workflow-logs

# Download logs for a specific workflow
gh aw logs weekly-research --start-date -1d

# Download logs with JSON output for programmatic analysis
gh aw logs --json

Audit a Specific Run

# Audit by run ID
gh aw audit 1234567890

# Audit from a GitHub Actions URL
gh aw audit https://github.com/owner/repo/actions/runs/1234567890

# Audit with JSON output
gh aw audit 1234567890 --json

Downloading Workflow Logs

The gh aw logs command downloads workflow run artifacts and logs from GitHub Actions for analysis.

Basic Usage

# Download logs for all workflows (last 10 runs)
gh aw logs

# Download logs for a specific workflow
gh aw logs <workflow-name>

# Download with custom output directory
gh aw logs -o ./my-logs

Filter Options

# Filter by date range
gh aw logs --start-date 2024-01-01 --end-date 2024-01-31
gh aw logs --start-date -1w                    # Last week
gh aw logs --start-date -1mo                   # Last month

# Filter by AI engine
gh aw logs --engine copilot
gh aw logs --engine claude
gh aw logs --engine codex

# Filter by count
gh aw logs -c 5                                # Last 5 runs

# Filter by branch/tag
gh aw logs --ref main
gh aw logs --ref feature-xyz

# Filter by run ID range
gh aw logs --after-run-id 1000 --before-run-id 2000

# Filter firewall-enabled runs
gh aw logs --firewall                          # Only firewall-enabled
gh aw logs --no-firewall                       # Only non-firewall

Output Options

# Generate JSON summary
gh aw logs --json

# Parse agent logs and generate Markdown reports
gh aw logs --parse

# Generate Mermaid tool sequence graph
gh aw logs --tool-graph

# Set download timeout
gh aw logs --timeout 300                       # 5 minute timeout

Downloaded Artifacts

When you run gh aw logs, the following artifacts are downloaded for each run:

FileDescription
aw_info.jsonEngine configuration and workflow metadata
safe_output.jsonlAgent's final output content (when non-empty)
agent_output/Agent logs directory
agent-stdio.logAgent standard output/error logs
aw.patchGit patch of changes made during execution
workflow-logs/GitHub Actions job logs (organized by job)
summary.jsonComplete metrics and run data for all runs

Example: Analyze Recent Failures

# Download failed runs from last week
gh aw logs --start-date -1w -o /tmp/debug-logs

# Check the summary for patterns
cat /tmp/debug-logs/summary.json | jq '.runs[] | select(.conclusion == "failure")'

Auditing Specific Runs

The gh aw audit command investigates a single workflow run in detail, downloading artifacts, detecting errors, and generating a report.

Basic Usage

# Audit by numeric run ID
gh aw audit 1234567890

# Audit from GitHub Actions URL
gh aw audit https://github.com/owner/repo/actions/runs/1234567890

# Audit from job URL (extracts first failing step)
gh aw audit https://github.com/owner/repo/actions/runs/1234567890/job/9876543210

# Audit from job URL with specific step
gh aw audit https://github.com/owner/repo/actions/runs/1234567890/job/9876543210#step:7:1

Output Options

# JSON output for programmatic analysis
gh aw audit 1234567890 --json

# Custom output directory
gh aw audit 1234567890 -o ./audit-reports

# Parse agent logs and firewall logs
gh aw audit 1234567890 --parse

# Verbose output
gh aw audit 1234567890 -v

Audit Report Contents

The audit command provides:

  • Error Detection: Errors and warnings from workflow logs
  • MCP Tool Usage: Statistics on tool calls by the AI agent
  • Missing Tools: Tools the agent tried to use but weren't available
  • Execution Metrics: Duration, token usage, and cost information
  • Safe Output Analysis: What GitHub operations were attempted

Example: Investigate a Failed Run

# Get detailed audit report
gh aw audit 1234567890 --json > audit.json

# Extract key information
cat audit.json | jq '{
  status: .status,
  conclusion: .conclusion,
  errors: .errors,
  missing_tools: .missing_tools,
  tool_usage: .tool_usage
}'

How Agentic Workflows Work

Understanding the workflow architecture helps in debugging.

Workflow Structure

Agentic workflows use a markdown + YAML frontmatter format:

---
on:
  issues:
    types: [opened]
permissions:
  issues: write
timeout-minutes: 10
engine: copilot
tools:
  github:
    mode: remote
    toolsets: [default]
safe-outputs:
  create-issue:
    labels: [ai-generated]
---

# Workflow Title

Natural language instructions for the AI agent.

Use GitHub context like ${{ github.event.issue.number }}.

Execution Flow

1. Trigger Event (issue opened, PR created, schedule, etc.)
     ↓
2. Activation Job
   - Validates permissions
   - Processes mcp-scripts
   - Sanitizes context
     ↓
3. AI Agent Job
   - Loads MCP servers and tools
   - Executes AI agent with prompt
   - Agent makes tool calls
   - Agent produces output
     ↓
4. Safe Outputs Job
   - Processes agent output
   - Creates GitHub resources (issues, PRs, etc.)
   - Applies labels, comments
     ↓
5. Completion
   - Workflow summary generated
   - Artifacts uploaded

Key Components

ComponentPurposeConfiguration
EngineAI model to useengine: copilot, claude, codex
ToolsAPIs available to agenttools: section with MCP servers
MCP ScriptsContext passed to agentmcp-scripts: with GitHub expressions
Safe-OutputsResources agent can createsafe-outputs: with allowed operations
PermissionsGitHub token permissionspermissions: block
NetworkAllowed network accessnetwork: with domain/ecosystem lists

Compilation Process

# Compile workflow to GitHub Actions YAML
gh aw compile <workflow-name>

# Result: .github/workflows/<name>.md → .github/workflows/<name>.lock.yml

The .lock.yml file is the actual GitHub Actions workflow that runs.

Common Issues and Solutions

Missing Tool Errors

Symptoms:

  • Error: "Tool 'github:read_issue' not found"
  • Agent cannot access GitHub APIs

Solution: Add GitHub MCP server configuration:

tools:
  github:
    mode: remote
    toolsets: [default]

Permission Errors

Symptoms:

  • HTTP 403 (Forbidden) errors
  • "Resource not accessible" errors

Solution: Add required permissions:

permissions:
  contents: read
  issues: write
  pull-requests: write

Safe-Input Errors

Symptoms:

  • "missing tool configuration for mcpscripts-gh"
  • Environment variable not available

Solution: Configure mcp-scripts:

mcp-scripts:
  issue:
    script: |
      return { title: process.env.ISSUE_TITLE, body: process.env.ISSUE_BODY };
    env:
      ISSUE_TITLE: ${{ github.event.issue.title }}
      ISSUE_BODY: ${{ github.event.issue.body }}

Safe-Output Errors

Symptoms:

  • Agent tries to create resources but fails
  • "Safe output not enabled" errors

Solution: Enable safe-outputs:

safe-outputs:
  staged: false  # Set to false to actually create resources
  create-issue:
    labels: [ai-generated]

Cascading Safe-Output Message Failures (Process Safe Outputs step)

Symptoms:

  • Process Safe Outputs reports multiple failed messages in one run
  • One failed update_pull_request message includes a 403 workflows-permission warning
  • Other failed messages (for example add_comment) include Bad credentials

What this means:

  • Do not assume all safe-output failures share one root cause.
  • A 403 workflows-permission error on update_pull_request can be expected/non-fatal in some workflows.
  • A 401-style Bad credentials error on other messages is a separate authentication failure that needs its own fix.

Diagnostic steps:

# Summarize failed safe-output messages and types
gh aw audit <run-id>

# Include additional artifacts when diagnosis needs more context
gh aw audit <run-id> --artifacts usage,github-api,mcp,agent

# Escalate to full artifact collection for hard-to-classify failures
gh aw audit <run-id> --artifacts all

# Inspect full failing job logs to classify each message failure
gh run view <run-id> --job=<job-id> --log
  • Triage each failed message by its own HTTP status code and tool/action name.
  • Check permissions: for missing scopes when 403 errors appear.
  • Compare the "failed message count" against the individual failed message lines to confirm whether there are multiple independent failures.
  • If several credential failures cluster together in time, investigate token freshness/expiry and token source for the run.

Network Access Errors

Symptoms:

  • Firewall denials
  • URLs appearing as "(redacted)"

Solution: Configure network access:

network:
  allowed:
    - defaults
    - python    # For PyPI
    - node      # For npm
    - "api.example.com"  # Custom domains

Timeout Errors

Symptoms:

  • Workflow exceeds time limit
  • Agent loops or hangs

Solution: Increase timeout or optimize prompt:

timeout-minutes: 30  # Increase from default

Advan


Content truncated.

When not to use it

  • Debugging non-GitHub Actions workflows
  • Modifying workflow configuration files directly

Prerequisites

GitHub CLI (gh) installedGitHub repository access

Limitations

  • Requires active GitHub Actions workflow runs
  • Limited to GitHub-hosted workflow logs

How it compares

Unlike manual log inspection, this skill automates the collection and parsing of agent-specific artifacts like safe_output.jsonl and tool usage metrics.

Compared to similar skills

debugging-workflows side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
debugging-workflows (this skill)13moReviewIntermediate
sentry-release-management127dCautionIntermediate
analyzing-logs1427dReviewBeginner
service-mesh-observability52moNo flagsAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

sentry-release-management

jeremylongshore

Manage Sentry releases and associate commits. Use when creating releases, tracking commits, or managing release artifacts. Trigger with phrases like "sentry release", "sentry commits", "manage sentry versions", "sentry release workflow".

15

analyzing-logs

jeremylongshore

Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.

14123

service-mesh-observability

wshobson

Implement comprehensive observability for service meshes including distributed tracing, metrics, and visualization. Use when setting up mesh monitoring, debugging latency issues, or implementing SLOs for service communication.

574

sentry

openai

Use when the user asks to inspect Sentry issues or events, summarize recent production errors, or pull basic Sentry health data via the Sentry API; perform read-only queries with the bundled script and require `SENTRY_AUTH_TOKEN`.

1048

obsidian-incident-runbook

jeremylongshore

Troubleshoot Obsidian plugin failures with systematic incident response. Use when plugins crash, data is corrupted, or users report critical issues with your Obsidian plugin. Trigger with phrases like "obsidian crash", "obsidian plugin broken", "obsidian incident", "debug obsidian failure", "obsidian emergency".

346

gh-fix-ci

openai

Use when a user asks to debug or fix failing GitHub PR checks that run in GitHub Actions; use `gh` to inspect checks and logs, summarize failure context, draft a fix plan, and implement only after explicit approval. Treat external providers (for example Buildkite) as out of scope and report only the details URL.

1234

Search skills

Search the agent skills registry