Workflow pr sync

From macalbert/envilder · View interactive version

Workflow pr sync is an AI agent skill from the GitHub repository macalbert/envilder. Create or update a GitHub pull request with an auto-generated title and description from branch commits. Use when opening a PR, syncing PR description, or preparing a branch for review.

How to use this skill

Skill file

PR Sync

Create or update a GitHub pull request for the current branch.

When to Use

Procedure

  1. Get the current branch: git branch --show-current
  2. Determine the base branch from the optional argument; if none is

provided, default to main.

  1. Check if a PR already exists:
  1. Get the final diff against base to understand what the PR actually

changes: git diff <base>...HEAD --stat (three-dot merge-base diff).

Use this: not the commit list: as the source of truth for the PR body.

Commits may include merge commits or changes already in main.

  1. Optionally get commits for context: git log <base>..HEAD --oneline
  2. Generate PR title and body following the template.

The template is mandatory: all four sections (Summary, Changes, Testing,

Related) must appear in every PR body, exactly in that order.

The body must describe the final diff vs base, not individual commits.

  1. Create or update the PR using --body-file (see constraints).

PR Title

Use the conventional commit format of the most significant commit:

<type>(<scope>): <description>

If the branch has a single commit, use that commit's message as the title.

Constraints

via --body (PowerShell corrupts backticks in inline strings)

--body-file to ensure template compliance and avoid encoding issues

replace with freeform text

use create_file to write the .pr-body.md file directly instead.

Here-strings corrupt backticks (` ` becomes escape char, e.g. 0 `` =

NUL), arrows (→), em-dashes (—), and other non-ASCII characters.

to instead of →, -- instead of —, etc.

sentence and each Changes bullet as a single unbroken line, no matter how

long. GitHub renders a single \n inside a paragraph or list item as a

visible line break, so hard-wrapped text (e.g. wrapped at ~80 chars) shows

up as broken, choppy lines instead of flowing text. Only insert a real

newline between sections or between separate bullets.

Commands

See reference.md for the PR body template and gh CLI commands.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.