Index of every page on this site: llms.txt
All skills
Run it yourself

Audits a repository's GitHub Actions workflows for CI optimization opportunities — missing caches, redundant setup, sleep-based readiness, long test jobs without sharding, full-history checkout, dead env vars, build-cache misconfig, and ~60 more patterns across caching, redundancy, parallelization, conditional execution, trigger scope, and hidden failures. Use when: (1) analyzing a repo's CI for optimization opportunities, (2) producing a prioritized report with measured wall-clock and runner-minute savings, (3) re-auditing after upstream CI changes. Do not trigger for: general CI setup help, writing new workflows from scratch, non-GitHub-Actions CI systems, or security/posture audits — use `ci-secure` for those.

Use this Skill: https://skilld.dev/gh/starslingdev/skills/ci-speedup

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencespatternsopt40-monorepo-job-runs-regardless-of-affected-app.md

≈859 tokens on demand. Your agent reads this file only when SKILL.md points to it.

OPT40 — Monorepo Job Runs Regardless of Affected App

TL;DR: In a monorepo, a job for one app runs on every PR even when only a different app changed.

Anti-pattern: Repo is a monorepo (top-level apps/*, packages/*, or services/* directories). Workflow has jobs whose work targets one app (e.g., web-quality runs playwright test in apps/web/), but the workflow's on.pull_request doesn't have paths filters AND no per-job dorny/paths-filter gate exists. Result: every PR runs full Playwright + tests + builds for every app, even when only apps/api/** changed.

Why distinct from OPT32: OPT32 catches workflows missing paths/paths-ignore at the WORKFLOW level. That works for single-purpose workflows. OPT40 covers the monorepo case where the workflow is correctly scoped (it should run on every PR — there's at least ONE thing that needs to run) but per-job gating is missing for the apps that weren't touched.

Detection heuristic:

  1. Detect monorepo layout: presence of apps/, packages/, services/, or pnpm-workspace.yaml / turbo.json / nx.json.
  2. For each job in each workflow, identify which app it targets:
    • Steps that cd apps/<name>, pnpm --filter <pkg>, turbo run --filter=<pkg>, nx run <project>:<target>, etc.
  3. For jobs with a clear single-app target, check whether the workflow paths includes ONLY that app's path AND whether a dorny/paths-filter precedes the job.
  4. Flag if neither gate exists.
  5. Activation fidelity: only flag when the workflow actually runs on every PR — suppress when the pull_request: trigger is types:-gated to a non-lifecycle activity (e.g. types: [labeled]), since the "targets every PR" claim is then false. (Shared _pr_trigger_runs_every_pr in scan.py; see OPT33.)

Fix: Same shape as OPT39 — add a changes: job with dorny/paths-filter@v3 mapping each app/package to its paths, then gate per-job:

jobs:
  changes:
    runs-on: ubuntu-latest
    outputs:
      web: ${{ steps.f.outputs.web }}
      api: ${{ steps.f.outputs.api }}
      mobile: ${{ steps.f.outputs.mobile }}
    steps:
      - uses: actions/checkout@<sha>
      - uses: dorny/paths-filter@v3
        id: f
        with:
          filters: |
            web: ['apps/web/**', 'packages/ui/**', 'package.json', 'bun.lock']
            api: ['apps/api/**', 'packages/db/**', 'pyproject.toml']
            mobile: ['apps/mobile/**']

  web-quality:
    needs: changes
    if: needs.changes.outputs.web == 'true'
    # ...

Required-status-check caveat from OPT39 applies here too.

Real-world example (blen-starter-kit deep-scan): ci.yml web-quality runs bunx playwright install --with-deps chromium + smoke e2e on every PR, even API-only or mobile-only PRs. Adding the changes: job + if: needs.changes.outputs.web == 'true' skips the entire job for ~50-70% of PRs.

Risk: MEDIUM. Cross-app changes (e.g., a shared packages/ui change that affects both apps/web and apps/mobile) need to be in the paths-filter rules for BOTH apps. List shared packages explicitly in each app's filter to avoid false-skip.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 alert2d3 checks · Risk SAFE
  • Gen Agent Trust Hub2d

    The skill is a robust CI optimization tool that audits GitHub Actions workflows. It identifies performance bottlenecks using deterministic logic and provides analysis of job logs. While it processes untrusted log data, it includes strong defensive instructions to mitigate indirect prompt injection. A minor best-practice issue regarding unsafe YAML loading was identified in a utility script.

  • Socket2d

    No alerts

  • Snyk2d

    Risk: CRITICAL · 2 issues

Signed by skilld at 9a84115. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 16 hours ago.

Activeupdated yesterday

README badge

README badge for starslingdev/skills/ci-speedup