cleanup

Verify merged PRs, backfill metadata, and prune git worktrees and branches.

33|Updated Jan 5, 2026
One-click install
npx skills add https://github.com/lvlup-sw/exarchos --skill cleanup-lvlup-sw
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: cleanup
Source: https://github.com/lvlup-sw/exarchos/tree/main/skills-src/cleanup
Command: npx skills add https://github.com/lvlup-sw/exarchos --skill cleanup-lvlup-sw

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill automates the manual, error-prone post-merge steps required to finalize a feature workflow by verifying PR merge status, backfilling synthesis metadata, resolving blocking review states, transitioning the workflow to completed, and cleaning up repository worktrees and branches.

Core Features & Use Cases

  • Merge Verification: Verifies that all PRs in a workflow are merged using the gh CLI or MCP pull_request_read and aborts if any PR is unmerged.
  • Orchestrated Cleanup: Calls the MCP cleanup action to backfill prUrl and mergedBranches, force-resolve review statuses, transition the workflow to completed, and emit the workflow.cleanup event.
  • Repository Hygiene: Removes associated git worktrees, prunes worktrees, prunes remote-tracking branches, and supports a dry-run preview mode for safe execution.
  • Use Case: Use when a stacked or multi-PR feature has fully merged and you want a single, auditable operation to finalize state and remove local artifacts.

Quick Start

Ask the cleanup skill to verify all PRs for feature <featureId>, mark the workflow completed, backfill merge metadata, and remove associated worktrees and branches.

Frequently Asked Questions about cleanup

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

FAQPage Schema
How do I clean up git worktrees and branches after a feature merge?▼

To clean up post-merge git worktrees and branches, you can automate the process by verifying PR merge status, backfilling metadata, and pruning local artifacts in a single operation. This ensures repository hygiene without manual error.

How can I verify all PRs are merged before cleaning up a feature workflow?▼

Verify all PRs are merged before cleanup by using the gh CLI or MCP pull_request_read integration to check pull request statuses. The workflow cleanup process automatically aborts if any associated PR remains unmerged.

What is the best way to finalize a completed stacked PR workflow in git?▼

The best way to finalize a stacked PR workflow is an orchestrated cleanup that verifies merges, transitions the workflow to completed, backfills synthesis metadata, and removes associated git worktrees and remote-tracking branches.

Can I preview repository cleanup actions before deleting branches and worktrees?▼

Yes, you can preview repository cleanup actions using a supported dry-run mode. This allows you to safely review which git worktrees, remote-tracking branches, and metadata updates will be executed before making permanent changes.

Does workflow cleanup require GitHub CLI or MCP integration to verify merge status?▼

Workflow cleanup requires either GitHub CLI or MCP pull_request_read integration to verify PR merge status. Access to git worktrees and branches is also required to perform the repository pruning.

What happens if a PR is unmerged when I try to run a post-merge workflow cleanup?▼

If a PR is unmerged during post-merge workflow cleanup, the process aborts to prevent premature state transitions. This safeguard ensures only fully merged feature workflows are marked completed and pruned.