Przejdź do treści
Biblioteka skilli
Programowanie · Automatyzacja

pr

/pr

Wypycha bieżącą gałąź i otwiera szkicowy PR przez gh, każe recenzentowi o świeżym kontekście go sprawdzić, poprawia uwagi HIGH i MED w maksymalnie 2 rundach i oznacza gotowy po PASS, bez scalania.

Repozytorium
ai-workflow ↗
Licencja
MIT
Ostatnia zmiana repozytorium
22.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 22.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Wypycha bieżącą gałąź i otwiera szkicowy PR przez gh, każe recenzentowi o świeżym kontekście go sprawdzić, poprawia uwagi HIGH i MED w maksymalnie 2 rundach i oznacza gotowy po PASS, bez scalania.

Wyzwalacze z opisu

open a PRpush this up for reviewship this branchcreate a draft PR

Argumenty

/pr [--draft] [--no-review]
Oryginalny opis (EN)

Push the current branch and open a pull request with gh (commits must already exist). Use when the user says 'open a PR', 'push this up for review', 'ship this branch', or 'create a draft PR'. Opens a draft, has the fresh-context wf:reviewer review it, fixes HIGH/MED findings (max 2 rounds), then marks it ready on PASS. Never merges.

Jak działa

  1. Parse Arguments
  2. Guardrails
  3. Steps
Sekcje z nagłówków SKILL.md, w oryginale · 121 linii, 1 714 słów
Podgląd SKILL.md
---
name: pr
description: "Push the current branch and open a pull request with gh (commits must already exist). Use when the user says 'open a PR', 'push this up for review', 'ship this branch', or 'create a draft PR'. Opens a draft, has the fresh-context wf:reviewer review it, fixes HIGH/MED findings (max 2 rounds), then marks it ready on PASS. Never merges."
argument-hint: "[--draft] [--no-review]"
---
Open a pull request for the current branch. Commits must already exist (from `/wf:commit`, `/wf:feature`, `/wf:fix`, or by hand).

Default flow: open as a draft, have a fresh-context reviewer review the branch, fix HIGH/MED findings in a bounded loop, then mark the PR ready on a pass. This is the writer/reviewer rule in your global `CLAUDE.md`: a reviewer with cold context sees the branch before it becomes review-ready.

## Parse Arguments

$ARGUMENTS may contain:
- **`--draft`** — leave the PR a draft even after the review passes. The review still runs; only the final `gh pr ready` is skipped.
- **`--no-review`** — skip the review loop and open the PR directly (ready, unless `--draft`). Two cases allow it. First, a fresh-context review of these exact commits already ran (say which). Second, the allow-list in your global `CLAUDE.md` → **Review**, repeated here so the skill is self-contained (update both together): the whole diff is a typo, spelling or formatting fix in prose, or a changelog entry or project-version bump. Text that instructs an agent — a skill, an agent definition, a `CLAUDE.md`, a prompt — is behaviour and never qualifies; neither does a revert, a file move, or a dependency bump. When unsure, review. Small or urgent is not a reason to skip. State it in the PR body as `Review: skipped — <reason>`.
- **No flags** — the default flow.

## Guardrails

- **Don't force-push without explicit confirmation, and never to the trunk branch.** Force-pushing rewrites history under everyone who has pulled it; surface the risk and confirm first.
- **Don't merge, request reviewers, add labels or milestones, or close issues.** Those depend on team conventions this skill doesn't have. The body or commits may reference an issue (`Closes #N`), but closing is the user's decision.
- **No Claude / Anthropic co-author tags in the PR body.** Co-authorship belongs on commits, not repeated in the description.
- **A dirty working tree stops the skill**; point the user at `/wf:commit`. Mixing uncommitted work in obscures what the PR contains. The only commits this skill makes are review fixes in step 9, staging just the files it fixed.

## Steps

1. **Check preconditions** (in parallel where possible).
   - `gh auth status` — if it fails, stop and print the manual `git push` plus the proposed title and body.
   - `gh pr view --json url,state,isDraft 2>/dev/null` — if an open PR already exists for this branch, don't create another: push any new commits and continue at step 8 (review).
   - Resolve the trunk branch once as `<base>`: `gh repo view --json defaultBranchRef -q .defaultBranchRef.name`, falling back to `git symbolic-ref --short refs/remotes/origin/HEAD` (strip `origin/`). Run `git fetch origin <base>` and use `origin/<base>` in every range below.
   - `git status` and `git rev-parse --abbrev-ref HEAD`.
   - **Dirty tree:** stop — *"Working tree has uncommitted changes. Run `/wf:commit` first, then re-run `/wf:pr`."*
   - **On `<base>`:** stop — *"You're on `<base>`. Create a feature branch first."*
   - **Branch name off the convention** (`feat|fix|refactor|docs|chore|test|perf|build|ci|security/<slug>`, see **Trunk-Based Workflow** in your global `CLAUDE.md`): warn and offer to rename before pushing.
   - **Size.** Measure the added hand-written source:
     `git diff --numstat origin/<base>...HEAD -- . ':(exclude,glob)**/tests/**' ':(exclude,glob)**/__tests__/**' ':(exclude,glob)**/*_test.*' ':(exclude,glob)**/*.test.*' ':(exclude,glob)**/*.spec.*' ':(exclude,glob)**/*_spec.*' ':(exclude,glob)**/test_*' ':(exclude,glob)**/*.lock' ':(exclude,glob)**/*-lock.*'`
     and sum the first column. Leave out generated files and files that only moved. Over ~500: decide whether it is one concern. One concern: carry on, say in your report how large it is and why it stays together, and add that line to the PR body. More than one: warn, suggest the split, and proceed only if the user confirms. Never split one concern to get under the number.

2. **Gather the range:** `git log origin/<base>..HEAD --oneline`, `git diff origin/<base>...HEAD --stat`, and the full diff when drafting. Empty range: stop, nothing to PR. Read every commit and the whole diff — the summary describes the branch, not the tip commit.

3. **Check upstream state:** `git rev-parse --abbrev-ref --symbolic-full-name @{u}` and `git status -sb`.
   - No upstream: `git push -u origin <branch>`.
   - Ahead: `git push origin <branch>`.
   - Behind or diverged: stop; don't pull, rebase or force-push. Tell the user.
   - Up to date: proceed.

4. **Title** — under 70 characters, imperative, **no type prefix** (that belongs in commit messages), describing the outcome. Good: `Add rate limiting to auth endpoints`. Bad: `feat: added rate limiter middleware with token bucket algorithm`.

5. **Body** — these sections in order; delete any that has nothing to say:

   ```markdown
   ## Summary
   - <1-3 bullets on what changed and why>

   ## Spec
   <link to the matching spec (scan docs/specs/, specs/, the feature dir)>

   ## Review
   <only with --no-review: `Review: skipped — <reason>`>

   ## Security checklist
   <only if the diff touches auth, sessions, crypto, password handling, input validation,
   SQL/command construction, file uploads, secrets, env vars, or external API calls>
   - [ ] Inputs validated at system boundary
   - [ ] No secrets or credentials in code/logs
   - [ ] Auth/authz checks unchanged or reviewed
   - [ ] External API calls use timeouts and error handling
   - [ ] <checks specific to what changed>

   ## Test plan
   - [ ] <how to verify each change: commands, URLs, manual steps>
   ```

   The Test plan is always required; "run the existing suite" counts. A focused 5-line body beats a templated 30-line one.

6. **Present the draft** and wait for approval; revise on edits and re-present.
   ```
   Title: <title>
   Base:  <base>
   Head:  <branch>
   Flow:  draft → fresh review → ready   (or: draft-only [--draft] / direct, no review [--no-review])

   Body:
   <full body>
   ```

7. **Create the PR** with a HEREDOC body:
   ```
   gh pr create --base <base> --title "<title>" [--draft] --body "$(cat <<'EOF'
   <body>
   EOF
   )"
   ```
   Always pass `--draft` when the review loop will run, so the branch is never review-ready before its review. With `--no-review`, pass it only if the user wants a draft.

8. **Review.** Skip only when `--no-review` was passed. You are the writer and never review your own work; an in-session review skill runs in your context and does not count. Dispatch the `wf:reviewer` agent, which starts cold. It runs in your working tree, so the tree must be clean:

   ```
   Agent(
     subagent_type: "wf:reviewer",
     description: "Review PR branch",
     prompt: "Base: <base>\nSpec: <spec-path, or 'none'>\nVerify: <the project's lint / typecheck / test commands>"
   )
   ```

   Take the `Verify` commands from the project's `CLAUDE.md`, `Makefile` or package scripts; pass `none` if there are none. It returns `VERDICT` (`PASS` or `FIX_REQUIRED`), `REVIEWED_AT` (the sha it read), `CHECKS`, `FINDINGS` (`HIGH` / `MED` / `LOW`) and `SUMMARY`.

9. **Process the verdict and fix.** Record the verdict with its `REVIEWED_AT` sha as a PR comment (`gh pr comment <url> --body …`), never as `gh pr review --approve`. Keep the LOW findings of every round: they are not fixed and a re-review does not repeat them, so the final comment and report list all of them.
   - `PASS`, and no LOW finding in any round: `Review: PASS`; go to step 10.
   - `PASS`, with LOW findings from this or an earlier round: `Review: PASS_WITH_NITS`; list them all in the final report; go to step 10.
   - `FIX_REQUIRED`: change only what the listed HIGH/MED items require, including the callers, docs and tests the fix needs (LOW items are listed, never fixed in a fix cycle), each fix with a test that fails without it where the project's suite can test it (otherwise say how it was verified). Re-run the project's lint, typecheck and the whole test suite, commit the fixes (conventional message), `git push`, and re-dispatch the reviewer with two extra lines, `Previous findings: <list>` and `Reviewed at: <the REVIEWED_AT sha of the latest verdict>`. That is a narrow re-review: it reads the fix commits; what they broke blocks as usual, and a defect that was already there blocks only when HIGH.

   At most 2 fix cycles. If cycle 2 still returns `FIX_REQUIRED`, record `Review: NEEDS_HUMAN — <count> HIGH/MED unresolved after 2 cycles` (add `Spec ambiguity suspected at <spec-path>` if one finding category recurred), leave the PR a draft, and stop looping. `PASS_WITH_NITS` and `NEEDS_HUMAN` are this skill's labels, not reviewer verdicts. Commits that change behaviour after a `PASS` need a fresh review before merge.

10. **Ready transition.**
    - If the diff touches a trust boundary, auth, crypto, input parsing, secrets, permissions, dependencies, or anything that runs automatically, run the built-in `/security-review` first (fresh context). A HIGH or MED finding keeps the PR a draft (with `--no-review` the PR is already ready: convert it back with `gh pr ready --undo <url>`; the fix commits change behaviour, so the reviewer in step 8 runs on them even though `--no-review` was passed): fix it under the fix-cycle rules of step 9, commit and push, then re-dispatch the reviewer as step 9's narrow re-review, with the security findings in `Previous findings` (only with `--no-review`, where no review has run yet, is it step 8's full review), and re-run `/security-review` on the new commits. These fixes draw on the same budget as step 9 — 2 fix cycles per PR in total, not 2 more. With no cycle left, or a HIGH/MED security finding still open after the last one, record `Review: NEEDS_HUMAN — security finding unresolved`, leave the PR a draft and stop. List LOW findings in the report.
    - `PASS` or `PASS_WITH_NITS`, no open HIGH/MED security finding, and no `--draft`: `gh pr ready <url>`.
    - `--draft`: leave it a draft and report the passing verdict.
    - `NEEDS_HUMAN`: leave it a draft and report the unresolved items.
    - `--no-review` and no security fix was made: nothing to flip; step 7 set the final state. If a security fix was made, the bullets above apply.

11. **Report** the PR URL, its draft/ready state, and the review outcome (`PASS`, `PASS_WITH_NITS` with the nits, or `NEEDS_HUMAN` with the unresolved items). If the reviewer's `CHECKS` says a check left the tree dirty, say so, or the next `/wf:pr` run stops on a dirty tree unexplained. Then add this reminder without running it (the PR isn't merged yet):

    *"After merge: `git checkout <base> && git pull --ff-only && git push origin --delete <branch>; git branch -D <branch>` (only once the PR shows MERGED; the remote delete is a no-op if GitHub already deleted it), plus `git worktree remove <path>` if you used a worktree. Never reuse a merged branch."*

The skill ends here.

Wersje

RepozytoriumWynikLicencja
Ta strona · rafagomes/ai-workflow100MIT
harlan-zw/harlan-claude-code100MIT
harlan-zw/harlan-agent-kit100MIT
jongio/skills100MIT
windmill-labs/windmill100Apache-2.0
opsmill/infrahub100Apache-2.0
nesquikm/dev-process-toolkit100MIT
tony/skills100MIT
tony/skills100MIT

Migawka bazy z 13.11.2026 · wersja paczki 9bb0535c9a26 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100pr-open
    Wypycha bieżącą gałąź i otwiera pull request z treścią wypełniającą szablon PR repozytorium w stylu Smart Brevity.
  • 100create-pr
    Prowadzi pełny przepływ PR: tworzy gałąź funkcji, commituje, pushuje i otwiera pull request.
  • 100create-pr
    Tworzy szkicowy pull request zgodnie z konwencjami projektu, gdy trzeba przygotować gałąź do przeglądu.
  • 100create-pr
    Tworzy szkicowy pull request zgodnie z konwencjami projektu, gdy trzeba przygotować gałąź do przeglądu.
  • 100raise-pr
    Publikuje bieżącą gałąź jako pull request na GitHubie: nazywa i wypycha gałąź, otwiera PR z tytułem zgodnym z konwencją repozytorium i opisuje go.
  • 90open-pr
    Aktualizuje gałąź, wypycha ją i otwiera pull request do zgłoszenia w formacie repozytorium, a potem obserwuje CI.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.