Verified against ChatGPT · 2026-08-10
Design a CI workflow that fails fast, isolates flaky tests, and doesn't punish contributors for a broken shared runner
Builds a CI pipeline configuration (jobs, stages, caching, retry policy) for a real repo's constraints, plus an explicit flaky-test quarantine strategy, instead of a generic lint-test-build template that ignores how the team's tests actually behave today.
The prompt
Ready to copy — highlighted parts are example details you can swap.
Act as a senior software engineer who owns CI reliability for this team. I need a CI workflow designed for a specific repo and its specific pain points, not a generic starter template. Work through this in phases. PHASE 1 — UNDERSTAND CURRENT STATE Repo and stack: Python 3.12 monorepo, pytest with ~4,200 tests across 6 services, roughly 40 PRs merged per week Current CI provider and constraints: GitHub Actions, self-hosted runner pool of 8 machines, no budget for GitHub-hosted large runners Known pain points: Three integration tests fail intermittently about 15% of the time depending on run order, and PRs regularly get re-run 2-3 times before merging Ask me up to three clarifying questions only if something above is ambiguous enough to change the design meaningfully (for example, whether tests can run in parallel across multiple containers, or whether secrets are already in a vault). Do not ask questions you could reasonably infer. PHASE 2 — PIPELINE DESIGN Propose the stage structure (e.g., lint → unit → integration → build → deploy-gate) with what runs in parallel versus what must be sequential, and why. For each stage, specify what causes it to fail fast versus what's allowed to be non-blocking (informational only). Design a caching strategy for dependencies and build artifacts specific to the stack given, not a generic 'cache node_modules' answer — name the actual cache keys and invalidation triggers. PHASE 3 — FLAKY TEST HANDLING Given the known pain points, propose a concrete quarantine mechanism: how a flaky test gets flagged, where it's tracked, how it's prevented from blocking merges while still being visible so it doesn't get forgotten forever, and who is accountable for un-quarantining it. This must be a real, checkable process, not just 'add retries to flaky tests' — retries alone hide a flaky test's existence instead of fixing it. PHASE 4 — FAILURE MODES Name the two most likely ways this pipeline design breaks in practice (e.g., cache poisoning across branches, a shared runner pool getting starved during a release week) and what monitoring or alert would catch each one. OUTPUT FORMAT 1. Any clarifying questions (skip if none needed). 2. The pipeline stage diagram described in prose or an ordered list. 3. The actual CI config file for the provider given, in a code block. 4. The flaky-test quarantine process as a numbered procedure. 5. The two failure modes and their corresponding alerts.
Customize
Optional — swap in your own details for the highlighted parts above.
Why this works
Structuring this as sequential phases matters because CI design has a dependency chain that a single flat request tends to skip over: you cannot design a sensible quarantine mechanism before understanding what actually causes the flakiness, and you cannot pick a caching strategy without knowing the CI provider's actual constraints, so collapsing all of it into one unstructured ask produces a plausible-sounding but generic pipeline that ignores the team's real bottleneck. Naming that retries alone are not a fix directly heads off GPT-5.1's most common default answer to 'handle flaky tests,' which is to suggest a retry-on-failure wrapper — a real fix but one that, applied alone, actively makes the flakiness invisible in dashboards and removes the pressure to ever actually diagnose it, which is worse than doing nothing if the goal is reliability rather than a quieter merge queue. Asking for actual cache keys and invalidation triggers rather than 'cache dependencies' forces engagement with the specific stack's lockfile format and build tool, since a wrong cache key (for example, keyed on branch name instead of lockfile hash) silently serves stale dependencies across PRs, a bug that's expensive to diagnose precisely because CI passing gives false confidence. The failure-modes phase exists because a pipeline design reviewed only for the happy path is exactly the kind of artifact that looks complete in a PR review but has no answer for what happens during a release-week runner crunch — asking for this explicitly, and pairing each failure mode with a specific alert, converts the deliverable from a static config file into an operationally accountable design a team can actually run without surprises.
What you get back
Clarifying question: Can integration tests run against ephemeral per-PR databases, or do they share one staging DB today? Assuming shared DB based on the pain point described. Stage design: lint (parallel, fails fast) -> unit tests sharded across 4 runners (fails fast) -> integration tests (sequential, non-blocking for the 3 known-flaky tests, tracked separately) -> build -> deploy-gate (manual approval). ... [full Actions YAML and quarantine procedure follow]
Verified against
ChatGPT GPT-5.1 · 2026-08-10
Changelog
- 2026-08-10 — Initial publish, verified against ChatGPT GPT-5.1.
Need this built into your business?
If a prompt isn't enough — custom software, built and maintained for you — that's Scult's day job.
EXPLORE CUSTOM SOFTWARE
