What problem does it solve?
This Skill solves the hassle of creating a GitHub pull request while forgetting to clean up a local git worktree, which wastes disk space and clutters your development directories.
Core Features & Use Cases
- Automated PR creation from a feature worktree: Detects the current worktree context and creates a PR using GitHub CLI (
gh pr create), optionally with a draft flag.
- Guardrails against unsafe execution: Checks for uncommitted changes and validates key preconditions before proceeding, with options to limit behavior to PR creation or cleanup only.
- Automatic worktree cleanup after success: Removes the worktree directory after a successful PR and returns you to the
main branch, while keeping local and remote branches intact.
Use Case: After finishing a feature in .worktrees/<feature-name>, run this Skill to open the PR and then automatically delete the temporary worktree to keep your workspace tidy.
Quick Start
Run the PR from your worktree by executing: cd .worktrees/<feature-name> && bash ../../.claude/skills/pr-and-cleanup/scripts/pr_and_cleanup.sh