pr-and-cleanup

Create GitHub Pull Requests and remove Git worktrees after success.

Updated Jan 8, 2026
One-click install
npx skills add https://github.com/takemo101/compose-workflow --skill pr-and-cleanup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pr-and-cleanup
Source: https://github.com/takemo101/compose-workflow/tree/main/.opencode/skill/pr-and-cleanup
Command: npx skills add https://github.com/takemo101/compose-workflow --skill pr-and-cleanup

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill automates the process of creating a Pull Request (PR) from a Git worktree and then cleaning up that worktree, streamlining the development workflow.

Core Features & Use Cases

  • Automated PR Creation: Generates a GitHub Pull Request with interactive or pre-defined titles and bodies.
  • Worktree Cleanup: Automatically removes the Git worktree after a successful PR creation.
  • Use Case: After completing a feature in a dedicated worktree, you can run this skill to submit your code for review and then automatically remove the temporary worktree, keeping your repository tidy.

Quick Start

Run this script from within your worktree directory to create a PR and clean up the worktree.

Frequently Asked Questions about pr-and-cleanup

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

FAQPage Schema
How do I automate GitHub Pull Request creation and Git worktree cleanup?

Automating Pull Request creation and Git worktree cleanup involves validating the environment, checking for uncommitted changes, creating the PR using the GitHub CLI, and automatically removing the worktree after successful submission to keep your repository tidy.

How do I create a GitHub PR and delete the worktree in one step?

Creating a GitHub PR and deleting the worktree in one step is possible by executing an automation script directly from within your worktree directory, which handles the PR submission and then removes the temporary worktree upon success.

Do I need the GitHub CLI to automate Pull Request creation from a worktree?

Yes, you need the GitHub CLI to automate Pull Request creation from a worktree, because the workflow relies on the GitHub CLI to submit the PR after validating the environment and checking for uncommitted changes.

Can I specify a base branch and PR details interactively when creating a GitHub PR?

Yes, you can specify a base branch and PR details interactively when creating a GitHub PR, as the automation supports both interactive input and pre-defined titles and bodies for the Pull Request generation.

What happens to uncommitted changes when automating Git worktree cleanup?

When automating Git worktree cleanup, the script checks for uncommitted changes during environment validation before creating the GitHub Pull Request, ensuring that pending modifications are addressed before the worktree is removed.

When should I avoid using an automated script for PR creation and worktree removal?

You should avoid using an automated script for PR creation and worktree removal if you need to retain the worktree after submitting your GitHub Pull Request, as the automation is designed to delete the temporary worktree upon successful completion.