LocalStudio Worktree Refresh
Overview
Use this skill before implementation starts in any LocalStudio worktree. The goal is to update the worktree from origin/main without losing local work or hiding branch divergence.
Refresh Workflow
Inspect the worktree before network or merge commands.
git status --short --branch git remote get-url origin git branch --show-currentStop if the worktree has local changes.
- Do not stash, reset, checkout, or overwrite user changes automatically.
- Report the dirty files and ask before continuing, unless the user explicitly told you those changes are yours to manage.
Fetch the latest remote main.
git fetch origin main- If network/sandboxing blocks this command, rerun it with approval/escalation.
- Do this before trusting local
origin/mainstate.
Confirm whether the current
HEADcan fast-forward toorigin/main.git merge-base --is-ancestor HEAD origin/mainFast-forward only when safe.
git merge --ff-only origin/main- This is valid for detached worktrees and branch worktrees when
HEADis an ancestor oforigin/main. - If the command says "Already up to date.", treat the worktree as fresh.
- This is valid for detached worktrees and branch worktrees when
Stop on divergence.
- If
HEADis not an ancestor oforigin/main, do not rebase or merge manually. - Report the branch,
git status --short --branch, and ask how the user wants to reconcile the worktree.
- If
Report the refreshed base.
git rev-parse --short HEAD git log -1 --oneline
Handoff Rules
- Mention the exact refresh command sequence used.
- If the refresh was skipped because the worktree was dirty or divergent, say that clearly before implementation starts.
- Never use
git reset --hard,git checkout --, or destructive cleanup as part of this skill unless the user explicitly requested that destructive action. - After refreshing, continue with the task using the repo's other applicable skills, such as
writing-typescriptfor TypeScript/source edits andlocalstudio-finish-checksbefore final handoff.