/update-h15-agentic-coding — sync from hailo15-agentic-coding
This hailo-media-library repo ships an .claude/ directory (skills + agents + settings) and a root CLAUDE.md. Those are frozen at each SDK release. Between releases, fresher versions are pushed to https://github.com/hailo-ai/hailo15-agentic-coding. This skill pulls those newer files in.
Semantics: "newer" is decided by last-commit date — if the external repo's HEAD is committed strictly after this repo's HEAD, the external files win. Files that exist locally but not in the external repo are left alone (no --delete). Files that exist in the external repo are overwritten in the local working tree.
The skill does not commit anything. The user reviews git status / git diff afterwards and commits manually.
External repo
https://github.com/hailo-ai/hailo15-agentic-coding
Assumed layout (mirrors this repo for the Claude-relevant files):
.claude/— skills, agents, settingsCLAUDE.md— root project instructions
If the layout has changed, adjust the sync paths in step 4 accordingly.
Procedure
Sanity-check the working tree. Refuse to overwrite uncommitted local edits to
.claude/orCLAUDE.mdwithout an explicit OK from the user.git status --porcelain .claude CLAUDE.mdIf non-empty, list the dirty paths and ask the user whether to proceed (their changes will be overwritten for any file the external repo also has).
Fetch the external repo's last commit date. No clone yet — just the metadata, via the unauthenticated GitHub API:
EXT_JSON=$(curl -fsSL "https://api.github.com/repos/hailo-ai/hailo15-agentic-coding/commits/HEAD") || { echo "Cannot reach hailo15-agentic-coding — check network or whether the repo is public/accessible." exit 1 } EXT_DATE=$(python3 -c 'import sys, json; print(json.loads(sys.argv[1])["commit"]["committer"]["date"])' "$EXT_JSON") EXT_SHA=$(python3 -c 'import sys, json; print(json.loads(sys.argv[1])["sha"][:12])' "$EXT_JSON")Get this repo's last commit date.
LOC_DATE=$(git -C . log -1 --format=%cI HEAD) LOC_SHA=$(git -C . log -1 --format=%h HEAD)Compare with
EXT_DATE. IfEXT_DATE <= LOC_DATE, report "up to date (local $LOC_SHA @ $LOC_DATE ≥ external $EXT_SHA @ $EXT_DATE)" and stop.Shallow clone the external repo to a temp dir.
TMP=$(mktemp -d) git clone --depth=1 https://github.com/hailo-ai/hailo15-agentic-coding.git "$TMP/agentic"Bail out if the clone fails.
Sync the files in. Use
rsync -a(no--delete) so we overwrite + add, never remove. Two sources, both rooted at the repo top:REPO_ROOT=$(git rev-parse --show-toplevel) # .claude/ (recursively) if [ -d "$TMP/agentic/.claude" ]; then rsync -a "$TMP/agentic/.claude/" "$REPO_ROOT/.claude/" fi # CLAUDE.md at the root, only if the external repo carries one if [ -f "$TMP/agentic/CLAUDE.md" ]; then cp -f "$TMP/agentic/CLAUDE.md" "$REPO_ROOT/CLAUDE.md" fiCleanup + summary.
rm -rf "$TMP" git -C "$REPO_ROOT" status --short .claude CLAUDE.md git -C "$REPO_ROOT" diff --stat .claude CLAUDE.md | tail -20Tell the user:
- external commit pulled (
$EXT_SHA @ $EXT_DATE), - the list of changed paths from
git status, - that they should review the diff and commit themselves; this skill does not commit.
- external commit pulled (
Inputs to ask the user
Ask only when something blocks the sync:
- "Your working tree under
.claude/has uncommitted changes — overwrite them?" (only if step 1 reports dirty paths) - "External repo isn't reachable / returns 404 — should I retry, or are you offline?" (only on API failure)
Otherwise the skill runs end-to-end.
Gotchas
- No
--delete. A file that you deleted locally but that still exists in the external repo will reappear after sync. If the user wants strict mirroring, they have to ask explicitly — this skill doesn't do destructive removal by default. - Don't auto-commit. The user owns the commit message and decides which subset of the sync to keep. The skill stops at
git status/git diff.