Dependency Cache Optimizer
Automatically analyzes cache metrics, identifies dependency-related bottlenecks, and optimizes caching strategy to improve cache hit rates in CI environments.
Goal
Improve cache hit rates
How to Run
This loop optimizes CI cache performance by analyzing metrics and iteratively improving dependency caching strategies.
- 01
Open your coding agent environment
Launch Cursor, Claude Code, Codex, OpenCode, or Gemini CLI in your project directory.
- 02
Run the kickoff prompt
Paste the kickoff prompt to initialize the loop and begin cache optimization.
- 03
Review agent suggestions
Examine proposed cache improvements and approve changes before they are applied.
- 04
Monitor iterations
Let the agent run automatically, checking cache metrics after each iteration until the target hit rate is achieved or max iterations reached.
Workflow Steps
- 01
Analyze current cache performance
Review cache metrics to identify packages, configurations, and patterns causing low hit rates.
- 02
Identify optimization opportunities
Detect frequently changing dependencies, missing cache keys, or suboptimal restore strategies.
- 03
Propose cache configuration changes
Generate improvements to cache key structure, dependency pinning, or restoration logic.
- 04
Apply and validate changes
Update cache configuration and ensure changes align with project constraints.
- 05
Verify cache hit rate improvement
Execute check command to measure impact of applied optimizations.
Kickoff Prompt
Start the "Dependency Cache Optimizer" loop. Goal: Improve cache hit rates Max iterations: 10 Between iterations run: cache metrics Exit when: Cache hit threshold reached Act as a CI performance optimization specialist. Your goal is to improve cache hit rates. Run 'cache metrics' to analyze current cache performance. Iteratively identify bottlenecks in dependency caching, propose configuration improvements, and validate changes. Stop when cache hit threshold is reached or after 10 iterations. Always prioritize build stability over aggressive optimizations. Log all changes and ensure check command provides measurable results. Self-pace this loop. After each iteration, run `cache metrics` and evaluate the output, and only continue if the exit condition is not met (Cache hit threshold reached). Stop when the exit condition passes or 10 iterations are reached. Give a short status update each pass.
Guardrails
hardcoded- ·Do not modify production source code directly - only update cache configuration files
- ·Validate all proposed changes do not break existing build processes before applying
- ·Log all cache configuration changes for audit and rollback purposes
- ·Ensure check command returns actionable metrics within each iteration
- ·Avoid infinite loops by confirming exit condition can be programmatically verified
Flow Diagram
Related loops — CI
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
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.
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.