github-actions-efficiency

Use when auditing GitHub Actions workflows for efficiency — reducing CI minutes, cutting costs, eliminating redundant runs, or optimizing caching and concurrency.

8 stars

Best use case

github-actions-efficiency is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Use when auditing GitHub Actions workflows for efficiency — reducing CI minutes, cutting costs, eliminating redundant runs, or optimizing caching and concurrency.

Teams using github-actions-efficiency should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/github-actions-efficiency/SKILL.md --create-dirs "https://raw.githubusercontent.com/drvoss/everything-copilot-cli/main/skills/workflow/github-actions-efficiency/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/github-actions-efficiency/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How github-actions-efficiency Compares

Feature / Agentgithub-actions-efficiencyStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Use when auditing GitHub Actions workflows for efficiency — reducing CI minutes, cutting costs, eliminating redundant runs, or optimizing caching and concurrency.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# GitHub Actions Efficiency

Audit GitHub Actions workflow efficiency without weakening required validation. Focus on
runner time, wasted runs, broad triggers, and the fastest fixes that actually hold up under
review.

## When to Use

- CI minutes are growing faster than the repository's actual change volume
- Workflows run too often for docs-only, workflow-only, or narrow-scope changes
- You need to optimize caches, concurrency, trigger scope, or matrix breadth
- A repository is onboarding GitHub Actions and needs a lean baseline first
- A team wants a before/after efficiency report grounded in real workflow evidence

## When NOT to Use

| Instead of github-actions-efficiency | Use |
|--------------------------------------|-----|
| Debugging one failed workflow run | `actions-debugging` |
| Reviewing Actions security risks | `gha-security-review` |
| Auditing model or token spend across AI workflows | `cost-audit` |

## Prerequisites

- Access to `.github/workflows/`
- `gh` CLI access if you want live run data
- Understanding of which checks are mandatory for release, shared libraries, or migrations

## Load Only What You Need

- [`../../../references/github-actions-efficiency/actions.md`](../../../references/github-actions-efficiency/actions.md) - audit order, trigger scoping, matrix reduction, and live validation guidance
- [`../../../references/github-actions-efficiency/reporting.md`](../../../references/github-actions-efficiency/reporting.md) - before/after reporting and follow-up review passes
- [`../../../references/github-actions-efficiency/patterns.md`](../../../references/github-actions-efficiency/patterns.md) - concrete YAML examples when inline guidance is not enough
- [`../../../references/github-actions-efficiency/review-rubric.md`](../../../references/github-actions-efficiency/review-rubric.md) - review rubric for completed efficiency changes

If no workflows exist yet, start with `actions.md` and define a minimal baseline before trying
to optimize.

If `gh` CLI access is unavailable, fall back to static analysis of workflow files and make the
scope explicit: **Static-only analysis** (not confirmed with live runs).

## Core Workflow

### 1. Measure first

```powershell
rg -n "on:|concurrency:|paths:|paths-ignore:|strategy:|matrix:|cache:" .github/workflows
gh run list --limit 10
$runId = gh run list --limit 1 --json databaseId --jq ".[0].databaseId"
gh run view $runId --log-failed
```

Look for:

- missing dependency caches
- missing `concurrency` cancellation
- over-broad triggers
- duplicate workflow coverage across files or jobs
- expensive jobs that run on every change regardless of scope

### 2. Apply guardrails

Check each proposed fix against these rules before recommending it:

1. Do not hide required validation for release, schema, migration, or shared-library safety.
2. Do not reduce parallelism without justification; only accept a slower critical path when the
   cost trade-off is explicit and still acceptable.
3. Preserve only documented matrix legs; drop unsupported versions or platforms first.
4. Keep write-back jobs opt-in; formatter or bot jobs should usually use labels, manual
   dispatch, or another explicit trigger.
5. Split repo-editable YAML changes from org-level or account-level settings.

### 3. Select the top 3 fixes

Rank the surviving candidates by expected daily CI minutes saved:

