gh-aw-troubleshooting
Skill4 starsChanged 6 months agoMITView on GitHub
Diagnose and fix GitHub Agentic Workflows (gh-aw) failures by analyzing logs for missing tools, permissions, or MCP server configurations.
- Reads credentials
In this repository124 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/AGENTS.mdAGENTS.md
- .github/workflows/AGENTS.mdAGENTS.md
- .vscode/AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- agent-log-analysisSkill
- agent-mdSkill
- agent-md-writerSkill
- agent-skill-md-writerSkill
- agentskillsSkill
- agents-md-writerSkill
- ai-prompt-writerSkill
- ansibleSkill
- apache-airflow-apiSkill
- apache-airflow-dagsSkill
- astro-cliSkill
- astronomer-docsSkill
- awesome-copilotSkill
- brainstorm-agent-runsSkill
- brainstorm-github-prSkill
- brainstormSkill
- catSkill
- chrome-devtoolsSkill
- claude-docsSkill
- codeqlSkill
- code-reviewSkill
- code-tourSkill
- coding-standard-writerSkill
- context-aware-opsSkill
- copilot-cliSkill
- copilot-docsSkill
- critical-thinkingSkill
- datadog-agentSkill
- datadog-apiSkill
- datadog-mcpSkill
- datadog-monitorsSkill
- datadog-pulumiSkill
- devcontainerSkill
- dictationSkill
- direnvSkill
- dockerfileSkill
- dockerSkill
- docs-reviewSkill
- docs-writerSkill
- dot-claudeSkill
- dotfilesSkill
- dot-githubSkill
- editorconfigSkill
- fact-writerSkill
- gdpr-compliantSkill
- gh-agent-taskSkill
- gh-apiSkill
- gh-aw-compileSkill
- gh-aw-firewall-debugSkill
- gh-aw-firewallSkill
- gh-aw-newSkill
- gh-awSkill
- gh-codespaceSkill
- gh-issueSkill
- gh-modelsSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
24 rules. About 0 are common, 5 are distinctive, and 19 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
19
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
When a GitHub Agentic Workflow run fails and requires root-cause analysis.
- Very specific: line 17
When an agent's safe-outputs configuration is rejecting intended file writes or API calls.
- Distinctive: line 22
When editing the conversational prompt text inside the markdown file without changing the YAML frontmatter constraints (this rarely causes …
- Very specific: line 36
Check the missing_tools array in the audit output.
- Very specific: line 41
Verify Configuration: Run gh aw mcp inspect <workflow-name> to check active MCP server settings and toolsets.
- Distinctive: line 42
Apply Fix: Update the workflow's YAML frontmatter or prompt instructions.
- Very specific: line 43
Recompile & Test: Run gh aw compile <workflow-name> and trigger a run with gh aw run <workflow-name> to verify the fix.
- Distinctive: line 97
Observe: Check the workflow run summary in the GitHub Actions UI for immediate failure signals.
- Very specific: line 98
Audit: Run gh aw audit RUN_ID for a structured breakdown of the root cause.
- Very specific: line 101
Validate: Run gh aw compile to ensure frontmatter schema and syntax are correct.
- Very specific: line 117
Fix: Add the missing MCP server to tools:, verify config with gh aw mcp inspect, increase startup-timeout, or recompile to sync with latest …
- Very specific: line 130
Fix: Add the blocked domain to the allowlist (refer to firewall.md from --parse).
- Very specific: line 136
Fix: Ensure safe-outputs: is correctly configured and permissions (e.g., issues: read) are granted.
- Very specific: line 167
Fix: Use gh aw compile --verbose to find schema errors and regenerate the lock file.
- Very specific: line 175
Check missing_tools array in audit output.
- Very specific: line 178
Review Agent Logs: Check logs/run-<run-id>/agent-stdio.log for reasoning and errors.
- Very specific: line 190
Verify Trigger: Ensure workflow_dispatch is present in on:.
- Very specific: line 192
Poll Audit Results: Use gh aw audit <run-id> --json in a loop until terminal status (completed, failure, cancelled).
- Very specific: line 196
Verify Version: Run gh extension list | grep 'github/gh-aw' to retrieve the installed gh aw version, then ensure it is not in the retired …
- Very specific: line 197
Check Logs: Look for Error: Tool '...' not found or Error: 403.
- Very specific: line 198
Inspect MCP: Ensure gh aw mcp inspect shows the expected toolsets.
- Very specific: line 199
Validate Triggers: Ensure mcp-scripts maps the correct event payload fields.
- Very specific: line 200
Check Recompilation: Verify the .lock.yml timestamp matches your last edit.
- Distinctive: line 206
Least Privilege: Only add the specific permissions required for the failing operation.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
gh-aw-troubleshooting
<!-- markdownlint-disable MD013 MD023 MD031 MD032 -->Diagnose, troubleshoot, and fix failing GitHub Agentic Workflows by analyzing logs, verifying MCP configurations, and correcting frontmatter.
When to Use
- When a GitHub Agentic Workflow run fails and requires root-cause analysis.
- To diagnose
401 Unauthorized, missing tools, or firewall egress blocks in an agent session. - When an agent's
safe-outputsconfiguration is rejecting intended file writes or API calls.
When Not to Use
- For debugging standard CI/CD pipelines (like unit tests or linters) that do not involve
gh-awagents (usegithub-actionsinstead). - When editing the conversational prompt text inside the markdown file without changing the YAML frontmatter constraints (this rarely causes structural failures).
- For troubleshooting standard GitHub CLI authentication issues unrelated to Agentic Workflows.
Common Pitfalls
- Ignoring the Firewall: Assuming a network call failed due to code errors, rather than checking the
network.allowedlist in the frontmatter which strictly blocks unapproved domains. - Missing Recompilation: Editing the
.mdworkflow file but forgetting to rungh aw compile, meaning the actual executed GitHub Actions.lock.ymlremains unchanged and still fails. - Over-Permissive Fixes: "Fixing" a permissions error by granting
write-allto the GitHub token instead of carefully mapping the exact minimum required scope insafe-outputs.
Core Process
- Extract Run ID: Parse the workflow run URL (e.g.,
https://github.com/*/actions/runs/<run-id>) to identify the{run-id}. - Audit the Run: Execute
gh aw audit <run-id> --jsonto download artifacts and generate a diagnostic report. - Analyze Missing Tools:
- Check the
missing_toolsarray in the audit output. - Review
safe_outputs.jsonlfor attempted tool calls. - Compare against the workflow's
tools:andsafe-outputs:configuration.
- Check the
- Review Agent Logs: Inspect
logs/run-<run-id>/agent-stdio.logfor the agent's reasoning and specific error messages. - Identify Root Cause: Determine if the failure is due to missing
tools, incorrectpermissions,mcp-scriptsmismatches, orsafe-outputsconfiguration errors. - Verify Configuration: Run
gh aw mcp inspect <workflow-name>to check active MCP server settings and toolsets. - Apply Fix: Update the workflow's YAML frontmatter or prompt instructions.
- Recompile & Test: Run
gh aw compile <workflow-name>and trigger a run withgh aw run <workflow-name>to verify the fix.
Key Commands
gh aw audit <run-id> [--json]→ investigate a specific run or diff multiple runsgh aw logs [workflow-name] --json→ download and analyze workflow logsgh aw checks→ classify CI check stategh aw compile [--strict]→ validate workflow syntaxgh aw run <workflow-name>→ run a workflow (requires workflow_dispatch)gh aw status→ show status of agentic workflows in the repositorygh aw health→ show health overview of all workflows in the repositorygh aw mcp inspect <workflow-name>→ check active MCP server settings
Mindmap of Debug Commands
mindmap
root((gh aw debug))
audit
Investigate runs
logs
Analyze logs
checks
Classify CI state
health
Workflow health
status
Workflow status
mcp inspect
Active settingsManual Debugging with CLI Commands
Audit a specific run
gh aw audit RUN_ID→ human-readable summarygh aw audit RUN_ID --json→ machine-readable diagnostic outputgh aw audit RUN_ID --parse→ writes detailedlog.mdandfirewall.mdreports
The audit report covers: failure summary, tool usage, MCP server health, firewall analysis, token metrics, and missing tools.
Analyze logs across multiple runs
gh aw logs my-workflow→ basic log analysisgh aw logs my-workflow --format markdown --count 10→ markdown report of last 10 runsgh aw logs --filtered-integrity→ analysis restricted to runs with DIFC-filtered events
Compare two runs for regressions
gh aw audit BASELINE_ID CURRENT_ID→ multi-dimensional diff of metrics, tooling, and behavior
Iterative Debug Workflow
- Observe: Check the workflow run summary in the GitHub Actions UI for immediate failure signals.
- Audit: Run
gh aw audit RUN_IDfor a structured breakdown of the root cause. - Consult Agent: For complex issues, use
/agent agentic-workflowsin Copilot Chat to analyze artifacts. - Fix: Edit the
.mdworkflow file based on findings. - Validate: Run
gh aw compileto ensure frontmatter schema and syntax are correct. - Execute: Trigger a new run (e.g.,
gh aw run <workflow-name>). - Verify: Compare the new run against the baseline with
gh aw audit BASELINE_ID NEW_ID.
Common Failure Patterns & Fixes
Authentication & Authorization
- Error:
401 UnauthorizedorAuthentication failed. - Cause: Missing or expired
COPILOT_TOKENorOPENAI_API_KEY. - Fix: Rotate secrets or check organization policy for Copilot access.
Missing Tools & MCP Connectivity
- Error:
Tool '...' not foundorinitialize: timeout. - Cause: Tool missing from
tools:section, server timeout, or schema mismatch. - Fix: Add the missing MCP server to
tools:, verify config withgh aw mcp inspect, increasestartup-timeout, or recompile to sync with latest MCP gateway schema.
Example fix for missing github tools:
tools:
github:
toolsets: [default]Network & Firewall Restrictions
- Error:
blocked egress to domain:443. - Cause: Domain not included in
network.allowedlist in frontmatter. - Fix: Add the blocked domain to the allowlist (refer to
firewall.mdfrom--parse).
Safe-Outputs & Permissions
- Error:
Write operations failorsafeoutputs nooppermission denied. - Cause: Missing
permissions:, or attempting to use bash for operations that requiresafe-outputs. - Fix: Ensure
safe-outputs:is correctly configured and permissions (e.g.,issues: read) are granted. Preferreadpermissions combined withsafe-outputsfor mutations.
Example safe-outputs configuration:
permissions:
issues: read
safe-outputs:
jobs:
create-issue:
labels: ["bug"]MCP Scripts & Payload Mapping
- Error: "missing tool configuration for mcpscripts-gh" or resource creation failures.
- Cause:
mcp-scriptsdoes not correctly map event payload fields. - Fix: Correct the mapping in the frontmatter.
Example mapping:
mcp-scripts:
issue:
number: ${{ github.event.issue.number }}
title: ${{ github.event.issue.title }}Compilation & Schema
- Error: Fields silently ignored or
Schema validation failed. - Cause: Misspelled fields (silently discarded!) or outdated
.lock.yml. - Fix: Use
gh aw compile --verboseto find schema errors and regenerate the lock file.
Debug Flows
Workflow Run URL Analysis
- Audit:
gh aw audit <run-id> --json. - Analyze Missing Tools:
- Check
missing_toolsarray in audit output. - Review
safe_outputs.jsonlartifact. - Common scenarios: Incorrect tool name (e.g., calling
safeoutputs-create_issueinstead ofcreate_issue), tool not intools:section, safe-output not enabled, name mismatch (underscores vs hyphens).
- Check
- Review Agent Logs: Check
logs/run-<run-id>/agent-stdio.logfor reasoning and errors.
Analyze Existing Logs
- Download Logs:
gh aw logs <workflow-name> --json. - Token Usage Data:
- Per-request detail:
firewall-audit-logsartifact (api-proxy-logs/token-usage.jsonl). - Aggregated summary:
agentartifact (agent_usage.json).
- Per-request detail:
- Analyze: Identify errors, patterns, token usage, and execution time.
Run and Audit
- Verify Trigger: Ensure
workflow_dispatchis present inon:. - Run:
gh aw run <workflow-name>. - Poll Audit Results: Use
gh aw audit <run-id> --jsonin a loop until terminal status (completed,failure,cancelled).
Investigation Steps
- Verify Version: Run
gh extension list | grep 'github/gh-aw'to retrieve the installedgh awversion, then ensure it is not in the retired range[0.68.4, 0.71.3]. If it is, rungh extension upgrade aw. - Check Logs: Look for
Error: Tool '...' not foundorError: 403. Usegh aw audit <run-id> --jsonfor detailed insights. - Inspect MCP: Ensure
gh aw mcp inspectshows the expected toolsets. - Validate Triggers: Ensure
mcp-scriptsmaps the correct event payload fields. - Check Recompilation: Verify the
.lock.ymltimestamp matches your last edit.
Core Principles & Safety
- Frontmatter Focused: Most failures originate in the YAML frontmatter. Always check
permissions:,tools:,mcp-scripts:, andsafe-outputs:. - Compile Mandatory: Any change to
.mdworkflow files MUST be recompiled usinggh aw compile. - Least Privilege: Only add the specific permissions required for the failing operation.
- Inside Workflows: To run
gh aw logswithin a workflow, addactions: readpermission and install the extension viasetup-cli.
References
- Upstream Debug Prompt
- gh-aw Runbook
- Official gh-aw Repo
- Debugging Agentic Workflows
- Maintaining Repositories with Agentic Workflows
Related Skills
- gh-aw: Core CLI commands for repository automation.
- github-aw: Guidance on incremental workflow updates and prompt engineering.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

