clean-branch

Removes .cursor permission files and non-code noise from a git branch before rebasing.

Updated Apr 9, 2026
One-click install
npx skills add https://github.com/muselesscreator/ui-skills --skill clean-branch-muselesscreator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-branch
Source: https://github.com/muselesscreator/ui-skills/tree/main/clean-branch
Command: npx skills add https://github.com/muselesscreator/ui-skills --skill clean-branch-muselesscreator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Cursor editor permission files and other non-code artifacts often get committed to feature branches, causing unnecessary merge conflicts during rebases. This Skill strips those noise files from the branch diff and stages the cleanup as a separate commit so the rebase proceeds cleanly. ## Core Features & Use Cases - Noise Detection: Scans the branch diff against the merge base with main to find .cursor files, .DS_Store, and .cursorrules artifacts. - Confirmed Cleanup: Shows the exact list of files to be removed and waits for user confirmation before making any changes. - Cleanup Commit: Restores noise files to their state on main, stages the changes, and commits them as a dedicated chore commit. - Use Case: You are about to rebase a feature branch onto main, but .cursor permission files keep causing conflicts. Run this Skill to strip them first, then rebase without interference. ## Quick Start Clean the cursor permission files from my current branch so I can rebase onto main without conflicts.

Frequently Asked Questions about clean-branch

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I remove .cursor files from a git branch before rebasing?

Identify the files by diffing your branch against the merge base with main, then restore each file to its main state using git checkout and commit the cleanup. This removes them from the branch diff so they no longer conflict during the rebase.

Why do cursor files cause merge conflicts during git rebase?

Cursor permission files are machine-specific and change frequently, so they diverge between branches even when no real code changed. During a rebase, git treats these divergences as conflicts, blocking the rebase until resolved.

Can I strip additional file patterns besides .cursor files?

Yes, the Skill accepts optional arguments specifying extra patterns to strip, such as .DS_Store or .cursorrules. These are checked alongside the default .cursor pattern when scanning the branch diff.

Does cleaning a branch delete the files from my working tree?

No, the cleanup restores each noise file to its state on main rather than deleting it. The files remain on disk; only the branch's changes to them are removed and committed as a cleanup commit.

When should I not use this branch cleanup approach?

Avoid it when the .cursor or config changes are intentional and should be shared with the team, since the cleanup reverts them to main's state. In that case, commit the files deliberately or add them to .gitignore instead.