merge-base-branch
Installation
SKILL.md
Merge the chosen base branch into the current branch and finish with a clean lint, full test coverage, and successful build. Use when you want the branch fully reconciled with its parent and CI-quality checks passing locally.
Usage:
/merge-base-branch— Run the full workflow below
Prerequisites:
- Repository root must be a git checkout on a named branch (not detached HEAD).
- If the project uses Node/npm,
package.jsonmust define scriptslint,test:coverage, andbuild. Ifpackage.jsonis missing or any of those scripts is missing, report what is absent and STOP (do not merge or proceed without the mandated checks).
Instructions:
-
Current branch:
- Run
git branch --show-current. If detached HEAD, inform the user and STOP.
- Run
-
Determine base branch candidate, then let the user choose:
- First, if
.agentexists at the repo root, read it forbaseBranch=<value>. That value is the detected candidate (if present). - Else, infer from git: run
git merge-base --fork-point main HEAD,git merge-base --fork-point master HEAD, andgit merge-base --fork-point develop HEAD. Any branch name that returns a commit is a match. If exactly one matches, that is the detected candidate. If several match, choose by priority:main, thenmaster, thendevelop. If none match, detected candidate is unset. - Use
AskUserQuestionso the user picks the base branch to merge. Always includemainas an option. Include the detected candidate as an option when it is set and differs frommain. Includemasteranddevelopas additional options when they exist onorigin(or locally). Include a short label on each option (e.g. “Detected from history: develop”). Wait for the answer; the selected branch is<base-branch>.
- First, if