|
| 1 | +--- |
| 2 | +name: github-actions-codespaces-efficiency |
| 3 | +description: Audit and improve GitHub Actions and Codespaces efficiency. Use this skill when a user wants to reduce CI minutes, cancel redundant runs, add dependency caching, narrow workflow triggers with path filters, slim devcontainers, right-size Codespaces, tune idle timeout guidance, or scope prebuilds to high-value branches. |
| 4 | +--- |
| 5 | + |
| 6 | +# GitHub Actions and Codespaces Efficiency |
| 7 | + |
| 8 | +Use this skill as a lean entrypoint for GitHub Actions and Codespaces efficiency work. Keep the hot path small: inspect the repo, identify the waste source, then load only the reference material needed for the current task. |
| 9 | + |
| 10 | +## Use This Skill When |
| 11 | + |
| 12 | +- The user wants to reduce GitHub Actions runtime, CI cost, or wasted workflow runs. |
| 13 | +- The user wants faster Codespaces startup or lower Codespaces spend. |
| 14 | +- The repo has `.github/workflows/*.yml`, a `.devcontainer/`, or explicit Codespaces configuration questions. |
| 15 | +- The user asks for caching, concurrency, path filters, matrix reduction, prebuild strategy, machine sizing, or idle-timeout guidance. |
| 16 | + |
| 17 | +## Load Only What You Need |
| 18 | + |
| 19 | +Start with the repo configuration, then load references selectively: |
| 20 | + |
| 21 | +- Read [`references/actions.md`](./references/actions.md) for GitHub Actions audits, job gating, matrix reduction, live validation, and workflow-specific fixes. |
| 22 | +- Read [`references/codespaces.md`](./references/codespaces.md) for devcontainer, machine-sizing, prebuild, and idle-timeout guidance. |
| 23 | +- Read [`references/reporting.md`](./references/reporting.md) when the user asks what changed, wants a before/after efficiency report, or wants another review pass over the remaining expensive jobs. |
| 24 | +- Read [`references/patterns.md`](./references/patterns.md) only when you need concrete YAML or configuration examples during implementation. |
| 25 | + |
| 26 | +If the task is CI-only, do not load the Codespaces reference. If the task is Codespaces-only, do not load the Actions reference. |
| 27 | + |
| 28 | +## Core Workflow |
| 29 | + |
| 30 | +### 1. Measure first |
| 31 | + |
| 32 | +Inspect the current configuration before proposing changes: |
| 33 | + |
| 34 | +- Workflow triggers and whether repeated pushes waste runs |
| 35 | +- Dependency installation and cache behavior |
| 36 | +- Whether docs-only or config-only changes trigger heavy validation |
| 37 | +- Whether matrix breadth matches the actual decision being made |
| 38 | +- Whether devcontainers or Codespaces defaults are oversized |
| 39 | + |
| 40 | +### 2. Rank fixes by payoff |
| 41 | + |
| 42 | +Prefer this order unless repo context says otherwise: |
| 43 | + |
| 44 | +1. Add dependency caching with lockfile-based keys |
| 45 | +2. Add or correct `concurrency` cancellation |
| 46 | +3. Remove duplicate workflow coverage before merging jobs together |
| 47 | +4. Narrow workflow or job triggers safely |
| 48 | +5. Reduce matrix breadth to match risk and event type |
| 49 | +6. Trim oversized devcontainer or Codespaces defaults |
| 50 | + |
| 51 | +### 3. Keep changes conservative |
| 52 | + |
| 53 | +- Do not hide required release, schema, migration, or shared-library validation behind overly-broad filters. |
| 54 | +- Do not assume fewer jobs means faster PR feedback; preserve parallelism unless runner cost matters more and the critical path stays acceptable. |
| 55 | +- Treat compatibility matrices as policy, not default ceremony. |
| 56 | +- Prefer opt-in triggers for nonessential write-back jobs such as formatting bots. |
| 57 | +- Separate repo-editable changes from GitHub/org settings recommendations. |
| 58 | + |
| 59 | +### 4. Verify in GitHub when possible |
| 60 | + |
| 61 | +YAML lint is necessary but not sufficient. |
| 62 | + |
| 63 | +- Validate trigger behavior with live runs when possible. |
| 64 | +- Use a low-scope change, such as a workflow-only or docs-only update, to prove heavy jobs actually skip. |
| 65 | +- Treat unexpected live behavior as a real bug even when the YAML looks correct. |
| 66 | + |
| 67 | +## Required Output Shape |
| 68 | + |
| 69 | +When using this skill, keep the response compact and structured around these four sections: |
| 70 | + |
| 71 | +1. `Waste sources`: the top cost or latency drivers you found |
| 72 | +2. `Proposed fixes`: the small set of highest-confidence changes |
| 73 | +3. `Validation`: what was proven live, what was only checked locally, and any remaining risk |
| 74 | +4. `Impact`: expected savings separately from measured savings |
| 75 | + |
| 76 | +For measured impact, separate: |
| 77 | + |
| 78 | +- PR wall-clock time |
| 79 | +- Total runner time across jobs |
| 80 | +- Jobs or matrix legs avoided entirely |
| 81 | + |
| 82 | +## Review Rubric |
| 83 | + |
| 84 | +Use this rubric when reviewing current or updated efficiency work: |
| 85 | + |
| 86 | +- `Scope discipline`: only relevant domain guidance was loaded |
| 87 | +- `Safety`: required validation coverage was preserved |
| 88 | +- `Token efficiency`: the skill or report stayed focused on the active task |
| 89 | +- `Measurement quality`: expected and measured gains were clearly separated |
| 90 | + |
| 91 | +If one rubric dimension is weak, call that out explicitly instead of averaging it away. |
| 92 | + |
| 93 | +## References |
| 94 | + |
| 95 | +- [`references/actions.md`](./references/actions.md) |
| 96 | +- [`references/codespaces.md`](./references/codespaces.md) |
| 97 | +- [`references/reporting.md`](./references/reporting.md) |
| 98 | +- [`references/patterns.md`](./references/patterns.md) |
0 commit comments