SkillAgentSearch skills...

gwt-pr

Create or update GitHub Pull Requests with the gh CLI, including deciding whether to create a new PR or only push based on existing PR merge status

Install / Use

npx skills add akiojin/llmlb --skill gwt-pr

Installs into whichever agent you are using.

About this skill
♊

Gemini Rules

Gemini CLI config

Quality Score

78/100

Supported Platforms

Gemini CLI

Our assessment of gwt-pr

gwt-pr scores 78/100 on our quality scale, 1545th of 2,717 Development & Engineering skills we index.

Its Gemini Rules is 15 KB long, well organised into 19 sections with 2 code examples: a thorough specification that gives an agent plenty to work with.

It has no GitHub stars yet, so there is no community track record; judge it on its content.

Substance
30/30
Structure
18/20
Description
15/15
Adoption
0/20
Freshness
15/15

Maintenance, license and trust

  • The repository was last updated 10 days ago, so gwt-pr is actively maintained.
  • No license is declared. By default that means all rights are reserved: you can read it, but reusing or redistributing it is not clearly permitted. Ask the author before building on it commercially.
  • Its trust signals score 80/100, with 2 cautions from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.

Safety scan

No issues found

Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.

AI review by kimi-k2.7-code on 2026-09-24. Automated pattern scan on 2026-09-24. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.

gwt-pr compared with similar skills

All 4 of these similar skills score higher than gwt-pr; compare them before choosing.

SkillScoreStarsUpdatedFormat
gwt-pr (this skill)by akiojin78010d agoGemini Rules
Agent-Reachby Panniantong10085.7k12d agoCLAUDE.md
ai-job-searchby MadsLorentzen10044.1ktodayCLAUDE.md
claude-howtoby luongnv8910041.7k1d agoCLAUDE.md
algorithmic-artby anthropics100177.9k5d agoSKILL.md

Frequently asked questions

How do I install gwt-pr?
Run npx skills add akiojin/llmlb. The install tabs above show the steps for each supported agent.
Which AI agents does gwt-pr work with?
It is written for Gemini CLI, as a Gemini Rules file. Other agents that read the same format can often use it too.
Is gwt-pr safe to use?
Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It declares no license and scores 80/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
Is gwt-pr still maintained?
The repository was last updated 10 days ago, so gwt-pr is actively maintained.

name: gwt-pr description: "Create or update GitHub Pull Requests with the gh CLI, including deciding whether to create a new PR or only push based on existing PR merge status. Use when the user asks to open/create/edit a PR, generate a PR body/template, or says 'open a PR/create a PR/gh pr'. Defaults: base=develop, head=current branch (same-branch only; never create/switch branches)."

GH PR

Overview

Create or update GitHub Pull Requests with the gh CLI using a detailed body template and strict same-branch rules.

Decision rules (must follow)

  1. Do not create or switch branches. Always use the current branch as the PR head.
  2. Only develop may target main. If the base is main and the head branch is anything other than develop, refuse to create the PR and instruct the user to merge into develop first, then create a release PR from develop.
  3. Check local working tree state before push/PR operations.
    • git status --porcelain
    • If output is non-empty (tracked or untracked changes), pause and ask the user what to do.
    • Present 3 options: continue as-is, abort, or manual cleanup then rerun.
    • Do not run git stash, git commit, or git clean automatically unless explicitly requested.
  4. Check for an existing PR for the current head branch.
    • gh pr list --head <head> --state all --json number,state,mergedAt,updatedAt,url,title,mergeCommit
  5. If no PR exists → create a new PR.
  6. If any PR exists and is NOT merged (mergedAt is null) → push only and finish (do not create a new PR).
    • This applies to OPEN or CLOSED (unmerged) PRs.
    • Only update title/body/labels if the user explicitly requests changes.
  7. If all PRs for the head are merged → check for post-merge commits (see below).
  8. If multiple PRs exist for the head → use the most recently updated PR for reporting, but the create vs push decision is based on mergedAt.

Post-merge commit check (critical)

When all PRs for the head branch are merged, you must check whether there are new commits after the merge:

  1. Get the merge commit SHA of the most recent merged PR.
  2. Validate merge commit ancestry first: git merge-base --is-ancestor <merge_commit> HEAD
  3. If the merge commit is an ancestor of HEAD, count commits after the merge:
    • git rev-list --count <merge_commit>..HEAD
  4. If the merge commit is missing or not an ancestor of HEAD, fallback to the branch upstream first:
    • git rev-list --count origin/<head>..HEAD
  5. If the upstream comparison fails, fallback to the base branch comparison:
    • git rev-list --count origin/<base>..HEAD
  6. Decision:
    • If the selected count is greater than 0 → create a new PR
    • If the selected count is 0 → report "No new changes since merge" and finish
    • If both fallback comparisons fail → stop and report MANUAL CHECK

Why this matters

  • Scenario A: PR merged → user makes local changes → pushes → changes are NOT in the merged PR
    • Without this check, the changes would be lost or require manual intervention
  • Scenario B: PR merged → user says "create PR" without new changes → would create empty/duplicate PR
    • This check prevents unnecessary PR creation

PR title rules (must follow)

  1. Format: <type>(<scope>): <subject> — follow Conventional Commits.
  2. type: must be one of feat / fix / docs / chore / refactor / test / ci / perf.
  3. scope: optional. Use a short scope that clearly identifies the affected area (for example: gui, core, pty).
  4. subject: keep it within 70 characters. Use the imperative mood (for example: "add ..." / "fix ..."). Do not capitalize the first letter or end with a period.
  5. If the branch name has a prefix such as feat/ or fix/, the title type must match that prefix.

PR body rules (must follow)

Section classification

| Section | Required | Notes | |---------|----------|-------| | Summary | YES | 1-3 bullet points. Include both the what and the why. | | Changes | YES | Enumerate changes by file or module. | | Testing | YES | List the commands run or the exact manual test steps. | | Closing Issues | YES | Closes #N 形式。クローズ対象がなければ "None"。 | | Related Issues / Links | YES | 参照のみ(自動クローズしない)。 | | Checklist | YES | Review every item and mark it checked or N/A. | | Context | Conditional | Required when 3 or more files changed or the rationale is non-trivial. | | Risk / Impact | Conditional | Required when the change is breaking, performance-sensitive, or needs rollback steps. | | Screenshots | Conditional | Required only for UI changes. | | Deployment | Optional | Include only when deployment steps exist. | | Notes | Optional | Include only when reviewers need extra context. |

Validation (agent must check before creating PR)

  1. Do not create a PR if any required section still contains TODO.
  2. If a conditional section does not apply, remove the entire section instead of leaving an empty TODO.
  3. Each Summary bullet must be a single sentence. Do not use vague wording such as "several changes" or "various fixes."
  4. Changes must be specific and include the changed file or module names.
  5. Testing must be reproducible. Do not use vague wording such as "tested."
  6. Add a reason comment to every unchecked checklist item (for example: - [ ] Docs updated — N/A: no user-facing change).
  7. Related Issues must be written as #123 or as a URL. If nothing applies, explicitly write "None".
  8. Closing Issues セクションは Closes #N または None のみ許可。- #N(キーワードなし)は不可。
  9. Related Issues / Links に #N があり、その Issue をリリースで閉じたい場合は、同じ番号を Closing Issues にも Closes #N で必ず記載する。Related Issues / Links のみでは auto-close されない。

Issue/PR Comment Formatting (must follow)

  • Final comment text must not contain escaped newline literals such as \n.
  • Use real line breaks in comment bodies. Do not rely on escaped sequences for formatting.
  • Before posting, verify the final body does not accidentally include escaped control sequences (\n, \t).
  • If a raw escape sequence must be shown for explanation, include it only inside a fenced code block and clarify it is intentional.

Issue Progress Comment Template (required for issue-based work)

When work is tracked in GitHub Issues, progress updates must use this template:

Progress
- ...

Done
- ...

Next
- ...
  • Post updates at least when starting work, after meaningful progress, and when blocked/unblocked.
  • In Next, explicitly state blockers or the immediate next action.

Workflow (recommended)

  1. Confirm repo + branches

    • Repo root: git rev-parse --show-toplevel
    • Current branch (head): git rev-parse --abbrev-ref HEAD
    • Base branch defaults to develop unless user specifies.
  2. Check local working tree state (preflight)

    • Run git status --porcelain.
    • If empty, continue.
    • If non-empty, show detected files and ask the user to choose:
      • Continue as-is
      • Abort
      • Manual cleanup first (git commit / git stash / git clean) and rerun
    • Proceed only when the user explicitly chooses continue.
  3. Fetch latest remote state

    • git fetch origin to ensure accurate comparison
  4. Check branch sync against base (critical)

    • Run git rev-list --left-right --count "HEAD...origin/$base".
    • Parse the result as ahead behind.
    • If behind == 0, continue.
    • If behind > 0, merge origin/$base into the current branch before PR creation.
    • The update strategy is always git merge origin/$base; do not use rebase for this workflow.
    • After merge, push the branch so the PR branch and worktree stay aligned with gwt's remote-first flow.
    • If merge conflicts occur, inspect the affected files carefully, resolve only when the resulting behavior is coherent, and continue.
    • If you cannot resolve the conflict with high confidence, stop and ask the user before proceeding.
  5. Check existing PR for head branch

    • Use decision rules above to pick action.
    • Treat mergedAt as the source of truth for "merged".
  6. If all PRs are merged, perform post-merge commit check

    • Get merge commit: gh pr list --head <head> --state merged --json mergeCommit -q '.[0].mergeCommit.oid'
    • If the merge commit is an ancestor of HEAD, count git rev-list --count <merge_commit>..HEAD
    • If the merge commit is missing or not an ancestor, count git rev-list --count origin/<head>..HEAD first
    • Only if the upstream comparison fails, count git rev-list --count origin/<base>..HEAD
    • If the selected count is 0 → finish with message "No new changes since merge"
    • If the selected count is >0 → proceed to create new PR
    • If neither comparison is usable → stop with MANUAL CHECK
  7. Ensure the head branch is pushed

    • If no upstream: git push -u origin <head>
    • Otherwise: git push
  8. Collect PR inputs (for new PR or explicit update)

    • Title, Summary, Context, Changes, Testing, Risk/Impact, Deployment, Screenshots, Related Links, Notes
    • Optional: labels, reviewers, assignees, draft
  9. Build PR body from template

    • Read the template from the gwt-pr skill path (not the current project path):
      • PR_BODY_TEMPLATE=".gemini/skills/gwt-pr/references/pr-body-template.md"
    • Read ${PR_BODY_TEMPLATE} and fill all required placeholders.
    • Derive missing sections from the diff, linked Issues/SPECs, and executed tests before asking the user.
    • If a conditional section does not apply, remove the entire section.
    • Remove any <!-- GUIDE: ... --> comments from the final output.
    • If any required section still contains TODO after inference, ask only for the irreducible missing information.
  10. Create or update the PR

    • Primary path:
      • Create: gh pr create -B <base> -H <head> --title "<title>" --body-file <file>
      • Update (only if user asked): gh pr edit <number> --title "<title>" --body-file <file>
    • If gh pr create or gh pr edit fails with a secondary rate limit or was submitted too quickly, do not stop.
    • Resolve the repo slug first: gh repo view --json nameWithOwner -q .nameWithOwner
    • REST fallback:
      • Create: gh api repos/<owner>/<repo>/pulls --method POST --input <json-file>
      • Update: gh api repos/<owner>/<repo>/pulls/<number> --method PATCH --input <json-file>
    • Keep the same title/body content across the primary path and REST fallback.
  11. Return PR URL

    • gh pr view <number> --json url -q .url
  12. Post-PR CI/merge check (automatic).

    • After PR creation or push, load .gemini/skills/gwt-pr-fix/SKILL.md and follow its workflow to inspect CI status, merge state, and review feedback.
    • If all CI checks are still pending, poll (30s interval) until complete.
    • If conflicts, review issues, or CI failures are detected, proceed with the gwt-pr-fix workflow to diagnose and fix.

Command snippets (bash)

head=$(git rev-parse --abbrev-ref HEAD)
base=develop
PR_BODY_TEMPLATE=".gemini/skills/gwt-pr/references/pr-body-template.md"

if [ ! -f "$PR_BODY_TEMPLATE" ]; then
  echo "PR template not found: $PR_BODY_TEMPLATE" >&2
  exit 1
fi

# Preflight: local working tree state
status_lines=$(git status --porcelain)
if [ -n "$status_lines" ] && [ "${ALLOW_DIRTY_WORKTREE:-0}" != "1" ]; then
  echo "Detected local uncommitted/untracked changes:" >&2
  echo "$status_lines" >&2
  echo "Choose one before continuing: continue as-is, abort, or manual cleanup then rerun." >&2
  echo "Set ALLOW_DIRTY_WORKTREE=1 only after explicit user confirmation to continue." >&2
  exit 1
fi

# Fetch latest remote state
git fetch origin

# Check branch sync against base before PR creation
divergence=$(git rev-list --left-right --count "HEAD...origin/$base" 2>/dev/null) || {
  echo "Failed to compare HEAD with origin/$base" >&2
  exit 1
}
ahead_count=$(ech

Truncated for display — read the full file on GitHub.

Related Skills

View on GitHub
GitHub Stars0
CategoryDevelopment
Updated10d ago
Forks0

Trust signals

80/100

From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.

1 medium1 low