agentleFS
nnguyenquanggnnguyenquangg/claude-code-spec-driven-development/skills/open-pr/SKILL.md

open-pr

Skill22 starsChanged 10 days agoMITView on GitHub

Finish a verified change by opening a DRAFT pull request that carries its evidence - feature branch, one commit, push, then a PR body with the spec, the checks run, the UI walkthrough table and its screenshots. Never merges, never pushes to the default branch, never force-pushes. The last step of /fix, /autopilot and /implement-specs; also on "open a PR", "make a PR", "push it for review".

  • Reads credentials
  • Deletes or force-pushes
  • Commits and pushes

62 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use review-change, commit-push and 8 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • thlaureSkill

    review-change

    Use this skill when the user asks for a code review, a correctness pass, a check before PR, or asks whether a Signalist change follows project conventions.

    Also in 4 projects that use this

  • DataCoveySkill

    commit-push

    Commit and push the changes made on this chat session to the current branch. Use best practices from Conventional Commits.

    Also in 3 projects that use this

  • Codagent-AISkill

    implement-change

    Implements an approved change in one continuous session, with tiered test runs. Use when asked to implement a change from its approved definition, or to invoke codagent:implement-change.

    Also in 3 projects that use this

  • saffron-healthSkill

    address-review

    Address PR review comments systematically. Use when responding to code review feedback on a pull request.

    Also in 3 projects that use this

  • DockerSkill

    review-pr

    Review one or more incoming Docker documentation pull requests as a maintainer. Independently validate technical claims, assess editorial fit and information architecture, choose a verdict, and draft exact inline or PR-wide feedback behind a confirmation gate. Use for requests such as "review PR 123", "is this PR correct?", "does this information belong here?", "validate this PR", or "help review backlog PRs". Do not use to maintain or fix a PR you own; use maintain-pr for that.

    Also in 10 projects that use this

  • SentrySkill

    write-tests

    Write tests following project conventions. Use when adding new tests or modifying existing ones.

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 61 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

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

    Commit message: what changed (imperative, one line), a blank line, then Spec: <change name> and Verified: <checks / requests / walkthrough>.

    line 32
  2. Very specific:

    Use .github/pull_request_template.md (or .github/PULL_REQUEST_TEMPLATE/) when the repo has one, filling its sections.

    line 79
  3. Distinctive:

    Leave out the "UI walkthrough" section when nothing in the change is visible in a UI.

    line 104

“Common” is measured: kept by at least 6 in 10 of the 61 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-pr: a draft PR with the proof attached

The reviewer of a PR should see what changed, what it was checked against, and what the screen looked like, without re-running anything. This skill packages that. It does not decide whether the work is done: it runs only after the lane's own gate passed.

0. Preconditions (stop if one fails, and say which)

  • The project's checks are green on the final code.
  • A UI-visible change has a reviewed ui-walkthrough: verify-screenshots/<date>-<task>/<slice>/ with screenshots and a review.md holding no open FINDING of this change's making.
  • The three reviewers (diff-reviewer, security-reviewer, edge-case-reviewer) returned PASS, or the skip reason is written down.
  • The user did not say "local only" / "don't push". A repo with no remote, or gh auth status failing: do steps 1–2 only and report that the PR could not be opened.

1. Branch

  • git branch --show-current. Empty (detached HEAD): git switch -c <type>/<short-slug> first. On the default branch (gh repo view --json defaultBranchRef -q .defaultBranchRef.name, else main/master): git switch -c <type>/<short-slug> (feat/, fix/, chore/; the slug from the change name). Never commit to the default branch, never push it.

2. Commit the unit of work

  • git status --porcelain: stage only files this change touched, by name. Never stage .env*, keys, credential files, screenshots, walkthrough output or editor files; if one shows up untracked, leave it out and mention it.
  • Commit message: what changed (imperative, one line), a blank line, then Spec: <change name> and Verified: <checks / requests / walkthrough>. The repo's own commit convention wins.
  • A review-fix round on a branch that already has its PR: add a new commit on the same branch (fix: <what the review asked>). Never amend, squash or rebase: history is never rewritten.

