update-from-main
Skill1 starsChanged 5 months agoApache-2.0View on GitHub
Safely sync attached non-`main` worktree branch with fetched `origin/main`. Use when asked to update, merge, or bring main into current branch.
In this repository21 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-aeoSkill
- agent-memorySkill
- beanquerySkill
- ci-repairbaySkill
- delegated-developmentSkill
- ghSkill
- git-commitSkill
- git-prSkill
- issue-blueprintSkill
- issue-workbenchSkill
- minifluxSkill
- og-imageSkill
- pencil-to-figma-migrationSkill
- pr-comment-sweepSkill
- pr-launchpadSkill
- repo-surveyorSkill
- review-checkpointSkill
- review-repairbaySkill
- shipyardSkill
- skill-optimizerSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
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
- Very specific: line 8
Run python3 <skill>/scripts/update_from_main.py once.
- Distinctive: line 19
Stop. No tests, install, history scan, push, extra commit, or helper rerun.
- Distinctive: line 31
Start conflict triage with emitted JSON conflict path list, then inspect marker line numbers one separately quoted path at a time:
- Distinctive: line 42
After recovery, verify exact source merged:
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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
update-from-main
Run python3 <skill>/scripts/update_from_main.py once. Helper fetches before mutation, stashes tracked/untracked state plus colliding ignored paths, and merges exact emitted main SHA.
Fast path
For status=merged or status=up_to_date, report emitted line, run:
git status --short --branch
git diff --check <emitted-before-sha> HEADStop. No tests, install, history scan, push, extra commit, or helper rerun.
Recovery
Emitted main SHA is authoritative for run. Do not rerun because origin/main advances. Never rerun while emitted stash remains retained; finish current recovery first.
status=merge_conflict: resolve andgit add <paths>; runGIT_EDITOR=true git merge --continue, then apply non-nonestash withgit stash apply --index <oid>.status=merge_pending: fix failed merge hook, runGIT_EDITOR=true git merge --continue, then apply non-nonestash.status=submodule_update_required: rungit submodule update --checkout --recursive, then apply non-nonestash.status=stash_conflict: resolve and stage every emitted conflict path; retain and report stash OID.status=stash_restore_failed: retain and report stash OID. Inspect once withgit stash show --name-status --include-untracked <oid>, restore clear changes, and ask user only when one upstream-path collision version must win. Never drop backup first.
Start conflict triage with emitted JSON conflict path list, then inspect marker line numbers one separately quoted path at a time:
git show --no-patch --oneline <emitted-main-sha>
grep -nE '^(<<<<<<<|=======|>>>>>>>)' -- '<one-conflict-path>'Inspect bounded source regions around markers. Never dump full git diff --cc across files. Use bounded git show :2:path | sed -n '<start>,<end>p' and git show :3:path | sed -n '<start>,<end>p' only when hunk lacks context. Prefer upstream for unrelated changes; combine compatible overlapping behavior. Ask user only when intent cannot determine one required semantic winner.
Resolve source first. Regenerate lockfiles and build artifacts instead of reading generated conflicts. For docs/index conflicts, keep entries whose paths exist, add upstream paths, remove deleted paths, and avoid full-repo scans.
After recovery, verify exact source merged:
git merge-base --is-ancestor <emitted-main-sha> HEAD
git status --short --branchRun only smallest relevant check; docs-only recovery gets docs-specific checks, not broad tests. Run project dependency preflight before dependency-backed checks. Redirect check output to temp file. On success report command plus PASS; on failure print only final 100 lines. Never rebase, reset, abort, push, or commit unrelated work.
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.

