본문으로 건너뛰기
cccskills
무료GitHub에 공개

clean-merged-branch-folders

Clean up local branch worktree folders for this repository after their branches or pull requests have merged to main. Use when the user asks to remove merged branch folders, tidy local worktrees, clean old feature branch directories, prune merged PR worktrees, or clean up local development folders without impacting main.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

jtenniswood/espcontrol스타 1,120(GitHub 1,120 + cccskills 0)
연동 도구GitHub

실행 점수 미검증

설치 방법 보기

포함된 파일(3)

  • SKILL.md3.2 KB
  • agents/openai.yaml246 B
  • scripts/clean_merged_worktrees.py8.8 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Clean Merged Branch Folders

Overview

Remove only local Git worktree folders whose branch is already merged to main. Keep main, the current worktree, dirty worktrees, detached worktrees, and unmerged branches untouched.

Use the bundled script for the candidate detection and removal. It dry-runs by default and requires --apply before deleting any folder.

Workflow

1. Check the Repository

Start from any worktree for this repository:

git status --short --branch
git worktree list
git fetch origin main --prune

Resolve the active worktree root before running bundled scripts so the command also works when started from a subdirectory:

REPO_ROOT="$(git rev-parse --show-toplevel)"

Do not overwrite, revert, or remove local changes. If a worktree has uncommitted changes, leave it alone and mention it in the final update.

2. Preview Cleanup Candidates

Run the script in dry-run mode first:

python3 "$REPO_ROOT/.agents/skills/clean-merged-branch-folders/scripts/clean_merged_worktrees.py"

The script treats a worktree as safe to remove when:

  • the worktree is on a local branch, not main or another protected branch;
  • the worktree is not the current working directory;
  • the worktree has no uncommitted changes;
  • the branch commit is already contained in origin/main, or GitHub reports a merged PR for that branch into main.

If GitHub CLI is unavailable or unauthenticated, the script still uses Git's merge check. Squash-merged PR branches may require GitHub CLI because their exact branch commits are often not ancestors of main.

3. Remove Merged Worktree Folders

After reviewing the dry-run output, remove only the listed safe candidates:

python3 "$REPO_ROOT/.agents/skills/clean-merged-branch-folders/scripts/clean_merged_worktrees.py" --apply

Leave local branch refs in place unless the user explicitly asks to delete them. If branch deletion is requested, use:

python3 "$REPO_ROOT/.agents/skills/clean-merged-branch-folders/scripts/clean_merged_worktrees.py" --apply --delete-branches

The script uses git branch -d, not forced deletion, so branches that Git does not consider merged are preserved.

4. Validate the Result

Confirm the cleanup:

git worktree list
git status --short --branch

Keep the final update plain and practical: list the folders removed, any folders skipped, and whether local branch refs were kept or deleted.

Safety Rules

  • Never remove main, the current worktree, dirty worktrees, detached worktrees, or unmerged branches.
  • Never use rm -rf for registered Git worktrees. Use git worktree remove.
  • Never force-delete branches unless the user explicitly asks and the branch has been checked carefully.
  • Do not close GitHub issues or merge pull requests as part of this cleanup.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Clean up completed Git branches and worktrees for this repository both locally and on GitHub. Use when the user asks to remove complete, completed, merged, stale, finished, or done branches, delete merged GitHub branches, tidy local worktrees, prune completed PR branches, or clean up branches and worktrees after pull requests have merged.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

jtenniswood/espcontrol1.1천2026년 10월 26일 업데이트

compile

무료

Test compile ESPHome firmware for all devices using Docker and fix any YAML or configuration errors until every device compiles successfully. Use when the user says "/compile", "test compile", "compile check", "build test", "check builds", "verify compile", or wants to make sure all devices compile before committing.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

jtenniswood/espcontrol1.1천2026년 10월 26일 업데이트

Review EspControl repository changes specifically for missing, stale, excessive, or misplaced documentation. Use when the user asks for a documentation coverage review, asks whether a feature or behavior change is concisely documented, invokes $docs-review, or explicitly wants docs checked as a secondary pass during a pull request, branch, or local diff review.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

jtenniswood/espcontrol1.1천2026년 10월 26일 업데이트

Provide an expert codebase review for this repository. Use when the user says "Expert Review" or "/expert-review", asks for an expert review, wants refactoring or codebase improvement recommendations, wants consistency and quality assessed, or asks how to reduce duplication, improve component use, preserve the end-user experience, and keep upgrades cleanly migratable.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

jtenniswood/espcontrol1.1천2026년 10월 26일 업데이트

Reimagine this repository from first principles using the current product and user experience as the target. Use when the user says "/expert-reset", asks how the project should be rebuilt if starting again, wants bold architecture or component-structure recommendations, or wants a research-only reset plan unconstrained by current implementation details.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

jtenniswood/espcontrol1.1천2026년 10월 26일 업데이트

Flash EspControl display firmware from this repository using ESPHome. Use when the user invokes /flash-displays with no extra display name, or asks to flash, reflash, update, or upload firmware to all known displays in sequence, or to a specific display such as 7inch, 7-inch P4, 10inch, 10-inch V1, 10-inch V2, 10-inch V3, P4-86, 4.3-inch P4, 4-inch P4, or S3, over an explicitly supplied OTA target or USB.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

jtenniswood/espcontrol1.1천2026년 10월 26일 업데이트

jtenniswood의 스킬 모두 보기

이 스킬의 문제 신고