agentleFS
EricTechProEricTechPro/super-board/skills/git-sync/SKILL.md

git-sync

Skill572 starsChanged 39 days agoMITView on GitHub

Sync the current branch in one pass — commit the working tree as one commit per logical change (in the host repo's commit format, or the super-board writing standard), gate Supabase schema changes, merge-pull, resolve conflicts hunk by hunk, then push without force. Use when the user runs /git-sync or says "git-sync", "sync", "commit and push", "pull and push", or "sync my branch".

  • Reads credentials
  • Commits and pushes

7 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

18 rules. 0 are common, 5 are distinctive, and 13 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 13

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Commit what is in the working tree, pull, push, report.

    line 8
  2. Very specific:

    Stop and tell the user when a step says stop.

    line 9
  3. Very specific:

    Run git status, git branch --show-current and git rev-parse --abbrev-ref @{upstream}.

    line 14
  4. Very specific:

    Run git fetch and git rev-list --left-right --count HEAD...@{upstream} for ahead/behind.

    line 15
  5. Distinctive:

    Stop on a detached HEAD.

    line 16
  6. Very specific:

    Stop when a merge, rebase, cherry-pick or revert is in progress that this run did not start (.git/MERGE_HEAD, .git/rebase-merge, …

    line 17
  7. Distinctive:

    Read the diff (git diff, git diff --staged, untracked files) and group it into logical changes.

    line 23
  8. Very specific:

    NEVER stage secrets: .env* (except .env.example), keys (*.pem, *.key, id_rsa*), credential or token files, or a diff line that holds a key.

    line 27
  9. Very specific:

    Run the Supabase gate (section 3) before any commit that touches supabase/.

    line 32
  10. Very specific:

    Commit each group. Let the hooks run.

    line 33
  11. Distinctive:

    Keep any attribution trailer the session asks for.

    line 43
  12. Very specific:

    When the CLI and local stack are up, run supabase migration list --local.

    line 54
  13. Very specific:

    Run supabase db advisors (or the Supabase MCP get_advisors) when available.

    line 55
  14. Distinctive:

    Run git pull --no-rebase. Merge, never rebase.

    line 61
  15. Distinctive:

    No conflict: go to Push.

    line 62
  16. Very specific:

    NEVER use -X ours, -X theirs, git checkout --ours/--theirs on a whole file, or delete a side to make the conflict go away.

    line 65
  17. Very specific:

    Run the host's fast checks before concluding the merge: typecheck, lint and tests as the host's AGENTS.md, CLAUDE.md or package.json …

    line 68
  18. Very specific:

    NEVER --force or --force-with-lease.

    line 77

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/git-sync

Commit what is in the working tree, pull, push, report. One step per line. Stop and tell the user when a step says stop. NEVER force push, rebase shared history, or skip a hook (--no-verify).

1 · Look

  1. Run git status, git branch --show-current and git rev-parse --abbrev-ref @{upstream}.
  2. Run git fetch and git rev-list --left-right --count HEAD...@{upstream} for ahead/behind.
  3. Stop on a detached HEAD.
  4. Stop when a merge, rebase, cherry-pick or revert is in progress that this run did not start (.git/MERGE_HEAD, .git/rebase-merge, .git/rebase-apply, .git/CHERRY_PICK_HEAD).
  5. Nothing to commit and nothing ahead or behind: say "in sync" and stop.

2 · Commit

  1. Read the diff (git diff, git diff --staged, untracked files) and group it into logical changes. One change, one commit.
  2. Stage each group by explicit path (git add -- <path>…). NEVER git add -A, git add . or git commit -a.
  3. NEVER stage secrets: .env* (except .env.example), keys (*.pem, *.key, id_rsa*), credential or token files, or a diff line that holds a key. Stop and warn, naming the file.
  4. A file that looks like someone else's work in progress (another task's half-edit, a file you can't explain from this conversation): leave it unstaged and list it in the report.
  5. Changes already staged by the user are one group; commit them as they are.
  6. Run the Supabase gate (section 3) before any commit that touches supabase/.
  7. Commit each group. Let the hooks run; a failing hook is a stop, not a retry with --no-verify.

Commit format. The host wins.

  1. The host's AGENTS.md, CLAUDE.md or CONTRIBUTING.md defines a commit format: follow it (for example #N: type: description).
  2. Otherwise use section "1 · Commit" of the super-board writing standard (.claude/skills/super-board/references/writing-standard.md): emoji, [type], scope, subject, 1–4 bullets, Closes #N when the commit finishes a ticket.
  3. Keep any attribution trailer the session asks for.

3 · Supabase gate

Runs only when a commit group touches supabase/ (migrations, schema, functions).

  1. The supabase skill is installed: follow its "Making and Committing Schema Changes" section and skip the rest of this list.
  2. Each schema change has its own migration file named the way supabase migration new <name> names it (supabase/migrations/<timestamp>_<name>.sql). A schema edit with no migration is a stop.
  3. When the CLI and local stack are up, run supabase migration list --local.
  4. Run supabase db advisors (or the Supabase MCP get_advisors) when available.
  5. An advisor error is a stop. Warnings go in the report.
  6. CLI or stack not available: say which checks were skipped and why, then continue.

4 · Pull

  1. Run git pull --no-rebase. Merge, never rebase.
  2. No conflict: go to Push.
  3. Conflict: use the resolving-merge-conflicts skill when it is installed.
  4. Without it, resolve hunk by hunk and keep both sides' intent.
  5. NEVER use -X ours, -X theirs, git checkout --ours/--theirs on a whole file, or delete a side to make the conflict go away.
  6. A hunk whose intent is unclear: stop and ask the user, showing both sides.
  7. Run the host's fast checks before concluding the merge: typecheck, lint and tests as the host's AGENTS.md, CLAUDE.md or package.json documents them.
  8. Checks fail: fix the merge, not the checks. Still failing: stop and report.
  9. Conclude with git commit --no-edit.

5 · Push

  1. The branch has an upstream: git push.
  2. A new branch: git push -u origin <branch>.
  3. NEVER --force or --force-with-lease.
  4. The branch is the default or a protected branch (main, master, production, or the repo's default from gh repo view --json defaultBranchRef): push only after the user says yes in this conversation. Otherwise offer a branch and a PR instead.
  5. Push rejected as non-fast-forward: go back to Pull once. Rejected again: stop.

6 · Report

Keep it short:

Committed  <sha> <subject>
           <sha> <subject>
Pulled     <N> commits (<conflicts resolved: N files | no conflicts>)
Pushed     <N> commits to <remote>/<branch>
Left out   <path> — <why>
Supabase   <advisors clean | N warnings | skipped: why>

Drop the lines that do not apply.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.