Back to list
mikeastock

fetching-buildkite-failures

by mikeastock

2🍴 0📅 Jan 24, 2026

SKILL.md


name: fetching-buildkite-failures description: Use when CI fails on Buildkite and you need to diagnose and fix failures - fetches build results for current branch, extracts errors from logs, and helps fix them

Fetching Buildkite Failures

Overview

Diagnose and fix CI failures by fetching build results from Buildkite, extracting actionable error information, and suggesting fixes.

Prerequisites

Environment variables must be set:

  • BUILDKITE_API_TOKEN - Buildkite API token with read access
  • BUILDKITE_ORGANIZATION_SLUG - Organization slug (e.g., buildr)

Workflow

digraph workflow {
    rankdir=TB;
    node [shape=box];
    
    fetch [label="1. Run fetch script"];
    check [label="2. Check for failures" shape=diamond];
    passed [label="Report: Build passed!"];
    read [label="3. Read failing source files"];
    present [label="4. Present failures + proposed fixes"];
    ask [label="5. Ask: Apply fix?" shape=diamond];
    apply [label="Apply the fix"];
    complex [label="Complex failure?" shape=diamond];
    debug [label="Use systematic-debugging skill"];
    next [label="Next failure?" shape=diamond];
    done [label="Done"];
    
    fetch -> check;
    check -> passed [label="passed"];
    check -> read [label="failed"];
    read -> present;
    present -> ask;
    ask -> apply [label="yes"];
    ask -> complex [label="no"];
    apply -> next;
    complex -> debug [label="yes"];
    complex -> next [label="no"];
    debug -> next;
    next -> read [label="yes"];
    next -> done [label="no"];
}

Quick Reference

Fetch failures for current branch:

python {baseDir}/scripts/fetch_buildkite_failures.py

Fetch specific build:

python {baseDir}/scripts/fetch_buildkite_failures.py --build 1723

Fetch different branch:

python {baseDir}/scripts/fetch_buildkite_failures.py --branch main

Step-by-Step Process

1. Fetch Build Failures

Run the script to get structured JSON output:

python {baseDir}/scripts/fetch_buildkite_failures.py

The script outputs JSON with:

  • Build info (number, branch, state, URL)
  • Failed jobs with extracted errors
  • Summary counts by error type

2. For Each Failure

Read the relevant source file to understand context:

  • For test failures: read the test file at the indicated line
  • For lint errors: read the source file at the indicated line
  • For TypeScript errors: read the file and understand the type issue

3. Present Findings and Propose Fix

Show the user:

  • What failed (test name, file, line)
  • Error message
  • Proposed fix based on the error

4. Ask User What To Do

Use the question tool to ask:

"How would you like to proceed with this failure?"
Options:
- "Apply the suggested fix"
- "Investigate further before fixing"
- "Skip this failure"
- "Use systematic-debugging for deeper investigation"

5. Complex Failures

If the failure requires deeper investigation (e.g., unclear root cause, flaky test, environmental issue), recommend the systematic-debugging skill.

Error Types Detected

TypeDetectionCommon Fixes
Test failureMinitest/RSpec failure outputFix assertion, update expected value, fix test setup
Lint errorRubocop/Biome violationsAuto-fix with rubocop -a or pnpm biome:fix
TypeScriptTSC compilation errorsAdd types, fix type mismatches
DatabaseActiveRecord errorsRun migrations, fix schema

Common Mistakes

MistakeSolution
Missing env varsSet BUILDKITE_API_TOKEN and BUILDKITE_ORGANIZATION_SLUG
Wrong branchUse --branch flag or check git branch --show-current
Build still runningWait for completion or check partial results
Rate limitingWait and retry

Integration with Other Skills

  • systematic-debugging: Use for complex failures requiring root cause analysis
  • test-driven-development: After fixing, ensure tests follow TDD principles
  • verification-before-completion: Run tests locally before pushing fix

Score

Total Score

50/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon