cleanup-feature

Merge approved pull requests and archive OpenSpec proposals to finalize features.

4|1|Updated Jan 16, 2026
One-click install
npx skills add https://github.com/jankneumann/agentic-coding-tools --skill cleanup-feature
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cleanup-feature
Source: https://github.com/jankneumann/agentic-coding-tools/tree/main/.agents/skills/cleanup-feature
Command: npx skills add https://github.com/jankneumann/agentic-coding-tools --skill cleanup-feature

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

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.

Frequently Asked Questions about cleanup-feature

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

FAQPage Schema
How do I safely merge a pull request and archive an OpenSpec proposal after feature implementation?

To safely merge a pull request and archive an OpenSpec proposal, run a cleanup-feature workflow that enforces pre-merge validation gating, merges the approved PR, archives the proposal, and tears down related worktrees to finalize completed features.

What happens to open tasks when I merge an OpenSpec feature branch?

When merging an OpenSpec feature branch, the cleanup process detects open tasks in the proposal and migrates them to coordinator issues or creates a follow-up OpenSpec proposal, ensuring no planned work is dropped during finalization.

Can I fast-forward submodule main branches and delete feature branches automatically after a merge?

Yes, you can fast-forward changed submodule main branches and delete feature branches automatically. The cleanup process handles submodule fast-forwarding, prunes remotes, and performs safe worktree teardown to restore a clean repository state.

Does the merge queue integration check merge order before finalizing a feature?

Merge queue integration checks merge order, enqueues merges, marks features as merged, and releases locks when a coordinator is available. This coordinator integration ensures orderly finalization within complex OpenSpec-driven workflows.

How does session log sanitization work during feature cleanup?

Session log sanitization appends a Cleanup phase to the session log and runs sanitization routines. If sanitization fails, the process falls back to proceed without the log, ensuring cleanup completion is never blocked by logging errors.

When should I override pre-merge validation gates for an OpenSpec feature?

Pre-merge validation gates should only be overridden when explicitly authorized, allowing you to bypass validation checks if a feature requires immediate finalization despite standard gating constraints during the merge process.