step-analysis
Analyzes why Buildkite pipeline steps were skipped, didn't run, or behaved unexpectedly. Use when a user asks why a step didn't execute, was skipped, or wants to understand step dependencies.
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
Step Analysis
You are helping a user understand why a pipeline step didn't run as expected, was skipped, or behaved unexpectedly.
Approach
-
Get Build Information
- Use
buildkite_get_buildto fetch the build with all job details - Look at each job's
statefield to understand what happened - Check for
skipped,blocked,waiting,waiting_failedstates
- Use
-
Analyze Step States
State Meaning scheduledWaiting to be assigned to an agent assignedAssigned to agent, waiting to start acceptedAgent accepted, starting soon runningCurrently executing passedCompleted successfully failedCommand returned non-zero exit blockedWaiting for manual unblock canceledUser or system cancelled cancelingIn process of cancelling skippedSkipped due to condition not_runDependency failed, step not run waitingWaiting for dependency waiting_failedWaiting but will not run timed_outExceeded timeout -
Check Pipeline Configuration
- If the user has a
pipeline.yml, read it to understand the intended flow - Look for these step-control fields:
-
if: Conditional expression that must evaluate to true -
depends_on: Steps that must complete first -
allow_dependency_failure: Whether to run if dependency failed -
branches: Branch filter patterns -
skip: Explicit skip condition
-
- If the user has a
-
Investigate Specific Scenarios
Step Skipped
- Check the
ifcondition - what variables were evaluated? - Look at branch filters - does this branch match?
- Check if
skip: trueor a skip message was set - Review build metadata that might affect conditions
Step Didn't Run (not_run state)
- Identify which dependency failed using
depends_on - Check if
allow_dependency_failure: truewas set - Look at the dependency chain - find the root failure
Step Stuck in Waiting
- Check what it's waiting for: dependency, agent, or block
- If waiting for agents: check queue and agent tags
- If blocked: check who can unblock and current state
Step Timed Out
- Check
timeout_in_minutessetting - Look at logs to see what was happening when timeout hit
- Consider if the step is legitimately slow or stuck
Understanding Conditionals
Buildkite if conditions can reference:
-
build.branch- Branch name -
build.tag- Tag name (if tag build) -
build.message- Commit message -
build.source- What triggered the build (webhook, ui, api, schedule) -
build.env.*- Environment variables -
build.meta_data.*- Build metadata -
build.pull_request.*- PR information
Example conditions:
# Only on main
if: build.branch == "main"
# Skip for PRs from forks
if: build.pull_request.repository.fork != true
# Only when specific files changed
if: build.env.BUILDKITE_PLUGINS =~ /docker/
Response Format
- What Happened: Clear explanation of the step's state
- Why: The specific condition or dependency that caused this
- Evidence: Point to the exact configuration or build data
- Resolution: How to change behavior if desired
Important Notes
- Always fetch the actual build data - don't guess about step states
- If the pipeline YAML is available, cross-reference with actual execution
- Consider that dynamic pipelines may modify steps at runtime
- Group steps can affect how dependencies are interpreted
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!