用途:为 JetBrains/intellij-community 仓库中的 Jewel 模块准备符合贡献规范的拉取请求,逐步完成环境校验、提交整理、本地 CI 检查、API 兼容性检查、截图与发布说明整理,最后创建 PR。
主要能力与流程:
- 环境校验:确认工作目录位于 intellij-community 检出内、platform/jewel 存在、当前分支不是 master,并确认 gh(GitHub CLI)可用(缺失时可 brew install gh 或访问 https://cli.github.com/)。
- 单提交要求:Jewel PR 必须在 master 之上恰好一个提交,用 git rev-list --count master..HEAD 检查;多于一个时用 git reset --soft master 与 git commit --amend --no-edit 压缩。
- 提交信息格式:主题须匹配 ^[(JEWEL-[0-9]+)(,\sJEWEL-[0-9]+)][ ],即 [JEWEL-xxx] 摘要,可含多个 issue;建议主题不超过 72 字符、正文换行。禁止添加 Co-Authored-By 或任何 AI 署名。
- 本地 CI 检查(在 platform/jewel 下):./gradlew check --continue --no-daemon;./gradlew detekt detektMain detektTest --continue --no-daemon;./scripts/check-api-dumps.main.kts;./scripts/metalava-signatures.main.kts validate;Bazel 构建与测试在仓库根目录用 ./tests.cmd --module <jps-module> --test <test-class-fqn-or-pattern> 及 ./bazel.cmd build <target>(如 //platform/jewel/ui:ui)。模块结构变化时运行 ./build/jpsModelToBazelCommunityOnly.cmd 并检查需提交的 Bazel 文件。
- API 兼容性:检查 IntelliJ Platform API dump 与 Jewel 的 Metalava dump;stable API 需保持二进制与源码兼容,experimental API 需保持二进制兼容。
- 视觉变更:若涉及 Composable、UI 组件、样式、颜色或布局,PR 描述需至少提供 after 截图或录屏,理想情况含 before;截图需用户手动上传。
- 发布说明:按 platform/jewel/docs 模板起草,面向使用 Jewel 的开发者,省略内部实现细节。
- PR 标题与描述:标题为 [JEWEL-xxx] 简短祈使句摘要,与提交主题一致;描述含摘要、## Changes、截图/录屏、## Release notes;不要硬换行,不要 AI 署名。
- 创建 PR:用户批准后用 gh pr create --repo JetBrains/intellij-community --base master ...,建议将正文写入临时 Markdown 文件。有权限时可加 jewel 标签、指派与审阅者(外部:DanielSouzaBertoldi、rock3r;内部:DejanMilicic、nebojsa-vuksic、AlexVanGogen、daaria-s),可用 python3 .claude/skills/jewel-pr-preparer/scripts/suggest_reviewers.py 建议审阅者。之后用 managing-youtrack 技能将 JEWEL issue 置为 In Review。
- 后续更新:修改后 git add、git commit --amend --no-edit,再 git push --force-with-lease <remote> <branch>,始终保持单提交。
限制:需在 intellij-community 检出内运行;gh 仅创建 PR 步骤必需;截图与视频无法程序化上传;审阅者建议为启发式,需用户确认;部分步骤需用户手动操作。