create-pr
SKILL.md
create-pr
Create a branch, commit staged changes with a signed commit, and push to open a pull request.
When to use
- When the user asks to create a pull request
- When the user wants to commit and push their changes as a PR
- When the user runs
/create-pr
Instructions
-
Identify the default branch:
- Run
git remote show originor checkgit symbolic-ref refs/remotes/origin/HEADto determine the default branch (e.g.,mainormaster).
- Run
-
Review the current changes:
- Run
git statusandgit diffto understand what has been modified. - If there are no changes, inform the user and stop.
- Run
-
Create a descriptive branch name:
- Based on the changes (file names, content of diffs), generate a short, descriptive branch name.
- Use kebab-case (e.g.,
fix-login-validation,add-user-api-endpoint,refactor-config-loader). - Prefix with a category when appropriate:
fix/,feat/,refactor/,docs/,chore/. - Keep it concise (3-5 words max after the prefix).
-
Create the branch from the default branch:
- Run
git switch -c <branch-name>from the default branch.
- Run
-
Stage and commit:
- Stage the relevant files with
git add. - Write a commit message in English that clearly describes the intent of the changes, not just what files were modified.
- Use the conventional commit format:
<type>: <description>(e.g.,feat: add user authentication endpoint). - The commit body should explain why the change was made if the reason is not obvious from the subject line.
- Always create a signed commit using
git commit -s -S(-sfor Signed-off-by,-Sfor GPG signature).
- Stage the relevant files with
-
Push the branch:
- Verify that the current branch is NOT the default branch. If it is, abort and inform the user.
- Run
git push -u origin <branch-name>.
-
Create the pull request:
- Use
gh pr createto open a pull request. - Set the title to match or closely reflect the commit message subject.
- Write a PR description that summarizes the changes and their intent.
- Target the default branch.
- Use
Important notes
- The
git pushcommand is NOT in the allowed-tools list intentionally. The user will be prompted by the tool permission system when push is executed. - NEVER push to the default branch directly. Always push to the feature branch.
- Always use signed commits (
git commit -s -S):-sadds Signed-off-by,-Sadds GPG signature. - Commit messages must be in English.
- Focus on the intent of changes in commit messages, not just listing modified files.
Weekly Installs
6
Repository
guni1192/agent-skillsFirst Seen
8 days ago
Security Audits
Installed on
opencode6
gemini-cli6
claude-code6
github-copilot6
codex6
amp6