agentleFS
ReflexioAIReflexioAI/reflexio/.agents/skills/create-pr/SKILL.md

create-pr

Skill385 starsChanged 55 days agoApache-2.0View on GitHub

Create high-quality pull requests via gh pr create. Use when the user wants to create a PR, submit a PR, open a pull request, submit for review, or push changes for review. Triggers on: create a pr, create-pr, submit a pr, open a pull request, submit for review, make a pr, gh pr create.

  • Reads credentials
  • Deletes or force-pushes
  • Commits and pushes

196 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use act-on-feedback, create-release-note and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • MicrosoftSkill

    act-on-feedback

    Act on user feedback attached to the current session. Use when the user submits feedback on the session's changes via the Submit Feedback button.

    Also in 3 projects that use this

  • ModelEngine-GroupSkill

    create-release-note

    从 PR/commit 中自动生成结构化的 Release Notes,并可选创建 GitHub Draft Release。支持 x.y.0 版本合并前一 minor 系列的 release notes。当用户要求生成发布说明、创建 release notes 时触发。参数为版本号和可选的上一版本号。

    Also in 3 projects that use this

  • MicrosoftSkill

    generate-run-commands

    Generate or modify run commands for the current session. Use when the user wants to set up or update run commands that appear in the session's Run button.

    Also in 3 projects that use this

  • frostneySkill

    native-nostalgia-stack

    Applies the user's FreePascal toolchain and its build, formatting, hook, and test contracts while leaving project-specific mechanics local. Use when scaffolding or working in a FreePascal project that follows this toolchain.

    Also in 3 projects that use this

  • frostneySkill

    software-engineering-excellence

    Applies the user's engineering standards during substantial technical work: preserve scope, use current evidence, delegate independent parts, and complete authorized outcomes. Use during substantial implementation, debugging, refactoring, or multi-part delivery work.

    Also in 3 projects that use this

  • parkchuSkill

    start-mission

    넥스트스텝(NextStep) 미션을 처음 시작할 때, 미션 저장소를 fork·clone하고 최초 작업 브랜치(step1 등)까지 만들어 준다. gh CLI로 fork하고 clone까지 이어서 처리하며, gh가 없거나 인증이 안 돼 있으면 브라우저 Fork 안내로 폴백한다. 이미 fork/clone돼 있으면 재사용하고 이어서 진행한다(재실행 안전). 사용자가 "미션 시작하려는데 저장소 세팅해줘", "새 미션 시작할래", "fork부터 해줘", "/nextstep:start-mission" 등으로 요청할 때 사용한다.

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. 0 are common, 11 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 178 edited versions we read keep these.

  • 11

    Distinctive

    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:

    Create well-structured, reviewer-friendly pull requests following best practices.

    line 8
  2. Distinctive:

    Run these checks before anything else:

    line 18
  3. Distinctive:

    Run git status to check for uncommitted changes.

    line 25
  4. Distinctive:

    If precommit hooks modify files, re-stage with git add -u and retry (up to 3 times).

    line 37
  5. Distinctive:

    If there are commits, use the current branch as-is

    line 47
  6. Distinctive:

    If there are NO commits (branch is at same point as base), this means something went wrong — investigate and fix

    line 48
  7. Distinctive:

    If the push is rejected (e.g., diverged history after rebase), use git push --force-with-lease -u origin HEAD.

    line 65
  8. Distinctive:

    Do NOT include any "Generated with Claude Code" footer or bot attribution

    line 95
  9. Very specific:

    Do NOT include Co-Authored-By lines

    line 96
  10. Distinctive:

    Write body to a temp file and create the PR:

    line 100
  11. Very specific:

    If gh pr create fails, diagnose the error and retry with fixes

    line 129
  12. Distinctive:

    Commit History: If the commit history is messy, suggest rebasing to clean it up before creating the PR.

    line 135
  13. Distinctive:

    Feedback Requests: If the user mentions wanting specific feedback, add a "Feedback Requested" section to the body.

    line 137

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

PR Creator

Create well-structured, reviewer-friendly pull requests following best practices.

CRITICAL: This skill MUST always result in a PR being created. Do NOT stop early, do NOT ask the user to run another command first. Handle all prerequisites (committing, branching, pushing) inline and proceed to gh pr create.


Workflow

Step 1: Pre-flight Checks

