agentleFS
jonathascostajonathascosta/claude-code-workflow/.claude/skills/pr-open/SKILL.md

pr-open

Skill2 starsChanged 14 days agoMITView on GitHub

Take a finished, self-reviewed change to an open pull request - show what will be committed and wait for approval, commit and push, run the project's checks that need the pushed code, draft the pull request from the project's template and wait for approval, open it with labels and reviewers, move the task on the board, and draft the announcement for the team. Use when the user asks to commit, to prepare or open a pull request, or says the work is ready to go for review.

  • Commits and pushes

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

17 rules. 0 are common, 7 are distinctive, and 10 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 10

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    If the user prefers to commit, push or run something themselves, give them the exact commands and wait until they say it is done.

    line 22
  2. Distinctive:

    Stop and say what is missing if any of these fails:

    line 28
  3. Very specific:

    Tests: run the component's test command from project.md now and keep the counts (passed, skipped, failed).

    line 31
  4. Very specific:

    No conflict with the base branch: check without touching the working tree, for example git fetch origin && git merge-tree --write-tree HEAD …

    line 33
  5. Distinctive:

    Nothing forbidden in the diff: no ticket numbers or people's names in code or comments, no secrets, no leftover debug output, no files that …

    line 34
  6. Very specific:

    Read "Before the commit" under "Extra steps for this project" in project.md and run the steps in order: typically reserving something …

    line 38
  7. Distinctive:

    Ask before any step that writes somewhere shared.

    line 40
  8. Very specific:

    If the section says none, skip it.

    line 43
  9. Very specific:

    Commit messages follow the convention in project.md.

    line 57
  10. Distinctive:

    Never force-push here. If the push is rejected, stop and show why.

    line 73
  11. Very specific:

    If a check fails and the fix changes code, say so plainly and go back: fix, tests, self-review, then step 3 again with the new commit.

    line 80
  12. Distinctive:

    Create any missing label.

    line 100
  13. Very specific:

    Write the description to a file in the scratchpad and create the pull request from that file (gh pr create --base <base> --head <branch> …

    line 101
  14. Distinctive:

    Read it back and confirm that the labels and the requested reviewers are really there.

    line 102
  15. Very specific:

    Read "After opening a pull request" in project.md and run the steps in order, asking before any that writes somewhere shared.

    line 112
  16. Very specific:

    Use the message skill: the form project.md asks for under "Communication", by default the link and one very short sentence per pull …

    line 116
  17. Very specific:

    Start pr-watch, so the review is noticed when it arrives.

    line 122

“Common” is measured: kept by at least 6 in 10 of the 4 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

Open a pull request

Take the change on the current branch from "reviewed" to "pull request open and announced". Everything specific to the project comes from .claude/project.md: the commit convention, the pull request template, title pattern, labels, reviewers, the board names for "pull request opened", the chat tool, and the project's own steps at each moment. If a value this skill needs is still a <...> placeholder, stop and ask for it.

The repository host is assumed to be GitHub, through the gh CLI. For another host, project.md must say how a pull request is created and read.

The golden rule, as it applies here

Nothing is committed, pushed or published without the user's approval. This skill has two approval points, in this order, and each needs its own explicit yes:

  1. The commit and push (step 3): after the user has seen the files and the commit message of every commit.
  2. The pull request (step 6): after the user has seen the title, the description, the labels (including any label that will be created) and the reviewers.

A yes to one never covers the other. Besides these two, every project step that writes somewhere shared, updates a shared branch or starts a pipeline is asked about on its own, saying exactly what it will do.

If the user prefers to commit, push or run something themselves, give them the exact commands and wait until they say it is done.

While an approval is pending, record it and keep saying so: worklog.py start <task id> waiting_user --note "<what is waiting>", and end every message with a line saying what is waiting. When the answer comes, go back to the stage the work is in.

1. Check that the change is ready

Stop and say what is missing if any of these fails:

  • Reviewed: self-review ended with a clean round, and the state it covered is the current state. Self-review records that state as a review_clean mark in the worklog (worklog.py report <task id> lists the marks with their notes), holding a state hash that does not change when the same content is committed. Compute the state hash again, with the same command self-review gives, and compare it with the latest mark. If it differs, something changed since the review: run self-review again first. The one exception is this skill's own step 2, below.
  • Tests: run the component's test command from project.md now and keep the counts (passed, skipped, failed). They go in the pull request. A failure listed in project.md as coming from the machine is reported, not treated as a blocker.
  • One task, one branch, one pull request: the branch holds this task and nothing else. Unrelated changes go to another branch.
  • No conflict with the base branch: check without touching the working tree, for example git fetch origin && git merge-tree --write-tree HEAD origin/<base>. If it conflicts, show where and ask how to proceed.
  • Nothing forbidden in the diff: no ticket numbers or people's names in code or comments, no secrets, no leftover debug output, no files that belong to another change.

2. Run the project's steps that come before the commit

Read "Before the commit" under "Extra steps for this project" in project.md and run the steps in order: typically reserving something shared (a release number) and adding files that belong in the commit (release configuration).

  • Ask before any step that writes somewhere shared.
  • A step that reserves something shared is done and confirmed before anything that uses it.
  • A step marked once is done once per pull request, never repeated on a later round or in a later session. Record each one when it is done, naming the branch, because a task can need a second pull request (worklog.py mark <task id> once_done --note "<branch>: <the step>"). Before running a once step, look for its mark for the current branch (worklog.py report <task id> lists the marks): if it is there, the step was already done. The same recording and lookup apply to the once steps of steps 5 and 9.
  • If the section says none, skip it.

Files these steps add (release or deployment configuration, not code) are part of the commit but were not seen by the reviewers. That is accepted for configuration files only: show each of them in full in step 3. If a step changes code, it is a code change like any other: self-review again. Then compute the state hash again and list exactly what changed since the reviewed state: git diff --name-status <state hash of the latest review_clean mark> <new state hash> (both hashes are git trees, so git can compare them). Only if that list is exactly the files step 2 added record the new state (worklog.py mark <task id> review_clean --note "<new state hash> after the steps before the commit"), so that coming back to this skill later does not ask for a review of what was already reviewed. If the list shows anything else (a file edited in the editor meanwhile, a file the tests rewrote, a version bumped inside a code file), do not record: say what changed and run self-review again.

3. Show what will be committed, and wait

Present, briefly:

  1. What was done, in a few lines a teammate could read.
  2. The test results and how many review rounds it took.
  3. The commits to create. One commit per concern: release or deployment configuration goes in its own commit, separate from the code. For each: the files (explicit paths, never "everything") and the message.
  4. Anything deliberately left out of the commit.
  5. What will happen right after the push: the project's checks of step 5, named one by one, so the user knows what the yes leads to. Each of those is still asked about when its turn comes.

Commit messages follow the convention in project.md; when it sets none: one short line in English that says what the commit contains and nothing more, no body, and no mention of the assistant as author or co-author.

Then stop and wait for the first approval.

4. Commit and push

After the yes:

git add <explicit paths>
git commit -m "<message>"
git log -1 --format="%h %an %s"          # confirm the author is the user
git push -u origin <branch>              # first push sets the upstream
git status -sb                           # confirm the branch tracks its own remote branch, not the base

Never force-push here. If the push is rejected, stop and show why.

5. Run the project's checks that need the pushed code

Read "After the push, before the pull request" in project.md and run the steps in order: typically updating a shared integration branch, deploying to a development environment and testing there (smoke-test). The commands for listing, starting and following a run come from the pipeline recipes file that project.md points to.

  • Each of these is its own question. Updating a shared branch is a merge and a push to a branch other people use: say which branch, what will be merged into it and that it will be pushed, and wait for the yes. Starting a pipeline or a job: say which one and on which ref, and wait. Look first for a run that already started by itself.
  • If a check fails and the fix changes code, say so plainly and go back: fix, tests, self-review, then step 3 again with the new commit. Steps marked once are not repeated; steps marked every change are.
  • If the section says none, skip it.

6. Draft the pull request, and wait

Build the draft from project.md:

  • Title: the project's pattern.
  • Description: the section headings of the project's template (read the file it names; if the template is marked outdated, follow what project.md says to do instead). Keep it as short as the template allows: what the change does, and the test results with their counts, including the checks of step 5. Write N/A under a section that does not apply. "Related pull requests" lists real, still-open dependencies only. No story of how the work went, no alternatives considered.
  • Labels and reviewers: from project.md. Check which labels already exist; list any that will have to be created.
  • Base and head: the base branch from project.md, and this branch. Never open a pull request from a shared integration branch.

Show the title, the description as raw markdown in a code fence, the labels (marking the ones to be created) and the reviewers. Point out anything the user must fill in or decide. If the reviewers' cut-off in project.md has passed, say that the review is expected on the next working day.

Then stop and wait for the second approval.

7. Open it and check it

After the yes:

  1. Create any missing label.
  2. Write the description to a file in the scratchpad and create the pull request from that file (gh pr create --base <base> --head <branch> --title "<title>" --body-file <file> --label <label> ... --reviewer <handle> ...).
  3. Read it back and confirm that the labels and the requested reviewers are really there; a missing release label can silently block every later deploy.

Give the user the link.

8. Move the board

Mark the task as "pull request opened", using the exact state or column from the moments table in project.md and the board recipes file. Read it back. This board change is part of this skill's agreed steps: make it and report it. The story does not move unless project.md says so.

9. Run the project's steps after opening

Read "After opening a pull request" in project.md and run the steps in order, asking before any that writes somewhere shared.

10. Draft the announcement

Use the message skill: the form project.md asks for under "Communication", by default the link and one very short sentence per pull request, plain text. Give it in a code fence so it can be pasted. The user sends it.

11. Close

Report what now exists: the commits, the pull request link, the board change, the project steps done, and the announcement ready to paste.

Start pr-watch, so the review is noticed when it arrives. Say what happens next: when a reviewer comments, pr-answer handles the replies; when the pull request is approved, release takes it from the merge onwards.

Then do not sit waiting. If the reviewers' cut-off in project.md has passed, or their working day has ended, the review will not come back before the next working day: say so, and propose the next piece of work at once by running story-start as far as its plan (unless the limit of tasks in flight in project.md is reached; then propose something that is not a new task). If the review can still come back today, the wait is short: say when it is expected, and use the time for something small that can be dropped when the watcher fires.

End with what is waiting for the user.

Timing

Record the stage changes in the worklog (python .claude/skills/worklog/scripts/worklog.py): start <task id> pre_pr_checks at step 2 and again when step 5 begins; start <task id> waiting_user at each approval point; at step 7 mark <task id> pr_opened followed by start <task id> team_review.

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.