Parallelize CI Jobs
This loop optimizes CI pipeline efficiency by identifying and parallelizing independent jobs to reduce overall runtime. The agent iteratively analyzes the current pipeline structure, implements parallelization strategies, and validates improvements through metrics.
Goal
Achieve a target runtime reduction through parallel job execution
How to Run
Run this loop in your preferred coding agent to automatically parallelize CI jobs and reduce pipeline runtime.
- 01
Identify CI Configuration File
Locate your project's CI configuration file (e.g., .github/workflows/*.yml, .gitlab-ci.yml)
- 02
Run Check Command
Execute 'pipeline metrics' to get baseline performance data
- 03
Apply Parallelization Changes
Implement suggested parallel job configurations based on agent analysis
- 04
Verify Results
Re-run pipeline metrics to confirm runtime improvement
- 05
Iterate Until Target
Continue loop iterations until target runtime is achieved or max iterations reached
Workflow Steps
- 01
Analyze Current Pipeline Structure
Identify sequential jobs and dependencies in the CI configuration
- 02
Detect Parallelization Opportunities
Find independent jobs that can run concurrently without conflicts
- 03
Modify CI Configuration
Update workflow file to enable parallel execution for identified jobs
- 04
Execute Pipeline Check
Run pipeline metrics to measure current runtime performance
- 05
Evaluate Improvement
Compare new metrics against target threshold to determine success
- 06
Decide Next Action
If target not met and iterations remain, return to analysis; otherwise exit loop
Kickoff Prompt
Start the "Parallelize CI Jobs" loop. Goal: Achieve a target runtime reduction through parallel job execution Max iterations: 10 Between iterations run: pipeline metrics Exit when: Runtime reduced to target Analyze the current CI pipeline configuration to identify sequential jobs that can be executed in parallel. For each job, check if it has dependencies on other jobs and whether those dependencies prevent parallel execution. Modify the CI configuration to maximize parallel job runs while maintaining proper build integrity. After making changes, run 'pipeline metrics' to measure the runtime improvement. If the runtime has been reduced to the target threshold, exit the loop. Otherwise, continue iterating up to the maximum allowed iterations. Always preserve existing test dependencies and ensure that parallelization does not introduce race conditions or inconsistent artifacts. Self-pace this loop. After each iteration, run `pipeline metrics` and evaluate the output, and only continue if the exit condition is not met (Runtime reduced to target). Stop when the exit condition passes or 10 iterations are reached. Give a short status update each pass.
Guardrails
hardcoded- ·Preserve existing test dependencies and order
- ·Ensure cross-platform compatibility in parallel jobs
- ·Avoid exceeding CI platform concurrency limits
- ·Maintain artifact and cache consistency between jobs
- ·Validate that parallelization doesn't introduce race conditions
Flow Diagram
Related loops — CI
CI
Dependency Cache Optimizer
Automatically analyzes cache metrics, identifies dependency-related bottlenecks, and optimizes caching strategy to improve cache hit rates in CI environments.
CI
Flaky Test Hunter
This loop automatically identifies and removes flaky tests in your Node.js project. A flaky test is one that passes and fails intermittently without any code changes. The agent will run your test suite multiple times, detect inconsistent test results, and attempt to fix or remove the flaky tests to stabilize your CI pipeline.
CI
CI Until Green
This loop continuously monitors and fixes CI issues until all checks pass. It runs the 'gh pr checks' command iteratively, analyzes failures, and applies fixes until the exit condition is met.