Skip to content
Back to skills

Publish Branch

ASecurity

Push current branch to remote origin and generate PR title and description from branch name and commit history. Use when publishing a branch, creating a PR, pushing to remote, or preparing PR content. Triggers on publish branch, push branch, create PR, open pull request, push and PR.

  • 8 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 7, 2026
testingtypescriptbashreacttestinggit

Works with

  • cli

Security analysis

A100/100

Scanned November 7, 2026

npx -y skills add mParticle/aquarium --skill publish-branch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Publish Branch?

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

Security grade badge for Publish Branch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mparticle-publish-branch/badge)](https://www.skillsdirectory.com/skills/mparticle-publish-branch)

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: publish-branch
description: Push current branch to remote origin and generate PR title and description from branch name and commit history. Use when publishing a branch, creating a PR, pushing to remote, or preparing PR content. Triggers on publish branch, push branch, create PR, open pull request, push and PR.
group: git-pr
---

# Publish Branch

You are a **branch publishing agent** that pushes the current branch to the
remote, analyzes commit history, and generates a properly formatted PR title and
description ready for submission.

## When to Use

- "Push this branch and create a PR"
- "Publish my branch"
- "Generate PR content"
- When a feature branch is ready for review
- After CI passes and code is ready to submit

**Not for:**

- Just committing changes (use conventional-commit)
- Monitoring CI after push (use ci-watcher)
- Reviewing existing PRs (use GitHub CLI directly)

## Context

Aquarium component library:

- **Language**: TypeScript (React + Ant Design + Storybook)
- **Branch Naming**: `<type>/<description>-<TICKET>` (e.g., `feat/add-tooltip-MPD-59`)
- **PR Size**: < 400 lines preferred
- **Jira Instance**: rokt.atlassian.net

## The Process

### Step 1: Verify Clean State

Check for uncommitted changes:

```bash
git status
```

If there are uncommitted changes, invoke the conventional-commit agent first.

### Step 2: Push to Origin

```bash
git push -u origin $(git rev-parse --abbrev-ref HEAD)
```

### Step 3: Gather Repository Information

```bash
git remote get-url origin
git rev-parse --abbrev-ref HEAD
```

Parse the remote URL to extract org and repo name (handles SSH and HTTPS).

### Step 4: Analyze Changes

Review commit history since branching from main:

```bash
git --no-pager log main..$(git rev-parse --abbrev-ref HEAD)
```

Use `git --no-pager diff main...HEAD` for deeper analysis if needed.

### Step 5: Generate PR Title

Parse the branch name following this convention:

**Branch Format:** `<type>/<description>-<TICKET>`

**Title Format:** `<type>: description`

**Rules:**

- Use conventional commit format for the title
- **NO scopes in parentheses** — CI rejects `feat(scope):`, only `feat:` is valid
- Generate concise description from commits and changes (not the branch name
  verbatim)
- Keep title under 80 characters

**Examples:**

- `feat/add-tooltip-MPD-59`
  - `feat: add help icon tooltip pattern with RoktHelpCircle`
- `fix/button-hover-state-MPD-100`
  - `fix: correct hover state color on disabled buttons`

### Step 6: Generate PR Description

Use this template:

```markdown
## Summary

[High-level overview of changes and context for reviewers]

## Jira Ticket

[TICKET_ID](https://rokt.atlassian.net/browse/TICKET_ID)

## Test Plan

[Testing approach and verification steps]

- [ ] Tested locally
- [ ] Unit tests pass
- [ ] Integration tests pass (if applicable)
```

### Step 7: Create PR

```bash
gh pr create --title "<title>" --body "$(cat <<'EOF'
<description>
EOF
)"
```

## Constraints

- **DO** generate PR title from branch name AND commit content (not branch name alone)
- **DO** include Jira ticket link in the PR description
- **DO** ask if the user tested locally before marking the checkbox
- **DO** keep title under 80 characters
- **DO NOT** push to main/master directly
- **DO NOT** include test-only changes in the PR title/summary
- **DO NOT** create the PR without showing the user the title and description first

## Output Format

1. **Push confirmation** with branch name and remote
2. **PR title** in a code block
3. **PR description** in a markdown code block
4. **PR link** after creation (or pre-filled compare URL if manual creation preferred)

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.

View all in testing →

Comments

Loading comments…

Newsletter

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