1. add dependency caching with lockfile-based keys
2. add or correct `concurrency` cancellation
3. remove duplicate workflow coverage before merging jobs
4. narrow workflow or job triggers safely
5. reduce matrix breadth to match risk and event type
6. parallelize independent jobs on the critical path

Keep only changes supported by audit evidence and guardrails. Return up to three.

### 4. Verify

- If live GitHub access is available, validate concurrency cancellation and path gating with a
  test change on a non-protected branch.
- If live validation is not possible, say so explicitly.
- Treat surprising live behavior as a real workflow bug even when the YAML looks correct.

## Required Output

1. **Waste sources** - top cost or latency drivers from the audit
2. **Proposed fixes** - up to 3 recommendations with supporting evidence
3. **Validation** - what was proven live, what stayed static-only, and what risk remains
4. **Impact** - expected savings versus measured savings; separate PR wall-clock time from total runner time

## Tips

- Measure before editing YAML; the first fix should be evidence-backed, not stylistic
- Prefer low-risk waste first: caches, concurrency, and redundant trigger scope
- Separate "fewer minutes billed" from "faster feedback for developers"
- Keep follow-up reviews short and ranked by value, not as a giant wishlist

## See Also

- [`actions-debugging`](../../copilot-exclusive/actions-debugging/SKILL.md) - investigate failed workflow runs and job logs
- [`gha-security-review`](../../security/gha-security-review/SKILL.md) - review GitHub Actions workflows for exploitable security issues
- [`cost-audit`](../cost-audit/SKILL.md) - compare broader AI cost patterns beyond CI runner spend

Related Skills

fix-github-issue

8
from drvoss/everything-copilot-cli

Use when you have a GitHub Issue number or link and want it resolved end-to-end — reads the issue, locates the bug, applies a fix, writes tests, and opens a PR from the terminal.

github-pr-workflow

8
from drvoss/everything-copilot-cli

Use when creating, updating, or managing pull requests — automates the full PR lifecycle (open, review requests, labels, merge) via GitHub MCP

github-issue-triage

8
from drvoss/everything-copilot-cli

Use when you have a backlog of unorganized GitHub Issues — bulk-reads, labels, prioritizes, and assigns issues at scale using Copilot's built-in GitHub MCP tools.

github-codespaces-efficiency

8
from drvoss/everything-copilot-cli

Use when optimizing GitHub Codespaces — faster startup times, lower spend, slimmer devcontainers, right-sizing machines, or scoping prebuilds.

github-code-search

8
from drvoss/everything-copilot-cli

Use when you need real-world implementation examples or cross-repository context — search GitHub's global code index with the built-in MCP tools and reuse the results as grounded context.

actions-debugging

8
from drvoss/everything-copilot-cli

Use when a GitHub Actions workflow fails — diagnose the run log, identify the root cause, and apply a targeted fix

verification-before-completion

8
from drvoss/everything-copilot-cli

Use before claiming any task is done — run the exact command that proves the fix works, read the output, and only then report success.

using-git-worktrees

8
from drvoss/everything-copilot-cli

Use when you need multiple branches checked out at once — create isolated working directories for parallel development without cloning the repository repeatedly

triage

8
from drvoss/everything-copilot-cli

Use when a single issue needs structured triage — classify it, reproduce if needed, request missing information, and leave a durable brief or close-out note in the tracker.

to-issues

8
from drvoss/everything-copilot-cli

Use when a plan, spec, or PRD must become an actionable backlog — break it into thin dependency-aware issues that each deliver a verifiable vertical slice

sprint-workflow

8
from drvoss/everything-copilot-cli

Use when starting a new feature, refactor, or multi-step dev task — runs the full sprint cycle (Think → Plan → Build → Review → Test → Ship → Monitor) using Copilot CLI's plan/autopilot modes.

sprint-retro

8
from drvoss/everything-copilot-cli

Use at the end of a sprint to run a data-driven retrospective — analyzes session history and git metrics to surface what shipped, what slowed you down, and concrete improvements.