delete

Delete Git branches and worktrees with safety confirmations.

Updated Mar 16, 2026
One-click install
npx skills add https://github.com/MJ-AgentLab/mj-agentlab-marketplace --skill delete-mj-agentlab
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: delete
Source: https://github.com/MJ-AgentLab/mj-agentlab-marketplace/tree/main/plugins/mj-git/skills/mj-git-delete
Command: npx skills add https://github.com/MJ-AgentLab/mj-agentlab-marketplace --skill delete-mj-agentlab

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a safe and guided process for deleting Git branches and associated worktrees, preventing accidental data loss and ensuring a clean repository state.

Core Features & Use Cases

  • Branch Deletion: Removes local and/or remote branches.
  • Worktree Cleanup: Removes associated worktree directories.
  • Safety Checks: Enforces confirmation steps and handles unmerged commits gracefully.
  • Use Case: After merging a feature branch, use this skill to completely remove the feature branch, its local copy, and its worktree to keep your repository tidy.

Quick Start

Use the delete skill to remove the branch named 'feature/new-login-flow' locally and remotely.

Frequently Asked Questions about delete

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

FAQPage Schema
How do I safely delete a Git branch both locally and remotely?

To safely delete a Git branch locally and remotely, this Skill guides you through a structured process with mandatory human confirmation. It enforces deletion order to prevent accidental data loss while removing local and remote branches.

What is the best way to clean up Git worktrees after merging a feature branch?

Cleaning up Git worktrees after merging involves removing the associated worktree directories alongside branch deletion. This Skill handles complete cleanup, ensuring repository hygiene by safely deleting both the worktree and its connected branch.

Can I delete a remote-only Git branch without affecting my local branch?

Yes, you can delete a remote-only Git branch without affecting your local copy. This Skill handles scenarios including remote-only deletion, local-only deletion, and complete cleanup, providing safety checks for each specific context.

How does the Git branch deletion process handle unmerged commits?

The Git branch deletion process handles unmerged commits gracefully by enforcing safety checks and guided steps. It requires human confirmation for destructive actions, preventing accidental data loss before removing branches or worktrees.

Do I need any special Git tools to remove worktree directories and branches?

No special Git tools are required to remove worktree directories and branches. This Skill operates independently without dependencies, managing the deletion order and safety confirmations directly to ensure a clean repository state.

Why should I use a guided process for deleting Git branches instead of standard commands?

Using a guided process for deleting Git branches prevents accidental data loss by enforcing deletion order and human confirmation. Unlike standard commands, it safely manages complex scenarios like complete local and remote cleanup with worktrees.