agentleFS
radiovisualradiovisual/claude-skills/skills/piv-create-pr/SKILL.md

piv-create-pr

Skill0 starsChanged 57 days agoMITView on GitHub

Push the current feature branch and open a pull request, ready for review. Use after a ticket's implementation is committed on its own branch — it detects the base branch, pushes, opens the PR with a clear body (summary · what changed · validation status), and returns the URL to hand to a reviewer.

  • Commits and pushes

1 other project uses a version of this, 1 of them edited.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 1

    1. coleam00/skills★ 73897% same

    Wrote their own version · 0

    None found.

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository10 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    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. Distinctive:

    Don't hardcode main. Resolve it:

    line 14
  2. Very specific:

    If $ARGUMENTS contains --base <branch>, use that.

    line 15
  3. Very specific:

    Project conventions: if .claude/references/conventions.md exists, read its ## pr section — its rules win over the default template below …

    line 38

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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

Create PR: Open the Pull Request, Hand Off for Review

This is the ship step of the PIV loop: the implementation is committed on a feature branch; now open the PR so it can be reviewed (by /code-review, then a human).

Phase 0 — Detect the base branch

Don't hardcode main. Resolve it:

  1. If $ARGUMENTS contains --base <branch>, use that.
  2. Else: git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@'
  3. Fallback: git remote show origin 2>/dev/null | grep 'HEAD branch' | awk '{print $NF}'
  4. Last resort: main. Store as {base}.

Phase 1 — Validate git state

git branch --show-current
git status --short
git log origin/{base}..HEAD --oneline
StateAction
On {base}STOP: "Create a feature branch first (the ticket should be on its own branch)."
Uncommitted changesSTOP: "Commit (or stash) before opening the PR."
No commits ahead of {base}STOP: "Nothing to PR."
Existing PR for this branch (gh pr list --head $(git branch --show-current) --json url)STOP and print the URL.
Clean, commits ahead, no PRPROCEED

Phase 2 — Gather context for the body

  • Project conventions: if .claude/references/conventions.md exists, read its ## pr section — its rules win over the default template below (sections, tone, what must be stated). That file is where a project's specifics live; this skill stays general.
  • Commits: git log origin/{base}..HEAD --pretty=format:"- %s"
  • Files: git diff --stat origin/{base}..HEAD
  • Implementation report (if piv-implement wrote one — .claude/reports/<…>-report.md): pull the summary, validation results, and documented deviations (these belong in the PR body — they tell the reviewer what was intentional).
  • Linked ticket / issue: look for ACC-…, #123, Fixes #… in the commits/branch name.
  • PR template: if .github/PULL_REQUEST_TEMPLATE.md exists, fill it; else use the default below.

Phase 3 — Push and open the PR

git push -u origin HEAD
gh pr create --base "{base}" --title "{type}: {concise description}" --body "$(cat <<'EOF'
## Summary
{1-2 sentences: what this ticket delivers}

## What changed
{commit summaries}

## Validation
- Tests / type-check / lint: {pass/fail from the implementation report or a fresh run}
- Manual check: {what was exercised, or "pending review"}

## Notes for the reviewer
{documented deviations from the plan — intentional decisions — or "none"}

## Linked
{ticket / issue refs, or "none"}

_Ready for review._
EOF
)"

({type} = feat/fix/refactor/… from the work. Use --draft if the work isn't ready for a real review.)

Output

gh pr view --json number,url,title,baseRefName,headRefName

Report the PR number + URL, the base ← head branches, and "Ready for review → run /code-review <number>, then a human approves." This is the handoff point: the agent's loop ends at an open PR; review and merge are the gates.

Notes

  • Tool-agnostic in spirit: this skill uses GitHub (gh); the same motion is "open a merge request" on GitLab, or "mark ready for review" wherever your team works. Solo with no remote? Skip the PR — commit on {base} and review your own diff before moving on.
  • Sets up parallel work: one branch per ticket → one PR per ticket is exactly what makes worktree parallelism (running independent tickets at once) clean.

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.