One-click install
npx skills add https://github.com/mrgeoffrich/mini-infra --skill finish-worktree-mrgeoffrich
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: finish-worktree
Source: https://github.com/mrgeoffrich/mini-infra/tree/main/.claude/skills/finish-worktree
Command: npx skills add https://github.com/mrgeoffrich/mini-infra --skill finish-worktree-mrgeoffrich

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the cleanup process for finished Git worktrees, helping developers free system resources and maintain a tidy repository environment.

Core Features & Use Cases

  • Worktree Validation: Checks for uncommitted changes, unpushed commits, and active pull requests to ensure safe cleanup.
  • Automated Cleanup: Deletes the worktree directory and corresponding VM/distro using pnpm worktree-env delete, and removes Git tracking with git worktree remove.
  • Use Case: After completing a feature branch, use this Skill to remove its associated worktree and environment, freeing resources and ensuring repository cleanliness.

Quick Start

Invoke the skill with your worktree's slug or issue key to safely remove the associated worktree and dev environment.

Frequently Asked Questions about finish-worktree

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

FAQPage Schema
How do I safely clean up a finished Git worktree without losing uncommitted changes?

To safely clean up a finished Git worktree, the Skill validates uncommitted changes, unpushed commits, and active pull requests before removing the worktree directory and its dev environment, ensuring repository integrity.

What is the best way to remove a Git worktree and its associated dev environment after finishing a feature branch?

The best way to remove a finished Git worktree is using automated cleanup that deletes the directory and corresponding VM/distro via `pnpm worktree-env delete`, then removes Git tracking with `git worktree remove`.

How does worktree validation work before deleting a Git worktree?

Worktree validation checks the repository for uncommitted changes, unpushed commits, and active pull requests to ensure safe cleanup and prevent accidental data loss during the worktree removal process.

Can I use this cleanup process if my worktree has an open pull request?

If your worktree has an open pull request, the Skill's validation process detects it during cleanup checks to ensure safe disposal, preventing you from accidentally removing resources tied to active development.

Do I need pnpm to delete my Git worktree and repository environment?

Yes, the automated cleanup process uses `pnpm worktree-env delete` to remove the corresponding VM or distro environment, making pnpm a necessary dependency for fully clearing the worktree and its resources.

Why should I use automated cleanup for finished Git worktrees instead of manual Git commands?

Automated worktree cleanup prevents accidental data loss by validating uncommitted changes and open PRs before disposal, freeing system resources and maintaining repository cleanliness more reliably than manual Git commands alone.