All skills
github avatar

/github-codespaces-efficiency

@12666c9 official
by githubgithub/awesome-copilot40k stars
5,040

Audit and improve GitHub Codespaces efficiency. Use this skill when a user wants faster Codespaces startup, lower Codespaces spend, slim devcontainers, right-size machines, tune idle timeout, or scope prebuilds to branches with sustained usage.

Use this Skill: https://skilld.dev/gh/github/awesome-copilot/github-codespaces-efficiency

This session only. Nothing lands on disk.

SKILL.md

β‰ˆ69 tokens always: the name and description. β‰ˆ1.1k when used: this file. β‰ˆ648 more on demand in 2 files.

GitHub Codespaces Efficiency

Use this skill as a lean entrypoint for GitHub Codespaces efficiency work. Inspect the repo, identify waste, and load only needed references.

If no .devcontainer/ exists yet, load references/codespaces.md and define a baseline before proceeding with the steps below.

Use This Skill When

  • The user wants faster Codespaces startup or lower Codespaces spend.
  • The repo has a .devcontainer/ or explicit Codespaces configuration questions.
  • The user asks for devcontainer optimization, machine sizing, prebuild strategy, or idle-timeout guidance.
  • The user is setting up Codespaces for the first time or needs help creating a new .devcontainer/ from scratch.

Load Only What You Need

Core Workflow

1. Measure first

find .devcontainer -maxdepth 2 -type f
gh codespace list
repo=$(gh repo view --json nameWithOwner --jq .nameWithOwner)
gh api "/repos/$repo/codespaces/machines"

If gh auth fails or the user lacks repo admin scope, proceed with static analysis of .devcontainer/ files; mark machine-type and prebuild recommendations as unverified.

Look for: devcontainer image >2 GB or more than 10 features, machine type larger than usage data supports, missing devcontainer-lock.json (recommend adding β€” many repos predate lock-file support), prebuilds scoped too broadly, and idle timeout mismatched to usage patterns.

2. Apply guardrails

Check each proposed fix against these rules before recommending it:

  1. Does not remove tools the team uses every day β€” drop any fix that strips required development tools or extensions.
  2. Does not assume smaller is always better β€” balance machine cost against developer experience and throughput.
  3. Does not turn the devcontainer into a production image β€” drop any fix that adds production-only dependencies unless the team explicitly requires it.
  4. Incremental changes preferred β€” a greenfield baseline is appropriate only when no .devcontainer/ exists; flag (do not drop) changes that restructure an existing config.
  5. Repo changes stay separate from org settings β€” split any fix that mixes repo-editable files with org-level or user-level Codespaces settings into two distinct recommendations.

3. Select the top 3 fixes

From the six candidates below, keep only those supported by audit evidence from step 1 and passing all guardrails from step 2. Rank survivors by estimated monthly cost savings (USD). Select all candidates that meet both criteria, up to a maximum of 3.

  1. Trim devcontainer β€” remove features, packages, or extensions not needed for everyday development work; target image <2 GB and fewer than 10 features
  2. Right-size machine type β€” match to observed usage patterns; if data is unavailable, state assumptions explicitly
  3. Scope prebuilds β€” enable for the default branch, release/* branches active in the last 14 days, and branches with more than 5 Codespaces per week; disable for all others
  4. Tune idle timeout β€” 30 min default; 15 min if most sessions end before 30 min; 60 min if most sessions run longer
  5. Remove unused extensions or port-forwarding rules
  6. Reduce devcontainer image size and improve layer caching

4. Verify

  • Start a test Codespace to confirm devcontainer changes build and start as expected.
  • Validate machine sizing against observed usage when telemetry is available; otherwise mark as unverified.
  • Treat unexpected build or startup failures as real bugs even when the configuration looks correct.

Required Output

Waste sources: [top cost or startup-time drivers]

Proposed fixes: [top 3 changes supported by audit evidence and passing guardrails]

Validation: [proven live / static-only / remaining risk]

Impact:

  • Startup time: [expected] / [measured if available]
  • Monthly spend: [expected] / [measured if available]
  • Resource utilization: [expected] / [measured if available]

References

Source: SKILL.md on GitHub

No alerts3mo3 checks Β· Risk SAFE
  • Gen Agent Trust Hub3mo

    This skill provides a structured workflow for optimizing GitHub Codespaces by auditing configurations and usage patterns using standard GitHub CLI tools. No security risks were identified.

  • Socket3mo

    No alerts

  • Snyk3mo

    Risk: LOW Β· No issues

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

Last checked against GitHub 19 hours ago.

Activeupdated 4 months ago
  • github-codespaces
  • devcontainer
  • codespaces
  • machine-sizing
  • prebuilds
  • cost-optimization
  • startup-time
  • idle-timeout

README badge

README badge for github/awesome-copilot/github-codespaces-efficiency

Audits GitHub Codespaces configuration to identify startup delays and cost waste, then recommends up to 3 prioritized fixes: trimming devcontainer image size and features, right-sizing machine type, scoping prebuilds to active branches, or tuning idle timeout. Targets repos with existing `.devcontainer/` configuration or those setting up Codespaces for the first time.

Generated from the current SKILL.md.

Does this skill work without GitHub CLI access or admin permissions?
Yes. If `gh` auth fails or the user lacks repo admin scope, the skill falls back to static analysis of `.devcontainer/` files. Machine-type and prebuild recommendations will be marked as unverified.
Will this skill remove development tools my team uses daily?
No. The skill has a guardrail that prevents recommending any fix that strips required development tools or extensions. Any such change is dropped before recommendations are made.
Can this skill set up a devcontainer from scratch?
Yes. If no `.devcontainer/` exists, the skill loads the codespaces reference guide and defines a baseline configuration before proceeding with optimization steps.
How many fixes does this skill recommend?
Up to 3, selected from six candidates based on audit evidence and guardrails. Only fixes with measured cost savings and passing all safety checks are included.
Does this skill handle org-level Codespaces settings?
No. The skill keeps repo-editable changes separate from org-level or user-level settings and flags any needed org-level changes as distinct from repo recommendations.

Generated from the current SKILL.md. These answers refresh after source changes.