agentleFS
NikoxkxNikoxkx/Agent-Skills/skills/devops/ci-cd-optimizer/SKILL.md

ci-cd-optimizer

Skill1 starsChanged 5 months agoApache-2.0View on GitHub

Analyzes and optimizes CI/CD pipeline speed, reliability, and cost. Use when pipelines are slow, flaky, or expensive.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 5 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Test suite that can be run locally for experimentation.

    line 28
  2. Very specific:

    Run independent jobs in parallel (needs: only where required).

    line 40
  3. Distinctive:

    Test results / coverage cache.

    line 46
  4. Very specific:

    Use tools like nx affected, Turborepo, or custom scripts.

    line 50
  5. Very specific:

    Use actions/cache or native cache features.

    line 55
  6. Distinctive:

    Use larger runners only when needed.

    line 58
  7. Distinctive:

    Before/after timing expectations.

    line 66
  8. Distinctive:

    Monorepos: Use workspace-aware tools (Nx, Turborepo, pnpm workspaces).

    line 74

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Overview

Provides a systematic 5-step workflow to diagnose and fix slow, flaky, or costly CI/CD pipelines. Covers bottleneck identification, parallelization, smart test selection, caching hierarchy, artifact reuse, flaky test quarantine, and cost optimization techniques with concrete before/after metrics and GitHub Actions examples.

When to Use This Skill

  • Pipelines take too long (developers are waiting).
  • High flakiness rate.
  • CI costs are rising.
  • User says "make the build faster" or "fix flaky tests".

Prerequisites

  • Existing CI configuration (GitHub Actions, GitLab CI, etc.).
  • Access to CI logs, timing data, and cost reports.
  • Test suite that can be run locally for experimentation.

Steps

  1. Measure current state:
    • Record wall time for full pipeline on main.
    • Identify the slowest job(s) from timing graphs.
    • Count flaky test rate (retries needed).
  2. Parallelize:
    • Split large jobs (e.g., test into shard by file or by package).
    • Use matrix strategy.
    • Run independent jobs in parallel (needs: only where required).
  3. Caching hierarchy (most impactful):
    • Dependencies (node_modules, pip cache, Go modules).
    • Build cache (Next.js, Turborepo, Gradle, etc.).
    • Docker layer cache.
    • Test results / coverage cache.
  4. Smart test selection:
    • Changed-files detection (only run tests for packages that changed).
    • Use tools like nx affected, Turborepo, or custom scripts.
    • Quarantine known flaky tests into a separate "flaky" job that runs less often.
  5. Artifact & reuse:
    • Upload build artifacts from build job and download in deploy/test jobs instead of rebuilding.
    • Use actions/cache or native cache features.
  6. Cost optimization:
    • Use larger runners only when needed.
    • Cancel in-progress workflows on new pushes to same branch.
    • Self-hosted runners for high-volume repos.
  7. Output:
    • Diagnosis report template.
    • Optimized workflow diff.
    • Flaky test handling pattern.
    • Before/after timing expectations.

Examples

A before/after GitHub Actions workflow showing parallel test sharding, aggressive caching, affected tests only, and cancellation is included, along with a flaky test quarantine pattern.

Edge Cases & Error Handling

  • Monorepos: Use workspace-aware tools (Nx, Turborepo, pnpm workspaces).
  • Flaky tests that are actually bugs: Quarantine + create ticket, do not ignore.
  • Cache invalidation bugs: Provide cache key best practices (hash of lockfile + OS).

Verification

  1. Re-run the pipeline multiple times and record new average duration.
  2. Flaky test rate drops (tracked in CI logs or a dashboard).
  3. Cost report shows reduction (if applicable).
  4. Developers report faster feedback on PRs.
  5. Success: Pipeline is 30-70% faster, reliable, and cheaper while maintaining the same quality gates.

References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.