home / skills / doanchienthangdev / omgkit / finishing-development-branch

This skill helps finishing development branches by enforcing quality gates, clean history, and thorough PR preparation for merge readiness.

npx playbooks add skill doanchienthangdev/omgkit --skill finishing-development-branch

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
3.5 KB
---
name: finishing-development-branches
description: AI agent completes development branches with comprehensive quality gates, clean git history, and thorough PR preparation. Use when wrapping up features, preparing for merge, or finalizing PRs.
---

# Finishing Development Branches

## Quick Start

1. **Code Complete** - All acceptance criteria met, edge cases handled, no TODOs
2. **Quality Assurance** - Tests pass, coverage met, lint clean, build succeeds
3. **Documentation** - README, API docs, inline comments updated
4. **Git Hygiene** - Rebase on main, clean commit history, no conflicts
5. **PR Ready** - Complete description, screenshots, reviewers assigned

## Features

| Feature | Description | Guide |
|---------|-------------|-------|
| Code Completeness | All requirements implemented | Check acceptance criteria, edge cases, cleanup |
| Quality Gates | Automated validation | Tests, lint, types, security, build |
| TODO Scanner | Find unaddressed items | `TODO`, `FIXME`, `HACK`, `XXX` patterns |
| Git Preparation | Clean history for merge | Rebase, squash WIP, conventional commits |
| PR Generation | Comprehensive description | Summary, changes, testing, screenshots |
| Verification Script | Final pre-PR check | Run all gates, generate report |

## Common Patterns

```
# Completion Checklist
PHASE 1: CODE COMPLETE
[ ] All acceptance criteria implemented
[ ] Edge cases handled
[ ] Error handling complete
[ ] No TODO/FIXME unaddressed
[ ] Debug code removed

PHASE 2: QUALITY ASSURANCE
[ ] All tests passing
[ ] Coverage meets threshold (80%+)
[ ] Lint/format passing
[ ] Type checking passing
[ ] Security scan passing

PHASE 3: DOCUMENTATION
[ ] README updated if needed
[ ] API documentation updated
[ ] Complex logic commented

PHASE 4: GIT HYGIENE
[ ] Rebased on latest main
[ ] Commit history clean
[ ] Conventional commit messages
[ ] No merge conflicts

PHASE 5: PR READY
[ ] Description complete
[ ] Screenshots for UI changes
[ ] Reviewers assigned
```

```bash
# Git Preparation
git fetch origin main
git rebase origin/main

# Review commits for squashing
git log --oneline main..HEAD
# Consider squashing: fix, wip, temp commits
git rebase -i main

# Push with lease (safe force)
git push origin feature-branch --force-with-lease

# Quality verification
npm run lint && npm run typecheck && npm test && npm run build
```

```
# PR Description Template
## Summary
[2-3 sentences on what/why]

## Changes
- [Change 1]
- [Change 2]

## Testing
- [x] Unit tests
- [x] Integration tests
- [ ] Manual testing

## Screenshots
[For UI changes]

## Checklist
- [x] Self-review completed
- [x] Tests pass
- [x] Documentation updated
```

## Best Practices

| Do | Avoid |
|----|-------|
| Run all checks locally before pushing | Pushing broken code |
| Rebase on latest main to avoid conflicts | Force pushing without --force-with-lease |
| Squash WIP commits into meaningful units | Leaving fix/wip/temp commits |
| Write clear conventional commit messages | Cryptic commit messages |
| Include screenshots for UI changes | Creating PRs without descriptions |
| Self-review your diff before requesting | Leaving debug statements in code |
| Test in clean environment if possible | Skipping tests to save time |
| Link to related tickets in PR | Ignoring linting warnings |

## Related Skills

- `requesting-code-reviews` - Write effective review requests
- `verifying-before-completion` - Quality gate checklists
- `writing-plans` - Plan completion criteria upfront
- `executing-plans` - Track progress to completion

Overview

This skill automates and guides the finalization of development branches so merges are clean, reviewed, and production-ready. It enforces quality gates, removes unfinished work, and prepares a thorough PR with a tidy git history. Use it to wrap up features, prevent regressions, and streamline reviewer onboarding.

How this skill works

The agent scans the branch for TODOs, failing tests, lint/type issues, and security alerts, then runs a verification script that executes linting, tests, type checks, and builds. It suggests and automates git hygiene steps (rebase on main, interactive squash, conventional commits) and generates a complete PR description with testing notes and screenshots. Finally, it produces a pre-PR report summarizing pass/fail status and remaining tasks.

When to use it

  • Finishing a feature before creating a pull request
  • Preparing a release candidate branch for merge
  • Cleaning up branches after a code freeze or QA pass
  • Before performing a stressful rebase or force-push
  • When you need to hand the change to reviewers or a release manager

Best practices

  • Run all checks locally before pushing and resolve failures first
  • Rebase on the latest main and use --force-with-lease for safe pushes
  • Squash WIP commits into meaningful units and use conventional commit messages
  • Remove debug code and address TODO/FIXME items before finalizing
  • Include screenshots and testing steps for UI changes; link to related tickets

Example use cases

  • Complete a feature branch: run verification, squash WIP, rebase, update docs, then open PR
  • Prepare hotfix branch: ensure tests and security scans pass, rebase, and create a focused PR
  • Polish a large refactor: scan for leftover TODOs, verify types and coverage, and produce a summary for reviewers
  • QA handoff: run the verification script and attach the generated report to the PR for faster review

FAQ

What checks are run before a branch is considered finished?

The verification script runs linting, type checking, unit/integration tests, build, and optional security scans; it also searches for TODO/FIXME markers and validates coverage thresholds.

How does the skill handle git history cleanup?

It recommends an interactive rebase to squash WIP commits, enforces conventional commit messages, rebases onto main, and suggests pushing with --force-with-lease to preserve safety.