agentleFS
haruharu/redmine_ai_helper/.claude/skills/create-pull-request/SKILL.md

create-pull-request

Skill107 starsChanged 9 months agoMITView on GitHub

Create a pull request from the current branch. Use when you want to open a PR, submit changes, or create a pull request. Handles release branches (release/**) and feature/fix branches differently, setting the correct base branch, title, description, and labels automatically.

  • Commits and pushes

27 other projects use a version of this, 1 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use grilling and frontend-design.

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.
  • GoogleSkill

    grilling

    Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.

    Also in 3 projects that use this

  • BlockSkill

    frontend-design

    Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

    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

29 rules. 0 are common, 19 are distinctive, and 10 are very specific to this project.

  • 0

    Common

    Most of the 26 edited versions we read keep these.

  • 19

    Distinctive

    This author's own choices. Worth a look.

  • 10

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create a pull request from the current branch with appropriate title, description, base branch, and labels.

    line 11
  2. Distinctive:

    Consider any additional context from the user input before proceeding.

    line 19
  3. Distinctive:

    Run git branch --show-current to get the current branch name.

    line 25
  4. Very specific:

    Check if the branch name starts with release/:

    line 29
  5. Distinctive:

    All other branches: follow the Feature/Fix Branch workflow below

    line 31
  6. Distinctive:

    Use the same text as the title.

    line 46
  7. Very specific:

    Use the GitHub MCP tool (mcp_github_mcp_se_create_pull_request) as the primary method.

    line 55
  8. Very specific:

    If unavailable, fall back to gh pr create:

    line 56
  9. Very specific:

    Start with an imperative verb (Add, Fix, Improve, Support, Allow, Remove).

    line 74
  10. Distinctive:

    Read the user stories / summary in spec.md and identify what the user gains or what is fixed

    line 86
  11. Distinctive:

    Write the title following the rules above

    line 87
  12. Distinctive:

    Run git log develop..HEAD --oneline to list commits on this branch

    line 90
  13. Distinctive:

    Run git diff develop...HEAD --stat to see changed files

    line 91
  14. Distinctive:

    Before creating the PR, re-read the title as an end user scanning the release notes: if it needs the code to be understood, rewrite it.

    line 94
  15. Very specific:

    Commit messages: run git log develop..HEAD --format=%B and look for #123, Fixes #123, Closes #123, or GitHub issue URLs.

    line 101
  16. Very specific:

    Branch name: only a pattern explicitly naming an issue, such as issue-123, issue/123, or fix/#123.

    line 103
  17. Distinctive:

    If no related issue is identified, skip the issue line in the description.

    line 109
  18. Distinctive:

    Run git diff develop...HEAD --stat and git log develop..HEAD --oneline to understand the changes.

    line 113
  19. Distinctive:

    Write a short English description using a bullet list:

    line 115
  20. Distinctive:

    Keep each bullet to one line.

    line 124
  21. Distinctive:

    If a related issue was identified, put it at the top of the description using a GitHub closing keyword so the PR is linked to the issue:

    line 126
  22. Very specific:

    Use Fixes #N for bug fixes and Closes #N for features/enhancements.

    line 135
  23. Very specific:

    If the PR only partially addresses the issue, use Related to #N instead so the issue is not auto-closed.

    line 137
  24. Very specific:

    Use the GitHub MCP tool (mcp_github_mcp_se_create_pull_request) as the primary method to create the PR.

    line 153
  25. Very specific:

    If the MCP tool is unavailable, fall back to gh pr create:

    line 154
  26. Distinctive:

    If git log or git diff returns empty (branch has no commits ahead of base), inform the user there is nothing to PR.

    line 168
  27. Distinctive:

    If the spec.md file cannot be found for a Spec Kit branch, fall back to deriving the title from git commits (still following the …

    line 169
  28. Distinctive:

    If label creation fails (label does not exist), omit that label and proceed.

    line 170
  29. Distinctive:

    If the PR already exists for this branch, report the existing PR URL instead of creating a duplicate.

    line 171

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

Create Pull Request

Create a pull request from the current branch with appropriate title, description, base branch, and labels.

User Input

$ARGUMENTS

Consider any additional context from the user input before proceeding.

Procedure

Step 1: Identify Current Branch

Run git branch --show-current to get the current branch name.

Step 2: Determine Branch Type

Check if the branch name starts with release/:

  • Release branch (release/**): follow the Release Branch workflow below
  • All other branches: follow the Feature/Fix Branch workflow below

Release Branch Workflow (release/**)

Base Branch

main

Title

Extract the version from the branch name.

  • Branch release/1.2.3 → title: Release 1.2.3
  • Format: Release <version>

Description

Use the same text as the title. No additional details needed.

Release <version>

Labels

None — do not add any labels.

Create PR

Use the GitHub MCP tool (mcp_github_mcp_se_create_pull_request) as the primary method. If unavailable, fall back to gh pr create:

gh pr create --base main --title "Release <version>" --body "Release <version>"

Feature/Fix Branch Workflow (non-release branches)

Base Branch

develop

Title

The PR title is copied verbatim into the release notes. Readers are plugin users and administrators, not developers. Write the title for them: it must make sense without seeing the code, the branch, or the PR description.

Title rules:

  • Describe the user-visible effect (what the user can now do, or what problem no longer occurs), not the implementation. Use the vocabulary of the UI and features (e.g. "health report", "model profile", "custom commands"), not class, method, file, or gem names.
  • Start with an imperative verb (Add, Fix, Improve, Support, Allow, Remove). For bug fixes, state the symptom that is fixed, e.g. Fix health report tables rendering without borders.
  • Be specific enough to stand alone in a list of ~20 entries; avoid vague titles such as Fix bug, Update settings, Refactor agents.
  • One line, ideally under 70 characters. No issue numbers, no branch or spec numbers (e.g. 076-), no author names, no emojis, no trailing period.
  • Changes with no user-visible effect (refactoring, tests, CI, internal docs) get a plain, honest title such as Refactor ... / Improve test coverage for ...; do not inflate them into features.

Good: Add model profile copy to the admin settings screen Bad: Implement ModelProfilesController#copy and add 010 spec

How to derive the title:

If the branch is a Spec Kit branch (branch name matches pattern used by speckit, e.g., feature/NNN-* or follows the speckit branch convention):

  1. Locate the corresponding spec.md file under specs/<branch-folder>/ (fall back to .specify/<branch-folder>/)
  2. Read the user stories / summary in spec.md and identify what the user gains or what is fixed
  3. Write the title following the rules above

If the branch is NOT a Spec Kit branch:

  1. Run git log develop..HEAD --oneline to list commits on this branch
  2. Run git diff develop...HEAD --stat to see changed files
  3. Work out the user-visible effect of the changes, then write the title following the rules above

Before creating the PR, re-read the title as an end user scanning the release notes: if it needs the code to be understood, rewrite it.

Related GitHub Issue

Determine whether this PR fixes or implements an existing GitHub issue. Look for issue references in these sources, in order:

  1. User input ($ARGUMENTS): e.g., #123, issue 123, or a GitHub issue URL.
  2. Commit messages: run git log develop..HEAD --format=%B and look for #123, Fixes #123, Closes #123, or GitHub issue URLs.
  3. Spec Kit artifacts (Spec Kit branches only): look for GitHub issue URLs or #123 references in the feature's spec.md (e.g., in the input/description section).
  4. Branch name: only a pattern explicitly naming an issue, such as issue-123, issue/123, or fix/#123. Do not treat the Spec Kit sequential prefix (e.g., 062- in 062-optional-temperature) as an issue number — it is a feature counter, not an issue ID.

For each candidate number, verify it is an existing issue (not a pull request) in this repository using the GitHub MCP tool (issue_read) or gh issue view <number> --json number,title,state. Discard candidates that do not exist or are pull requests.

If no reference is found but the changes clearly address a known problem, you may search open issues (GitHub MCP search_issues or gh issue list --search "<keywords>" --state open). Only link a search result if it clearly matches the changes; if uncertain, ask the user to confirm rather than guessing, since a wrong link can auto-close an unrelated issue.

If no related issue is identified, skip the issue line in the description.

Description

Run git diff develop...HEAD --stat and git log develop..HEAD --oneline to understand the changes.

Write a short English description using a bullet list:

## Changes

- <concise description of change 1>
- <concise description of change 2>
- ...

Keep each bullet to one line. Focus on what changed and why, not implementation details.

If a related issue was identified, put it at the top of the description using a GitHub closing keyword so the PR is linked to the issue:

Fixes #<issue-number>

## Changes

- ...
  • Use Fixes #N for bug fixes and Closes #N for features/enhancements.
  • For multiple issues, put each on its own line (e.g., Fixes #12 and Fixes #34).
  • If the PR only partially addresses the issue, use Related to #N instead so the issue is not auto-closed.

Labels

Analyze the changes and select one or more labels from:

LabelWhen to use
enhancementNew feature or improvement
bugBug fix
documentationDocs-only change (README, YARD, locales)

Select all that apply. If a label does not exist in the repository, skip it rather than failing.

Create PR

Use the GitHub MCP tool (mcp_github_mcp_se_create_pull_request) as the primary method to create the PR. If the MCP tool is unavailable, fall back to gh pr create:

gh pr create \
  --base develop \
  --title "<title>" \
  --body "<description>" \
  --label "<label1>" \
  --label "<label2>"

Error Handling

  • If git log or git diff returns empty (branch has no commits ahead of base), inform the user there is nothing to PR.
  • If the spec.md file cannot be found for a Spec Kit branch, fall back to deriving the title from git commits (still following the release-notes title rules).
  • If label creation fails (label does not exist), omit that label and proceed.
  • If the PR already exists for this branch, report the existing PR URL instead of creating a duplicate.

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.