github-pr-creation by fvadicamo/dev-agent-skills
npx skills add https://github.com/fvadicamo/dev-agent-skills --skill github-pr-creation包含 Shell 命令
此技能包含可能执行系统命令的 shell 命令指令(!命令``)。安装前请仔细审查。
创建具有任务验证、测试执行和 Conventional Commits 格式化的 Pull Request。
!git rev-parse --abbrev-ref HEAD 2>/dev/null !git log @{u}..HEAD --oneline 2>/dev/null || echo "(no upstream tracking)"
在继续之前务必询问用户:
正在从 [当前分支] 创建 PR 到 [目标分支]。是否正确?
| 分支流向 | 典型目标 |
|---|---|
| feature/* | develop |
| fix/* | develop |
| hotfix/* |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| main/master |
| develop | main/master |
查找描述此 PR 应完成内容的任务/规格文件。按工具的常见位置:
| 工具/约定 | 路径 |
|---|---|
| Spec2Ship (s2s) | .s2s/plans/*.md(查找与分支名称或提交匹配的活动计划) |
| AWS Kiro | .kiro/specs/*/tasks.md |
| Cursor | .cursor/rules/*.md, .cursorrules |
| Trae | .trae/rules/*.md |
| GitHub Issues | gh issue list --assignee @me --state open |
| 通用 | docs/specs/, specs/, tasks.md, TODO.md |
找到时提取任务 ID、标题、描述和需求引用。
对于此分支上的每个提交,识别类型、范围、任务引用和破坏性更改。当存在任务文件时,将提交映射到已记录的任务。
如果存在任务文档:
feature/task-2-* -> 任务 2)如果任务未完成,停止并显示状态:
任务 2 未完成:缺失 1/3 个子任务
- 任务 2.1: 已完成
- 任务 2.2: 已完成
- 任务 2.3: 缺失
询问用户是完成缺失的任务还是继续。
运行项目测试套件。在创建 PR 之前测试必须通过。
| 分支流向 | 标题前缀 |
|---|---|
| feature/* -> develop | feat(scope): |
| fix/* -> develop | fix(scope): |
| hotfix/* -> main | hotfix(scope): |
| develop -> main | release: |
| refactor/* -> develop | refactor(scope): |
| chore/* -> develop | chore(scope): |
| ci/* -> develop | ci(scope): |
| docs/* -> develop | docs(scope): |
标题格式:<type>(<scope>): <description>
破坏性更改:如果任何提交包含 BREAKING CHANGE: 或类型后的 !:
breaking 标签## 破坏性更改 部分根据 PR 类型使用 references/pr_templates.md 中的相应模板,并用收集的数据填充。
务必首先检查可用标签:
gh label list
将提交类型与可用的项目标签匹配。项目可能使用与标准不同的名称(例如,使用 "feature" 而不是 "enhancement")。
| 提交类型 | 常见标签名称 |
|---|---|
| feat | feature, enhancement |
| fix | bug, bugfix |
| refactor | refactoring, tech-debt |
| docs | documentation |
| ci | ci/cd, infrastructure |
| security | security |
| hotfix | urgent, priority:high |
如果不存在匹配的标签:建议创建一个。用户可能已移除默认标签,因此建议添加相关标签是合适的。
检查开放的里程碑:
gh api repos/$(gh repo view --json nameWithOwner -q '.nameWithOwner')/milestones \
--jq '.[] | select(.state == "open") | "\(.number): \(.title)"'
务必首先显示标题、正文、标签和里程碑以供用户批准。
gh pr create \
--title "[标题]" \
--body "$(cat <<'EOF'
[正文内容]
EOF
)" \
--base [基础分支] \
--label "[标签1]" --label "[标签2]" \
--milestone "[里程碑标题]" \
--reviewer "[用户名]" # 如果知道团队成员
如果 PR 尚未准备好进行合并审查(进行中、等待 CI 或仅创建以触发分支上的 AI 机器人审查),请使用 --draft。
gh label list 检查可用标签--label(不要在一个字符串中用逗号分隔)--draft--reviewerreferences/pr_templates.md - 所有类型(feature, release, bugfix, hotfix, refactoring, docs, CI/CD)的 PR 正文模板每周安装次数
111
仓库
GitHub 星标数
54
首次出现
2026年1月21日
安全审计
已安装于
claude-code90
opencode90
codex86
gemini-cli86
cursor81
github-copilot79
Contains Shell Commands
This skill contains shell command directives (!command``) that may execute system commands. Review carefully before installing.
Creates Pull Requests with task validation, test execution, and Conventional Commits formatting.
!git rev-parse --abbrev-ref HEAD 2>/dev/null !git log @{u}..HEAD --oneline 2>/dev/null || echo "(no upstream tracking)"
ALWAYS ask user before proceeding:
Creating PR from [current-branch] to [target-branch]. Correct?
| Branch flow | Typical target |
|---|---|
| feature/* | develop |
| fix/* | develop |
| hotfix/* | main/master |
| develop | main/master |
Look for task/spec files that describe what this PR should accomplish. Common locations by tool:
| Tool/Convention | Path |
|---|---|
| Spec2Ship (s2s) | .s2s/plans/*.md (look for active plan matching branch name or commits) |
| AWS Kiro | .kiro/specs/*/tasks.md |
| Cursor | .cursor/rules/*.md, .cursorrules |
| Trae | .trae/rules/*.md |
| GitHub Issues | gh issue list --assignee @me --state open |
| Generic |
Extract task IDs, titles, descriptions, and requirements references when found.
For each commit on this branch, identify type, scope, task references, and breaking changes. Map commits to documented tasks when task files exist.
If task documentation exists:
feature/task-2-* -> Task 2)If tasks incomplete , STOP and show status:
Task 2 INCOMPLETE: 1/3 sub-tasks missing
- Task 2.1: done
- Task 2.2: done
- Task 2.3: MISSING
Ask user whether to complete missing tasks or proceed anyway.
Run the project test suite. Tests MUST pass before creating PR.
| Branch flow | Title prefix |
|---|---|
| feature/* -> develop | feat(scope): |
| fix/* -> develop | fix(scope): |
| hotfix/* -> main | hotfix(scope): |
| develop -> main | release: |
| refactor/* -> develop | refactor(scope): |
| chore/* -> develop | chore(scope): |
Title format : <type>(<scope>): <description>
Breaking changes : if any commit contains BREAKING CHANGE: or ! after type:
breaking label if it exists in the project## Breaking changes section in the PR bodyUse the appropriate template from references/pr_templates.md based on PR type and populate with gathered data.
ALWAYS check available labels first:
gh label list
Match commit types to available project labels. The project may use different names than standard (e.g., "feature" instead of "enhancement").
| Commit type | Common label names |
|---|---|
| feat | feature, enhancement |
| fix | bug, bugfix |
| refactor | refactoring, tech-debt |
| docs | documentation |
| ci | ci/cd, infrastructure |
| security | security |
| hotfix | urgent, priority:high |
If no matching label exists : suggest creating one. The user may have removed default labels, so offering to add relevant ones is appropriate.
Check for open milestones:
gh api repos/$(gh repo view --json nameWithOwner -q '.nameWithOwner')/milestones \
--jq '.[] | select(.state == "open") | "\(.number): \(.title)"'
ALWAYS show title, body, labels, and milestone for user approval first.
gh pr create \
--title "[title]" \
--body "$(cat <<'EOF'
[body content]
EOF
)" \
--base [base_branch] \
--label "[label1]" --label "[label2]" \
--milestone "[milestone-title]" \
--reviewer "[username]" # if teammates are known
Use --draft if the PR is not ready for merge review yet (work in progress, awaiting CI, or created only to trigger AI bot review on the branch).
gh label list before suggesting--label for each label separately (not comma-separated in one string)--draft for PRs not ready for merge review--reviewer when teammates are known from team config or CODEOWNERSreferences/pr_templates.md - PR body templates for all types (feature, release, bugfix, hotfix, refactoring, docs, CI/CD)Weekly Installs
111
Repository
GitHub Stars
54
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
claude-code90
opencode90
codex86
gemini-cli86
cursor81
github-copilot79
Azure Data Explorer (Kusto) 查询技能:KQL数据分析、日志遥测与时间序列处理
138,800 周安装
工作流编排器:Temporal、Camunda、Saga模式实现,构建可靠长时运行流程
111 周安装
FiveM vRP框架开发指南:Lua脚本、API函数与服务器架构详解
72 周安装
Docker Compose 生产环境部署模板 - 安全可靠可扩展的最佳实践配置
114 周安装
Google Ads策略构建器:从架构到优化的完整指南 | 提升广告支出回报率
112 周安装
Generic React UX Designer - React用户体验设计技能,提升前端开发效率与界面设计质量
112 周安装
英语日语中文文档写作规范指南:学术商务技术创意写作风格与格式
117 周安装
docs/specs/, specs/, tasks.md, TODO.md |
| ci/* -> develop | ci(scope): |
| docs/* -> develop | docs(scope): |