agentleFS
jnsfhrmnnjnsfhrmnn/jf-agentic-coding-starter-kit/.claude/skills/pull-main-ff/SKILL.md

pull-main-ff

Skill1 starsChanged 4 months agoMITView on GitHub

Context-sensitive safe sync with origin - one command for both sides of the worker-worktree cycle. On the default branch (main/master) it fast-forwards from origin; on a protected worker branch (*-workbench or .csk/worktrees.json) it re-syncs the branch onto the new default and fast-forward-pushes the remote ref, restoring it after host auto-delete. Use after a pull-request merge, when the user says their branch or main is behind, or as the sync step of the parallel-worktree cycle (both sides). Never switches branches, never creates a merge commit, blocks on uncommitted tracked changes and on unmerged worker commits, and stops with a MERGE-COMMIT-GATE when incoming commits bypassed the pull-request door.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When this skill starts, first give the user one plain-language sentence in the user's language, for example: "Egal wo du stehst — dieses …

    line 14
  2. Very specific:

    If the output contains the marker MERGE-COMMIT-GATE, the incoming commits contain no merge commit.

    line 43
  3. Distinctive:

    Do not simply rerun the skill.

    line 51
  4. Distinctive:

    Ask why there is no merge commit (direct push?

    line 55
  5. Distinctive:

    Only after the user explicitly confirms, rerun deliberately:

    line 57
  6. Distinctive:

    Run any other git command or modify files in this skill.

    line 65

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “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

Sync With Origin (Fast-Forward Only, Context-Sensitive)

One command for both sides: the user intention is always "bring me safely up to date with origin" - the script detects the context itself and picks the safe mechanics. A command that recognizes its context beats two commands the user must choose between.

When this skill starts, first give the user one plain-language sentence in the user's language, for example: "Egal wo du stehst — dieses eine Kommando bringt dich sicher auf den neuesten Stand. Wenn es stoppt, sagt es dir warum und was als Nächstes zu tun ist."

Run the bundled script only

python .claude/skills/pull-main-ff/scripts/pull_main_ff.py

Show the user the complete script output. The script detects the mode from the current branch:

ContextBehaviour
Default branch (main/master)Mode A: fast-forward the default branch from origin - the orchestrator step of the cycle.
Protected worker branch (*-workbench or listed in .csk/worktrees.json)Mode B: re-sync - merge --ff-only onto the new origin/<base>, then a fast-forward push so the remote ref follows (also restores a remote ref the host auto-deleted after the merge).
Worker branch with local commits not yet on originFail-closed stop with guidance: integrate through a pull request first (/finish-branch), then re-sync. No silent merge.
Any other branchStop without changes.

Both modes guarantee: no branch switch, no merge commit, a hard stop on uncommitted tracked changes (untracked files are allowed), and an honest result - "already up to date" is distinguished from "fast-forwarded <sha> -> <sha> (N commits)" and from "local branch is ahead (unpushed work)".

MERGE-COMMIT-GATE (applies in both modes)

If the output contains the marker MERGE-COMMIT-GATE, the incoming commits contain no merge commit. The expected workflow is a worker or feature branch merged into the default branch through a pull request - that always creates a merge commit. A missing merge commit points to a direct push to the default branch, a squash merge, or a rebase merge.

In that case:

  1. Do not simply rerun the skill.
  2. Show the user the listed incoming commits and explain in one plain sentence: work reached the default branch without going through the normal pull-request door, and the stop is protection, not a defect.
  3. Ask why there is no merge commit (direct push? squash/rebase merge? something unexpected?).
  4. Only after the user explicitly confirms, rerun deliberately:
python .claude/skills/pull-main-ff/scripts/pull_main_ff.py --allow-non-merge-ff

Never do

  • Run any other git command or modify files in this skill.
  • Switch branches or create a merge commit.
  • Work around the unmerged-commits stop with a manual merge or push; route that work through /finish-branch.
  • Resolve a reported divergence yourself; explain it and let the user decide the next step.

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.