agentleFS
me-cedricme-cedric/agent-compass/skills/pr-flow/SKILL.md

pr-flow

Skill3 starsChanged 27 days agoMITView on GitHub

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.

  • Deletes or force-pushes
  • Commits and pushes

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

10 rules. 0 are common, 4 are distinctive, and 6 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use the CLI of the origin remote: gh for GitHub, glab for GitLab (also a self-hosted GitLab).

    line 16
  2. Very specific:

    Check the login first: gh auth status or glab auth status.

    line 17
  3. Distinctive:

    Run the gates (lint, typecheck, tests) and keep the exact counts for the body.

    line 27
  4. Very specific:

    When a CHANGELOG.md of a touched app has ## [Unreleased], add the entry in this change.

    line 28
  5. Very specific:

    Never a label that states a judgement: breaking-change, critical, confirmed.

    line 42
  6. Very specific:

    Write the body to $TMPDIR/pr-<branch>.md, never into the repository.

    line 48
  7. Distinctive:

    Only add. Never remove a label or an assignee that someone else set.

    line 64
  8. Distinctive:

    Update the title and the body when a push changes what the branch delivers.

    line 67
  9. Distinctive:

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

    line 72
  10. Very specific:

    Check the delivery by tree, because a squash breaks ancestry: git fetch origin && git diff --stat <branch> origin/<base> -- <touched dirs> …

    line 79

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.

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.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.