skills/ci-cache-optimizer/SKILL.md
CI/CD caching optimizer for dependency caching, Docker layer caching, and build speed improvements. Activate on: CI cache, build speed, dependency caching, Docker layer cache, turbo remote cache, GitHub Actions cache, pnpm store cache. NOT for: CI/CD pipeline creation (use github-actions-pipeline-builder), deployment strategy (use blue-green-deployment-orchestrator), Docker image building (use docker-multi-stage-optimizer).
npx skillsauth add curiositech/windags-skills ci-cache-optimizerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Expert in reducing CI/CD build times through dependency caching, Docker layer caching, and build pipeline optimization.
Activate on: "CI cache", "build speed", "dependency caching", "Docker layer cache", "turbo remote cache", "GitHub Actions cache", "pnpm store cache", "slow builds", "CI optimization"
NOT for: Pipeline creation → github-actions-pipeline-builder | Deployment strategy → blue-green-deployment-orchestrator | Docker builds → docker-multi-stage-optimizer
| Domain | Technologies | |--------|-------------| | Dependency Cache | pnpm store, npm cache, pip cache, Go module cache, Cargo registry | | Docker Cache | BuildKit inline cache, GitHub Actions gha cache, registry cache | | Build Cache | Turborepo remote cache, Nx Cloud, Gradle build cache, ccache | | CI Platforms | GitHub Actions, GitLab CI, CircleCI, Buildkite | | Analysis | GitHub Actions timing, CI Insights, custom duration metrics |
# .github/workflows/ci.yml
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm' # Built-in pnpm cache support
# Turbo remote cache for monorepo build outputs
- name: Build
run: pnpm turbo build --cache-dir=.turbo
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
# Strategy 1: GitHub Actions cache backend (fastest for GHA)
- uses: docker/build-push-action@v6
with:
context: .
push: true
tags: myapp:latest
cache-from: type=gha
cache-to: type=gha,mode=max
# Strategy 2: Registry cache (works across CI providers)
- uses: docker/build-push-action@v6
with:
context: .
push: true
tags: registry.io/myapp:latest
cache-from: type=registry,ref=registry.io/myapp:cache
cache-to: type=registry,ref=registry.io/myapp:cache,mode=max
Priority 1 — Dependency install (biggest time save):
├─ pnpm store: ~/.local/share/pnpm/store
├─ pip cache: ~/.cache/pip
├─ Go modules: ~/go/pkg/mod
└─ Cargo registry: ~/.cargo/registry
Priority 2 — Build outputs (incremental builds):
├─ Turbo remote cache: .turbo/
├─ Next.js: .next/cache
├─ TypeScript: tsconfig.tsbuildinfo
└─ Webpack: node_modules/.cache
Priority 3 — Docker layers (image builds):
├─ BuildKit cache mounts
├─ Docker layer cache (gha or registry)
└─ Multi-stage build ordering
Priority 4 — Test artifacts (expensive to regenerate):
├─ Playwright browsers: ~/.cache/ms-playwright
├─ Cypress: ~/.cache/Cypress
└─ Snapshot baselines
key: deps-${{ hashFiles('pnpm-lock.yaml') }}.restore-keys with prefix matching for partial cache hits.[ ] CI build time profiled and bottleneck identified
[ ] Dependency cache uses lockfile hash as cache key
[ ] Fallback restore-keys configured for partial hits
[ ] Docker builds use BuildKit with cache-from/cache-to
[ ] Turbo/Nx remote cache enabled for monorepo builds
[ ] Test browser binaries cached (Playwright, Cypress)
[ ] Cache size monitored (GitHub Actions: 10GB limit)
[ ] Stale caches cleaned via retention or key rotation
[ ] Parallel jobs configured for independent packages
[ ] Build time target set (e.g., < 5 minutes for PR checks)
[ ] Cache hit rate tracked (> 80% target)
[ ] Before/after metrics documented for optimization efforts
tools
Building resilient distributed systems with circuit breakers, retries with full-jitter exponential backoff, retry budgets (per-request 3-attempt + per-client 10% ratio per Google SRE), deadline propagation, and the cascading-failure math (4 layers × 3 retries = 64x amplification). Grounded in Resilience4j, Microsoft Cloud Patterns, AWS Architecture Blog (Marc Brooker), and Google SRE Book.
testing
Designing HTTP cache headers that work correctly across browsers, CDNs, and shared proxies — `Cache-Control` directives per RFC 9111, `stale-while-revalidate` and `stale-if-error` per RFC 5861, the Vary header for varying responses, and surrogate keys for tag-based purging. Grounded in IETF RFCs and Cloudflare/Fastly docs.
development
Use when designing or fixing a Content Security Policy on a real site, choosing between nonce-based and hash-based CSP, adding strict-dynamic, debugging "Refused to execute inline script" errors, deploying CSP in report-only mode first, configuring report-to / report-uri, or auditing an existing policy for unsafe-inline / unsafe-eval / wildcards. Triggers: "CSP blocks legitimate inline script", strict-dynamic, nonce-{RANDOM}, sha256-{HASH}, object-src none, base-uri none, frame-ancestors, Trusted Types, X-Content-Security-Policy obsolete, report-only vs enforced. NOT for general HTTP security headers (HSTS, COOP/COEP), Trusted Types deep dive, CORS configuration, or building a WAF.
tools
Choosing and operating an HTTP API versioning strategy that doesn't break clients — Stripe's date-based pinned versions, the Deprecation/Sunset header pair (RFC 9745 + RFC 8594), URI vs header vs media-type approaches, and the version-transformer pattern. Grounded in Stripe's published architecture and IETF RFCs.