Agent skill

finish-branch

Stars 1
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/iamladi/cautious-computing-machine--sdlc-plugin/tree/main/skills/finish-branch

SKILL.md

Finish Branch Skill

Priorities

Safety > Completeness > Speed

Goal

Clean up local and worktree branches after PR merge. Verify merge status via gh pr view or git branch --merged, switch to main, pull latest, run tests, delete branch using safe delete, and remove associated worktree if present. Maintain repository hygiene without losing work.

Constraints

  • Check merge detection: use gh pr view for PR numbers, git branch -r --merged for branch names
  • Never delete unmerged: use git branch -d (safe delete), never -D
  • Verify clean state: check git status before switching branches
  • Confirm worktree cleanup: git worktree remove only after verifying path
  • Stop if PR not merged or branch has unmerged commits
  • Warn on test failures but continue cleanup

Workflow

  1. Parse arguments: PR number, branch name, or detect from current branch
  2. Verify merge status: gh pr view or git branch --merged check
  3. Check uncommitted changes: git status --porcelain, warn if dirty
  4. Switch to main: git checkout main
  5. Pull latest: git pull origin main
  6. Run tests: detect and execute appropriate test command
  7. Delete branch: git branch -d [name]
  8. Clean worktree: git worktree list, then git worktree remove if exists
  9. Prune remotes: git remote prune origin

Safety Checks

  • PR merge detection: always verify before cleanup
  • Safe delete only: never force delete with -D
  • Check before switch: confirm no uncommitted work
  • Worktree path confirmation: verify worktree path before removal
  • Stop on unmerged: halt cleanup if branch not merged to main

Arguments

$ARGUMENTS

Expand your agent's capabilities with these related and highly-rated skills.

iamladi/cautious-computing-machine--sdlc-plugin

tdd

TDD enforcement during implementation. Reads `tdd:` setting from CLAUDE.md. Modes - strict (human approval for escape), soft (warnings), off (disabled). Auto-invoked by /implement.

1 0
Explore
iamladi/cautious-computing-machine--sdlc-plugin

judgment-eval

Evaluates agent judgment quality through scenario-based testing in-conversation. Use when the user wants to test, validate, or stress-test an agent, skill, or command definition — e.g. "test this agent", "evaluate this skill", "does this prompt handle edge cases", "check this agent's judgment", or after writing or modifying any agent/skill/command .md file.

1 0
Explore
iamladi/cautious-computing-machine--sdlc-plugin

update-models

Re-resolve the model registry by querying OpenAI Codex cache, Google AI API, and Oracle CLI. Use when models feel stale or after a major model release.

1 0
Explore
iamladi/cautious-computing-machine--sdlc-plugin

gemini

Use when the user asks to run Gemini CLI for code review, plan review, or big context (>200k) processing. Ideal for comprehensive analysis requiring large context windows. Resolves the latest flagship model from the model registry.

1 0
Explore
iamladi/cautious-computing-machine--sdlc-plugin

agent-change-walkthrough

Generates a narrative walkthrough of AI-authored code changes. Use after implementation to explain what changed, why, and how it behaves.

1 0
Explore
iamladi/cautious-computing-machine--sdlc-plugin

interview

Interview me about anything in depth

1 0
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results