skills/mine.worktree-rebase/SKILL.md
Use when the user says: "rebase this worktree" or "sync worktree to parent branch". Detects the parent repo's current branch and rebases this worktree onto it.
npx skillsauth add NodeJSmith/Claudefiles mine.worktree-rebaseInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
$ARGUMENTS — optional, natural language. Parse for two things:
feature/jsmith/foo, main). If provided, skip auto-detection and rebase onto this branch.force, just rebase, no prompt, skip prompt, yes, -y. If present, skip Phase 4 confirmation.Both are independent and can be combined.
Examples:
/mine.worktree-rebase — auto-detect, confirm before rebasing/mine.worktree-rebase just rebase — auto-detect, no confirmation/mine.worktree-rebase feature/jsmith/foo — explicit branch, confirm/mine.worktree-rebase feature/jsmith/foo force — explicit branch, no confirmationgit rev-parse --git-dirgit branch --show-currentgit-default-branchDetect whether the parent repo is currently on a non-default branch, and offer to rebase this worktree onto it. For best results, run this immediately after entering a new worktree.
Check the Context above. If the Git dir value does not contain worktrees/, stop immediately:
This skill only works from inside a git worktree. The current git dir is not a worktree path. Nothing to do.
If $ARGUMENTS contains a target branch (see Arguments), use that as <orig-branch> and skip to Phase 3.
Otherwise, auto-detect from the parent repo. Run these commands sequentially. Do NOT use $(...) command substitution (see CLAUDE.md bash restrictions).
Step 1 — Get the shared git directory:
git rev-parse --git-common-dir
Note the output — call it <common-git-dir>.
Step 2 — Derive the original repo root. Use the exact path from Step 1 — substitute it directly (no pipes, no xargs — handles spaces in paths correctly):
dirname <common-git-dir>
For example, if Step 1 returned /home/jessica/Claudefiles/.git, run dirname /home/jessica/Claudefiles/.git. Note the output — call it <orig-root>.
Step 3 — Read the current branch of the original repo. Use the exact path from Step 2:
git -C <orig-root> symbolic-ref --short HEAD 2>/dev/null
<orig-branch>.<orig-branch> as the default branch (no rebase needed).Compare <orig-branch> to the default branch from Context.
If they are the same → stop with a friendly message:
The parent repo is currently on
<default-branch>. No rebase needed.
Display a summary:
Parent repo branch : <orig-branch>
Worktree branch : <current-branch>
Worktree base : origin/<default-branch>
This worktree's base is assumed to be `origin/<default-branch>`, but the parent repo is currently on `<orig-branch>`.
Rebasing will move this worktree's commits on top of `<orig-branch>`.
If $ARGUMENTS indicates skipping confirmation (see Arguments), proceed directly to Phase 5.
Otherwise, ask the user to confirm using AskUserQuestion:
<current-branch> onto <orig-branch>?"Worktree rebaseYes — rebase onto <orig-branch> (description: git rebase --onto <orig-branch> origin/<default-branch>)No — leave as-is (description: Keep the current base (origin/<default-branch>))If the user selects "No", stop with: "No changes made."
Verify the working tree is clean before rebasing:
git status --porcelain
If the output is non-empty, stop with:
The working tree has uncommitted changes. Commit or stash them before rebasing.
Fetch to ensure refs are current before rebasing:
git fetch origin
Then run:
git rebase --onto <orig-branch> origin/<default-branch>
If the rebase succeeds (exit 0):
git log --oneline -5
Then confirm:
Rebase complete.
<current-branch>is now based on<orig-branch>.
If the rebase exits non-zero (conflict), print:
Rebase conflict. Resolve the conflicts, then run:
git rebase --continueOr to abort and return to the original state:
git rebase --abort
Do not attempt to auto-resolve conflicts. Stop here.
development
Use when the user says: 'create an issue', 'file an issue', 'open an issue', 'write an issue', 'new issue for this'. Codebase-aware issue creation — investigates the code to produce well-structured issues with acceptance criteria, affected areas, and enough detail for automated triage.
development
Use when the user says: 'triage issues', 'classify issues by complexity', 'assess issue complexity', 'find quick wins', 'which issues are small', 'batch issue assessment'. Batch codebase-aware issue triage — parallel Haiku subagents assess actual complexity and effort by reading the code, not just titles.
development
Use when the user says: "review my changes", "run the reviewers", "code and integration review", "readability review", "maintainability review", "sniff test this", "WTF check", "code smells", "is this code any good", "fresh eyes on this branch", "review this directory", "check this module". Dispatches three parallel reviewers — code, integration, and a readability pass — and consolidates findings into one prioritized report.
development
Use when the user says: "clean code check", "style review", "LLM smell check", "code hygiene", "nitpick this", "style check", "find style sins", "nitpicker review", "anal retentive review", "exhaustive style review", "no-filter style report". Dispatches three parallel stylistic checkers — llm-checker (training-bias patterns), lazy-checker (deferred debt), and nitpicker (style hygiene) — and consolidates findings into a report organized by checker with a Summary section for orchestration consumption.