AGENT SKILL

cleanup-to-main

Clean up local git branches that have been removed from the remote repository. Use when the user wants to tidy up their local git branches, remove stale branches, clean up after merging PRs, or mentions 'cleanup branches', 'remove old branches', 'prune local branches', 'git branch cleanup'. Safely handles uncommitted changes, preserves local-only branches, and provides a detailed report.

License 许可
MIT
最近更新
2026-07-16
Stars
★ 0
Forks
0

01 前言 Front Matter

name
cleanup-to-main
description
Clean up local git branches that have been removed from the remote repository. Use when the user wants to tidy up their local git branches, remove stale branches, clean up after merging PRs, or mentions 'cleanup branches', 'remove old branches', 'prune local branches', 'git branch cleanup'. Safely handles uncommitted changes, preserves local-only branches, and provides a detailed report.

02 资源文件 1

03 SKILL.md 正文

Cleanup to Main

Cleans up local git branches that have been deleted from the remote repository, with safety checks and detailed reporting.

Workflow

  1. Pre-flight safety checks → Abort if uncommitted changes or branch not synced
  2. Switch to default branch → Detect and checkout main or master
  3. Fetch and prune → Update remote references with git fetch -p
  4. Identify deletion candidates → Local branches whose remote no longer exists
  5. Safe delete → Use git branch -d for each candidate
  6. Generate report → Summarize deleted, skipped, and kept branches

Execution

Run the cleanup script directly:

./scripts/cleanup_branches.sh

Or execute step-by-step using git commands following the workflow above.

Safety Guarantees

  • Aborts on uncommitted changes - Working directory must be clean
  • Aborts on unsynced branch - Current branch must match origin
  • Preserves local-only branches - Branches never pushed are kept
  • Safe delete only - Uses git branch -d (fails if not merged)
  • Never deletes main/master - Protected branches always kept

Branch Categories

Category Action Reason
Deleted from remote Delete Tracking branch gone, safe to remove
Not fully merged Skip May contain unmerged work
Local-only (never pushed) Skip User's local work in progress
main/master Keep Protected default branches

Exit Codes

  • 0 - Success (branches cleaned or nothing to clean)
  • 1 - Safety abort (uncommitted changes or unsynced branch)
  • 2 - Partial failure (some branches couldn't be deleted)

04 同仓库更多 Skills

haryelramalho
haryelramalho/skills

to-prompt-opus

Use when preparing or rewriting prompts for Claude Opus 4.8, Anthropic API agents, XML-structured prompts, long-context document work, coding agents, research synthesis, frontend/design tasks, or model-specific prompt optimization. Do not use for GPT/OpenAI prompts or raw context packaging without Opus-specific tuning.

★ 0
haryelramalho
haryelramalho/skills

to-prompt-gpt

Use when preparing or rewriting prompts for GPT-5.5, OpenAI API agents, Responses workflows, coding agents, research synthesis, support assistants, or model-specific prompt optimization. Do not use for Claude/Opus prompts or raw context packaging without GPT-specific tuning.

★ 0
haryelramalho
haryelramalho/skills

plan-refactor-qa

Plans and runs qa-report before executing Compozy refactor tasks. Use when the user provides a refactor or issue slug and wants Codex to inspect the matching .compozy/tasks directory, related PRD/TechSpec/ADR/task artifacts, affected code, and existing tests, then invoke $qa-report with a repository-grounded prompt. Do not use to run tests, execute qa-execution, implement code, or perform post-refactor verification.

★ 0
haryelramalho
haryelramalho/skills

multi-tool-branch-review

Orchestrates a multi-tool branch review of the current git branch against a base branch. By default it runs two independent thermo-nuclear maintainability audits, one on Codex GPT-5.5 xhigh and one on Claude Opus xhigh, then consolidates the findings into a single remediation plan via writing-plans. If the user explicitly asks for native reviews, it can add the Claude native review pass, the Codex native review pass, or both. Use when the user wants a deep cross-model review of a branch or PR before merge, or asks to review this branch with multiple tools or models. Encodes known infra failure modes and their fixes (missing Claude ACP adapter, Codex MCP auth hangs, false-positive report files, long jobs orphaned inside subagents). Do not use for reviewing a single uncommitted snippet, for non-git work, for running only one reviewer, or when the user only wants a quick lint or test run.

★ 0
haryelramalho
haryelramalho/skills

create-pr-with-template

Create a GitHub Pull Request with gh CLI and prefer repository PR templates automatically. Use this whenever the user asks to open/create a PR, especially when template compliance is needed. If multiple templates exist, ask the user which template to use.

★ 0
haryelramalho
haryelramalho/skills

ui-craft

Provides guardrails for user-facing UI work: usability heuristics, accessibility floors, design-system discipline, component states, microcopy, motion, dark mode, responsive behavior, and human-AI UX. Use when designing, generating, reviewing, or refactoring visible product surfaces such as components, pages, dashboards, forms, dialogs, loading/empty/error states, or AI interfaces. Do not use for backend-only work, infrastructure, CLI/TUI design, or pure documentation editing.

★ 0