speckit-git-cleanup

Integrates a completed feature branch into the base branch, tags it, and deletes the branch.

Updated Jul 8, 2026
One-click install
npx skills add https://github.com/NarenKarthikBM/specseyal --skill speckit-git-cleanup-narenkarthikbm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: speckit-git-cleanup
Source: https://github.com/NarenKarthikBM/specseyal/tree/main/.claude/skills/speckit-git-cleanup
Command: npx skills add https://github.com/NarenKarthikBM/specseyal --skill speckit-git-cleanup-narenkarthikbm

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Retiring a finished feature branch involves several error-prone git steps — merging into the base branch, creating a completion tag, and deleting the branch — and doing them by hand risks losing commits, skipping the tag, or deleting an unmerged branch. This Skill wraps that entire sequence in one deterministic, idempotent script invocation. ## Core Features & Use Cases - Safe branch integration: Fast-forwards into the configured base branch when possible, falling back to git merge --no-ff only when the base has diverged, never squashing or rebasing. - Mandatory completion tagging: Creates the annotated complete/<spec-id> tag as the completion anchor, independent of merge topology. - Conflict-safe abort: On a merge conflict it aborts the merge, leaves the feature branch fully intact, and surfaces the error — never auto-resolving or force-deleting. - Idempotent re-runs: Detects an already-completed cleanup (branch gone, tag present) and exits as a no-op. - Use Case: After a spec-driven feature passes its final testing phase, run /speckit-git-cleanup to merge the feature branch into main, tag it complete/002-speckit-ext-git, and delete the branch in one verified step. ## Quick Start Run the /speckit-git-cleanup command, optionally passing a feature branch name, to merge the finished feature into the base branch, create the completion tag, and delete the branch.

Frequently Asked Questions about speckit-git-cleanup

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

FAQPage Schema
How do I safely merge and delete a finished git feature branch?

Run /speckit-git-cleanup, optionally passing the branch name. It fast-forwards the branch into the base branch (or merges with --no-ff if diverged), creates an annotated complete/<spec-id> tag, and deletes the branch with git branch -d so unmerged work is never lost.

What happens if the feature branch merge has a conflict?

The cleanup script runs git merge --abort and exits non-zero, leaving the feature branch fully intact with no tag created. You resolve the conflict manually on either branch, then re-run the command — it never auto-resolves or force-deletes.

Can I re-run git branch cleanup after it already completed?

Yes, the operation is idempotent. If the feature branch is already deleted and the complete/<spec-id> tag already exists, the script prints a no-op message and exits 0 without side effects.

Does this cleanup command run automatically in the pipeline?

No. It is the one human-invoked command in the git extension — no hook fires it. A human must explicitly run /speckit-git-cleanup or ask the agent to run it, because deleting a branch ref is a consequential decision.

What are the prerequisites for running speckit-git-cleanup?

The git extension must be installed at .specify/extensions/git/ with cleanup.sh and git-config.yml present, the working tree must be clean when real work is needed, and the feature must actually be complete since the branch ref is deleted.