Skip to content
Skills Library
Programming · Building & coding

submit-pr

/submit-pr

创建或复用当前 checkout 已提交变更的 GitHub PR,必要时推送任务分支。PR 审查使用 review-pr;仅本地提交使用 git-commit。

Repository
easydict ↗
Licence
GPL-3.0
Last repository change
27.10.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
6
Scripts
2
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.

Licence

GPL-3.0, otwarta.

What to check before installing
  • 2 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: scripts/submit_pr.py, tests/test_submit_pr.py

What it does and when to use it

创建或复用当前 checkout 已提交变更的 GitHub PR,必要时推送任务分支。PR 审查使用 review-pr;仅本地提交使用 git-commit。

Original author description

创建或复用当前 checkout 已提交变更的 GitHub PR,必要时推送任务分支。PR 审查使用 review-pr;仅本地提交使用 git-commit。

How it works

  1. 模式与授权
  2. 主流程
  3. 安全、完成与停止
Original SKILL.md headings · 63 lines, 266 words
SKILL.md preview
---
name: submit-pr
description: 创建或复用当前 checkout 已提交变更的 GitHub PR,必要时推送任务分支。PR 审查使用 review-pr;仅本地提交使用 git-commit。
---

# 提交 GitHub PR

根据当前 Git checkout 的已提交变更,规划、创建或复用 GitHub Pull Request。
`<submit-pr-skill-dir>` 指实际加载的本 Skill 目录。
PR 正文只使用 Skill 自带的 [固定模板](assets/pull_request_template.md);不发现、读取或合并目标
仓库的 GitHub PR 模板。

## 模式与授权

- `plan`:只读发现仓库拓扑,预览提交范围、标题、正文、base、head 和 push remote;
  不 fetch、创建分支、写仓库文件、push 或创建 PR。
- 默认:在明确的 PR 交付授权下,fetch 精确 base、推送任务分支、创建或复用正式 PR,
  并验证最终远程状态。
- `draft`:与默认模式相同,但创建 Draft PR。

用户未指定时使用默认模式。用户的只读、确认、暂缓和范围限制持续有效。

分支命名依赖完整的 `git-commit` 技能,须同级安装;命名只使用其
[统一规范与工具](../git-commit/references/branch-naming.md),不触发提交流程。
只有需要把既有 staged 内容创建为提交时才执行 `git-commit` 的提交流程。
依赖缺失时可报告已知事实,但在 Git 写入前停止,不复制或另拟规则。

## 主流程

1. 读取 [工作流契约](references/workflow.md),确定英文标题、正文语言、固定正文、Issue 策略、repository
   拓扑、base/head 分支与恢复规则。
2. 记录 HEAD、当前分支和 staged、unstaged、untracked 边界。若 checkout 处于 detached 状态:
   - 根据统一命名规范获取用户明确名称或生成任务候选。
   - 使用统一命名工具的 `validate` 校验字面名称,并在本轮 `preflight`、`plan` 与 `apply` 都
     显式传入 `--head-branch`;调用 Agent 不在 helper 之外创建或切换分支。
3. 在创建 staged 提交、fetch 或 apply 前运行 helper `preflight`,使用本轮相同的拓扑参数与
   `--head-branch`。它只读解析目标 base 和 GitHub default branch。当前分支名与任一分支相同时,
   停止并提示用户新建、切换到任务分支后重新运行;即使指定了不同的 `--head-branch` 也不得继续。
   调用 Agent 不自动创建或切换分支、不在保护分支上提交。已有提交会随新分支保留,无需重复创建
   相同提交。显式 head 名称与 base/default 同名时也停止,包括 head 来自 fork 的情况。
4. `plan` 模式运行 helper `plan` 并展示完整 PR 预览。该模式不 fetch、创建分支、写仓库文件、push
   或创建 PR。缺少提交或 cached base 时报告预览缺口,不为使 plan 成功而写入。
5. 默认或 `draft` 模式要求工作树可安全交付:
   - 存在 unstaged 或 untracked 内容时停止,不运行 `git add`。
   - 仅 staged 非空时,按宿主交付规则使用 `git-commit`;工作树干净时复用已有提交。
   - 精确 fetch base ref,检查完整 `<base-remote>/<base>..HEAD` 提交与文件范围。
     范围为空、来源不明或 HEAD 未包含 base 时停止,不自动修正历史。
6. 根据真实范围起草 Context、Changes 和 Verification;不读取目标仓库中的
   `pull_request_template` 文件或目录。运行 helper `plan` 并展示语言来源和完整预览。
   默认模式继续;用户要求确认或暂缓时先停止。
7. 使用相同内容运行 helper `apply`;`draft` 追加 `--draft`。helper 重新发现并校验本地/远程状态,
   精确 push,创建或复用 PR,然后读回验证身份、head SHA、title、body 和 Draft 状态。
8. 报告 PR URL、base/head repository 与 branch、head SHA、Draft、分支/push/PR 动作和截图提醒。
   本轮创建提交时同时保留 `git-commit` 的完整回执。

## 安全、完成与停止

- 只支持 GitHub remote;拓扑有歧义时要求显式参数,不创建 fork。
- 不 force push,不 rebase、merge、reset、stash、删除 remote/分支,不切换 checkout 或推送保护分支。
- detached checkout 只在 helper `apply` 内从冻结 HEAD 创建或复用命名分支 ref;`plan` 不创建 ref,
  `apply` 后 checkout 仍保持 detached。
- 不自动添加 reviewer、label、milestone 或 project,不 merge PR、评论或关闭 Issue。
- 只有 helper `apply` 返回成功且 `pr_verification.status == "passed"` 时才声称 PR 交付完成。
  默认不等待 CI;仅在用户或宿主规则要求时查询或等待 checks。
- 远程实体或已有 PR 与冻结计划不匹配、范围/身份漂移、授权被拒或写后验证失败时,
  保留已完成动作并停止;不覆盖维护者编辑、创建第二个 PR 或重复已成功的远程写入。
Files in this package (6)
  • SKILL.md 5 KB
  • agents/openai.yaml 1 KB
  • assets/pull_request_template.md 1 KB
  • references/workflow.md 13 KB
  • scripts/submit_pr.py 43 KB
  • tests/test_submit_pr.py 42 KB

Versions

RepositoryScoreLicence
This page · tisfeng/easydict90GPL-3.0
dxos/dxos100Apache-2.0

Database snapshot: 13.11.2026 · package version ecb4c1dbaf92 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100create-github-pr
    Create GitHub pull requests using the gh CLI. Use when the user wants to create a new PR, submit code for review, or open a pull request. Trigger keywords - create PR, pull request, new PR, submit for review, code review.
  • 90submit-pr-from-current-changes
    Create a branch, commit existing local changes, push them, and open a pull request. Use when submitting current work as a PR.
  • 100create-pull-request
    Create a GitHub pull request following project conventions. Use when the user asks to create a PR, submit changes for review, or open a pull request. Handles commit analysis, branch management, PR template usage, and PR creation using the gh CLI tool.
  • 100create-pr
    Open or update a GitHub pull request for the current branch — use when asked to create a PR, open a pull request, push and PR, or submit a PR.
  • 100create-pull-request
    Create a GitHub pull request following project conventions. Use when the user asks to create a PR, submit changes for review, or open a pull request. Handles commit analysis, branch management, and PR creation using the gh CLI tool.
  • 100submit-pull-request
    Use this skill ONLY when the user explicitly asks to create, submit, push, or open a GitHub Pull Request for code changes. It prepares an isolated clone, reuses or creates the authenticated user's Fork, previews the real Git diff, and after exact confirmation commits and pushes…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.