merge-worktree

Solid

Squash-merge the current worktree branch into the main branch (or a specified target). Analyzes git history and source code to craft a comprehensive commit message.

Code & Development 11 stars 1 forks Updated 4 days ago MIT

Install

View on GitHub

Quality Score: 82/100

Stars 20%
36
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Merge Worktree Squash-merge the current worktree branch back into the target branch with a comprehensive, structured commit message. ## Current context - Git dir: `!git rev-parse --git-dir` - Current branch: `!git branch --show-current` - Recent commits: `!git log --oneline -20` - Working tree status: `!git status --short` ## Instructions Follow these phases exactly, in order. Do NOT skip phases. --- ### Phase 1: Validation 1. **Verify worktree**: Check if the current git directory is a worktree. The output of `git rev-parse --git-dir` must contain `/worktrees/`. If it does not, **stop immediately** and tell the user: > "This skill must be run from inside a git worktree. Use `/worktree` to create one first." 2. **Identify current branch**: Get the worktree branch name from `git branch --show-current`. 3. **Resolve target branch**: - If `$ARGUMENTS` is provided and non-empty, use it as the target branch. - Otherwise, detect the default branch: check if `main` exists, else check `master`. If neither exists, stop and ask the user. 4. **Identify the original repo path**: Parse the original repo root from the git-dir path. The worktree's `.git` file points back to the main repo — use `git rev-parse --git-common-dir` to find it, then derive the original repo working directory (its parent). 5. **Clean working tree**: Run `git status --porcelain`. If there are uncommitted changes, stop and tell the user to commit or stash them first. --- ### Phase 2: Research...

Details

Author
HyperAITeam
Repository
HyperAITeam/CLITrigger
Created
4 months ago
Last Updated
4 days ago
Language
TypeScript
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category