tune-ci
Skill2 starsChanged 2 days agoMITView on GitHub
Changes the GitHub workflows without making CI slower, costlier or less safe, and finds why a run waits or takes long. Use when you add or edit a job in .github/workflows, add a matrix row, or a run sits queued or runs past its usual time.
In this repository26 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-chainSkill
- add-mcp-toolSkill
- add-migrationSkill
- add-protocol-operationSkill
- add-venueSkill
- clean-diffSkill
- debug-failureSkill
- handle-security-reportSkill
- releaseSkill
- review-diffSkill
- review-money-pathSkill
- review-testsSkill
- run-testsSkill
- shape-commitSkill
- speed-up-testsSkill
- test-telegramSkill
- vet-releaseSkill
- write-adrSkill
- binference-toolsSkill
- copy-tradingSkill
- dca-planSkill
- meme-huntingSkill
- safe-swapSkill
- token-due-diligenceSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 37
Read the run before you change a workflow:
- Very specific: line 57
Every job sets timeout-minutes close to its slowest normal run plus a margin, never the default six hours.
- Very specific: line 59
Every workflow sets permissions: contents: read and a concurrency group.
- Distinctive: line 64
No secret reaches a job that runs code from a pull request.
- Very specific: line 75
Run actionlint and zizmor --offline .github/ on the changed workflow.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Tune CI
CI runs on GitHub-hosted runners only, on pushes to master and each night, never on a branch push
or a pull request (decision 0294). Every job a change adds runs on each push to master, often on
three operating systems. Count before you add.
1. Know what runs
| Workflow | When | Jobs |
ci.yml | each push to master, by hand | pnpm check less its tests and gate self-test, check:gates, the tests in 3 shards and their merge, OS adapters and the service smoke on macOS; commits and scans; Postgres by hand |
codeql.yml | Monday 05:37 UTC, by hand | CodeQL's security queries on the TypeScript and JavaScript sources, on Linux |
mutation.yml | by hand | Stryker on up to 12 files changed since a base, 45 minutes at most |
fork.yml | nightly 03:41 UTC, by hand | the fork suite on Linux |
crash.yml | nightly 04:23 UTC, by hand | the crash suite in 17 parts on macOS, 3 at a time, BINFERENCE_CRASH_RUNS runs per kill point |
packed.yml | nightly 00:37 UTC, by hand | the Node pins and both packs on Linux; the smoke, one-liner and first day on macOS |
image.yml | by hand | the Docker image suite on Linux amd64 |
nightly.yml | nightly 02:17 UTC, a full run on Sunday | Stryker in 20 shards with saved results |
release.yml | a pushed v* tag (dry), by hand to publish | pnpm release:dry and the smoke on macOS (decision 0449); npm and GitHub's release |
A push to master starts 10 jobs (decision 0454, and check:gates in a job of its own); a night starts 43, and Monday adds the weekly
CodeQL run (decision 0453). A newer push to master cancels the CI run of the older one, while the nightly
suites never cancel. The nightly workflows start at different times so their jobs do not queue
behind each other. A release tag starts 2 jobs in release.yml, and a publish run 4 (decisions
0353, 0354 and 0449); none restores a cache.
check:pr is no CI job: the merger runs it on the branch's range before the merge, as
pnpm check:pr master..<branch>, with --title and --body <file> for a squash merge.
2. Find the bottleneck first
Read the run before you change a workflow:
gh run list --workflow ci.yml --limit 10
gh run view <run-id> --json jobs --jq '.jobs[] | [.name, .status, .startedAt, .completedAt] | @tsv'
gh run view <run-id> --log-failed- Queued, no runner yet: the account's concurrent job limit is full, often with nightly shards
or several pushes to
master. Fewer parallel rows help; a bigger timeout does not. - Started late: a
needs:dependency held it, or the cache restore was slow. - One step dominates: usually a test shard. Read Turborepo's summary for a cache miss,
then use
speed-up-testson the slow files. - Fails on one OS only: a path, a line ending, a permission or a service manager difference.
Fix it in
platform, never by skipping the OS. - Fork job flakes: public BSC nodes answer bursts with 403 for up to a minute. The fork helpers wait and try again; a new test with many reads at once needs the same.
3. Rules for a workflow change
- Every job sets
timeout-minutesclose to its slowest normal run plus a margin, never the default six hours. - Every workflow sets
permissions: contents: readand aconcurrencygroup. A job that needs more names it at the job, with a comment, as CodeQL does forsecurity-events: write. - Actions are pinned to a full commit SHA with the version in a comment. A downloaded tool is pinned by version and checked against its published SHA-256.
actions/checkoutkeepspersist-credentials: false.- No secret reaches a job that runs code from a pull request. The fork and crash suites hold no key and must stay that way.
pnpm checkand the OS jobs run on macOS while the release supports macOS alone (decisions 0449 and 0453); a Linux or Windows row returns to each OS matrix with its OS, under rule OS-6 ofdocs/ENGINEERING.md. A job that reads no OS behavior, such as a scan or the commit message check, runs on Linux alone: macOS and Windows minutes cost more.- A change to Windows-specific code runs CI by hand on its branch (
workflow_dispatch), or its tests on Windows, before the push that merges it: CI onmastersees it only after the merge. - A red
masterrun stops the line: nothing else is pushed until the fix is. - A new shard count, a new nightly job or a new required check is load-bearing: run
write-adrwith the job count per push and per night, and the time it saves. - Run
actionlintandzizmor --offline .github/on the changed workflow. CI runs both, with OpenGrep and the audit;.github/zizmor.ymlsays why each disabled audit is off.
4. Check the effect
Compare three runs before and three after: queued time, run time per job and the total minutes per OS. A change that saves time on Linux and adds a macOS row may cost more than it saves.
5. Report
What waited or ran long and why, the change, the job count per push before and after, the numbers from step 4, and the run links.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

