merge
Skill6 starsChanged 27 days agoMITView on GitHub
Plan and execute a safe merge of the current working branch into `upstream/main` by accumulating only green-test changes onto a separate `<branch>-merge` branch. Invoked via `/merge`. Use this skill whenever the user asks to "merge", "land", "prepare for merge", "cherry-pick safely", or any equivalent request to move work from a long-running branch toward `upstream/main`. The skill enforces the house policy that `pyre/check.py` must be all green, and it prefers line-level imports over whole-commit cherry-picks (bare `git cherry-pick` is only safe for trivially conflict-free, self-contained commits). Default to using this skill any time the user hints at moving work from a long-running branch toward `upstream/main`, even without explicit keywords.
57 other projects use a version of this.
Adopted by
Most recently taken up by
- Kealman/cland-v0their own version, first seen Nov 15, 2026
- Trixx4191/asrartheir own version, first seen Nov 15, 2026
- automagik-si/genietheir own version, first seen Nov 15, 2026
- ToolJet/ToolJettheir own version, first seen Nov 12, 2026
- toy-crane/claude-code-playbook-templatetheir own version, first seen Nov 10, 2026
- ryanportfolio/HarnessFirmware.comtheir own version, first seen Nov 8, 2026
Used with
Projects with it also use addskill, apply-firmware and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
ryanportfolioSkilladdskill
Create, import, update, or install repo or personal skills: runtime ownership, resources, discovery checks.
Also in 6 projects that use this
ryanportfolioSkillapply-firmware
Bring current folder (plain folder, existing repo, old or partial firmware copy) up to full Harness Firmware in place. Mirror external repo → adopt-repo.
Also in 6 projects that use this
- +10 more from ryanportfolio
Other versions57 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 57
- microsoft/vscode★ 195ksame name
- remotion-dev/remotion★ 73ksame name
- withastro/astro★ 64ksame name
- ToolJet/ToolJet★ 41ksame name
- Openpanel-dev/openpanel★ 7.3ksame name
- raine/workmux★ 3ksame name
- jtenniswood/espcontrol★ 1.2ksame name
- K9i-0/ccpocket★ 1.1ksame name
- r1n7aro/Locus★ 759same name
- automagik-dev/genie★ 353same name
47 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- codex-reviewSkill
- paritySkill
- apple-containerSkill
- codex-reviewSkill
- paritySkill
- rebaseSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
24 rules. 0 are common, 8 are distinctive, and 16 are very specific to this project.
0
Common
Most of the 51 edited versions we read keep these.
8
Distinctive
This author's own choices. Worth a look.
16
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
- Very specific: line 16
Keep the original working branch untouched — it remains the source of truth for "what we eventually want".
- Very specific: line 20
When the user types /merge:
- Distinctive: line 23
Check current state and plan.
- Very specific: line 43
If <MERGE> does not exist:
- Very specific: line 44
Create it at upstream/main: git branch <MERGE> upstream/main
- Distinctive: line 45
Do not check it out yet unless the user wants to start immediately.
- Very specific: line 47
If <MERGE> already exists:
- Very specific: line 48
Verify it is a descendant of (or equal to) upstream/main.
- Very specific: line 49
Check whether pyre/check.py passes on <MERGE> before adding anything.
- Very specific: line 66
Default to line-by-line imports.
- Distinctive: line 78
If any of those fail, fall back to line-by-line.
- Very specific: line 87
Write the change by hand on <MERGE> — read the source from WORK, but apply it with Edit/Write onto <MERGE>.
- Very specific: line 89
Before committing, re-read the diff against the base (git diff upstream/main -- <file>) and confirm only the intended lines moved.
- Very specific: line 93
Run python ./pyre/check.py after every slice, no matter how small.
- Distinctive: line 105
If the change is irreducibly unsafe on its own, mark it as "deferred" and move on to a different slice.
- Very specific: line 107
Never "commit and fix later".
- Very specific: line 111
When pyre/check.py is green, commit with a factual message (no speculation about goals, no Co-Authored-By but use Assisted-By, English …
- Distinctive: line 130
When the user decides to stop (either the diff is empty or the remaining work is not safely landable):
- Distinctive: line 135
Do not push, merge, or open a PR unless the user explicitly asks.
- Distinctive: line 139
Prefer line-by-line slices.
- Very specific: line 140
Never commit on <MERGE> without a green pyre/check.py immediately before.
- Very specific: line 141
Never modify WORK from this skill — it is read-only here.
- Very specific: line 142
Never push <MERGE> or open a PR without explicit user instruction.
- Distinctive: line 143
Always commit after each green test — do not batch multiple slices into one commit, because a later red test cannot be bisected if slices …
“Common” is measured: kept by at least 6 in 10 of the 51 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.
Files
Safe Merge via -merge Branch
Why this skill exists
The working branch has accumulated many commits; some of them break pyre/check.py. House policy is:
pyre/check.py must be all green — no exceptions — before anything lands on upstream/main.
Cherry-picking by commit almost always breaks the build because commits depend on each other and on intermediate states that never made it through review. So we never move whole commits. We move code, one small slice at a time, and run the tests after each slice.
Keep the original working branch untouched — it remains the source of truth for "what we eventually want". The -merge branch is a clean, always-green staging area that starts at upstream/main and only grows with verified slices.
Invocation
When the user types /merge:
- Parse any follow-up text as scoping hints (e.g.
/merge only the heapcache changes,/merge focus on blackhole.rs). Default is "work through everything safely". - Check current state and plan.
- Execute the plan with the user.
Step 1 — Establish the -merge branch
Determine:
WORK= the current branch (e.g.stdlib)MERGE=<WORK>-merge(e.g.stdlib-merge)BASE=upstream/main
Run:
git branch --show-current # confirm WORK
git rev-parse --verify upstream/main # confirm BASE exists
git rev-parse --verify <MERGE> 2>/dev/null # does MERGE already exist?This skill does not auto-fetch — upstream/main is whatever the user last fetched (they sync the upstream remote manually). If upstream/main is missing, stop and ask the user to add the remote (git remote add upstream <URL>) and fetch it; do not fall back to local main.
If <MERGE> does not exist:
- Create it at
upstream/main:git branch <MERGE> upstream/main - Do not check it out yet unless the user wants to start immediately. Confirm with the user before switching.
If <MERGE> already exists:
- Verify it is a descendant of (or equal to)
upstream/main. If not, surface the divergence and ask the user whether to reset it toupstream/mainor continue from its current tip. - Check whether
pyre/check.pypasses on<MERGE>before adding anything.
State the plan concisely before moving code: which branch is source, which is destination, and what the user wants to land first.
Step 2 — Survey what needs to move
Work from the current state of both branches:
git diff <MERGE>..<WORK> --stat # what's left to bring over
git diff upstream/main..<MERGE> --stat # what's already landed safelygit diff upstream/main <MERGE> is how we track progress — it grows with each safe slice. Show the user the remaining diff bucketed by file/area so they can point at what to try first.
Step 3 — Prefer line-by-line slices; cherry-pick only when trivially clean
Default to line-by-line imports. The reason is that commits on WORK tend to:
- Depend on earlier broken states, scaffolding, or partial refactors that never land.
- Mix correctness fixes (safe) with speculative behavior changes (unsafe) in a single commit.
- Split renames and follow-up cleanups across commits — taking only one leaves dangling references.
That said, git cherry-pick is acceptable for a commit that meets all of:
- Applies cleanly (no conflict, no
--strategytricks). - Is self-contained — touches one concern, with no implicit dependency on other un-landed commits.
- Has been inspected hunk-by-hunk, not just by subject line.
If any of those fail, fall back to line-by-line. When in doubt, line-by-line is always safe; cherry-pick is an optimization.
Safe slicing procedure (line-by-line path):
- Pick a small, self-contained change from
git diff <MERGE>..<WORK>for one file. Prefer:- A single added/renamed helper function with no new call sites yet.
- A bugfix hunk that does not depend on new types or new fields.
- A pure refactor (e.g. extracted local, renamed local variable) verifiable by inspection.
- Comment, doc, or dead-code removal.
- Write the change by hand on
<MERGE>— read the source fromWORK, but apply it withEdit/Writeonto<MERGE>. Do not usegit checkout <WORK> -- <file>for partial changes; that grabs the whole file and usually breaks things. - For a clean whole-file import where inspection confirms the file is self-contained (e.g. an isolated new module with no existing callers on
upstream/main),git checkout <WORK> -- <path>is acceptable, but verify with the test run immediately after. - Before committing, re-read the diff against the base (
git diff upstream/main -- <file>) and confirm only the intended lines moved.
Step 4 — Test every slice
Run python ./pyre/check.py after every slice, no matter how small. This is non-negotiable — the whole point of the -merge branch is that it is always green.
python ./pyre/check.pyOutcomes:
- All green → commit immediately, then pick the next slice.
- Red → do NOT commit. Either:
- Shrink the slice further (most common fix — revert part of the change and retry).
- Pull in the missing dependency (a helper, a type, a rename) from
WORKfirst, then re-test. - If the change is irreducibly unsafe on its own, mark it as "deferred" and move on to a different slice. Tell the user which slice was deferred and why.
Never "commit and fix later". <MERGE> must stay green at every commit.
Step 5 — Commit on success
When pyre/check.py is green, commit with a factual message (no speculation about goals, no Co-Authored-By but use Assisted-By, English only):
git add <files>
git commit -m "<concise factual summary>"Then loop back to Step 3 with the next slice.
Periodically re-run:
git diff <MERGE>..<WORK> --statto see what is left. The goal is to drive this diff toward empty, one green commit at a time.
Step 6 — Wrap-up
When the user decides to stop (either the diff is empty or the remaining work is not safely landable):
- Report what landed on
<MERGE>(git log upstream/main..<MERGE> --oneline). - Report what is deferred, per-file, with the reason it could not land.
- Confirm the original
WORKbranch is untouched (git log <WORK>unchanged vs. when we started). - Do not push, merge, or open a PR unless the user explicitly asks.
Hard rules (recap)
- Prefer line-by-line slices.
git cherry-pickis allowed only for trivially conflict-free, self-contained commits that have been inspected hunk-by-hunk. - Never commit on
<MERGE>without a greenpyre/check.pyimmediately before. - Never modify
WORKfrom this skill — it is read-only here. - Never push
<MERGE>or open a PR without explicit user instruction. - Always commit after each green test — do not batch multiple slices into one commit, because a later red test cannot be bisected if slices are batched.
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.

