agentleFS
digitaltracerdigitaltracer/agent-skills/skills/pr/SKILL.md

pr

Skill4 starsChanged yesterdayMITView on GitHub

Create a GitHub pull request from the current branch with gh, with a description written for people (what changed and why, not file names), existing labels, CODEOWNERS reviewers and a confirm step. Use when the user runs /pr or asks to open a PR.

  • Reads credentials
  • Commits and pushes

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. About 0 are common, 8 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    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
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Create a GitHub pull request from the current branch.

    line 9
  2. Very specific:

    Write like you're explaining the PR to a coworker on Slack.

    line 17
  3. Distinctive:

    Use parameterized queries instead of f-string interpolation

    line 22
  4. Distinctive:

    Every bullet answers either *what does this change do for the system?* or *why was it needed?* — never describes code mechanics.

    line 29
  5. Distinctive:

    All optional, never prompt for them:

    line 35
  6. Distinctive:

    Check for an existing PR:

    line 57
  7. Distinctive:

    If one exists, show the URL and ask: "PR already exists.

    line 61
  8. Very specific:

    If the filtered diff is over ~600 lines, read --stat plus only the core logic files.

    line 80
  9. Very specific:

    Size flag: if insertions + deletions from the filtered stat > 800 → set SIZE_WARNING.

    line 93
  10. Distinctive:

    If this fails, surface the exact error and stop.

    line 116
  11. Distinctive:

    Use this template. Strip all HTML comments and placeholder text from the final output.

    line 130
  12. Very specific:

    If SIZE_WARNING is set, add a final bullet noting the size and suggesting git log origin/$BASE..HEAD for commit-by-commit review.

    line 155
  13. Very specific:

    If SECURITY_FLAG is set, add: "Touches security-sensitive code (<area>).

    line 168
  14. Very specific:

    Do not proceed without an explicit y.

    line 194

≈ “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

Create a GitHub pull request from the current branch.

Most of this command is mechanical (gh commands, signal detection). The part that matters is how you write the PR description — that's where this command actually thinks. Read the Voice section first; it's the rubric for Step 6.


Voice

Write like you're explaining the PR to a coworker on Slack. Not "I changed auth.py and updated utils.py" — "I added token expiry checks so logged-out sessions stop working."

Bad — exactly what to avoid:

  • Replace the search_cache round-trip with direct lookups against products and listings
  • Rename build_search_query to fetch_product_ids
  • Use parameterized queries instead of f-string interpolation

Good — same diff:

  • Product search no longer depends on the search cache (being retired) and reads from the product tables directly
  • Delisted products are now left out of search results — previously they could still show up
  • Fixed a SQL injection risk where store_id and category ids were interpolated into query strings

Every bullet answers either what does this change do for the system? or why was it needed? — never describes code mechanics. No file or function names. Housekeeping (renames, formatting, import cleanup) folds into another bullet or gets omitted.


Step 0 — Parse $ARGUMENTS

All optional, never prompt for them:

  • --base <branch> — override base
  • --draft — create as draft
  • --reviewer <handle> — repeatable
  • --milestone <name>

Step 1 — Pre-flight

gh auth status
git rev-parse --show-toplevel
BRANCH=$(git branch --show-current)
DEFAULT=$(gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name')
BASE=${ARG_BASE:-$DEFAULT}

Abort with a specific message if:

  • on $DEFAULT → "You are on $DEFAULT — create a feature branch first."
  • git log origin/$BASE..HEAD --oneline is empty → "No commits ahead of $BASE. Nothing to PR."

Check for an existing PR:

gh pr list --head "$BRANCH" --json number,url

If one exists, show the URL and ask: "PR already exists. (open / abort)"


Step 2 — Gather context

# Commit messages — primary source for intent
git log origin/$BASE..HEAD --format="%s%n%b---%n"

# Size and shape (filtered)
EXCLUDES="-- :!*.lock :!package-lock.json :!yarn.lock :!poetry.lock \
  :!*.snap :!dist/* :!build/* :!*.generated.* :!*_pb2.py \
  :!*.min.js :!*.min.css"

git diff origin/$BASE...HEAD --stat $EXCLUDES
git diff origin/$BASE...HEAD $EXCLUDES

If the filtered diff is over ~600 lines, read --stat plus only the core logic files. Skip fixtures, assets, generated code.

Signal detection — one pass over the changed-files list:

git diff origin/$BASE...HEAD --name-only

From that list, note presence of:

  • env vars: *.env.example lines added
  • migrations/schema: migration|schema|\.sql
  • new services: docker-compose|k8s/|\.service
  • public docs/API: readme|docs/|openapi|swagger
  • security-sensitive: auth|password|secret|token|crypto|permission|rbac|oauth|jwt|credential → set SECURITY_FLAG

Size flag: if insertions + deletions from the filtered stat > 800 → set SIZE_WARNING.

Ticket refs: grep [A-Z]+-[0-9]+ from $BRANCH and from commit messages.


Step 3 — Labels and CODEOWNERS

gh label list --limit 100 --json name,description
cat .github/CODEOWNERS 2>/dev/null || cat CODEOWNERS 2>/dev/null

Pick 1–3 labels that exist in the repo — never invent. Cross-reference changed paths against CODEOWNERS for reviewer suggestions, but only if --reviewer wasn't passed.


Step 4 — Push

git push -u origin "$BRANCH"

If this fails, surface the exact error and stop. Never force-push.


Step 5 — Title

Sentence case, ≤72 chars, no emoji. Append the ticket ref if one was found.

Example: Leave delisted products out of search results (SHOP-123)


Step 6 — Body

Use this template. Strip all HTML comments and placeholder text from the final output.

## Change Overview
<CHANGE_OVERVIEW>

### Change Checklist
- [x] I have performed a self-review of my code
- [x] I have added necessary tags for the PR
<CONDITIONAL_ITEMS>
- [ ] I have included related PR's in order of dependency.
  - include here
- [ ] This is a release PR and have posted to #releases channel about this
  - slack thread link

### Testing Overview
- [ ] I have added proof of thorough testing
  - include proof here

### Instructions for the reviewer
<REVIEWER_INSTRUCTIONS>

Change Overview: 2–5 bullets, fewer is better. Group ruthlessly. Lead with the highest-impact change. Follow the Voice section at the top — that is the rubric. Commit messages are the primary source for intent; the diff is secondary.

If SIZE_WARNING is set, add a final bullet noting the size and suggesting git log origin/$BASE..HEAD for commit-by-commit review.

Conditional checklist items — include only the ones matching signals from Step 2; delete the rest entirely (don't leave them unchecked):

SignalItem to include
env vars- [x] This PR has new env variables and has been added to GitHub Secrets
new service- [x] This change adds new service(s) and I have included related op changes.
migration/schema- [x] This code has changes to database schema
public docs/API- [x] Mark if documentation changes are required and have been added.

Reviewer instructions: what to exercise, one happy path + one edge case, expected outcome, any setup. For pure refactors or PRs under ~100 lines, collapse to one line: "Pure refactor — verify <existing suite / specific regression> still passes."

If SECURITY_FLAG is set, add: "Touches security-sensitive code (<area>). Verify <specific invariant> still holds and check for unintended access-control changes."


Step 7 — Confirm

Print the full composed PR:

========================================
TITLE:     <title>
BASE:      <base>
LABELS:    <labels>
DRAFT:     yes / no
REVIEWERS: <handles, or "none — CODEOWNERS will apply">

BODY:
<body>
========================================
Looks good? (y / edit / abort)
  • y → Step 8
  • edit → ask what to change, re-show, repeat until y
  • abort → stop

Do not proceed without an explicit y.


Step 8 — Create

cat > /tmp/pr_body.md << 'PRBODY'
<confirmed body>
PRBODY

gh pr create \
  --title "<title>" \
  --body-file /tmp/pr_body.md \
  --base "$BASE" \
  --label "<label>" [--label "<label>"...] \
  [--draft] [--reviewer "<handle>"...] [--milestone "<name>"]

Print the PR URL after creation.

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.