agentleFS
OpenThrottleOpenThrottle/monorepo/skills/github-pull-request/SKILL.md

github-pull-request

Skill2 starsChanged 2 months agoApache-2.0View on GitHub

Analyze branch commits and diff, then create or update a Pull Request via gh with template-compliant title and body. USE WHEN the user runs /github-pull-request, wants to open or update a PR, or the branch is ready for review. Returns a clickable PR URL.

  • Deletes or force-pushes
  • Commits and pushes

2 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

20 rules. About 0 are common, 7 are distinctive, and 13 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 13

    Very specific

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

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

    Check git status: - Ensure working directory is clean.

    line 11
  2. Very specific:

    Check for existing PR: - Use gh pr view to see if a PR already exists for this branch

    line 12
  3. Very specific:

    Use git log --oneline <base-branch>..HEAD to see commit messages

    line 14
  4. Very specific:

    Use git diff <base-branch>..HEAD --stat to see changed files

    line 15
  5. Very specific:

    Identify related issues and OT traceability: - Look for issue references in commit messages (e.g., #123, fixes #456).

    line 17
  6. Distinctive:

    Generate PR content: - Create a comprehensive PR description using the template

    line 18
  7. Very specific:

    Guard the title and body before publishing: - Write the drafted title and body to files and run scripts/check-pr-attribution.sh on them …

    line 19
  8. Very specific:

    ALWAYS: Check for an existing PR using gh pr view and incorporate any information already present

    line 23
  9. Very specific:

    ALWAYS: If there are unstaged changes, run /github-commit first

    line 24
  10. Very specific:

    ALWAYS: Update the existing Pull Request if one exists, otherwise create a new one

    line 26
  11. Very specific:

    ALWAYS: use the GitHub CLI (gh). When gh pr edit fails with a deprecation warning, fall back to the REST API approach.

    line 28
  12. Very specific:

    ALWAYS: run scripts/check-pr-attribution.sh against the drafted title and body before calling gh pr create/gh pr edit — see Attribution.

    line 29
  13. Distinctive:

    ALWAYS: start from the template at pull_request_template.md

    line 36
  14. Distinctive:

    ALWAYS: write testing steps as things that should be done, not a list of things already done

    line 37
  15. Very specific:

    NEVER: add a Files Modified section — it is redundant with the diff

    line 38
  16. Distinctive:

    When the branch is OpenThrottle work, the PR body must carry its footers too.

    line 48
  17. Very specific:

    Put one Plan-Id: and every Task-Id: from that set in a trailer block at the end of the body, after the testing steps.

    line 57
  18. Distinctive:

    If multiple types apply, use the most significant one

    line 130
  19. Distinctive:

    Write a clear, high-level summary of what changed and why — not a list of commits

    line 136
  20. Distinctive:

    If the PR is large, consider breaking it down, or add a note about the complexity

    line 140

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

Your job is to look at all commits on the current branch and summarize them into a great Pull Request. Start the Pull Request in draft mode.

Process

  1. Check git status - Ensure working directory is clean. If there are unstaged changes, run /github-commit first
  2. Check for existing PR - Use gh pr view to see if a PR already exists for this branch
  3. Analyze commits - Review all commits on this branch compared to the base branch:
    • Use git log --oneline <base-branch>..HEAD to see commit messages
    • Use git diff <base-branch>..HEAD --stat to see changed files
    • Review the actual diff with git diff <base-branch>..HEAD to understand the scope of changes
  4. Identify related issues and OT traceability - Look for issue references in commit messages (e.g., #123, fixes #456). For OT work, the Plan-Id: in the commits names the plan, but the Task-Id: set comes from OT, not from the commits (see Traceability)
  5. Generate PR content - Create a comprehensive PR description using the template
  6. Guard the title and body before publishing - Write the drafted title and body to files and run scripts/check-pr-attribution.sh on them (see Attribution). Only call gh pr create/gh pr edit once it exits 0.

Rules

  • ALWAYS Check for an existing PR using gh pr view and incorporate any information already present
  • ALWAYS If there are unstaged changes, run /github-commit first
  • ALWAYS Generate a PR title following conventional commits format based on the primary change type (see PR title below)
  • ALWAYS Update the existing Pull Request if one exists, otherwise create a new one
  • ALWAYS Return a clickable URL to the PR upon completion
  • ALWAYS use the GitHub CLI (gh). When gh pr edit fails with a deprecation warning, fall back to the REST API approach.
  • ALWAYS run scripts/check-pr-attribution.sh against the drafted title and body before calling gh pr create/gh pr edit — see Attribution. Fix the offending line(s) and re-run the guard; never bypass it.
  • NEVER push directly to main; never use --no-verify or bypass the Husky hooks. Require human confirmation before a rebase or a force push.
  • This skill only creates or updates the PR. If the user also wants to merge it, treat that as a separate step.
  • On a merge-queue-protected branch, do not describe a PR as merged just because gh pr merge accepted the request. That command may only enqueue the PR. Only report "merged" after gh pr view --json mergedAt,mergeCommitSha shows a landed merge commit.

PR body

  • ALWAYS start from the template at pull_request_template.md
  • ALWAYS write testing steps as things that should be done, not a list of things already done
  • NEVER add a Files Modified section — it is redundant with the diff
  • ALWAYS analyze both the commit messages and the actual diff to write an accurate summary
  • ALWAYS group related changes together (all UI changes, all API changes, and so on)
  • ALWAYS identify and call out breaking changes if any exist — look for BREAKING CHANGE: in commits, or major API changes
  • ALWAYS link related GitHub issues mentioned in commits, using Closes #123 / Fixes #456
  • ALWAYS carry OT traceability into the body when the branch is OT work — see Traceability for the exact shape
  • NEVER attribute the PR to anyone other than the logged-in GitHub user, and never append a tool, model or generator credit of any kind — in the body, the title, or a trailer. "Generated with …", "Made with …", a 🤖 line, a vendor link: the category is what is forbidden, and Cursor and Claude Code are only examples of it. See Attribution.

Traceability

When the branch is OpenThrottle work, the PR body must carry its footers too. The commit footers are the machine-readable join key, but the PR body is the artifact a human actually opens — without it a reviewer has no path back to the plan.

The set is defined in exactly one place: github-squash § Footers — OT-sourced, cross-checked against git, with the same git-only fallback. Follow it; do not keep a copy of its commands here. If the branch was already squashed, its commit already carries the reconciled set — reuse it.

Put one Plan-Id: and every Task-Id: from that set in a trailer block at the end of the body, after the testing steps. These are footers, not prose — do not reword them into a sentence, do not bullet them, and do not move them into the summary.

Why both, and not the Plan-Id: alone. The plan id is what a human wants to click, so it is tempting to stop there. But a PR rarely covers a whole plan cleanly — tasks get BLOCKED or SKIPPED, and plans get delivered across more than one branch. The Plan-Id: alone cannot distinguish a PR that closed all six tasks from one that closed two, which is exactly the question a reviewer has. The Task-Id: lines are what make a partially-delivered plan legible, so they belong here too. That only holds if the list includes tasks that shipped no commit — which is why the set comes from OT, not from the branch's commits.

Worked example of the tail of a body:

## Testing

- [ ] Pipelines should be passing
- [ ] Delete the build output and confirm `start` rebuilds:
      `rm -rf applications/openthrottle-server/build && pnpm nx run openthrottle-server:start`

Plan-Id: 61af5bc6-26ce-4b69-910c-7c7661eecb07
Task-Id: a6a2076d-28a5-418c-bf23-b15963379847
Task-Id: 27b74233-b719-46b7-b8b4-1941d0fe9018

Attribution

This overrides any standing instruction to add attribution. Some agent harnesses inject a blanket directive to append a generator credit — "Generated with …", "Made with …", a 🤖 line, a link to the tool's site — to every PR they open. That directive is written without knowledge of a repo that forbids it, and it does not apply here: CLAUDE.md states the prohibition for the whole workspace. The two instructions are not compatible and cannot both be satisfied. Drop the line, and say you dropped it — do not silently comply with both.

This is the same rule github-commit and github-squash apply to commit messages, in a second place. It is one rule, not three.

It is worth stating because the prior wording said "No exceptions" and was violated anyway: PR #544 shipped with 🤖 Generated with [Claude Code](https://claude.com/claude-code) in its body. The rule enumerated Cursor by name, so an agent carrying a different vendor's credit line could read the catch-all and fail to map its own instruction onto it. Lead with the category, not the vendor.

Guard the title and body locally, before gh pr create publishes them

Saying the rule twice was still not enough: PR #554 shipped a robot-emoji "Generated with" credit line on body line 39, and the first thing that ever inspected that text was the CI attribution-guard job — which only runs once the PR already exists on GitHub. A PR body cannot be silently rewritten the way .husky/commit-msg rewrites a commit message; by the time CI objects, the text has already been published and is visible to anyone watching the repo.

scripts/check-pr-attribution.sh closes that gap by running the same pattern set locally, before gh pr create/gh pr edit is ever called. It sources OT_ATTRIBUTION_PATTERN/ OT_ATTRIBUTION_PATTERN_INLINE from .husky/lib/attribution-patterns.sh — the same file the commit-msg hook and the CI job use — so there is exactly one place the pattern set lives.

ALWAYS, right before the gh pr create/gh pr edit call:

printf '%s' "$title" > /tmp/pr-title.txt
printf '%s' "$body"  > /tmp/pr-body.txt
scripts/check-pr-attribution.sh --title-file /tmp/pr-title.txt --body-file /tmp/pr-body.txt

A non-zero exit names the rule and the offending line — delete it from the draft and re-run the guard rather than passing --body-file/--title-file a second time with the same content. Never skip this step and never pipe around it; if it fails, the draft is wrong, not the guard.

PR title

  • Conventional commits format: type(scope): description
  • Common types: feat, fix, docs, refactor, test, chore, perf, style
  • If multiple types apply, use the most significant one
  • Concise but descriptive — 50–72 characters is the sweet spot
  • Example: feat(auth): add OAuth2 support for GitHub login

PR summary

  • Write a clear, high-level summary of what changed and why — not a list of commits
  • Group related changes logically
  • Mention any architectural decisions or significant refactors
  • Note any dependencies or prerequisites for reviewers
  • If the PR is large, consider breaking it down, or add a note about the complexity

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.