Skip to content
Back to skills

Pr Flow

ASecurity

Open, update, mark ready or merge a PR or MR with gh or glab: draft, base, labels, reviewer, evidence body. Use when the user asks to open, update or merge one.

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 6, 2026
ai-agentsbashgitapidocumentation

Works with

  • claude code
  • cli
  • api
  • mcp

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned November 6, 2026

npx -y skills add me-cedric/Shipyard --skill pr-flow --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Pr Flow?

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

Security grade badge for Pr Flow
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/me-cedric-pr-flow/badge)](https://www.skillsdirectory.com/skills/me-cedric-pr-flow)

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: pr-flow
description: Open, update, mark ready or merge a PR or MR with gh or glab: draft, base, labels, reviewer, evidence body. Use when the user asks to open, update or merge one.
risk_level: high
writes_files: false
requires_tools: [git, gh, glab]
---

# pr-flow

Open a PR or MR only when the user asks. Opening one includes the push of its branch.
The project rules in `AGENTS.md` win over the defaults below: base, branch name, labels, language.

## Forge

Use the CLI of the `origin` remote: `gh` for GitHub, `glab` for GitLab (also a self-hosted GitLab). Never a forge MCP.
Check the login first: `gh auth status` or `glab auth status`.

## Before you open

1. `git status --short`. Commit only the files of this change.
2. Branch name: the project pattern, else `<type>/<TICKET>-<short-kebab>`. Rename a tool branch (`claude/…`, `codex/…`) before the first push.
3. Rebase onto the base: `git fetch origin && git rebase origin/<base>`. The guard blocks `git merge` and `git pull` without `--rebase`.
   Push a rebased branch with `git push --force-with-lease origin <branch>`, never `--force`. Ask the user in chat first.
   Claude Code and Copilot also show a permission prompt for it.
4. Review your own change locally with `review` ("Review your own change"). Post nothing. Fix the findings.
5. Run the gates (lint, typecheck, tests) and keep the exact counts for the body.
6. When a `CHANGELOG.md` of a touched app has `## [Unreleased]`, add the entry in this change.

## Base

The base that the project declares. Else `develop` when `git ls-remote --heads origin develop` finds it. Else the default branch:
`gh repo view --json defaultBranchRef -q .defaultBranchRef.name` or `glab repo view -F json` (`.default_branch`).
A feature request onto the release branch is wrong. Ask first.

## Title, labels, people

- Title: `<type>(<scope>): <subject>` in the language of the project's requests, with the ticket key where the project puts it.
- Labels: read them first (`gh label list`, `glab label list`). Use only labels that exist. Never ask about them.
  - One type label from the commit type, for example `feat` → feature, `fix` → bugfix or fix, `docs` → documentation, `ci`/`build` → ci, dependency bumps → dependencies.
  - Each area label whose area the diff touches.
  - Never a label that states a judgement: `breaking-change`, `critical`, `confirmed`. A person sets those.
- Assignee: yourself. Reviewer: at least one. When the user names none, ask, and list the likely ones:
  `gh api 'repos/{owner}/{repo}/contributors' --jq '.[].login'` or `git shortlog -sne --since=6.months -- <changed dirs>`.

## Open as draft

Write the body to `$TMPDIR/pr-<branch>.md`, never into the repository. Follow [references/body.md](references/body.md).

```bash
gh pr create --draft --base <base> --title "<title>" --body-file "$TMPDIR/pr-<branch>.md" \
  --assignee @me --reviewer <login> --label "<label>,<label>"

me=$(glab api user | jq -r .username)
glab mr create --draft --target-branch <base> --title "<title>" --description-file "$TMPDIR/pr-<branch>.md" \
  --assignee "$me" --reviewer <user> --label "<label>,<label>" --yes
```

With `--draft`, the title has no `Draft:` prefix. A GitLab draft MR runs no pipeline. That is expected.
Then move the ticket (see `task-flow`) and give the user the URL.

## Update

- Only add. Never remove a label or an assignee that someone else set.
  - `gh pr edit <n> --add-label <label> --add-assignee @me`
  - `glab mr update <iid> --label <label> --assignee "+$me"`. The `+` is required: a bare assignee replaces the whole list.
- Update the title and the body when a push changes what the branch delivers.
- To answer review threads: fix, push, reply on each thread with the fixing commit, and resolve it.

## Ready and merge

Only after an explicit yes from the user, for each action.

1. Ready: `gh pr ready <n>` or `glab mr update <iid> --ready`. Then add the labels and the assignee again.
2. Rebase onto the base again right before the merge. Merge only with a green pipeline.
3. Merge:
   - `gh pr merge <n> --squash --match-head-commit "$(git rev-parse HEAD)" --delete-branch`
   - `glab mr merge <iid> --squash --sha "$(git rev-parse HEAD)" --remove-source-branch --yes`
4. Check the delivery by tree, because a squash breaks ancestry: `git fetch origin && git diff --stat <branch> origin/<base> -- <touched dirs>` is empty.
5. Move the ticket (see `task-flow`).

Merge a request of someone else only when the user says so for that request.

## Never

- An AI attribution line in a commit, a title, a body or a comment.
- An invented label, count, verdict or file name.
- A merge, a ready switch or a push to the base branch without a yes.

Files in this skill

  • SKILL.md4.6 KB
  • references/body.md3.2 KB

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 ai-agents →

Comments

Loading comments…

Newsletter

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