Imported from multiplai-ai/ai-marketing-os (
sops/sync-repo/SKILL.md). Install upstream withnpx skills add multiplai-ai/ai-marketing-os --skill sync-repo. Copyright stays with the author (MIT).
Sync Repo
Use this skill before changing files in the brand OS repo from a production Hermes profile, especially on the VPS production instance.
Operating Branch
Read the branch from config/hermes-profiles.yaml:
BRANCH=$(python3 - <<'PY'
import yaml
with open('config/hermes-profiles.yaml') as f:
print(yaml.safe_load(f)['operating_branch'])
PY
)
test "$BRANCH" = "main" || { echo "Unexpected operating_branch=$BRANCH"; exit 1; }
D1 rule: production agents pull and push only the registry branch. Do not discover or choose a different branch from local git state.
Before Editing
- Confirm you are in the brand OS repo and on the registry branch:
git rev-parse --show-toplevel
git remote -v
git branch --show-current
test "$(git branch --show-current)" = "$BRANCH"
- Check for existing local work:
git status --short
If the working tree is dirty before you start, stop and report the changed files. Do not overwrite or auto-commit work that owner or another agent may have made.
- Pull only when the tree is clean, using the D3 rebase protocol:
git fetch origin
git pull --rebase origin "$BRANCH"
If the pull/rebase fails, stop and report the failure. Do not merge, reset, clean, or force-push unless owner explicitly asks.
After Editing
- Review the diff:
git status --short
git diff --check
git diff --stat
- Commit only the files you changed:
git add <files-you-changed>
git commit -m "[hermes] <specific summary>"
- Push to the registry branch. If rejected because the remote moved, retry once with
pull --rebase, then stop and report if it still fails:
git push origin "$BRANCH" || {
git pull --rebase origin "$BRANCH" && git push origin "$BRANCH"
}
Guardrails
- Never commit
.env, logs, caches, key files, token files, or profile secrets. - Never use
git reset --hard, force push, or broad checkout commands without explicit approval. - Use
[hermes]for Hermes-authored repo changes. - Use
[mac-sync]only for local scheduled safety-net commits. - Keep reusable workflow logic in
skills-core/; keep Hermes-specific setup inproducts/hermes-brand-agent/.