agentleFS
Smirnov-LabsSmirnov-Labs/claude-skills/skills/pr/SKILL.md

pr

Skill6 starsChanged 8 days agoMITView on GitHub

Use when the user runs /pr to commit the current work, push the branch, and open or update its pull request.

  • Commits and pushes

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 7 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    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:

    If this branch already has a PR (gh pr view --json number,url,baseRefName), its baseRefName is the base.

    line 14
  2. Distinctive:

    Run git branch --show-current.

    line 19
  3. Distinctive:

    Run git status, git diff and git diff --cached --stat.

    line 20
  4. Distinctive:

    If the index already holds changes you did not make, stop and ask the user.

    line 21
  5. Distinctive:

    Write the message in the repo's style (git log --oneline -10): what changed, and why.

    line 26
  6. Very specific:

    Never skip hooks with --no-verify.

    line 27
  7. Distinctive:

    Only your commits and your files may appear.

    line 37
  8. Distinctive:

    If the repo is public, scan the added lines before you push.

    line 39
  9. Very specific:

    If the branch has a PR (found above), update its body with gh pr edit --body-file FILE, and say what is new.

    line 47
  10. Very specific:

    If none exists, search for a duplicate first: gh pr list --state all --search "<keywords> in:title".

    line 48
  11. Very specific:

    Create it: gh pr create --base "$BASE" --title "..." --body-file FILE.

    line 49
  12. Distinctive:

    Keep the title and body plain: what changed, why, and how you tested it.

    line 50
  13. Very specific:

    wait for the reviewers: prbots wait <PR> --trigger, in the background (the watching-pr-bot-reviews skill).

    line 56

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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: commit, push, open or update the PR

The repo's own rules come first. If the repo has .claude/commands/pr.md, or a CLAUDE.md with PR rules (a base branch, a title format, an issue link, required checks), read them now. Where they differ from the steps below, follow them.

Find the base branch before anything else:

  1. If this branch already has a PR (gh pr view --json number,url,baseRefName), its baseRefName is the base. If the user named a different base, stop and ask: the PR targets another branch.
  2. Otherwise the base is the argument, if the user gave one, or else the repo's default branch: gh repo view --json defaultBranchRef -q .defaultBranchRef.name.

1. Check where you are

  1. Run git branch --show-current. If you are on the base branch, stop. Create a branch first, or a worktree if other sessions share this checkout.
  2. Run git status, git diff and git diff --cached --stat. Know every change before you stage it.
  3. If the index already holds changes you did not make, stop and ask the user. A commit would take them along, and unstaging them can lose another session's work.

2. Commit

  1. Stage the files you mean, by name. In a shared checkout, git add . and git add -A pick up other sessions' edits.
  2. Write the message in the repo's style (git log --oneline -10): what changed, and why. End it with the attribution lines your session gives you.
  3. Never skip hooks with --no-verify.

3. Check what the push will carry

git fetch origin "$BASE"
git log --oneline "origin/$BASE..HEAD"        # the commits the push carries
git diff --name-only "origin/$BASE...HEAD"     # the files the PR changes (three dots: since the branch left the base)

Only your commits and your files may appear. Anything else means a wrong base: fix that before you push.

If the repo is public, scan the added lines before you push. Look for secrets and private details: tokens, internal hostnames, private IPs, home-directory paths, client names. Scan the commit message too.

4. Push

git push -u origin HEAD

5. Open or update the PR

  1. If the branch has a PR (found above), update its body with gh pr edit --body-file FILE, and say what is new.
  2. If none exists, search for a duplicate first: gh pr list --state all --search "<keywords> in:title".
  3. Create it: gh pr create --base "$BASE" --title "..." --body-file FILE. The body has Summary, Changes and Testing sections, and ends with your session's attribution line.
  4. Keep the title and body plain: what changed, why, and how you tested it.

6. Report

Give the user the PR URL and a line on what it holds, then stop. Do more only if the user asked for it:

  • wait for the reviewers: prbots wait <PR> --trigger, in the background (the watching-pr-bot-reviews skill);
  • fix their findings: /pr-fix;
  • merge: /pr-land.

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.