mcpField
U
unopim-git

unopim-git

github.com/unopim开发140 次安装2 周前更新
代码仓库

关于 unopim-git

说明 UnoPim 分支、提交、拉取请求和 CI 流程的仓库专用技能,提供明确的命名与格式规则,并指向仓库权威指南。

主要功能

  1. 01分支命名与目标规则
  2. 02Conventional Commits 标题格式
  3. 03拉取请求必需章节
  4. 04推送前检查的六项 CI 门禁
  5. 05安全与贡献流程指引

适用场景

  1. 01准备变更分支
  2. 02编写提交或拉取请求
  3. 03推送前检查 CI 要求
  4. 04遵循仓库贡献流程

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/unopim/agent-skills --skill unopim-git

安装后在 Claude Code 中输入/unopim-git确认已加载。

详细介绍

UnoPim Git 工作流

UnoPim 仓库的分支、提交和拉取请求。权威来源是 UnoPim 检出目录($UNOPIM)中的 .github/CONTRIBUTING.md 和 .github/PULL_REQUEST_TEMPLATE.md — 如果本指南与这些文件不一致,以仓库文件为准。

分支

  • 目标分支为 master,除非维护者要求回移植到版本分支(例如 2.1)。
  • 每个分支只处理一个修复,并使用问题 ID 命名:issue-1234。
  • 使用小写字母和连字符。没有问题 ID 时,按意图添加前缀: feature/short-description、refactor/short-description、test/short-description。

提交消息 — Conventional Commits(强制)

.github/CONTRIBUTING.md 要求采用 Conventional Commits 格式,并在主题末尾的括号中引用问题:

type(scope): imperative description (#1234)
  • type:feat、fix、refactor、perf、test、ci、chore、docs。
  • scope:所涉及的软件包或领域 — admin、product、attribute、datagrid、core。
  • 主题:使用祈使语气、小写字母、不加句号,且不超过 72 个字符。
  • 可选正文需在空行后说明原因,而非说明内容。

良好示例(取自真实提交历史):

fix(admin): prevent duplicate SKU on product creation (#1234)
feat(product): configurable association types with per-link fields (#570)
fix(attribute): copy a cloned family's attribute mappings in the database

不良示例 — 切勿使用以下形式编写提交消息:

Fixed #1234 - Prevent duplicate SKU     <- legacy format; not the repo convention
Update ProductController.php            <- no type(scope), describes the file not the change
fix: stuff                              <- no scope, vague

拉取请求

PR 标题与提交消息使用相同的 conventional type(scope): description 格式。 关闭关键词(Fixes #123)应放在正文的 Issue Reference 部分,绝不可放在标题中。

PR 正文必须按顺序包含 .github/PULL_REQUEST_TEMPLATE.md 中的全部六个部分:Issue Reference、Description、How To Test This?、Screenshots、Checklist、Documentation。不要省略任何部分,也不要重命名 "How To Test This?"。

gh pr create --title "fix(admin): prevent duplicate SKU on product creation (#1234)" --body "$(cat <<'EOF'
## Issue Reference
Fixes #1234

## Description
Adds a unique-SKU guard to the product store flow so a double submit no longer
creates two products with the same SKU.

## How To Test This?
1. Open Catalog > Products and create a product with SKU `test-sku`.
2. Submit the create form twice in quick succession.
3. Only one product exists; the second submit returns a validation error.

## Screenshots
N/A — no UI change.

## Checklist
- [x] `vendor/bin/pest` passes locally
- [x] `vendor/bin/pint --test` reports no style issues
- [x] Tailwind classes are reordered
- [x] New user-facing strings use translation keys (all 33 locales)
- [x] Target branch is `master` (unless a maintainer requested a backport)

## Documentation
- [ ] My pull request requires an update on the documentation repository.
EOF
)"
  • UI 变更:将 Screenshots 占位内容替换为前后对比图片或简短录屏。其他情况下,模板允许移除该部分的内容,但保留标题并填写 N/A。
  • 如果文档受到影响,勾选 Documentation 选项并说明需要进行哪些更改。
  • 只有实际运行过对应命令后,才能勾选 Checklist 选项。

CI 门禁 — 每次推送和 PR 都需通过六项门禁

GitHub Actions 会运行六项门禁;推送前,请将每一项都视为阻断条件:

  1. vendor/bin/pint --test — 代码风格(linting_tests.yml)
  2. 在 MySQL 和 PostgreSQL 上运行 Pest 套件 — composer test(pest_tests.yml、pest_tests_pgsql.yml)
  3. Playwright E2E — cd tests/e2e-pw && npx playwright test(playwright_test.yml)
  4. Larastan — composer phpstan(static_analysis.yml)。切勿添加 ignoreErrors 来通过检查。
  5. Rector — composer rector-dry(static_analysis.yml;CI 中的 dry-run 任务仅供参考 — 仍须修复其发现的问题,切勿扩展 withSkip)。
  6. php artisan unopim:translations:check — 确保全部 33 种语言环境的翻译完整(translation_tests.yml)

必需的子技能: 推送任何分支或发起 PR 前,必须使用 unopim-verify — 它会在本地按顺序运行相同的门禁,并使用适配工作区的命令。门禁未通过时切勿推送;未通过 verify 检查时,切勿声称 PR 已准备就绪。

贡献流程

  • 安全漏洞:切勿在 GitHub 上公开提交问题 — 请遵循 SECURITY.md。
  • Bug 修复:先搜索现有问题;然后 fork 仓库,按问题创建分支,并向 master 发起 PR。
  • 功能:实现前先提交功能请求问题。

评论

支持 Markdown