pr

hrntknr 的头像作者 hrntknr

通过git和GitHub CLI创建拉取请求,同时遵循仓库模板和常规提交。当用户请求创建PR、推送分支或打开GitHub PR,并且需要发送PR前的明确确认时使用。

📖 中文导读:通过git和GitHub CLI创建拉取请求,同时遵循仓库模板和常规提交。当用户请求创建PR、推送分支或打开GitHub PR,并且需要发送PR前的明确确认时使用。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。

name: pr description: Create pull requests via git and GitHub CLI while following repo templates and Conventional Commits. Use when a user asks to make a PR, push a branch, or open a GitHub PR, and when explicit confirmation is required before sending the PR.

Pr

Overview

Create a PR end-to-end: stage and commit changes, push the branch, fill the PR template, ask for confirmation, then open the PR with gh.

Workflow

  1. Inspect git state: run git status -sb, identify uncommitted or untracked changes, and confirm which files to include. Avoid modifying unrelated files.
  2. Stage changes: git add <paths> for the approved files only, then re-check status.
  3. Commit: generate a Conventional Commit message when requested and run git commit -m "<message>".
  4. Push branch: git push origin <branch> or git push -u origin <branch> if needed. If push fails due to auth/remote issues, ask for next steps.
  5. Build PR body: read .github/pull_request_template.md if present and fill required sections (Summary, Type of Change, Related Issues). Keep checkboxes accurate.
  6. Ask for confirmation before creating the PR. Do not run gh pr create until the user says OK.
  7. Create PR: gh pr create --base <base> --head <branch> --title "<title>" --body "<body>", then return the PR URL.

Notes

  • Follow repo conventions for templates, required sections, and Conventional Commits.
  • If running in a sandboxed environment, request approval for network operations like git push or gh pr create.