Run these checks before anything else:

  1. Verify GitHub CLI authentication — run gh api user --jq '.login' to confirm the CLI is authenticated. If this fails, tell the user to run gh auth login first and stop.
  2. Determine the base branch — default to main. If the user specifies a different base, use that. Capture as $BASE_BRANCH.

Step 2: Commit Uncommitted Changes

Run git status to check for uncommitted changes. If there are uncommitted changes, commit them directly — do NOT delegate to another skill or tell the user to commit first.

  1. Stage changes — run git add <files> for relevant modified/untracked files. Do not stage .env or gitignored files.
  2. Lint and format — if Python files are staged, run:
    ruff check --fix <files> && ruff format <files>
    Re-stage any modified files.
  3. Commit — write a conventional commit message based on the staged diff:
    git commit -m "<type>: <description>"
    If precommit hooks modify files, re-stage with git add -u and retry (up to 3 times).

Step 3: Ensure Feature Branch

  1. Check current branch — run git branch --show-current.
  2. If on $BASE_BRANCH, create a feature branch:
    • Analyze the commits/changes to pick a descriptive name (e.g., feat/add-auth, fix/login-bug)
    • Run git checkout -b <branch-name>
  3. If on a different branch, check whether the branch has PR-worthy commits vs $BASE_BRANCH:
    • Run git log $BASE_BRANCH..HEAD --oneline
    • If there are commits, use the current branch as-is
    • If there are NO commits (branch is at same point as base), this means something went wrong — investigate and fix

Step 4: Sync with Base Branch

  1. Fetch latest — run git fetch origin $BASE_BRANCH
  2. Check for divergence — run git log HEAD..origin/$BASE_BRANCH --oneline
  3. Rebase if needed — if the base branch has new commits: a. Run git rebase origin/$BASE_BRANCH b. If conflicts arise, surface them to the user — show both sides and ask which to keep. Do not silently resolve. c. After resolving, git add <file> and git rebase --continue

Step 5: Push

Push the branch to remote:

git push -u origin HEAD

If the push is rejected (e.g., diverged history after rebase), use git push --force-with-lease -u origin HEAD.

Step 6: Analyze Changes and Draft PR

  1. Analyze — run these in parallel:
    • git log $BASE_BRANCH..HEAD --oneline — all commits
    • git diff $BASE_BRANCH...HEAD --stat — files changed summary
    • git diff $BASE_BRANCH...HEAD — full diff
  2. Check PR size — if >500 lines changed, warn the user but continue.
  3. Draft title — under 70 characters, conventional prefix (feat:, fix:, refactor:, docs:, chore:).
  4. Draft body using this template:
## Summary
<1-5 bullet points explaining what changed and WHY>

## Changes
<Categorized list of what was modified — group by area/concern>

## Diagrams
<OPTIONAL — include Mermaid diagrams when visual aids clarify workflow or architecture changes>

## Test Plan
<How the changes were verified — manual testing steps, automated tests run, curl commands, etc.>

Guidelines:

  • Explain why, not just what
  • For WIP PRs, use the --draft flag instead of [WIP] prefix
  • Include Mermaid diagrams when they clarify workflows or architecture
  • Do NOT include any "Generated with Claude Code" footer or bot attribution
  • Do NOT include Co-Authored-By lines

Step 7: Create the PR

Write body to a temp file and create the PR:

cat > /tmp/pr_body.md <<'EOF'
## Summary
...

## Changes
...

## Test Plan
...
EOF
gh pr create --title "the pr title" --base $BASE_BRANCH --body-file /tmp/pr_body.md

Optional flags:

  • WIP/draft: add --draft
  • Reviewers: add --reviewer <handle>
  • Assignees: add --assignee <handle>

Do NOT add:

  • --author flag (gh uses the authenticated user automatically)
  • Any Co-Authored-By trailer
  • Any "Generated with Claude Code" footer

Step 8: Report

  • Return the PR URL so the user can review it
  • If gh pr create fails, diagnose the error and retry with fixes

Best Practices

Commit History: If the commit history is messy, suggest rebasing to clean it up before creating the PR.

Feedback Requests: If the user mentions wanting specific feedback, add a "Feedback Requested" section to the body.

Screenshots: For frontend changes, remind the user to add screenshots or recordings to the PR after creation.

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.