rebase-pr
Skill2 starsChanged 19 days agoApache-2.0View on GitHub
Rebase a PR branch onto main. Handles merge commits, conflicts (auto-resolve when possible), linting, force push. Use when user says "rebase", "rebase PR", "rebase branch".
- Deletes or force-pushes
- Commits and pushes
2 other projects use a version of this.
Adopted by
Most recently taken up by
- zzacong/agent-skillstheir own version, first seen Oct 4, 2026
- pmatos/skillstheir own version, first seen Jul 2, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- pmatos/skills★ 2same name
- zzacong/agent-skills★ 0same name
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 repository124 other files it gives its agents.
- add-projectSkill
- ansible-configure-vmSkill
- api-smoke-testSkill
- appinterface-checkSkill
- attach-session-to-jiraSkill
- aws-rds-debugSkill
- beerSkill
- bootstrap-all-knowledgeSkill
- bootstrap-knowledgeSkill
- build-persona-styleSkill
- cancel-pipelineSkill
- cert-checkSkill
- check-ci-healthSkill
- check-integration-testsSkill
- check-mr-feedbackSkill
- check-my-prsSkill
- check-secretsSkill
- ci-retrySkill
- cleanup-branchesSkill
- cleanup-stale-executionsSkill
- clone-jira-issueSkill
- close-issueSkill
- close-mrSkill
- cloud-inventorySkill
- coffeeSkill
- compare-optionsSkill
- create-jira-issueSkill
- create-mrSkill
- create-slide-deckSkill
- data-migration-verifySkill
- debug-local-dbSkill
- debug-prodSkill
- deploy-to-ephemeralSkill
- dev-workflow-orchestratorSkill
- discovered-work-summarySkill
- edit-slide-deckSkill
- email-digestSkill
- environment-overviewSkill
- explain-codeSkill
- export-presentationSkill
- extend-ephemeralSkill
- find-similar-codeSkill
- gather-contextSkill
- gdrive-researchSkill
- gke-cluster-opsSkill
- hello-worldSkill
- hotfixSkill
- inscope-researchSkill
- investigate-alertSkill
- investigate-service-issuesSkill
- investigate-slack-alertSkill
- jira-hygiene-allSkill
- jira-hygieneSkill
- knowledge-refreshSkill
- konflux-statusSkill
- learn-architectureSkill
- learn-patternSkill
- list-presentationsSkill
- local-build-testSkill
- local-dev-environmentSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 1 is distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 31
If mr_id: gitlab_mr_view(project, mr_id) → extract branch via extract_branch_from_mr
- Very specific: line 32
If issue_key: git_branch_list(repo, all_branches=true) → parse_git_branches with issue filter
- Very specific: line 49
If conflicts: parse_conflict_markers — auto-resolve when: identical, ours empty (accept theirs), theirs empty (accept ours), …
- Distinctive: line 52
If needs human: list files, show conflict markers, guide: git add → git rebase --continue → git push --force-with-lease
- Very specific: line 61
If mr_id: skill_run("ci_retry", '{"mr_id": X, "project": "..."}') — restart pipeline
- Very specific: line 69
Update state/current_work.open_mrs — last_rebase, rebase_success, pushed
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Rebase PR Branch
Inputs
| Input | Type | Default | Purpose |
mr_id | int | - | GitLab MR ID — find branch |
issue_key | string | - | Jira key — find branch and resolve repo |
branch | string | - | Branch name directly |
repo_path | string | "" | Repo path; resolved from issue_key/repo_name if empty |
repo_name | string | - | Config repo name |
base_branch | string | "" | Rebase onto (default: main from config) |
force_push | bool | false | Auto force-push after rebase |
run_linting | bool | true | Run black/flake8 before push |
Workflow
1. Bootstrap
persona_load("developer")check_known_issues("git_rebase")— known rebase patterns- Load
learned/patterns.rebases— conflict-prone files knowledge_query(project="automation-analytics-backend", section="patterns.coding")
2. Resolve Repo & Branch
- Resolve repo from
repo_path,repo_name, orissue_keyvia config - If
mr_id:gitlab_mr_view(project, mr_id)→ extract branch viaextract_branch_from_mr - If
issue_key:git_branch_list(repo, all_branches=true)→parse_git_brancheswith issue filter - Require one of: mr_id, issue_key, branch
3. Pre-rebase
git_fetch(repo, prune=true)git_log(repo, range_spec="origin/main..origin/branch", merges_only=true)— merge commitsgit_status(repo)— uncommitted changes- If dirty:
git_stash(repo, action="push", message="rebase_pr: auto-stash") git_checkout(repo, target=branch)— orforce_create=true, start_point=origin/branchif local missinggit_pull(repo)orgit_reset(repo, target=origin/branch, mode="hard")if pull fails
4. Rebase
git_fetch(repo, remote="origin", branch=default_branch)— update basegit_rebase(repo, onto="origin/main")— ororigin/{default_branch}- Parse: success ("Successfully rebased"), conflicts (extract conflict files via
extract_conflict_files)
5. Handle Conflicts
- If conflicts:
parse_conflict_markers— auto-resolve when: identical, ours empty (accept theirs), theirs empty (accept ours), whitespace-only, subset merge - Stage resolved:
git_add(repo, files="...") git_rebase(repo, continue_rebase=true)if all resolved- If needs human: list files, show conflict markers, guide:
git add→git rebase --continue→git push --force-with-lease
6. Linting (if success and run_linting)
lint_python(repo, fix=false)— or black --check + flake8- Block push if lint fails
7. Force Push (if success and force_push)
- Dry-run:
git_push(repo, branch, force=true, dry_run=true)— check protection - If allowed:
git_push(repo, branch, force=true) - If
mr_id:skill_run("ci_retry", '{"mr_id": X, "project": "..."}')— restart pipeline persona_load("developer")— restore after ci_retry
8. Notify & Memory
skill_run("notify_team", '{"message": "Branch rebased and force-pushed for MR !X", "channel": "team"}')memory_session_log("Rebased MR !X", "Success|Conflicts|Failed")- Record in
learned/patterns.rebases— branch, mr_id, had_conflicts, auto_resolved, conflict_files - Track
conflict_prone_filesfor files with repeated conflicts - Update
state/current_work.open_mrs— last_rebase, rebase_success, pushed
9. Failure Learning
- "conflict" →
learn_tool_fix("git_rebase", "conflict", "Merge conflicts", "Resolve, git add, git rebase --continue") - "no such host" →
learn_tool_fix("gitlab_mr_view", "no such host", "VPN", "vpn_connect()") - "permission denied" → ssh-add, check credentials
Key MCP Tools
persona_load,git_fetch,git_status,git_stash,git_checkout,git_pull,git_reset,git_log,git_rebase,git_add,git_push,git_rev_parsegitlab_mr_viewlint_pythonor black/flake8 subprocessknowledge_query,check_known_issues,learn_tool_fixmemory_session_log,skill_run
Conflict Resolution
Auto-resolve: identical, accept_theirs (ours empty), accept_ours (theirs empty), whitespace_only, subset_merge. Complex conflicts: guide user through <<<<<<<, =======, >>>>>>> resolution.
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.

