build-debugging
Analyzes failed Buildkite builds to identify root causes. Use when a user asks why a build failed, wants to understand build errors, or needs help fixing CI failures.
Installation
Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.
View source ↗GuidesSkill instructions
Build Debugging
You are helping debug a failed Buildkite build. Your goal is to identify the root cause and provide actionable guidance.
Approach
-
Get Build Context
- Use
buildkite_get_buildto fetch the build details - Note the build state, branch, commit, and any metadata
- Check if this is a retry or first attempt
- Use
-
Identify Failed Jobs
- Look at the jobs array in the build response
- Find jobs with
state: "failed"orstate: "timed_out" - Note the job names/labels to understand what failed
-
Analyze Logs
- Use
buildkite_read_logsto get the full log output for failed jobs - Look for error messages, stack traces, or failure indicators
- Pay attention to the last 50-100 lines where failures typically surface
- Use
-
Check Test Results
- Use
buildkite_get_build_test_engine_runsto see if Test Engine captured results - If tests failed, use
buildkite_get_failed_test_executionsfor details - Look for patterns: flaky tests, environment issues, code changes
- Use
-
Review Artifacts
- Use
buildkite_list_artifacts_for_buildto see what artifacts were uploaded - Look for test reports, coverage data, or debug outputs
- Use
buildkite_get_artifactto download relevant files for analysis
- Use
Common Failure Patterns
Exit Code Failures
- Exit code 1: General error - check command output
- Exit code 127: Command not found - missing dependency or PATH issue
- Exit code 137: OOM killed (128 + 9) - increase memory or optimize
- Exit code 143: SIGTERM (128 + 15) - timeout or cancelled
Test Failures
- Flaky tests: Check if same test passed on retry
- Environment differences: Compare agent tags, environment variables
- Timing issues: Look for race conditions or async problems
Infrastructure Issues
- Agent disconnected: Network or agent health problem
- Timeout: Job exceeded
timeout_in_minutes - No agents available: Check agent tags and queue configuration
Response Format
Provide your analysis in this structure:
- Summary: One-line description of what failed
- Root Cause: What actually caused the failure
- Evidence: Relevant log snippets or data points
- Recommendation: Specific steps to fix the issue
- Prevention: How to avoid this in the future (if applicable)
Important Notes
- Always check logs before speculating about causes
- Look for the FIRST error, not just the last - cascading failures are common
- Consider recent changes to the pipeline or codebase
- If the failure seems infrastructure-related, suggest checking Buildkite status
Examples
Read the usage examples in the source repository.
View source ↗Source history
- Indexed on
- 2026-01-20
- Index updated
- 2026-01-26
- Branch
- main
Index and sync dates describe this directory. View the source repository for code history.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!