Reset worktree to origin/main
Perform the following steps to reset the current worktree branch to origin/main:
- •
Kill any active background job
- •
Check for uncommitted changes: Run
git statusto see if there are any staged or unstaged changes. If there are uncommitted changes, stop and inform the user - they need to commit or stash these changes first. - •
Check for untracked files: Run
git statusto list any untracked files. If untracked files exist:- •Analyze each untracked file to determine if it's throwaway code (temp files, test outputs, build artifacts, etc.) or potentially important work
- •If you're uncertain about any file, use AskUserQuestion to ask the user whether each uncertain file should be deleted or kept
- •Only proceed with cleanup if the user confirms all untracked files can be deleted
- •
Run git clean: If the user confirms cleanup (or if all untracked files are clearly throwaway), run
git clean -dffrom the root of the repository to remove untracked files and directories. - •
Reset state: Run the m.sh script located next to this SKILL.md file:
bash "$(find ~/.claude -path '*/personal/skills/m/m.sh' 2>/dev/null | head -1)"
Report the final status to the user when complete.