PR 描述撰写与提交
pr
用于撰写 PR 描述、评估或拆分工作量,或在 GitHub 或 Forgejo/Gitea 上创建拉取请求;不适用于提交信息;提供以审查者优先的模板,以及 gh 或 tea pr 的操作步骤。
- License 许可
- MIT
- 所属仓库
- mintuz/skills
- 最近更新
- 2026-11-13
- Stars
- ★ 35
- Forks
- 7
01 前言 Front Matter
- name
- pr
- description
- WHEN drafting PR descriptions, sizing/splitting work, or opening pull requests on GitHub or Forgejo/Gitea; NOT for commit messages; provides reviewer-first templates and gh or tea pr steps.
02 资源文件 3
- 参考文档pr-creation.md5.9 KB
- 参考文档pr-description.md4.7 KB
- 参考文档pr-sizing.md2.9 KB
03 SKILL.md 正文
Pull Request Skills
Philosophy
- Reviewer-first: optimise for the reviewer, not the author.
- Context over detail: explain why; link to how.
- Scannable: busy reviewers skim.
- Actionable: clear testing steps, obvious risks.
- Honest: flag complexity; never hide it.
Scope
Covers PR descriptions, PR sizing, and PR creation on GitHub (gh) and on Forgejo or Gitea (tea).
Commit messages are out of scope. When a request also asks for a commit message, draft the PR content and direct the author to the commit-messages skill for the commit message.
Gathering Context
Run git fetch origin first. Compare against the remote-tracking branch origin/main: local main can be behind the remote. On a fork, fetch the remote that owns the base branch (often upstream) and compare against that remote's branch instead. When the repository's default branch is not main, substitute it; git remote show origin prints it as HEAD branch on any host.
# Compare branch changes against main
git diff origin/main...HEAD
# List modified files
git diff origin/main...HEAD --name-only
# Review commit history
git log origin/main..HEAD --oneline
# Get detailed commit messages
git log origin/main..HEAD --format="%B---"
# Get files changed with stats
git diff origin/main...HEAD --stat
Size sanity check
Before choosing a template or drafting a description, run git diff origin/main...HEAD --stat and compare the file and line totals with the author's account of the change.
Stop when the totals contradict that account, or when the diff includes bulk generated or vendored content the author did not mention (e.g. dist/, vendor/, node_modules/, lockfiles). Report the totals and the mismatch, and ask the author to confirm those files belong in the PR or to remove them. Do not draft the description until the author answers: a description that presents unmentioned bulk content as intentional hides the mismatch from reviewers. A diff that touches several source directories for one coherent change is not a mismatch; report the scope and continue.
If you cannot run the command, size the PR and draft from the facts you have, and say the size is unverified. Do not refuse to draft because the stat is missing.
Guides
| Guide | Use for |
|---|---|
| pr-sizing.md | Size categories (small/medium/large); signs a PR should be split; splitting strategies; when large PRs are acceptable |
| pr-description.md | Commit analysis and issue linking; templates for small, medium, and large PRs; section guidelines (summary, changes, testing, etc.) |
| pr-creation.md | gh pr create (GitHub) and tea pr create (Forgejo/Gitea) syntax and options; HEREDOC for multi-line bodies; draft PRs, reviewers, labels, and milestones; troubleshooting |
Draft rule: pass --draft whenever the title or body calls the PR a draft, WIP, or not ready.
04 同仓库更多 Skills
lens-review
USE WHEN reviewing uncommitted work, a branch diff or a pull request through several installed skills, each run as its own review lens; NOT WHEN you need one cold second opinion (double-check), a verdict against a specification (acceptance-review) or the built-in fixed-lens /code-review. Runs each lens in an isolated read-only agent, has a separate agent try to refute every finding, and returns one severity-ranked report.
XState 状态机建模
xstate
当 React 状态因外部响应而变化——异步提交、进行中或加载标志、重试、取消、轮询、乐观更新、过期响应——或因与可中断的过程(如拖拽或手势)交互而变化时使用;或在构建、审查、测试或可视化 XState 5 actors 和 @xstate/react 集成时使用;不适用于单个事件即可完全设定的值,如文本草稿、焦点标志或简单的开关切换;建模类型化生命周期并渲染合法的 Mermaid stateDiagram-v2 图表。
网页界面设计优化
web-design
在优化 UI 布局、排版、色彩或细节打磨时使用;不涉及代码实现;提供简洁的原则,以实现有意图、易读的设计。
Tailwind CSS 样式开发
tailwind
在编写、修复或审查使用 Tailwind CSS 的项目中的样式时使用,即便只是改一个类名,或请求中未提及 Tailwind:颜色、焦点环、间距、由 prop、map 或 CVA 变体选择的类名、Tailwind 样式表或 tailwind.config 中的主题令牌与深色模式、配置或升级(如不确定项目是否使用 Tailwind,先检查 package.json 或主样式表);不适用于在没有 Tailwind 的项目中编写纯 CSS 或 Sass;产出的类名能被 Tailwind 识别,语法适配已安装的主版本,具有可见的焦点指示器,且不引入未要求的依赖或杜撰的品牌值。
代码重构规划
refactoring
当你需要制定计划来重构、重组或清理正常工作的代码,且测试结果已知(全绿或已记录的失败集合)时使用;不适用于新功能交付或任何行为变更;以可逆的基线安全性和按优先级排序的改进为核心。
react
USE WHEN changing the logic, data, props, state, Effects or rendered text of a React component, hook or page, even a one-line change; NOT WHEN the request is styling only (class names, Tailwind, CSS, dark mode, spacing, shadows) or tests only, or when it models submit, in-flight, loading, retry or failure states, even for a named React form (xstate covers that, including its React wiring); applies React 19 composition, state, Effect, structure, API and performance rules with only the project's installed libraries.