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.
In this repository18 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- 1-csk-initSkill
- 2-csk-write-specSkill
- 3-csk-architectureSkill
- 4-csk-frontendSkill
- 5-csk-backendSkill
- 6-csk-qaSkill
- 7-csk-deploySkill
- audit-plan-loopSkill
- claude-skill-proxy-syncSkill
- create-worker-worktreeSkill
- csk-adopt-plan-scaffoldSkill
- csk-helpSkill
- csk-refineSkill
- csk-startSkill
- finish-branchSkill
- review-loopSkill
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
- Distinctive: line 14
When this skill starts, first give the user one plain-language sentence in the user's language, for example: "Egal wo du stehst — dieses …
- Very specific: line 43
If the output contains the marker MERGE-COMMIT-GATE, the incoming commits contain no merge commit.
- Distinctive: line 51
Do not simply rerun the skill.
- Distinctive: line 55
Ask why there is no merge commit (direct push?
- Distinctive: line 57
Only after the user explicitly confirms, rerun deliberately:
- Distinctive: line 65
Run any other git command or modify files in this skill.
≈ “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.
Files
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.pyShow the user the complete script output. The script detects the mode from the current branch:
| Context | Behaviour |
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 origin | Fail-closed stop with guidance: integrate through a pull request first (/finish-branch), then re-sync. No silent merge. |
| Any other branch | Stop 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:
- Do not simply rerun the skill.
- 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.
- Ask why there is no merge commit (direct push? squash/rebase merge? something unexpected?).
- Only after the user explicitly confirms, rerun deliberately:
python .claude/skills/pull-main-ff/scripts/pull_main_ff.py --allow-non-merge-ffNever 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.
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
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.