3. Push

git push -u origin <branch> (the remote that git remote lists for the repo, usually origin; a fork workflow pushes to the fork and opens the PR against upstream). Never --force / --force-with-lease. A push rejected because the remote moved: git pull --no-rebase on the feature branch, re-run the checks, push again. Rejected for permission (403, "denied"): stop and report; never retry another way.

4. Screenshots into the PR

Embed them only when the repo is private (gh repo view --json visibility -q .visibility) or the project's CLAUDE.md says PR screenshots are allowed; a public repo otherwise gets the table and the file names, and the author drags the images in. Before uploading, look at every image once more: one that shows a secret, a token or a real person's data is left out and named in the PR. Upload only the files you approved, by name: never a glob. Name them per round (02-saved-r2.png) so a review-fix round does not overwrite images an earlier PR body points at. A pushed image stays in the branch history for anyone who can read the repo, even after the PR closes. On a public repo, keep the "Shown" column of the table to non-sensitive values for the same reason. Making a private repo public later exposes pr-evidence: delete that branch first. Treat anything already pushed as possibly seen: deleting a branch does not purge GitHub's copies.

Upload to the orphan branch pr-evidence through a temporary worktree, so the feature branch and your checkout stay untouched:

D=$(mktemp -d); W="$D/evidence"; B=<feature branch>
trap 'git worktree remove --force "$W" 2>/dev/null; rm -rf "$D"; true' EXIT   # always cleaned up
if git ls-remote --exit-code --heads origin pr-evidence >/dev/null; then
  git fetch origin pr-evidence && git worktree add --detach "$W" FETCH_HEAD
else   # a fresh root commit with no branch name left behind
  git worktree add --detach "$W" && git -C "$W" checkout --orphan "evidence-$$" \
    && git -C "$W" rm -rfq --ignore-unmatch .
fi || { echo "evidence worktree setup failed; not uploading"; exit 1; }
mkdir -p "$W/$B" && cp <slice folder>/<approved-1>.png <slice folder>/<approved-2>.png "$W/$B/"   # by name, no glob
git -C "$W" add "$B"
if ! git -C "$W" diff --cached --quiet; then   # identical images: nothing to upload
  git -C "$W" commit -qm "evidence: $B" && git -C "$W" push origin HEAD:pr-evidence
fi
git -C "$W" checkout -q --detach 2>/dev/null || true
git branch -D "evidence-$$" >/dev/null 2>&1 || true

Image URL: https://github.com/<owner>/<repo>/blob/pr-evidence/<branch>/<file>.png?raw=true (renders for anyone who can see the repo).

5. Open the draft PR

Use .github/pull_request_template.md (or .github/PULL_REQUEST_TEMPLATE/) when the repo has one, filling its sections; otherwise this body, short and factual:

## What
<2–4 bullets: behaviour that changed, for a user or a caller>

## Spec
<OpenSpec change name + path; ADRs if any>

## Verified
| Check | Result |
|---|---|
| <lint / unit / e2e command> | pass |
| <API call: method path → status, value read back> | pass |

## UI walkthrough
| Step | Expected | Shown | |
|---|---|---|---|
| <from review.md, one row per screenshot> | | | OK |

<one image per row: ![01-login](<image URL>)>

## Review
diff / security / edge-case: PASS (<minor findings left, if any>)

Leave out the "UI walkthrough" section when nothing in the change is visible in a UI. gh pr view --json url,state on the branch first: a PR in state OPEN (a review-fix round) gets the new commit and an updated body (gh pr edit --body-file <file>), never a second PR. Otherwise gh pr create --draft --base <default branch> --title "<commit subject>" --body-file <file>. A change spanning several repos gets one draft PR per repo, each linking the others. The body never contains tokens, credentials or raw api.log lines with secrets (the walk template masks them; check anyway).

6. Report

The PR URL, the branch, what is embedded vs left for the author, and anything not pushed. Merging, marking ready for review and requesting reviewers are the user's.

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.