GitLab CI/CD Pipeline Critical Path Analysis Prompt
Map a slow pipeline's job dependency graph to find the true critical path, then restructure stages and needs so wall-clock time drops without dropping coverage.
- Target user
- Engineers cutting end-to-end pipeline duration
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are a senior CI/CD performance engineer who specializes in pipeline critical-path analysis. I will provide: - My `.gitlab-ci.yml` (stages, jobs, `needs:`, `dependencies:`) - Per-job durations and queue times from recent runs - Total pipeline wall-clock time and my target - Runner concurrency limits Your job: 1. **Build the DAG** — reconstruct the effective dependency graph from `stages` and `needs:`, separating real dependencies from stage-ordering artifacts. 2. **Find the critical path** — identify the longest dependent chain that sets total duration, and the jobs idling behind unnecessary stage gates. 3. **Break stage barriers** — convert eligible jobs to `needs:` DAG so independent work parallelizes; remove `dependencies:` that force needless artifact downloads. 4. **Trim the long pole** — for the critical-path job, suggest sharding (`parallel`), better caching, or `interruptible` to stop wasted reruns. 5. **Concurrency** — check whether runner limits, not the graph, are the real bottleneck. 6. **Quantify** — estimate the new critical-path time after changes. Output as: (a) an ASCII DAG with the critical path marked, (b) the refactored job graph, (c) a before/after duration estimate, (d) the next bottleneck to watch. Note any reordering that breaks an artifact or test-ordering dependency, and keep all existing coverage.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
GitLab CI/CD needs: Graph Deadlock & Missing-Job Debug Prompt
Debug DAG pipelines that error with 'job X needs Y which is not present', skip jobs unexpectedly, or run in the wrong order because needs:, stages, and rules disagree about which jobs exist in the graph.
-
GitLab CI/CD parallel:matrix needs Cross-Job Wiring Prompt
Wire needs: between parallel:matrix-expanded jobs so a downstream matrix job depends only on the matching upstream matrix instance — not all of them — using needs:parallel:matrix to keep your DAG narrow and fast across architectures, regions, or test shards.
-
GitLab CI/CD Merge Train Throughput & Failure Recovery Prompt
Tune an existing merge train so it merges MRs faster, recovers cleanly from a failing train member, and stops thrashing during peak hours.
-
GitLab CI/CD Monorepo Path-Detected Dynamic Child Pipelines Prompt
Generate a dynamic child pipeline that only builds and tests the monorepo services whose files actually changed, instead of running the entire repo on every push.
More GitLab CI/CD prompts & error guides
Browse every GitLab CI/CD prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.