agentleFS
ROCmROCm/rocprofiler-systems-skills/skills/update-pr-description/SKILL.md

update-pr-description

Skill5 starsChanged 17 days agoMITView on GitHub

Use when user says 'update PR description', 'refresh PR description', 'fix PR description', 'rewrite PR body', 'update my PR', or types /update-pr-description

  • Commits and pushes

1 other project uses 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. About 0 are common, 5 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    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:

    Read the current PR description and branch changes, then produce an updated description that accurately reflects what is on the branch.

    line 8
  2. Very specific:

    NEVER hardcode main as base branch: Always read baseRefName from the PR.

    line 26
  3. Distinctive:

    Do NOT discard user-written Motivation — it captures domain context the code cannot express.

    line 46
  4. Distinctive:

    Do NOT wrap prose at 80 characters: Write each paragraph as a single continuous line.

    line 64
  5. Distinctive:

    ALWAYS show the diff before applying: Never silently overwrite.

    line 68
  6. Very specific:

    Use AskUserQuestion with a Yes/No question before applying:

    line 82
  7. Distinctive:

    Only proceed if the user selects Yes.

    line 89

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

Update PR Description

Read the current PR description and branch changes, then produce an updated description that accurately reflects what is on the branch. Always edit in-place — never recreate the PR.

Process

Phase 0: Verify GitHub CLI

gh auth status

Phase 1: Read Current PR State

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

Extract: PR number, existing body (may be empty), base branch, head branch.

NEVER hardcode main as base branch. Always read baseRefName from the PR.

Phase 2: Analyze Branch Changes

BASE=$(gh pr view --json baseRefName -q .baseRefName)
HEAD=$(gh pr view --json headRefName -q .headRefName)

git log --oneline "$BASE".."$HEAD"        # Commit history → Motivation
git diff --stat "$BASE".."$HEAD"          # File stats → Technical Details
git diff --name-only "$BASE".."$HEAD"     # File list → Test Plan

Phase 3: Decide How to Handle Existing Description

SituationAction
Body is empty or placeholderGenerate fresh from branch analysis
Body has real contentPreserve user-written Motivation, update Technical Details and Test Plan from diff

Do NOT discard user-written Motivation — it captures domain context the code cannot express.

Phase 4: Draft the Description

## Motivation
<Why this change — problem being solved, user need, or context>

## Technical Details
<Key implementation decisions, trade-offs, architecture changes>

## Test Plan
- [ ] <how this was tested>
- [ ] <edge cases verified>

Reference actual commits, files, and decisions — never use generic filler text.

Do NOT wrap prose at 80 characters. Write each paragraph as a single continuous line. Hard line breaks inside sentences make the rendered GitHub description look broken. Only break lines at natural paragraph boundaries (blank line between sections).

Phase 5: Show Before → After, Then Apply

ALWAYS show the diff before applying. Never silently overwrite.

Current description:
──────────────────────────────────────────────
<current body, or "(empty)" if blank>
──────────────────────────────────────────────

Proposed description:
──────────────────────────────────────────────
<new body>
──────────────────────────────────────────────

Use AskUserQuestion with a Yes/No question before applying:

Question: "Apply this description to PR #<NUMBER>?"
Options:  Yes | No

Only proceed if the user selects Yes. If No, ask what to change and re-draft.

Apply using the GitHub API directly:

gh api --method PATCH repos/{owner}/{repo}/pulls/<NUMBER> \
  --field body='## Motivation
...

## Technical Details
...

## Test Plan
- [ ] ...'

Resolve {owner}/{repo} with:

gh repo view --json nameWithOwner -q .nameWithOwner

To also update the title, add --field title='...' to the same call.

Verify the update:

gh pr view <NUMBER>

Red Flags — Stop and Correct

  • About to call gh pr create — that recreates the PR. Use gh api --method PATCH.
  • Using main as the base branch without reading baseRefName from the PR.
  • Overwriting the body without reading and displaying the current content first.
  • Applying changes without showing before/after and using AskUserQuestion Yes/No.

Common Mistakes

MistakeFix
Using gh pr edit or gh pr createUse gh api --method PATCH repos/{owner}/{repo}/pulls/<NUMBER>
Hardcoding base branch as mainRead baseRefName from gh pr view
Overwriting user-written motivationRead existing body first, preserve domain context
Skipping confirmationShow before/after diff, then use AskUserQuestion Yes/No
Generic descriptionReference actual commits, files, and decisions from the diff
Hard-wrapping lines at 80 charsWrite prose as continuous lines; only break at paragraph boundaries

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.