Skip to content

Instantly share code, notes, and snippets.

@DanielCardonaRojas
Created September 30, 2025 15:23
Show Gist options
  • Save DanielCardonaRojas/02af92c942973026921690ae816ea05c to your computer and use it in GitHub Desktop.
Save DanielCardonaRojas/02af92c942973026921690ae816ea05c to your computer and use it in GitHub Desktop.
pr-description claude
allowed-tools description
Bash(git log:*), Bash(git config:*), Bash(git diff:*), Bash(git branch:*), Read, Glob
Generate a PR description from commits on the current branch

Context

  • Current branch: !git branch --show-current
  • Pull request template: find .github -type f -name "pull_request_template.md"

Your task

  1. If a PR template is found, read it and use its structure. Otherwise STOP and surface an error to the user.

  2. Extract the ticket ID from the branch name if possible (look for patterns like JIRA-123, TICKET-456, issue-789, #123, etc.)

  3. Generate a plain markdown PR description that:

    • Follows the PR template structure if one exists
    • Fills in sections with relevant information based on:
      • The ticket ID from the branch name
      • Commit messages and summaries
      • The diff showing actual code changes
    • If no template exists, create a description with:
      • Title (derived from branch name or main commit message)
      • Ticket/Issue reference (if found in branch name)
      • High-level overview of the branch's purpose
      • Bullet list of key changes
      • Detailed description based on the diff
      • Test plan or testing notes
      • Notes or questions for reviewers (if relevant)
  4. Output ONLY the filled-in markdown template, ready to be pasted into a PR description. The output should be raw markdown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment