agentleFS
jaskirat1616jaskirat1616/grok-skills/skills/pr-description-writer/SKILL.md

pr-description-writer

Skill22 starsChanged 3 months agoMITView on GitHub

Draft and post a GitHub PR title and body from git diff and commit history. Use when opening a new PR, when the user asks to "write a PR description", "draft a PR", "open a PR for this branch", or after running the git-commit skill and pushing the branch. Chains naturally after git-commit and before qodoloop / coderabbitloop.

  • Commits and pushes

6 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

7 rules. 0 are common, 4 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If the diff is large (>500 changed lines), read file-by-file rather than all at once.

    line 58
  2. Very specific:

    If a PR exists in OPEN state: update it with gh pr edit.

    line 66
  3. Very specific:

    If no PR exists: create one with gh pr create.

    line 67
  4. Distinctive:

    If a template exists, mirror its section headings and populate them.

    line 77
  5. Very specific:

    Use Conventional Commits prefix when the branch/commits use it: feat(scope):, fix:, etc.

    line 83
  6. Distinctive:

    If commits already have good conventional messages, use them as the skeleton.

    line 108
  7. Distinctive:

    Always pass the body via a heredoc or temp file: never interpolate it into the command string (quotes and newlines will break the shell):

    line 114

“Common” is measured: kept by at least 6 in 10 of the 5 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

🤖 Auto-generated by weekly-pattern-learner · qodoloop and coderabbitloop both open with gh pr view: the PR creation/description step was never codified as its own skill

PR Description Writer

Draft a GitHub-ready PR title and body from the branch's commit history and diff, then create or update the PR so reviewers and AI tools have full context.

Inputs

  • Base branch (optional, default: main or master, detect from gh repo view)
  • Draft mode (optional, default: off)
  • Template (optional): if .github/pull_request_template.md exists, use its section headings

Workflow

1. Gather branch context

# Current branch
git rev-parse --abbrev-ref HEAD

# Base branch
gh repo view --json defaultBranchRef -q '.defaultBranchRef.name'

# Commits since base
git log <base>..<head> --oneline --no-merges

# Diff summary (full diff for small PRs, stat-only for large)
git diff <base>..<head> --stat
git diff <base>..<head>   # only if total changes < ~500 lines

If the diff is large (>500 changed lines), read file-by-file rather than all at once.

2. Check for existing PR

gh pr view --json number,title,body,state 2>/dev/null
  • If a PR exists in OPEN state: update it with gh pr edit.
  • If no PR exists: create one with gh pr create.

3. Check for a PR template

cat .github/pull_request_template.md 2>/dev/null \
  || cat .github/PULL_REQUEST_TEMPLATE.md 2>/dev/null \
  || cat PULL_REQUEST_TEMPLATE.md 2>/dev/null

If a template exists, mirror its section headings and populate them. Skip sections that ask for credentials, tokens, internal hostnames, or content unrelated to the diff.

4. Draft title and body

Title rules:

  • Use Conventional Commits prefix when the branch/commits use it: feat(scope):, fix:, etc.
  • ≤ 70 characters
  • Imperative mood ("Add X", "Fix Y", not "Added X")
  • Include ticket number if present in branch name (e.g. LIN-123, GH-456)

Body sections (use the template if one was found, otherwise use this structure):

## Summary
- <bullet: what changed>
- <bullet: why>

## Changes
- `<file or subsystem>`: <what changed and why>

## Test plan
- [ ] <what to run and what result to expect>
- [ ] <manual steps if automated tests don't cover it>

## Notes
<optional: anything a reviewer should watch for, known gaps, follow-up issues>

Rules:

  • Describe intent, not what the diff already shows line-by-line.
  • If commits already have good conventional messages, use them as the skeleton.
  • Skip any section that has nothing meaningful to say.
  • Reference specific files, functions, or lines only when they aid navigation.

5. Create or update the PR

Always pass the body via a heredoc or temp file: never interpolate it into the command string (quotes and newlines will break the shell):

# Create new PR
gh pr create \
  --title "<title>" \
  --body "$(cat <<'PRBODY'
<body>
PRBODY
)" \
  --base <base> \
  [--draft]

# Update existing PR
gh pr edit <number> \
  --title "<title>" \
  --body "$(cat <<'PRBODY'
<body>
PRBODY
)"

6. Confirm and report

gh pr view --json number,title,url -q '"PR #\(.number): \(.title)\n\(.url)"'

Print the PR number, title, and URL. If the PR was newly created, note whether CI triggered automatically.

Chaining

Before this skillAfter this skill
olko:git-commit + git pusholko:qodoloop
git push -u origin <branch>olko:coderabbitloop
N/Aolko:open-source-publisher (for new repos)

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.