Gitsync

From JayFarei/opentraces · View interactive version

Gitsync is an AI agent skill from the GitHub repository JayFarei/opentraces. Sync both git repos in this project: opentraces (root) and closedtraces (kb/). Runs the full lifecycle for each — pull, check status, commit any pending changes, push. Use when the user says "gitsync", "sync repos", "sync both repos", "commit and push both", or "sync opentraces and closedtraces".

How to use this skill

Skill file

gitsync

Sync both repos in this project: opentraces (root) and closedtraces (kb/).

Repos

| Repo | Path | Remote |

|------|------|--------|

| opentraces | /Users/jayfarei/src/tries/2026-03-27-community-traces-hf | github.com/JayFarei/opentraces |

| closedtraces | /Users/jayfarei/src/tries/2026-03-27-community-traces-hf/kb | github.com/JayFarei/closedtraces |

Lifecycle (run for each repo in order)

1. Pull (rebase)

git -C <path> pull --rebase

If the pull produces a merge conflict, stop immediately and report it to the user with

the conflicted files. Do not attempt to resolve conflicts automatically.

2. Check status

git -C <path> status --short

If clean, skip to the next repo — nothing to commit.

3. Commit pending changes

Show the user a brief summary of what's pending (file list + diff stat), then commit:

git -C <path> add -A
git -C <path> commit -m "$(cat <<'EOF'
<descriptive message summarizing the changes>

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
EOF
)"

Write a meaningful commit message. Do not use generic messages like "sync" or "update files".

Look at git diff --cached to understand what changed and summarize it.

4. Push

git -C <path> push

If push is rejected (non-fast-forward), pull --rebase first then push again.

Output format

After completing both repos, report a one-liner per repo:

opentraces:    pulled (2 commits), committed "fix(quality): ..." (3 files), pushed
closedtraces:  already up to date, committed "update discussion log" (1 file), pushed

Or if nothing needed:

opentraces:    already up to date, nothing to commit
closedtraces:  already up to date, nothing to commit

Important notes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.