SuperAPI AI 工具集

pr-title

编程与开发

查看项目

更新于 10-16 23:40

技能介绍

pr-title 是一个用于生成符合 Conventional Commits(约定式提交)规范的 PR 标题的技能,属于 metamask/skills。该技能的作者为特定仓库提供了变体,本文介绍的是面向 metamask-mobile 仓库的变体。

用途

为 Pull Request 生成规范化的标题,使其符合 Conventional Commits 格式,从而通过仓库的 CI 校验。

标题格式

<type>[optional scope]: <description>

规则要求:

  • 总长度最多 72 个字符。
  • 使用祈使语气("add",而非 "added" 或 "adds")。
  • 不包含工单/issue 编号(这些应放在 PR 描述中)。
  • 类型和作用域均使用小写。

类型

类型 使用场景
feat 新功能或增强
fix Bug 修复
refactor 不改变行为的代码重构
chore 维护(依赖、配置、脚本)
test 添加或更新测试
docs 文档变更
perf 性能改进
style 代码风格/格式化(无逻辑变更)
ci CI/CD 流水线变更
build 构建系统或外部依赖变更
revert 回退先前的提交

作用域

作用域是可选的,应主要根据被修改的主要功能区域或目录推断。仓库中任何有意义的区域都是有效的作用域。

常见作用域(非穷尽列举):analytics、transactions、wallet、ui、network、settings、permissions、tokens、nfts、swaps、bridge、staking、onboarding、confirmations、agents、e2e、deps、ramp、earn、perps、predict、notifications、accounts。

应避免:app、src、components 等无法传达含义的泛化作用域。

何时省略:如果变更跨越多个不相关的区域,则完全省略作用域。

使用方式

  1. 获取分支名:git rev-parse --abbrev-ref HEAD
  2. 获取完整 diff:git diff main...HEAD
  3. 根据变更的性质确定类型(type)
  4. 从被修改的主要文件夹/功能推断作用域(scope),若存在歧义则省略
  5. 用祈使语气撰写简洁的描述(description)

示例

feat(predict): add market details view
fix(transactions): resolve memory leak in controller
refactor(analytics): migrate rewards tracking to useAnalytics hook
chore(deps): update @metamask/controller-utils to v5.0.0
test(onboarding): add e2e spec for SRP import flow
docs(staking): update pooled staking integration guide
perf(wallet): lazy-load token list on scroll
style(ui): apply design system tokens to network selector
ci: add conventional commit validation to PR checks
revert: undo NFT gallery feature flag removal

CI 校验

PR 标题由 amannn/action-semantic-pull-request GitHub Action(.github/workflows/pr-title-linter.yml)进行校验。不符合 Conventional Commits 格式的标题将导致 CI 失败。

许可证

本项目基于 MIT 许可证发布,版权所有 (c) 2026 MetaMask。

MIT License

Copyright (c) 2026 MetaMask

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

作者原文与适用仓库

作者:MetaMask。许可:MIT。原文包含针对不同仓库的专用版本,请按项目选择适用章节。

固定版本:03e6fbb8b3bf507a2ec8aefc827a71ee8507a6ea。

作者说明 · 技能元数据

作者许可

MIT License

Copyright (c) 2026 MetaMask

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.