finishing-a-development-branch
Completes development branches by verifying tests, managing merge or PR workflows, and cleaning up worktrees to ensure a consistent repository state.
Introduction
The finishing-a-development-branch skill provides a robust, standardized exit path for software engineering tasks performed by autonomous agents. It acts as the final gatekeeper in a development lifecycle, ensuring that code is never merged or integrated until it has been rigorously validated. Designed for developers and automated coding agents, it eliminates human error in version control operations by enforcing a mandatory testing phase before offering any integration options. When a subagent or developer completes a set of tasks, this skill prompts for test suite verification using standard commands like npm test, pytest, or cargo test. Only upon a passing test result does the agent present four distinct, actionable paths: performing a local merge, opening a pull request, preserving the work in its current state, or discarding the changes. This structured approach prevents common issues such as broken merges, orphaned feature branches, or unmanaged git worktree clutter. The skill integrates seamlessly into larger development workflows, such as subagent-driven-development or executing-plans, ensuring that cleanup—specifically the removal of git worktrees—is handled only when appropriate to avoid accidental data loss. It requires explicit, human-in-the-loop confirmation for destructive actions like discarding work, thereby providing a safety net for complex feature development. Key capabilities include automated git base branch detection (main/master), integration with the GitHub CLI (gh) for streamlined pull request creation, and strict worktree lifecycle management. By automating the transition from 'code complete' to 'integrated/merged,' this skill enables agents to maintain a high level of repository hygiene while significantly reducing the cognitive load on human supervisors. Users benefit from predictable, repeatable integration patterns that align with modern CI/CD practices and clean Git history principles.
Repository Stats
- Stars
- 171,934
- Forks
- 15,166
- Open Issues
- 278
- Language
- Shell
- Default Branch
- main
- Sync Status
- Idle
- Last Synced
- Apr 29, 2026, 06:04 AM