What problem does it solve?
This skill automates the finalization of OpenSpec feature work by merging an approved PR, migrating any remaining tasks, archiving the proposal, and cleaning up related branches, submodules, and worktrees so completed work is properly finalized and traceable.
Core Features & Use Cases
- Merge & Validation Gates: Enforces pre-merge validation, integrates with a merge gate script, and supports explicit user overrides when authorized.
- Task Migration: Detects open tasks in the proposal and migrates them to coordinator issues or creates a follow-up OpenSpec proposal to avoid dropping work.
- Submodule & Branch Hygiene: Fast-forwards changed submodule main branches, deletes feature branches, prunes remotes, and tears down worktrees safely.
- Coordinator & Merge Queue Integration: Optionally enqueues merges, checks merge order, marks features merged, and releases locks when a coordinator is available.
- Session Logging & Sanitization: Appends a Cleanup phase to the session log and runs sanitization with a fallback to proceed without the log if sanitization fails.
- Use Case: After implementation and validation, run cleanup to merge the PR, archive the OpenSpec change, migrate follow-ups, and restore a clean repository state.
Quick Start
Run the cleanup-feature skill with the change id to merge the PR, migrate open tasks, archive the OpenSpec proposal, and remove related branches and worktrees.