Sync SKILL.md and rules workflow (JuliusBrussee/caveman)
The Sync SKILL.md and rules workflow from JuliusBrussee/caveman, explained and optimized by Latchkey.
A
CI health: A - excellent
Point runs-on at Latchkey and get job timeouts, self-healing for flaky steps, and up to 58% lower cost, applied automatically.
What it does
This is the Sync SKILL.md and rules workflow from the JuliusBrussee/caveman repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
workflow (.yml)
name: Sync SKILL.md and rules
on:
push:
branches: [main]
paths:
- skills/caveman/SKILL.md
- skills/cavecrew/SKILL.md
- agents/cavecrew-*.md
- skills/caveman-compress/SKILL.md
- skills/caveman-compress/scripts/**
concurrency:
group: sync-skill
cancel-in-progress: false
jobs:
sync:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: main
- name: Pull latest before making changes
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git pull --rebase origin main
- name: Sync SKILL.md copies
run: |
cp skills/caveman/SKILL.md plugins/caveman/skills/caveman/SKILL.md
- name: Sync caveman-compress skill to plugin
run: |
# Plugin distribution mirrors source verbatim - no rename, no sed.
mkdir -p plugins/caveman/skills/caveman-compress
cp skills/caveman-compress/SKILL.md plugins/caveman/skills/caveman-compress/SKILL.md
rm -rf plugins/caveman/skills/caveman-compress/scripts
cp -r skills/caveman-compress/scripts plugins/caveman/skills/caveman-compress/scripts
rm -rf plugins/caveman/skills/caveman-compress/scripts/__pycache__
- name: Sync cavecrew skill + agents to plugin
run: |
mkdir -p plugins/caveman/skills/cavecrew plugins/caveman/agents
cp skills/cavecrew/SKILL.md plugins/caveman/skills/cavecrew/SKILL.md
cp agents/cavecrew-investigator.md plugins/caveman/agents/cavecrew-investigator.md
cp agents/cavecrew-builder.md plugins/caveman/agents/cavecrew-builder.md
cp agents/cavecrew-reviewer.md plugins/caveman/agents/cavecrew-reviewer.md
- name: Rebuild caveman.skill ZIP
run: mkdir -p dist && cd skills && zip -r ../dist/caveman.skill caveman/
- name: Commit and push if changed
run: |
git add \
skills/caveman-compress/ \
plugins/caveman/skills/caveman-compress/ \
plugins/caveman/skills/caveman/SKILL.md \
plugins/caveman/skills/cavecrew/SKILL.md \
plugins/caveman/agents/cavecrew-investigator.md \
plugins/caveman/agents/cavecrew-builder.md \
plugins/caveman/agents/cavecrew-reviewer.md \
dist/caveman.skill
git diff --staged --quiet && exit 0
git commit -m "chore: sync SKILL.md copies [skip ci]"
git push
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: Sync SKILL.md and rules on: push: branches: [main] paths: - skills/caveman/SKILL.md - skills/cavecrew/SKILL.md - agents/cavecrew-*.md - skills/caveman-compress/SKILL.md - skills/caveman-compress/scripts/** concurrency: group: sync-skill cancel-in-progress: false jobs: sync: timeout-minutes: 30 runs-on: latchkey-small permissions: contents: write steps: - uses: actions/checkout@v4 with: ref: main - name: Pull latest before making changes run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git pull --rebase origin main - name: Sync SKILL.md copies run: | cp skills/caveman/SKILL.md plugins/caveman/skills/caveman/SKILL.md - name: Sync caveman-compress skill to plugin run: | # Plugin distribution mirrors source verbatim - no rename, no sed. mkdir -p plugins/caveman/skills/caveman-compress cp skills/caveman-compress/SKILL.md plugins/caveman/skills/caveman-compress/SKILL.md rm -rf plugins/caveman/skills/caveman-compress/scripts cp -r skills/caveman-compress/scripts plugins/caveman/skills/caveman-compress/scripts rm -rf plugins/caveman/skills/caveman-compress/scripts/__pycache__ - name: Sync cavecrew skill + agents to plugin run: | mkdir -p plugins/caveman/skills/cavecrew plugins/caveman/agents cp skills/cavecrew/SKILL.md plugins/caveman/skills/cavecrew/SKILL.md cp agents/cavecrew-investigator.md plugins/caveman/agents/cavecrew-investigator.md cp agents/cavecrew-builder.md plugins/caveman/agents/cavecrew-builder.md cp agents/cavecrew-reviewer.md plugins/caveman/agents/cavecrew-reviewer.md - name: Rebuild caveman.skill ZIP run: mkdir -p dist && cd skills && zip -r ../dist/caveman.skill caveman/ - name: Commit and push if changed run: | git add \ skills/caveman-compress/ \ plugins/caveman/skills/caveman-compress/ \ plugins/caveman/skills/caveman/SKILL.md \ plugins/caveman/skills/cavecrew/SKILL.md \ plugins/caveman/agents/cavecrew-investigator.md \ plugins/caveman/agents/cavecrew-builder.md \ plugins/caveman/agents/cavecrew-reviewer.md \ dist/caveman.skill git diff --staged --quiet && exit 0 git commit -m "chore: sync SKILL.md copies [skip ci]" git push
What changed
- Run on Latchkey managed runners with one line (
runs-on), which apply the fixes below automatically and self-heal transient failures. This example useslatchkey-small; pick the runner size that fits the job. - Add a job timeout so a hung step cannot burn hours of runner time.
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.