feature-teardown

Delete local git worktrees and feature branches after verifying uncommitted changes.

Updated Apr 26, 2026
One-click install
npx skills add https://github.com/oletizi/writingcontrol.org --skill feature-teardown
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: feature-teardown
Source: https://github.com/oletizi/writingcontrol.org/tree/main/.claude/skills/feature-teardown
Command: npx skills add https://github.com/oletizi/writingcontrol.org --skill feature-teardown

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Remove local feature infrastructure: worktree and branch. Infrastructure-only, no opinion on feature status.

Core Features & Use Cases

  • Safe teardown: verifies worktree existence and handles uncommitted changes with appropriate prompts.
  • Automated cleanup: removes the feature-specific worktree, deletes the local feature branch if safe, and prunes stale references.
  • Use Case: when a feature slug 'new-payment-flow' is done, run this to clean up local worktree and branches, ensuring a clean local repo state.

Quick Start

Run the feature-teardown operation on the current feature context to remove the local worktree and feature branch if safe to do so.

Frequently Asked Questions about feature-teardown

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

FAQPage Schema
How do I safely delete a git worktree and local feature branch after finishing a feature?

To safely delete a git worktree and local feature branch, you need a teardown process that verifies worktree existence, checks for uncommitted changes, removes the worktree, deletes the branch, and prunes stale references.

What happens to uncommitted changes when removing a git worktree?

When removing a git worktree, uncommitted changes are detected during the process and appropriate prompts are triggered to ensure no local modifications are lost before the feature branch and worktree are deleted.

Can I clean up feature branches across multiple repos at once?

Yes, you can clean up feature branches and worktrees across multiple local development repositories by running a teardown operation that prunes stale references and removes local infrastructure for each finished feature.

What is the best way to clean up stale git worktree references?

The best way to clean up stale git worktree references is to use an automated teardown workflow that removes the feature-specific worktree, deletes the local branch if safe, and prunes lingering references for a clean local repo state.

When should I not use an automated git worktree removal process?

You should not use an automated git worktree removal process if your feature is not yet finished, as this teardown operation is infrastructure-only and deletes local feature branches without checking the feature's completion status.