Prompt Pack: debug a broken CI run without panic

CIDebuggingPrompt PackDevOps

A practical Prompt Pack for debugging a red CI run: collect logs, find the first failing step, separate code issues from environment drift, and choose the next useful check

Prompt Pack: debug a broken CI run without panic

Picture the common post-merge moment: the PR is merged, the pipeline turns red, and the logs feel like a wall of noise. This is the point where guessing becomes the real problem.

This Prompt Pack helps you slow down, collect facts, and move to the next useful probe without spiraling. It is meant for cases where you need to figure out:

  • which job failed first;
  • where the first real error appears;
  • whether the behavior differs locally and in CI;
  • what to check next so you do not circle the same issue twice.

When this is especially useful

  • the pipeline broke right after a merge;
  • the failure looks like infrastructure, but it might be code;
  • there are several jobs and the real root cause is not obvious;
  • the team has seen flaky tests or local-versus-CI differences before.

What to gather before asking AI

Before you ask for help, gather a short fact set:

  • repository and branch name;
  • commit SHA or merge request;
  • the first job that failed;
  • the exact error text;
  • whether there is a last green build;
  • whether the problem can be reproduced locally;
  • what changed in code, dependencies, or environment variables.

The better the context, the less likely you are to get a generic “check the logs” reply.

How to read the answer

Look for practical signal, not a polished theory:

  • if the model names a specific step, inspect that step first;
  • if local and CI diverge, that becomes a separate hypothesis;
  • if the answer asks for more logs, gather exactly those logs;
  • if the failure smells flaky, do not jump straight into a large refactor before a repeat run.

Mini glossary

  • CI: the automated build and test run that happens after changes.
  • flaky test: a test that fails intermittently without a stable cause.
  • environment drift: a difference between the local environment and CI.
  • first failing step: the first point where the chain breaks, not just the last red line.

Who this is not for

If you already know the exact root cause, this Prompt Pack is too broad. It is meant for the stage where the run is red, but the reason is still unclear.

Quick checklist

  • Find the first failed job.
  • Copy the exact error text.
  • Compare the last commit with the last green build.
  • Check whether the failure reproduces locally.
  • Decide whether the failure looks like code, CI environment, or test instability.

Debug a broken CI run without guessing

Help me debug a broken CI run. Context: - Repository: [insert] - Branch / merge request: [insert] - Commit SHA: [insert] - First failed job: [insert] - First error or exact log fragment: [insert] - What changed in the last commit: [insert] - Last successful run: [yes/no] - Reproduces locally: [yes/no/not sure] - What I already checked: [insert] Do this: 1. Briefly explain where the problem starts. 2. Separate a likely code issue from an environment issue or flaky test. 3. Tell me the single next step that will give the most signal. 4. If needed, give 2-3 short checks in priority order. 5. Do not invent details that are not in the logs.