electron-chromium-upgrade by electron/electron
npx skills add https://github.com/electron/electron --skill electron-chromium-upgrade重复运行 e sync --3,在出现补丁冲突时进行修复,直到命令成功执行。然后导出补丁并原子性地提交更改。
当满足以下条件时,第一阶段完成:
e sync --3 以代码 0 退出(无补丁失败)在满足这些标准之前不要停止。
关键 除非 100% 确定补丁不再需要,否则不要删除或跳过补丁。在您用尽所有其他选项后,应将复杂的冲突或难以解决的问题呈现给用户。不要仅仅因为无法解决就删除补丁。
关键 切勿使用 git am --skip,然后通过创建新提交来手动重新创建补丁。这会破坏原始补丁的作者身份、提交消息及其在系列中的位置。如果 git am --continue 报告“没有更改”,请调查原因——更改很可能已被先前的冲突解决中的三方合并所吸收。应将此情况呈现给用户,而不是跳过并重新创建。
roller/chromium/main 分支由自动化创建,用于更新 Electron 的 Chromium 依赖 SHA。尚未进行任何工作来处理新旧版本之间的破坏性更改。
关键目录:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
e..(父目录):Chromium 仓库(大多数补丁应用的位置)patches/:按目标组织的补丁文件docs/development/patches.md:补丁系统文档在每个升级会话开始时运行一次:
.. 仓库中运行 git rerere clear。来自先前尝试的陈旧记录解决方案可能会静默地应用错误的合并。.git/hooks/pre-commit 是否存在。如果不存在,请运行 yarn husky 来安装它。该钩子会运行 lint-staged,后者负责处理 C++ 文件的 clang-format。e sync --3(--3 标志启用三方合并,始终需要)git am --continuegit am --continue 成功,您必须运行 e patches {target} 来导出修复e sync --3 成功时,运行 e patches allreferences/phase-one-commit-guidelines.md,然后严格按照其中的说明提交更改。| 命令 | 用途 |
|---|---|
e sync --3 | 克隆依赖项并使用三方合并应用补丁 |
git am --continue | 解决冲突后继续(在目标仓库中运行) |
e patches {target} | 将目标仓库中的提交导出到补丁文件 |
e patches all | 从所有目标导出所有补丁 |
e patches {target} --commit-updates | 导出补丁并自动提交微小更改 |
e patches --list-targets | 列出目标和配置路径 |
patches/{target}/*.patch → [e sync --3] → target repo commits
← [e patches] ←
| 情况 | 操作 |
|---|---|
在活跃的 git am 冲突期间 | 在目标仓库中修复,然后运行 git am --continue |
| 在冲突之外修改补丁 | 直接编辑 .patch 文件 |
| 创建新补丁(罕见,避免) | 在目标仓库中提交,然后运行 e patches {target} |
99% 的时间应修复现有补丁,而不是创建新的。
From: 字段)TODO(name) 必须保留原始名称DCHECK → CHECK_IS_TEST),请更新补丁提交消息以反映当前状态git am --continue 提示“没有更改——您是否忘记使用 'git add'?”,请不要运行 git am --skip 并创建替代提交。该补丁的更改已被先前的三方合并解决方案所吸收。这意味着较早的冲突解决引入了过多的更改。应将此情况呈现给用户以获取指导——正确的修复可能需要更仔细地重新进行先前的解决,以保持每个补丁的更改独立。重复运行 e build -k 999 -- --quiet,在出现构建问题时进行修复,直到命令成功执行。然后运行 e start --version 以验证 Electron 是否启动,并原子性地提交更改。
第一阶段完成后立即运行第二阶段。
当满足以下条件时,第二阶段完成:
e build -k 999 -- --quiet 以代码 0 退出(无构建失败)e start --version 以检查 Electron 是否启动在满足这些标准之前不要停止。不要删除代码或功能,切勿为了走捷径而注释掉代码。确保所有现有代码、逻辑和意图都能正常工作。
roller/chromium/main 分支由自动化创建,用于更新 Electron 的 Chromium 依赖 SHA。尚未进行任何工作来处理新旧版本之间的破坏性更改。Chromium API 经常被重命名或重构。在任何情况下,都必须更新 Electron 中的代码以适应 Chromium 的更改,强烈避免修改 chromium 中的代码来修复 Electron 的构建。
关键目录:
e 命令)..(父目录):Chromium 仓库(不要为了修复构建问题而修改此代码,仅读取它以获取上下文)e build -k 999 -- --quiet(--quiet 标志抑制每个目标的状态行,仅显示错误和最终结果)e build -t {target_that_failed}.o 以仅构建我们正在修复的失败目标
FAILED: 2e506007-8d5d-4f38-bdd1-b5cd77999a77 "./obj/electron/chromium_src/chrome/process_singleton_posix.o" CXX obj/electron/chromium_src/chrome/process_singleton_posix.o 中的目标名称是 obj/electron/chromium_src/chrome/process_singleton_posix.oreferences/phase-two-commit-guidelines.md,然后严格按照其中的说明提交更改。git status
.patch 文件git commit -am "chore: update patches (trivial only)"e build 成功时,运行 e start --versiongit status 检查您在 Chromium 仓库中是否有任何待处理的更改
| 命令 | 用途 |
|---|---|
e build -k 999 -- --quiet | 构建 Electron,出错继续,抑制状态行 |
e build -t {target}.o | 仅构建一个特定目标以验证修复 |
e start --version | 在成功构建后验证 Electron 是否启动 |
当错误出现在 Electron 打补丁的文件中时(使用 grep -l "filename" patches/chromium/*.patch 检查):
在 Chromium 源代码树中编辑文件(例如,/src/chrome/browser/...)
创建一个针对原始补丁提交的修复提交:
cd .. # 进入 chromium 仓库
git add <modified-file>
git commit --fixup=<original-patch-commit-hash>
GIT_SEQUENCE_EDITOR=: git rebase --autosquash --autostash -i <commit>^
导出更新后的补丁:e patches chromium
按照 references/phase-one-commit-guidelines.md 提交更新后的补丁文件。
要查找需要修复的原始补丁提交:git log --oneline | grep -i "keyword from patch name"
用于变基的基础提交是应用补丁之前的 Chromium 提交。通过检查 refs/patches/upstream-head 引用来找到它。
当错误出现在 Electron 自身的源代码中时:
references/phase-one-commit-guidelines.mdreferences/phase-two-commit-guidelines.md此技能在 references/ 目录下有额外的参考文件:
在工作流程步骤中引用时请阅读这些文件。
每周安装次数
157
仓库
GitHub 星标数
120.6K
首次出现
2026年1月21日
安全审计
安装于
opencode137
codex134
gemini-cli132
cursor127
claude-code124
github-copilot122
Run e sync --3 repeatedly, fixing patch conflicts as they arise, until it succeeds. Then export patches and commit changes atomically.
Phase One is complete when:
e sync --3 exits with code 0 (no patch failures)Do not stop until these criteria are met.
CRITICAL Do not delete or skip patches unless 100% certain the patch is no longer needed. Complicated conflicts or hard to resolve issues should be presented to the user after you have exhausted all other options. Do not delete the patch just because you can't solve it.
CRITICAL Never use git am --skip and then manually recreate a patch by making a new commit. This destroys the original patch's authorship, commit message, and position in the series. If git am --continue reports "No changes", investigate why — the changes were likely absorbed by a prior conflict resolution's 3-way merge. Present this situation to the user rather than skipping and recreating.
The roller/chromium/main branch is created by automation to update Electron's Chromium dependency SHA. No work has been done to handle breaking changes between the old and new versions.
Key directories:
e commands here).. (parent): Chromium repo (where most patches apply)patches/: Patch files organized by targetdocs/development/patches.md: Patch system documentationRun these once at the start of each upgrade session:
git rerere clear in both the electron and .. repos. Stale recorded resolutions from a prior attempt can silently apply wrong merges..git/hooks/pre-commit exists. If not, run yarn husky to install it. The hook runs lint-staged which handles clang-format for C++ files.e sync --3 (the --3 flag enables 3-way merge, always required)git am --continue in affected repogit am --continue succeeds you MUST run e patches {target} to export fixese sync --3 succeeds, run e patches allreferences/phase-one-commit-guidelines.md NOW, then commit changes following those instructions exactly.| Command | Purpose |
|---|---|
e sync --3 | Clone deps and apply patches with 3-way merge |
git am --continue | Continue after resolving conflict (run in target repo) |
e patches {target} | Export commits from target repo to patch files |
e patches all | Export all patches from all targets |
e patches {target} --commit-updates | Export patches and auto-commit trivial changes |
e patches --list-targets |
patches/{target}/*.patch → [e sync --3] → target repo commits
← [e patches] ←
| Situation | Action |
|---|---|
During active git am conflict | Fix in target repo, then git am --continue |
| Modifying patch outside conflict | Edit .patch file directly |
| Creating new patch (rare, avoid) | Commit in target repo, then e patches {target} |
Fix existing patches 99% of the time rather than creating new ones.
From: field)TODO(name) must retain original nameDCHECK → CHECK_IS_TEST), update patch commit message to reflect current stategit am --continue says "No changes — did you forget to use 'git add'?", do NOT run git am --skip and create a replacement commit. The patch's changes were already absorbed by a prior 3-way merge resolution. This means an earlier conflict resolution pulled in too many changes. Present the situation to the user for guidance — the correct fix may require re-doing an earlier resolution more carefully to keep each patch's changes separate.Run e build -k 999 -- --quiet repeatedly, fixing build issues as they arise, until it succeeds. Then run e start --version to validate Electron launches and commit changes atomically.
Run Phase Two immediately after Phase One is complete.
Phase Two is complete when:
e build -k 999 -- --quiet exits with code 0 (no build failures)e start --version has been run to check Electron launchesDo not stop until these criteria are met. Do not delete code or features, never comment out code in order to take short cut. Make all existing code, logic and intention work.
The roller/chromium/main branch is created by automation to update Electron's Chromium dependency SHA. No work has been done to handle breaking changes between the old and new versions. Chromium APIs frequently are renamed or refactored. In every case the code in Electron must be updated to account for the change in Chromium, strongly avoid making changes to the code in chromium to fix Electrons build.
Key directories:
e commands here).. (parent): Chromium repo (do not touch this code to fix build issues, just read it to obtain context)e build -k 999 -- --quiet (the --quiet flag suppresses per-target status lines, showing only errors and the final result)e build -t {target_that_failed}.o to build just the failed target we were specifically fixing
FAILED: 2e506007-8d5d-4f38-bdd1-b5cd77999a77 "./obj/electron/chromium_src/chrome/process_singleton_posix.o" CXX obj/electron/chromium_src/chrome/process_singleton_posix.o the target name is obj/electron/chromium_src/chrome/process_singleton_posix.oreferences/phase-two-commit-guidelines.md NOW, then commit changes following those instructions exactly.| Command | Purpose |
|---|---|
e build -k 999 -- --quiet | Build Electron, continue on errors, suppress status lines |
e build -t {target}.o | Build just one specific target to verify a fix |
e start --version | Validate Electron launches after successful build |
When the error is in a file that Electron patches (check with grep -l "filename" patches/chromium/*.patch):
Edit the file in the Chromium source tree (e.g., /src/chrome/browser/...)
Create a fixup commit targeting the original patch commit:
cd .. # to chromium repo
git add <modified-file>
git commit --fixup=<original-patch-commit-hash>
GIT_SEQUENCE_EDITOR=: git rebase --autosquash --autostash -i <commit>^
Export the updated patch: e patches chromium
Commit the updated patch file following references/phase-one-commit-guidelines.md.
To find the original patch commit to fixup: git log --oneline | grep -i "keyword from patch name"
The base commit for rebase is the Chromium commit before patches were applied. Find it by checking the refs/patches/upstream-head ref.
When the error is in Electron's own source code:
references/phase-one-commit-guidelines.mdreferences/phase-two-commit-guidelines.mdThis skill has additional reference files in references/:
Read these when referenced in the workflow steps.
Weekly Installs
157
Repository
GitHub Stars
120.6K
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubPassSocketWarnSnykPass
Installed on
opencode137
codex134
gemini-cli132
cursor127
claude-code124
github-copilot122
Wix CLI 应用验证:四步工作流确保应用质量与部署成功
252 周安装
| List targets and config paths |
git status in the electron repo
.patch files that only have index/hunk header changesgit commit -am "chore: update patches (trivial only)"e build succeeds, run e start --versiongit status