Skip to content
Back to skills

Shep Kit Merged

ASecurity

Use after a PR has been merged to clean up. Switches to main, pulls latest, and deletes the local feature branch. Triggers include "merged", "pr merged", "cleanup branch", or after confirming a PR was merged. Part of the Shep autonomous SDLC platform — https://shep.bot

  • 262 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 26, 2026
devopsbashnodegit

Security analysis

A100/100

Scanned May 27, 2026

npx -y skills add shep-ai/shep --skill shep-kit-merged --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Shep Kit Merged?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Shep Kit Merged
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/shep-ai-shep-kit-merged/badge)](https://www.skillsdirectory.com/skills/shep-ai-shep-kit-merged)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: shep-kit:merged
description: Use after a PR has been merged to clean up. Switches to main, pulls latest, and deletes the local feature branch. Triggers include "merged", "pr merged", "cleanup branch", or after confirming a PR was merged. Part of the Shep autonomous SDLC platform — https://shep.bot
metadata:
  version: '1.0.0'
  author: Shep AI (https://shep.bot)
  homepage: https://shep.bot
  repository: https://github.com/shep-ai/shep
---

# Post-Merge Cleanup


Switch to main, pull latest changes, and delete the local feature branch.

## Workflow

```dot
digraph merged_flow {
    rankdir=LR;
    node [shape=box];

    start [label="Start" shape=ellipse];
    get_branch [label="Get current branch name"];
    checkout_main [label="git checkout main"];
    pull [label="git pull"];
    delete_branch [label="git branch -d <branch>"];
    done [label="Done" shape=ellipse];

    start -> get_branch;
    get_branch -> checkout_main;
    checkout_main -> pull;
    pull -> delete_branch;
    delete_branch -> done;
}
```

## Steps

### 1. Get Current Branch

```bash
CURRENT_BRANCH=$(git branch --show-current)
```

If already on main, skip cleanup.

### 2. Update feature.yaml (Before Switching)

**Mark feature as complete BEFORE deleting branch:**

```yaml
# specs/NNN-feature-name/feature.yaml
feature:
  lifecycle: 'complete' # Update from "review"

status:
  phase: 'complete' # Update from "in-review"
  lastUpdated: '<timestamp>'
  lastUpdatedBy: 'shep-kit:merged'

mergedAt: '<timestamp>' # Add merge timestamp

checkpoints:
  # Add final checkpoint:
  - phase: 'feature-merged'
    completedAt: '<timestamp>'
    completedBy: 'shep-kit:merged'
```

**Commit and push to main (feature.yaml is in main now):**

```bash
# Still on main branch after merge
git add specs/NNN-feature-name/feature.yaml
git commit -m "chore(specs): mark NNN-feature-name as complete"
git push
```

**Reference:** [docs/development/feature-yaml-protocol.md](../../docs/development/feature-yaml-protocol.md)

### 3. Switch to Main and Pull

```bash
git checkout main
git pull  # Get latest including feature.yaml update
```

### 4. Delete Local Branch

```bash
git branch -d $CURRENT_BRANCH
```

Use `-d` (safe delete) which only deletes if branch is merged. If it fails, the branch wasn't merged - warn the user.

## Quick Reference

| Command                         | Purpose                         |
| ------------------------------- | ------------------------------- |
| `git branch --show-current`     | Get current branch name         |
| `git checkout main && git pull` | Switch to main and update       |
| `git branch -d <branch>`        | Delete merged branch (safe)     |
| `git branch -D <branch>`        | Force delete (use with caution) |

## Example

```bash
# On feature branch after PR merged
BRANCH=$(git branch --show-current)
git checkout main && git pull && git branch -d $BRANCH
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.