/ai-performance:performance-ci [runs=N] [workflow=NAME] [branch=NAME] [events=all] [repo=OWNER/NAME] [save=yes|no]from ai-performance
Audits GitHub Actions CI performance by analyzing the last 150 runs, breaking down job time into queue, setup, and work phases. Identifies nine common slowdowns and suggests specific file-level fixes with estimated time savings.
Ships in ai-performance. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Agents can push dozens of pull requests a day, and each one then waits for CI. Writing the change takes minutes, and the rest of the time goes to waiting for a machine, setting up the job and running checks that could run faster. /performance-ci measures that time from the repository's recent runs, finds where it goes, and says which line of which file to change and how much each change saves.
It works with GitHub Actions, through the GitHub CLI (gh). It runs in the repository's checkout, or against any repository the user can read with repo=.
The text typed after the command holds the arguments. In Claude Code it is inserted here: $ARGUMENTS. In other agents, read it from the user's message. It may be empty.
| Argument | Sets | Default |
|---|---|---|
runs=N | How many completed runs to measure, up to 1000 | 150 |
workflow=NAME | Only one workflow, by its name, file name or ID | Every workflow |
branch=NAME | Only runs on one branch | Every branch |
events=all | Count every trigger, including schedules and manual runs | Pull requests, pushes and the merge queue |
repo=OWNER/NAME | The repository to measure | The repository in the working directory |
save=yes or save=no | Whether to save the report in the repository, under docs/performance/ | yes when a CI report is already saved there, otherwise no |
If the arguments are plain language ("only the CI workflow on main"), map what clearly matches and use the defaults for the rest.
Examples:
/performance-ci/performance-ci workflow=ci.yml runs=300/performance-ci repo=acme/widgetsgh run view, gh run list, gh pr list and gh api with its default GET method. Never re-run, cancel or start a workflow, delete a cache, change repository or organization settings, commit or push. With save=yes, the report is the only file you write.continue-on-error, and don't change required checks. Any change that runs fewer or different checks goes under "For You to Decide"..claude/rules/kb/, .claude/kb/). Note what they say about CI, required checks, the merge queue, branch rules and release steps.gh auth status. If gh isn't installed or isn't logged in, stop and tell the user to install the GitHub CLI and run gh auth login. The account needs read access to the repository's Actions.repo=, or gh repo view --json nameWithOwner,visibility,defaultBranchRef in the working directory. When repo= names a repository that isn't checked out here, read its workflow files with gh api repos/OWNER/NAME/contents/.github/workflows and the files they call. Say in the report that fixes can't be applied from here..github/workflows/*.yml or *.yaml. If it uses another CI system instead (.gitlab-ci.yml, azure-pipelines.yml, .circleci/, Jenkinsfile, bitbucket-pipelines.yml, .buildkite/), stop. Say that the timing data comes from GitHub's API. Offer a review of the config against checks C2 to C9 with no measured times, and run it only if the user says yes.git status --short, the branch and the HEAD commit. Check it again at the end.CI_DIR=$(mktemp -d).If no one can answer (an unattended run, such as a scheduled or headless session), don't ask. Use the defaults in the Arguments table, and mark each one "(default)" on the report's Settings line.
Fetch the runs, from the repository root so gh finds the repository:
python3 -I "<skill folder>/scripts/ci_timings.py" fetch --out "$CI_DIR" --runs 150
Add --repo, --workflow, --branch or --events all to match the arguments. The script makes one GET request per run, plus a few for paging, and downloads two logs for each of the ten slowest jobs. It saves everything in $CI_DIR and lists failed requests in $CI_DIR/meta.json.
Summarize:
python3 -I "<skill folder>/scripts/ci_timings.py" summarize "$CI_DIR"
It prints Markdown tables and writes the same data to $CI_DIR/summary.json. All times are in seconds. It splits each job into three parts:
needs: have finished, so this is machine wait. The exception is a job that waits for an environment approval, as check C1 explains.Check the sample. With fewer than 30 runs, or fewer than 10 runs of a job, say that the numbers are rough. If the workflow files changed during the sample (git log --since=<first run date> -- .github/workflows), say so. Then consider branch= or a smaller runs=, so the numbers describe the current config.
Check the step classification for the five slowest jobs in the step tables. A step can mix setup and work, such as npm ci && npm test. A setup step can also have a name the patterns miss, such as "Download benchmark binary". In those cases, run summarize again with --setup REGEX or --work REGEX (case-insensitive, matched against step names), and record the override in the report's Method section.
When a check needs more evidence, fetch up to ten more logs into the scratch folder, with gh run view --job <job id> --log > "$CI_DIR/logs/<job id>.log".
For each workflow in the sample, and for each of the five slowest jobs:
.github/actions/*/action.yml), and the reusable workflows it calls.package.json scripts, Makefile, Taskfile.yml, justfile, tox.ini, noxfile.py, files in scripts/.tsconfig*.json, the build tool and the git hooks.on: triggers, concurrency:, needs:, each matrix, runs-on, path filters and caching.Tie each slow step to the file and line that defines it.
Run every check in references/checks.md. Each one ends as one or more findings, as "OK" with the evidence, or as "Not applicable" with the reason.
| ID | Check |
|---|---|
| C1 | Queueing on the default runners |
| C2 | Slow lint |
| C3 | Slow typechecking |
| C4 | Tests that aren't sharded, or machines that are too small |
| C5 | Every test file reloads the whole app |
| C6 | Slow setup: cache misses, full clones, more parallel tasks than cores |
| C7 | Jobs that don't run in parallel |
| C8 | Every PR runs the full test suite |
| C9 | No local checks before push |
For each finding, record:
Merge findings that have one cause into one finding. Several jobs missing the same cache count as one finding, for example.
Use the template below. Give the report as your reply, following any reply format the user's instructions set, and save a copy as $CI_DIR/report.md.
With save=yes:
docs/performance/YYYY-MM-DD-HHMMSS-ci-audit.md at the repository root, using the current time. Create the folder if it doesn't exist, and never overwrite an earlier report.*-ci-audit.md report exists there, fill "Changes Since the Last Run". Compare the time to a CI result and each slow job's queue, setup and work, as before → after rows. Match findings by cause, not by ID.Keep the scratch folder. Say where it is, and that it can be deleted after the fixes ship.
Ask which fixes to apply. Use the AskUserQuestion tool, or plain text if it isn't available:
Apply an item from "For You to Decide" only when the user names its ID and says yes to it. An unattended run stops after the report.
Apply what the user picks:
actionlint on changed workflow files when it is installed. Otherwise, read the diff for indentation and expression syntax. Run the changed command locally when you can, such as the lint command with its new cache or one test shard, and report the result./performance-ci save=yes again to compare.Every section is required. Write "None found" or "Not run" rather than dropping one.
# CI Audit: <owner/name>
**Date:** <ISO 8601 timestamp>
**Auditor:** ai-performance plugin 2.1.0, /performance-ci
**Repo:** <owner/name, public or private, default branch. Local checkout: path, branch and commit, or "none".>
**Sample:** <N completed runs from <date> to <date>: events, workflows and job counts>
**Settings:** <each setting and where it came from: argument, answer or (default)>
## Summary
<Two to four sentences. The time to a CI result for a PR now (median and p90), and where it goes on the critical path: queue, setup or work. The biggest fix. The expected time after the free fixes.>
## Where the Time Goes
### Time to a CI Result per Commit
| Trigger | Commits | Median | p90 | Finishes last most often |
|---------|---------|--------|-----|--------------------------|
| <pull request> | <n> | <s (min)> | <s (min)> | <workflow / job (share)> |
### Five Slowest Jobs
| # | Workflow / job | Runner | Runs | Queue | Setup | Work | Total (median) | p90 total |
|---|----------------|--------|------|-------|-------|------|----------------|-----------|
| 1 | <workflow / job> | <labels> | <n> | <s> | <s> | <s> | <s> | <s> |
<One line per job: its biggest steps and their seconds.>
## Findings
Free fixes, ordered by seconds saved on the wait for a CI result.
| ID | Check | Costs now | File:line | Fix | Saves | Basis |
|----|-------|-----------|-----------|-----|-------|-------|
| CI-1 | <C6 Slow setup> | <seconds, and where> | <path:line> | <one line> | <seconds per commit, critical path or runner minutes> | <measured: ... / estimate: ...> |
## For You to Decide
### Costs Money
| ID | Change | Saves | Cost | Basis |
|----|--------|-------|------|-------|
| CI-D1 | <change> | <seconds> | <what it costs and where the price comes from> | <basis> |
### Runs Fewer or Different Checks
| ID | Change | Saves | What stops running or changes | Basis |
|----|--------|-------|-------------------------------|-------|
| CI-D2 | <change> | <seconds> | <what> | <basis> |
## Check Results
| Check | Result | Evidence |
|-------|--------|----------|
| C1 Queueing on the default runners | <CI-n, OK or Not applicable> | <one line> |
| C2 Slow lint | | |
| C3 Slow typechecking | | |
| C4 Tests not sharded, or machines too small | | |
| C5 Test files reload the whole app | | |
| C6 Slow setup | | |
| C7 Jobs that don't run in parallel | | |
| C8 Every PR runs the full test suite | | |
| C9 No local checks before push | | |
## Expected Result
| | Now | After the free fixes | After the free fixes and every decided item |
|---|-----|----------------------|---------------------------------------------|
| Time to a CI result per PR (median) | <measured> | <estimate range> | <estimate range> |
| Runner minutes per PR | <measured> | <estimate> | <estimate> |
<One sentence on how you got the estimates.>
## Changes Since the Last Run
<Only when an earlier saved CI report exists: before → after rows for the time to a CI result and each slow job, plus findings fixed, still open and new. Otherwise "First saved run." or "Not saved.">
## Method
- **Data:** `ci_timings.py` fetch and summarize: <n> runs, <n> jobs, <n> logs, plus <n> logs fetched by hand
- **Step classification:** <the default patterns, or the overrides used and why>
- **Requests:** GET requests through gh only
- **Not checked:** <for example logs past their retention period, jobs with too few runs, or a CI system other than GitHub Actions>
- **Scratch folder:** <path>
- **Repo:** <unchanged, or what changed during the audit and who changed it>
---
*Generated by [ai-performance](https://github.com/charlesjones-dev/ai-agent-plugins) `/performance-ci`.*
Before giving the report:
Inspired by a post by Vox (Voxyz_ai on X) with a prompt for a CI audit. This skill follows its approach (split each job's time into queue, setup and work, check nine causes, and report before changing anything) in its own words, and adds the measurement script.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub charlesjones-dev/ai-agent-plugins --plugin ai-performance2 skills in this plugin
Other plugins' skills for the same job