closeout

Validate merged PR status, sync base branch, and remove task-owned worktrees and branches.

92|7|Updated Dec 11, 2025
One-click install
npx skills add https://github.com/encero-systems/incan --skill closeout-encero-systems
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: closeout
Source: https://github.com/encero-systems/incan/tree/main/.agents/skills/closeout
Command: npx skills add https://github.com/encero-systems/incan --skill closeout-encero-systems

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill automates the cleanup process after a Pull Request (PR) in an Incan project is merged, ensuring a safe and thorough closure of work by verifying merge status, syncing the base branch, and removing task-owned local worktrees/assets, branches, and pruning refs.

Core Features & Use Cases

  • Verify Merge Status: Checks if the PR has been merged and if the target branch matches the PR head branch.
  • Sync Base Branch: Updates the base branch if clean.
  • Remove Task-Owned Worktrees: Deletes worktrees tied to the merged PR.
  • Delete Merged Branches: Removes local and remote branches of the merged PR.
  • PruneRefs: Removes stale refs.
  • Report Leftovers: Lists and confirms any remaining dirty or ambiguous items.

Quick Start

To initiate the closeout process for a merged PR, run: /closeout

Frequently Asked Questions about closeout

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

FAQPage Schema
How do I clean up worktrees and branches after a PR merge?

To clean up worktrees and branches after a PR merge, you can automate the process by validating the merge status, syncing the base branch, and deleting task-owned worktrees and local branches. This ensures proper branch hygiene.

What is the best way to automate branch cleanup in Incan projects?

Automating branch cleanup in Incan projects involves verifying the PR merge status against the target branch, pruning stale refs, and removing task-owned worktrees. This safely closes out completed work and reports any leftover ambiguous items.

How does worktree cleanup handle unmerged or dirty branches?

Worktree cleanup handles unmerged or dirty branches by validating the merge status before deletion and reporting leftover dirty or ambiguous items. It ensures safe closure by only removing task-owned worktrees tied to successfully merged PRs.

Can I sync the base branch automatically when closing out a merged PR?

Yes, you can sync the base branch automatically when closing out a merged PR. The process updates the base branch if it is clean, synchronizing your local repository state immediately after verifying the PR merge.

Do I need to manually prune stale refs after deleting local branches?

No, you do not need to manually prune stale refs after deleting local branches. The closeout process automatically prunes refs, removes task-owned worktrees, and deletes both local and remote branches of the merged PR.