{"name": "electron", "version": "0.1.0", "hash": "sha256:3b5fe87e7fe7e8b83952cb16f921eb8a6d47d3773f8341ce9479604d97a194e8", "files": {"ABSORB_REPORT.md": "# Absorb report: electron\n\n- **Source:** https://github.com/electron/electron at `b5e057bafe52`\n- **Licence:** MIT\n- **Project names searched for:** electron, dev-root\n\n## What was absorbed\n\n| Piece | Kind | Class | Project names | Project paths |\n|---|---|---|---|---|\n| chrome-release-cls | skill | mixed | electron ×2 |  |\n| chrome-release-verify | skill | mixed | electron ×11 | patches/config.json, script/lint.js, .github/PULL_REQUEST_TEMPLATE.md, patches |\n| electron-chromium-upgrade | skill | mixed | electron ×39 | docs/development/patches.md, .git/hooks, script/lint-roller-chromium-changes.mjs, script/gen-hunspell-filenames.js, script/gen-siso-revision.js, build/siso_revision, script/gen-filenames.mts, docs/api, .github/workflows/pipeline-segment-electron-gn-check.yml, patches/chromium, patches, lib |\n| electron-node-upgrade | skill | mixed | electron ×79 | patches/node, docs/development/patches.md, script/node-spec-runner.js, script/node-disabled-tests.json, build/args/all.gn, spec/node.spec.ts, shell, patches |\n| triage-prs | skill | mixed | electron ×17 |  |\n| permission rules | permissions | mixed | electron ×2 |  |\n\n## Needs review before sharing\n\nThese pieces mention the project by name or lean on its files. Move those facts into configuration, or keep the piece out of a shared starter.\n\n- **chrome-release-cls** (skill): names electron\n- **chrome-release-verify** (skill): names electron; paths patches/config.json, script/lint.js, .github/PULL_REQUEST_TEMPLATE.md, patches\n- **electron-chromium-upgrade** (skill): names electron; paths docs/development/patches.md, .git/hooks, script/lint-roller-chromium-changes.mjs, script/gen-hunspell-filenames.js, script/gen-siso-revision.js, build/siso_revision, script/gen-filenames.mts, docs/api, .github/workflows/pipeline-segment-electron-gn-check.yml, patches/chromium, patches, lib\n- **electron-node-upgrade** (skill): names electron; paths patches/node, docs/development/patches.md, script/node-spec-runner.js, script/node-disabled-tests.json, build/args/all.gn, spec/node.spec.ts, shell, patches\n- **triage-prs** (skill): names electron\n- **permission rules** (permissions): names electron\n\n## Not absorbed\n\n- instruction files (CLAUDE.md): they describe the project, so they stay with it. Pass --with-instructions to absorb them for review\n- `.claude/.gitignore` (1 file(s)): this version of absorb does not read it, so it stays with the project\n\n## Self-test\n\nNo case could be generated.\n", "ATTRIBUTION.md": "# Attribution: electron\n\nThis harness was absorbed from https://github.com/electron/electron at commit `b5e057bafe526dea89ee79d024da6bce638dbe18` on 2026-11-27 with `baudrier absorb`.\n\n- **Licence:** MIT. Licence and notice files kept unchanged in this folder: `LICENSE`.\n- **Credit:** every file listed below is the work of the source repository's authors. Files were copied unchanged, except that hook commands name their folder as `${HARNESS_HOOKS}` and slash commands were wrapped as skills.\n\n## Absorbed files\n\n- `skills/chrome-release-cls/SKILL.md` (skill)\n- `skills/chrome-release-verify/SKILL.md` (skill)\n- `skills/electron-chromium-upgrade/SKILL.md` (skill)\n- `skills/electron-chromium-upgrade/references/patch-analysis.md` (skill)\n- `skills/electron-chromium-upgrade/references/phase-one-commit-guidelines.md` (skill)\n- `skills/electron-chromium-upgrade/references/phase-two-commit-guidelines.md` (skill)\n- `skills/electron-node-upgrade/SKILL.md` (skill)\n- `skills/electron-node-upgrade/references/patch-analysis.md` (skill)\n- `skills/electron-node-upgrade/references/phase-one-commit-guidelines.md` (skill)\n- `skills/electron-node-upgrade/references/phase-three-commit-guidelines.md` (skill)\n- `skills/electron-node-upgrade/references/phase-two-commit-guidelines.md` (skill)\n- `skills/triage-prs/SKILL.md` (skill)\n- `skills/triage-prs/triage-prs.sh` (skill)\n", "LICENSE": "Copyright (c) Electron contributors\nCopyright (c) 2013-2020 GitHub Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", "harness.yaml": "$schema: https://harnessprotocol.io/schema/v1/harness.schema.json\nversion: '1'\nkind: profile\nmetadata:\n  name: electron\n  description: 'The Electron repository''s agent setup: Chromium and Node upgrade skills, PR triage and pre-allowed build commands.'\n  version: 0.1.0\n  license: MIT\nskills:\n- name: chrome-release-cls\n  source: ./skills/chrome-release-cls\n- name: chrome-release-verify\n  source: ./skills/chrome-release-verify\n- name: electron-chromium-upgrade\n  source: ./skills/electron-chromium-upgrade\n- name: electron-node-upgrade\n  source: ./skills/electron-node-upgrade\n- name: triage-prs\n  source: ./skills/triage-prs\npermissions:\n  tools:\n    allow:\n    - Bash(e sync)\n    - Bash(e patches --list-targets:*)\n    - Bash(git add:*)\n    - Bash(git am:*)\n    - Bash(git commit:*)\n    - Bash(git log:*)\n    - Bash(git show:*)\n    - Bash(e patches:*)\n    - Bash(e sync:*)\n    - Skill(electron-chromium-upgrade)\n    - Skill(electron-node-upgrade)\n    - Read(*)\n    - Bash(echo:*)\n    - Bash(e build:*)\n    - Bash(tee:*)\n    - Bash(git diff:*)\n    - Bash(git rev-parse:*)\nx-origin:\n  repository: https://github.com/electron/electron\n  commit: b5e057bafe526dea89ee79d024da6bce638dbe18\n  license: MIT\n  license_basis: detected\n  license_files:\n  - LICENSE\n  absorbed_at: '2026-11-27'\n", "skills/chrome-release-cls/SKILL.md": "---\nname: chrome-release-cls\ndescription: Given a Chrome Releases blog post URL (chromereleases.googleblog.com), extract every CVE/bug and find the underlying Gerrit CL that fixed it by searching the local Chromium checkout and sub-repos. Use when asked to map Chrome security release notes to fixing CLs, or to find which commits correspond to CVEs in a Chrome stable update.\n---\n\n# Chrome Release → Fixing CL Mapper\n\nMaps every security fix in a Chrome Releases blog post to the Gerrit CL(s) that fixed it.\n\n## Input\n\n`$ARGUMENTS` — a `https://chromereleases.googleblog.com/...` URL. If empty, ask the user for one.\n\n## Procedure\n\n### 1. Extract CVE → bug ID pairs from the blog post\n\nThe blog HTML buries bug IDs inside `<a>` tags, so strip tags first. Run:\n\n```bash\ncurl -sL \"$URL\" | python3 -c '\nimport sys, re, html\nt = re.sub(r\"<[^>]+>\", \" \", sys.stdin.read())\nt = re.sub(r\"\\s+\", \" \", html.unescape(t))\nseen = set()\nfor m in re.finditer(r\"\\[\\s*(\\d{6,})\\s*\\]\\s*(Critical|High|Medium|Low)\\s*(CVE-\\d{4}-\\d+):\\s*([^.]+?)\\.\", t):\n    if m.group(3) in seen: continue\n    seen.add(m.group(3))\n    print(f\"{m.group(3)}|{m.group(1)}|{m.group(2)}|{m.group(4).strip()}\")\n' > /tmp/cve_bugs.txt\ncat /tmp/cve_bugs.txt\n```\n\nIf this yields nothing, the page may have changed format — fall back to `grep -oE 'CVE-[0-9]{4}-[0-9]+'` and `grep -oE 'crbug\\.com/[0-9]+'` and pair them by order.\n\n### 2. Find the fixing CL for each bug\n\nSearch git history in the Chromium checkout and relevant sub-repos for commits whose `Bug:` or `Fixed:` footer references the bug ID, then extract the `Reviewed-on:` Gerrit URL.\n\nRepo selection by component keyword:\n- ANGLE → `third_party/angle`\n- Skia, Graphite → `third_party/skia`\n- PDFium → `third_party/pdfium`\n- Dawn → `third_party/dawn`\n- V8, Turbofan, Maglev, Turboshaft → `v8`\n- everything else → `.` (chromium/src)\n\nAlways also fall back to `.` if the hinted repo has no match.\n\n```bash\ncd /root/src/electron/src   # chromium root (parent of electron/)\n\nlookup() {\n  local bug=\"$1\" repos=\"$2\"\n  for repo in $repos . v8 third_party/skia third_party/angle third_party/pdfium third_party/dawn; do\n    local hits\n    hits=$(git -C \"$repo\" log --all --since='6 months ago' -E \\\n           --grep=\"(Bug|Fixed):.*\\\\b${bug}\\\\b\" --format='%H' 2>/dev/null | sort -u)\n    [[ -z \"$hits\" ]] && continue\n    while read -r h; do\n      git -C \"$repo\" log -1 --format='%B' \"$h\" | grep '^Reviewed-on:' | sed 's/^/    /'\n      echo \"      ↳ $(git -C \"$repo\" log -1 --format='%s' \"$h\")\"\n    done <<<\"$hits\"\n    return 0\n  done\n  echo \"    (not found locally)\"\n}\n```\n\nDrive it from `/tmp/cve_bugs.txt`. Prefer the **non-`[M1xx]`-prefixed** commit subject as the canonical main CL; the `[M1xx]` ones are branch cherry-picks.\n\n### 3. Handle misses\n\nFor any bug with no local hit:\n- `git -C <repo> fetch origin` then re-search `--remotes` (fix may be newer than the checkout).\n- **Search gitiles history** — works with or without a checkout and needs no auth. Query `refs/heads/main` plus the release's branch refs (`refs/branch-heads/<Chromium branch number>` for `chromium/src`, `refs/branch-heads/<V8 major.minor>` for `v8/v8`, likewise `angle/angle` and `skia` on chromium.googlesource.com, and `pdfium.googlesource.com/pdfium`, `dawn.googlesource.com/dawn`, `aomedia.googlesource.com/aom`). The response starts with a `)]}'` line; gitiles `grep` is a substring match over the whole commit message, so check the hit's `Bug:`/`Fixed:` footer:\n  ```bash\n  gitiles_grep() {  # gitiles_grep <host> <repo> <ref> <bug>   e.g. chromium v8/v8 refs/branch-heads/15.2 558734727\n    curl -s \"https://$1.googlesource.com/$2/+log/$3?format=JSON&n=50&grep=$4\" | tail -n +2 | python3 -c '\n  import sys, json, re\n  for c in json.load(sys.stdin).get(\"log\", []):\n      if re.search(r\"^(Bug|Fixed):.*\\b\" + sys.argv[1] + r\"\\b\", c[\"message\"], re.M):\n          print(c[\"commit\"], c[\"message\"].splitlines()[0])\n  ' \"$4\"\n  }\n  ```\n  For `chromium/src` **always bound the walk with a range** — an unbounded grep over its full history times out (HTTP 502): pass `refs/branch-heads/<previous milestone's branch>..refs/branch-heads/<this branch>` and `refs/branch-heads/<this branch>..refs/heads/main` as the ref (branch number = third component of the Chrome version, e.g. 8010 for 153.0.8010.x; the previous milestone's is in `https://chromiumdash.appspot.com/fetch_milestones?mstone=<N-1>`). The sub-repos are small enough to walk unbounded (a few seconds). A hit gives the sha, the ref, and (from the commit message) the `Reviewed-on:` CL — report it as the fix even if Gerrit refuses to show that CL.\n- Query Gerrit directly: `curl -s \"https://chromium-review.googlesource.com/changes/?q=bug:${BUG}&n=10\" | tail -n +2 | python3 -m json.tool` (also try `skia-review`, `pdfium-review`, `dawn-review`, `aomedia-review`).\n- **`b/` bug format (Skia, Graphite, Dawn):** These repos reference bugs as `b/<id>` in commit messages rather than `Bug: <id>` footers. The Gerrit `bug:` query will return nothing. Use `message:<id>` search instead:\n  ```bash\n  curl -s \"https://skia-review.googlesource.com/changes/?q=message:${BUG}&n=5\" | tail -n +2\n  ```\n  Apply the same pattern for `dawn-review.googlesource.com` when the component is Dawn.\n- **Tracing main CLs from merges:** When only `[M1xx]` merge CLs are found, query the CL detail for `cherry_pick_of_change` to find the original main CL number:\n  ```bash\n  curl -s \"https://chromium-review.googlesource.com/changes/${CL_NUM}?o=CURRENT_REVISION\" | tail -n +2 | python3 -c \"\n  import sys, json\n  d = json.load(sys.stdin)\n  print(d.get('cherry_pick_of_change', 'none'))\n  \"\n  ```\n- **A CL that is restricted in Gerrit may still be public in git.** The change record and the repository have separate ACLs, and the change often stays hidden for days after the commit has landed on main and the branch-heads. So RESTRICTED is only a valid verdict once git history (local, `--remotes` after a fetch) *and* gitiles have both come up empty — a Gerrit miss on its own is not enough.\n- If still nothing and the bug was reported very recently (especially by \"Google Threat Intelligence\" or marked in-the-wild), the CL is likely still access-restricted — report it as RESTRICTED rather than guessing, and flag it for a re-check (restrictions are commonly lifted within hours).\n\n### 4. Special cases\n\n- **Roll CLs — skip and find the upstream fix:** For components whose fixes land in upstream repos (PDFium, Dawn, Skia, Graphite, libaom, libvpx, ffmpeg), the chromium-review hit will be a `Roll src/third_party/...` commit. Do not report the roll CL as the fix. Instead, query the component's own Gerrit instance directly for the actual fixing CL:\n  - PDFium → `pdfium-review.googlesource.com` (use `bug:` or `message:` query)\n  - Dawn → `dawn-review.googlesource.com` (use `message:` query — uses `b/` format)\n  - Skia / Graphite → `skia-review.googlesource.com` (use `message:` query — uses `b/` format)\n  - libaom → `aomedia-review.googlesource.com`\n  \n  Only if the upstream Gerrit instance returns no results should you fall back to reporting the roll CL — in that case, include the roll CL and note that the actual fix is upstream but the specific CL could not be identified.\n- Multiple `Reviewed-on:` lines in one commit body: cherry-picks keep the original line plus a new one. The **first** `Reviewed-on:` is the original CL.\n- A bug may have multiple distinct fix CLs (fix + follow-up hardening) — list all of them.\n\n### 5. Output\n\nProduce a markdown table per severity level: `CVE | Bug | Component | Fix CL (main)`. Link bugs as `https://crbug.com/<id>`. Save raw output (including all branch merges) to `/tmp/cve_cls.txt` and mention the path.\n", "skills/chrome-release-verify/SKILL.md": "---\nname: chrome-release-verify\ndescription: End-to-end Chrome security backport for an Electron release branch. Given a Chrome Releases blog URL and a branch (e.g. 41-x-y), determines which CVE fixes are missing from the *actual synced source*, writes the cherry-pick patches locally, validates them with `e sync --3` + `lint --patches`, then pushes a single PR. Use when asked to backport a Chrome security release to N-x-y, \"is CVE-X already in N-x-y?\", or to produce/validate the cherry-pick set for a release branch.\n---\n\n# Chrome Release → Validated Backport PR\n\nInput: `$ARGUMENTS` = `<release-branch> <chrome-releases-blog-url>` (e.g. `41-x-y https://chromereleases.googleblog.com/2026/04/stable-channel-update-for-desktop_15.html`). Ask if either is missing.\n\nThe flow is **local-first**: nothing is pushed until every patch applies via `e sync --3` and passes `lint --patches`.\n\n## 1. Map CVE → bug → fix CL\n\nRun `/chrome-release-cls <blog-url>` (or its inline procedure) to produce `/tmp/cve_bugs.txt` (`CVE|bug|severity|desc`) and a per-bug canonical fix CL. For each CL also note `repo` (path under `src/`: `.`, `v8`, `third_party/{skia,angle,pdfium,dawn}`, `third_party/libaom/source/libaom`) and `gerrit-host`.\n\n**Prefer the target-milestone merge CL** if one exists (e.g. on `41-x-y` ≈ M146, prefer the `[M146]` cherry-pick over the main CL) — it's already rebased and far less likely to conflict. Find it via `git log --all --grep` on the Change-Id, or Gerrit `?q=bug:<n>`. If Chrome did _not_ merge a fix to the target milestone, that is **not** by itself a reason to skip — Chrome's merge window is shorter than Electron's support window. Fall back to the main CL (or a nearby-milestone rebase, see step 5) and let step 3 decide whether the vulnerable code exists on the branch.\n\n## 2. Prepare a synced worktree\n\nReuse `bp-<NN>` from `e show configs` if present, else `e worktree add bp-<NN> ~/src/electron-bp-<NN> --source <current> --no-sync`.\n\n```bash\ncd <root>/src/electron\ngit fetch origin <branch>\ngit checkout -B security-backport/<branch>/<short-date> origin/<branch>\ne use bp-<NN>\ne sync 2>&1 | tee /tmp/bp_sync.log\n```\n\nIf sync fails with `NotADirectoryError: '<root>/src/.git/objects/info/alternates'`, remove `GIT_CACHE_PATH` from the bp config's `env` and retry.\n\n## 3. Verify IN-TREE vs NEEDS-BACKPORT\n\nFor each bug, three checks against the **synced** repo:\n\n1. `git -C \"$repo\" log HEAD --since='1 year ago' -E --grep=\"\\b${bug}\\b\" --format='%h %s'`\n2. Fetch Change-Id from Gerrit, then `git log HEAD --grep=\"^Change-Id: ${cid}$\"`\n3. `grep -rlE \"(\\b${bug}\\b|${cid})\" <root>/src/electron/patches/`\n\nAny hit ⇒ IN-TREE. All empty ⇒ NEEDS-BACKPORT.\n\nRows that step 1 (or an upstream triage report you were handed) left as **RESTRICTED / no public CL** are not inherited — re-resolve them here before classifying. Run `git -C \"$repo\" fetch origin` and `git -C \"$repo\" log --all --remotes -E --grep=\"(Bug|Fixed):.*\\b${bug}\\b\" --format='%h %s'`, the `chrome-release-cls` skill's `gitiles_grep` on `refs/heads/main` and the branch-heads refs of `chromium/src`, `v8` and the component's repo, and a fresh Gerrit `?q=bug:<id>` / `?q=message:<id>` query. The Gerrit change record is often restricted while the fix commit is already public in git, and restrictions lift during a run, so an earlier RESTRICTED verdict is a hint, not a result. A row stays RESTRICTED only when all of those are empty; it is never IN-TREE by omission — list it separately in the report so a human can follow up.\n\nFor each NEEDS-BACKPORT CL, also fetch its file list (`/changes/<proj>~<cl>/revisions/current/files`) and **skip** if every file is under `chrome/browser/`, `chrome/android/`, `ios/`, or `components/**/android/` — Electron doesn't compile those.\n\nReport the table now (`CVE | Sev | Bug | Component | Verdict | CL`) and the proposed backport set; get user sign-off before continuing.\n\n## 4. Write patches locally (no push yet)\n\nFor each backport CL, fetch the raw patch and write it into `patches/<dir>/`:\n\n```bash\ncurl -s \"https://${host}.googlesource.com/changes/${proj//\\//%2F}~${cl}/revisions/current/patch\" \\\n  | base64 -d > \"patches/${dir}/cherry-pick-${short}.patch\"\necho \"cherry-pick-${short}.patch\" >> \"patches/${dir}/.patches\"\n```\n\nFor repos with no Gerrit host `e cherry-pick` supports (e.g. **libaom** on aomedia), instead `git cherry-pick` the upstream commits onto the synced sub-repo HEAD and `git format-patch` the result.\n\nFor any newly-created `patches/<dir>/`, append to `patches/config.json` **preserving the compact one-line-per-entry style**:\n\n```json\n  { \"patch_dir\": \"src/electron/patches/<dir>\", \"repo\": \"src/third_party/<dir-or-nested-path>\" }\n```\n\n## 5. Validate with `e sync --3`\n\n```bash\ne sync --3 2>&1 | tee /tmp/bp_sync3.log\n```\n\nOn `Patch failed at NNNN <subject>`:\n\n- `cd` into the failing repo, inspect `git diff` for conflict markers.\n- **Test-only files** (e.g. `web_tests/VirtualTestSuites`, `*_unittest.cc` context drift): take ours (`git checkout --ours -- <file>`) if the security-relevant hunks merged cleanly.\n- **Substantive code conflicts**: a conflict is not a reason to drop. Work through, in order:\n  1. A merge of the same Change-Id on the **target milestone** (`git log --all --grep` on the Change-Id, or Gerrit `?q=change:<Change-Id>`) — swap to it.\n  2. The same Change-Id on a **nearby milestone** (the author's rebase, e.g. an `[M152]` CL when the target is M150 — status NEW is fine), and any **prerequisite CL** the fix was written against (the refactor that introduced the helpers or signatures the fix touches). Pick those so the fix applies verbatim; list prerequisites in the report.\n  3. Otherwise **hand-port** the fix's semantics onto the branch's code, inside the pick's patch file: resolve the hunks in the target repo, fold them into the pick's commit (`git commit --fixup` + autosquash rebase), then re-export. Keep the upstream commit header verbatim and append an `Electron adaptation notes (<branch>)` paragraph to the patch header describing **every** adaptation (renamed member, changed signature, helper inlined, ...). Adapt mechanically and structurally only — never change what the fix checks or guards, and never invent semantics the upstream diff doesn't have. Mark the row `BACKPORTED (adapted)` and flag it for reviewer attention in the report and the PR body. An adapted pick is held to the same bar as any other: `e sync --3`, `lint --patches`, and whatever build gate the caller imposes.\n- **DROPPED** is reserved for two cases: (a) the vulnerable code is **absent** on the branch (file, function or feature doesn't exist), or (b) a **subsystem rewrite** where the fix has no counterpart to attach to. Every DROPPED row must say which, with the evidence. Remove a dropped patch fully (delete the file, remove from `.patches` and `config.json`).\n- After resolving: `git add <files> && git -c commit.gpgsign=false am --continue`, then `e patches <repo>` to export the resolved patch, then re-run `e sync --3`. Repeat until clean.\n\n## 6. Export → lint → re-apply loop\n\n```bash\ne patches all\nnode script/lint.js --patches   # must exit 0\n```\n\nIf lint reports findings (typically trailing whitespace on `+` content lines), fixing them **changes the bytes the patch writes**, which invalidates the `index <old>..<new>` blob hashes that `e patches` baked in. Hand-editing a `.patch` and pushing it as-is will pass lint locally but fail CI's Apply Patches re-export check with a one-line `index` hash diff.\n\nSo whenever lint (or you) modifies any `.patch` file after export, round-trip once more:\n\n```bash\n# fix the lint findings in patches/**/*.patch, then:\ne sync            # re-apply the edited patches (no --3 needed; they applied cleanly last time)\ne patches all     # re-export so index blob hashes match the edited content\nnode script/lint.js --patches      # must now exit 0\ngit diff --quiet -- patches/ || { echo \"patches changed again — repeat the loop\"; }\n```\n\nRepeat until `lint --patches` exits 0 **and** `git diff -- patches/` is empty after the final `e patches all`. Only then is the patch set CI-stable.\n\n## 7. Commit, push, PR\n\n```bash\ngit add patches/\ngit commit -m \"chore: cherry-pick <N> changes from <dirs>\"\ngit push origin HEAD\ngh pr create --repo electron/electron --base <branch> --head <this-branch> \\\n  --title \"chore: cherry-pick <N> changes from <dirs>\" \\\n  --label \"<branch>\" --label backport-check-skip --label semver/patch --label \"security 🔒\" \\\n  --body-file /tmp/pr_body.md\n```\n\nPR body format — follow `.github/PULL_REQUEST_TEMPLATE.md` (`Description of Change` / `Checklist` / `Release Notes` sections; PRs that don't follow it are auto-closed):\n\n```markdown\n#### Description of Change\n\nBackports the following changes:\n\n* [`<shortCommit>`](<gerrit-CL-url>) from <patchDir> — <subject>\n* [`<shortCommit>`](<gerrit-CL-url>) from <patchDir> — <subject> (adapted for <branch>; see patch header)\n* ...\n\n#### Checklist\n\n- [x] I have filled out the PR description\n- [x] [I have reviewed and verified the changes](https://github.com/electron/governance/blob/main/policy/ai.md)\n\n#### Release Notes\n\nNotes: Backported fixes from upstream Chromium and V8.\n```\n\n**Keep the PR body low-key about security.** The PR is public the moment it opens, while the fixes only protect users after a release ships — don't advertise the exploit map in between. Concretely: no CVE numbers, no crbug.com links, no \"security\"/\"0-day\"/severity wording anywhere in the title, body, or `Notes:` line. The `security 🔒` label is fine (it's how releases track these). Upstream commit subjects stay verbatim even when they say \"UAF\" — rewriting them breaks traceability to the Gerrit CL. Adjust the `Notes:` wording to match what's actually in the set (e.g. drop \"and V8\" if no v8 patches).\n\nKeep the CVE↔CL mapping out of the PR entirely: leave it in the local notes file (`/tmp/cve_cls.txt`) and report it to the user in chat, including any adapted, dropped or skipped fixes with reasons.\n\nRestore `e use <previous>` when done.\n", "skills/electron-chromium-upgrade/SKILL.md": "---\nname: electron-chromium-upgrade\ndescription: Guide for performing Chromium version upgrades in the Electron project. Use when working on the roller/chromium/main branch to fix patch conflicts during `e sync --3`. Covers the patch application workflow, conflict resolution, analyzing upstream Chromium changes, and proper commit formatting for patch fixes.\n---\n\n# Electron Chromium Upgrade: Phase One\n\n## Summary\n\nRun `e sync --3` repeatedly, fixing patch conflicts as they arise, until it succeeds. Then export patches and commit changes atomically.\n\n## Success Criteria\n\n**Linter Requirements**:\n- Code/patch edits: Title must be exactly `{CL-Number}: {upstream CL original title}` with `Ref: {URL}` in the body.\n- Metadata-only patch updates (hashes/line numbers): Message must be exactly `chore: update patches` with no body.\n\nPhase One is complete when:\n- `e sync --3` exits with code 0 (no patch failures)\n- All changes are committed per the commit guidelines\n\nDo not stop until these criteria are met.\n\n**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.\n\n**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.\n\n## Context\n\nThe `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.\n\n**Key directories:**\n- Current directory: Electron repo (always run `e` commands here)\n- `..` (parent): Chromium repo (where most patches apply)\n- `patches/`: Patch files organized by target\n- `docs/development/patches.md`: Patch system documentation\n\n## Pre-flight Checks\n\nRun these once at the start of each upgrade session:\n\n1. **Clear rerere cache** (if enabled): `git rerere clear` in both the electron and `..` repos. Stale recorded resolutions from a prior attempt can silently apply wrong merges.\n2. **Ensure pre-commit hooks are installed**: Check that `git config core.hooksPath` prints `.husky/_` and that `.husky/_/pre-commit` exists (husky does not use `.git/hooks/`). If not, run `yarn husky` to install it. The hook runs `lint-staged`, which handles clang-format for C++ files and runs `script/lint-roller-chromium-changes.mjs` on every commit.\n\n## Workflow\n\n1. Run `e sync --3` (the `--3` flag enables 3-way merge, always required)\n2. If succeeds → skip to step 5\n3. If patch fails:\n   - Identify target repo and patch from error output\n   - Analyze failure (see references/patch-analysis.md)\n   - Fix conflict in target repo's working directory\n   - Run `git am --continue` in affected repo\n   - Repeat until all patches for that repo apply\n   - IMPORTANT: Once `git am --continue` succeeds you MUST run `e patches {target}` to export fixes\n   - Return to step 1\n4. When `e sync --3` succeeds, run `e patches all`\n5. **Regenerate the derived file lists.** Electron checks in lists that mirror Chromium's DEPS pins, and the gn-check CI job fails the roll on every platform if any of them is stale. The roller bot bumps `DEPS` without running the pre-commit hook that normally regenerates them, so run the generators by hand now (the gn-check job runs the `--check` form of each):\n   ```bash\n   node script/gen-hunspell-filenames.js   # filenames.hunspell.gni (from ../third_party/hunspell_dictionaries)\n   node script/gen-libc++-filenames.js     # filenames.libcxx.gni / filenames.libcxxabi.gni\n   node script/gen-siso-revision.js        # build/siso_revision (the gen_siso_revision sync hook usually did this already)\n   node script/gen-filenames.mts --check   # fails only if lib/ or docs/api changed; regenerate without --check if it does\n   ```\n   Then `git status` and commit each changed file on its own:\n   - `build/siso_revision` → `chore: update siso revision` (exact title, no body). CI builds siso from this file.\n   - `filenames.libcxx.gni` → `chore: update libc++ filenames` (exact title, no body, that file only).\n   - `filenames.hunspell.gni` (and `filenames.libcxxabi.gni`, which has no dedicated pattern) → a `{CL-Number}: {upstream CL original title}` commit with a `Ref:` line, where the CL is the upstream commit that moved the pin. Find it from the dep's new SHA in Chromium's `DEPS` (hunspell is `src/third_party/hunspell_dictionaries`, libc++abi is `src/third_party/libc++abi/src`):\n     ```bash\n     cd .. && git log --format='%h %s%n%(trailers:key=Reviewed-on,valueonly)' refs/patches/upstream-head -S<new-dep-sha> -- DEPS\n     ```\n6. **Read `references/phase-one-commit-guidelines.md` NOW**, then commit changes following those instructions exactly.\n\n## Commands Reference\n\n| Command | Purpose |\n|---------|---------|\n| `e sync --3` | Clone deps and apply patches with 3-way merge |\n| `git am --continue` | Continue after resolving conflict (run in target repo) |\n| `e patches {target}` | Export commits from target repo to patch files |\n| `e patches all` | Export all patches from all targets |\n| `e patches {target} --commit-updates` | Export patches and auto-commit trivial changes |\n| `e patches --list-targets` | List targets and config paths |\n\n## Patch System Mental Model\n\n```\npatches/{target}/*.patch  →  [e sync --3]  →  target repo commits\n                          ←  [e patches]   ←\n```\n\n## When to Edit Patches\n\n| Situation | Action |\n|-----------|--------|\n| During active `git am` conflict | Fix in target repo, then `git am --continue` |\n| Modifying patch outside conflict | Edit `.patch` file directly |\n| Creating new patch (rare, avoid) | Commit in target repo, then `e patches {target}` |\n\nFix existing patches 99% of the time rather than creating new ones.\n\n## Patch Fixing Rules\n\n1. **Preserve authorship**: Keep original author in TODO comments (from patch `From:` field)\n2. **Never change TODO assignees**: `TODO(name)` must retain original name\n3. **Update descriptions**: If upstream changed (e.g., `DCHECK` → `CHECK_IS_TEST`), update patch commit message to reflect current state\n4. **Never skip-and-recreate a patch**: If `git 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.\n\n# Electron Chromium Upgrade: Phase Two\n\n## Summary\n\nRun `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.\n\nRun Phase Two immediately after Phase One is complete.\n\n## Success Criteria\n\n**Linter Requirements**:\n- Code/patch edits: Title must be exactly `{CL-Number}: {upstream CL original title}` with `Ref: {URL}` in the body.\n- Metadata-only patch updates (hashes/line numbers): Message must be exactly `chore: update patches` with no body.\n\nPhase Two is complete when:\n- `e build -k 999 -- --quiet` exits with code 0 (no build failures)\n- `e start --version` has been run to check Electron launches\n- `npm run gn-check` exits with code 0 and every `script/gen-*` `--check` passes (see step 7 — this is what the gn-check CI job runs, and it fails the roll independently of the build)\n- All changes are committed per the commit guidelines\n\nDo 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.\n\n## Context\n\nThe `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.\n\n**Key directories:**\n- Current directory: Electron repo (always run `e` commands here)\n- `..` (parent): Chromium repo (do not touch this code to fix build issues, just read it to obtain context)\n\n## Workflow\n\n1. Run `e build -k 999 -- --quiet` (the `--quiet` flag suppresses per-target status lines, showing only errors and the final result)\n2. If succeeds → skip to step 6\n3. If build fails:\n    - Identify underlying file in \"electron\" from the compilation error message\n    - Analyze failure\n    - Fix build issue by adapting Electron's code for the change in Chromium\n    - Run `e build -t {target_that_failed}.o` to build just the failed target we were specifically fixing\n        - You can identify the target_that_failed from the failure line in the build log. E.g. `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.o`\n    - **Read `references/phase-two-commit-guidelines.md` NOW**, then commit changes following those instructions exactly.\n    - Return to step 1\n4. **CRITICAL**: After ANY commit (especially patch commits), immediately run `git status` in the electron repo\n    - Look for other modified `.patch` files that only have index/hunk header changes\n    - These are dependent patches affected by your fix\n    - Commit them immediately with: `git commit -am \"chore: update patches\"`\n5. Return to step 1\n6. When `e build` succeeds, run `e start --version`\n7. **Run the gn-check CI job locally.** CI runs `linux-gn-check`, `macos-gn-check` and `windows-gn-check` on every roll; a green build does not imply they pass. Run exactly what the job runs (see `.github/workflows/pipeline-segment-electron-gn-check.yml`), from the electron directory:\n    ```bash\n    npm run gn-check                          # `gn check` on electron targets against the current out dir\n    node script/gen-hunspell-filenames.js --check\n    node script/gen-libc++-filenames.js --check\n    node script/gen-siso-revision.js --check\n    node script/gen-filenames.mts --check\n    ```\n    - A `gn check` failure means a header is included from a target that is not in `deps` — fix `BUILD.gn`/`filenames.gni` (or the include) in Electron, then re-run. CI checks the `testing` and `release` graphs on all three platforms, so an include guarded by another platform's `BUILDFLAG` can still fail there; read the included header's `BUILD.gn` visibility/deps when the local check passes but CI does not.\n    - A `gen-*` `--check` failure means a derived list is stale: run the generator without `--check` and commit per Phase One step 5.\n8. Check if you have any pending changes in the Chromium repo by running `git status`\n    - If you have changes follow the instructions below in \"A. Patch Fixes\" to correctly commit those modifications into the appropriate patch file\n9. Final commit self-check: run `git log --format='%h %B'` over the commits this upgrade added (everything since the `chore: bump chromium in DEPS` commit) and verify that each upstream CL is referenced by exactly one non-fixup commit — full messages, not just titles, since `Ref:` lines live in commit bodies. If a CL appears in more than one non-fixup commit, consolidate with `git commit --fixup` + autosquash rebase per `references/phase-two-commit-guidelines.md`\n\n## Commands Reference\n\n| Command | Purpose |\n|---------|---------|\n| `e build -k 999 -- --quiet` | Build Electron, continue on errors, suppress status lines |\n| `e build -t {target}.o` | Build just one specific target to verify a fix |\n| `e build --no-remote -t {target}.o` | Same, built locally — use when the remote executor fails on toolchain/module inputs rather than on Electron code |\n| `e start --version` | Validate Electron launches after successful build |\n| `npm run gn-check` | `gn check` over Electron targets, as the gn-check CI job runs it |\n\n## Two Types of Build Fixes\n\n### A. Patch Fixes (for files in chromium_src or patched Chromium files)\n\nWhen the error is in a file that Electron patches (check with `grep -l \"filename\" patches/chromium/*.patch`):\n\n1. Edit the file in the Chromium source tree (e.g., `/src/chrome/browser/...`)\n2. Create a fixup commit targeting the original patch commit:\n    ```bash\n    cd ..  # to chromium repo\n    git add <modified-file>\n    git commit --fixup=<original-patch-commit-hash>\n    GIT_SEQUENCE_EDITOR=: git rebase --autosquash --autostash -i <commit>^\n    ```\n3. Export the updated patch: `e patches chromium`\n4. Commit the updated patch file following `references/phase-one-commit-guidelines.md`.\n\nTo find the original patch commit to fixup: `git log --oneline | grep -i \"keyword from patch name\"`\n\nThe base commit for rebase is the Chromium commit before patches were applied. Find it by checking the `refs/patches/upstream-head` ref.\n\n### B. Electron Code Fixes (for files in shell/, electron/, etc.)\n\nWhen the error is in Electron's own source code:\n\n1. Edit files directly in the electron repo\n2. Commit directly (no patch export needed)\n\n# Critical: Read Before Committing\n\n- Before ANY Phase One commits: Read `references/phase-one-commit-guidelines.md`\n- Before ANY Phase Two commits: Read `references/phase-two-commit-guidelines.md`\n\n# Skill Directory Structure\nThis skill has additional reference files in `references/`:\n- patch-analysis.md - How to analyze patch failures\n- phase-one-commit-guidelines.md - Commit format for Phase One\n- phase-two-commit-guidelines.md - Commit format for Phase Two\n\nRead these when referenced in the workflow steps.\n", "skills/electron-chromium-upgrade/references/patch-analysis.md": "# Analyzing Patch Failures\n\n## Investigation Steps\n\n1. **Read the patch file** at `patches/{target}/{patch_name}.patch`\n\n2. **Examine current state** of the file in Chromium at mentioned line numbers\n\n3. **Check recent upstream changes:**\n   ```bash\n   cd ..  # or relevant target repo\n   git log --oneline -10 -- {file}\n   ```\n\n4. **Find Chromium CL** in commit messages:\n   ```\n   Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/{CL_NUMBER}\n   ```\n\n## Critical: Resolve by Intent, Not by Mechanical Merge\n\nWhen resolving a patch conflict, do NOT blindly preserve the patch's old code. Instead:\n\n1. **Understand the upstream CL's full scope** — not just the conflicting hunk.\n   Run `git show <commit> --stat` and read diffs for all affected files.\n   Upstream may have removed structs, members, or methods that the patch\n   references in other hunks or files.\n\n2. **Re-read the patch commit message** to understand its *intent* — what\n   behavior does it need to preserve or add?\n\n3. **Implement the intent against the new upstream code.** If the patch's\n   purpose is \"add a feature flag guard\", add only the guard — don't also\n   restore old code inside the guard that upstream separately removed.\n\n### Lesson: Upstream Removals Break Patch References\n\n- **Trigger:** Patch conflict involves an upstream refactor (not just context drift)\n- **Strategy:** After identifying the upstream CL, check its full diff for\n  removed types, members, and methods. If the patch's old code references\n  something removed, the resolution must use the new upstream mechanism.\n- **Evidence:** An upstream CL removed a `HeadlessModeWindow` struct from a\n  header, but the conflict was only in a `.mm` file. Mechanically keeping the\n  patch's old line (`headless_mode_window_ = ...`) produced code referencing\n  a nonexistent type — caught only on review, not at patch-apply time.\n\n### Lesson: Separate Patch Purpose from Patch Implementation\n\n- **Trigger:** Conflict between \"upstream simplified code\" vs \"patch has older code\"\n- **Strategy:** Identify the *minimal* change the patch needs. If the patch\n  wraps code in a conditional, only add the conditional — don't restore old\n  code that was inside the conditional but was separately cleaned up upstream.\n- **Evidence:** An occlusion patch needed only a feature flag check, but the\n  old patch also contained a version check that upstream intentionally removed.\n  Mechanically preserving the old patch code re-added the removed check.\n\n### Lesson: Finish the Adaptation at Conflict Time\n\n- **Trigger:** A patch conflict involves an upstream API removal or replacement\n- **Strategy:** When resolving the conflict, fully adapt the patch to use the\n  new API in the same commit. Don't remove the old code and leave behind stale\n  references that will \"be fixed in Phase Two.\" Each patch fix commit should be\n  a complete resolution.\n- **Evidence:** A safestorage patch conflicted because Chromium removed Keychain V1.\n  The conflict was resolved by removing V1 hunks, but the remaining code still\n  called V1 methods (`FindGenericPassword` with 3 args, `ItemDelete` with\n  `SecKeychainItemRef`). These should have been adapted to V2 APIs in the same\n  commit, not deferred.\n\n## Common Failure Patterns\n\n| Pattern | Cause | Solution |\n|---------|-------|----------|\n| Context lines don't match | Surrounding code changed | Update context in patch |\n| File not found | File renamed/moved | Update patch target path |\n| Function not found | Refactored upstream | Find new function name |\n| `DCHECK` → `CHECK_IS_TEST` | Macro change | Update to new macro |\n| Deleted code | Feature removed | Verify patch still needed |\n\n## Using Git Blame\n\nTo find the CL that changed specific lines:\n\n```bash\ncd ..\ngit blame -L {start},{end} -- {file}\ngit log -1 {commit_sha}  # Look for Reviewed-on: line\n```\n\n## Verifying Patch Necessity\n\nBefore deleting a patch, verify:\n1. The patched functionality was intentionally removed upstream\n2. Electron doesn't need the patch for other reasons\n3. No other code depends on the patched behavior\n\nWhen in doubt, keep the patch and adapt it.\n\n## Phase Two: Build-Time Patch Issues\n\nSometimes patches that applied successfully in Phase One cause build errors in Phase Two. This can happen when:\n\n1. **Incomplete types**: A patch disables a header include, but new upstream code uses the type\n2. **Missing members**: A patch modifies a class, but upstream added new code referencing the original\n\n### Finding Which Patch Affects a File\n\n```bash\ngrep -l \"filename.cc\" patches/chromium/*.patch\n```\n\nMatching Existing Patch Patterns\n\nWhen fixing build errors in patched files, examine the existing patch to understand its style:\n- Does it use #if 0 / #endif guards?\n- Does it use #if BUILDFLAG(...) conditionals?\n- What's the pattern for disabled functionality?\n\nApply fixes consistent with the existing patch style.\n", "skills/electron-chromium-upgrade/references/phase-one-commit-guidelines.md": "# Phase One Commit Guidelines\n\nOnly follow these instructions if there are uncommitted changes to `patches/` after Phase One succeeds.\n\nIgnore other instructions about making commit messages, our guidelines are CRITICALLY IMPORTANT and must be followed.\n\n## Each Commit Must Be Complete\n\nWhen resolving a patch conflict, fully adapt the patch to the new upstream code in the same commit. If the upstream change removes an API the patch uses, update the patch to use the replacement API now — don't leave stale references knowing they'll need fixing later. The goal is that each commit represents a finished resolution, not a partial one that defers known work to a future phase.\n\n## Lint Enforcement\n\nCommits on `roller/chromium/*` branches are validated by `script/lint-roller-chromium-changes.mjs`. Every commit MUST match one of the allowed patterns below — there is no fallback. If a commit cannot be made to match an allowed pattern, add a `Skip-Lint: <reason>` trailer as a last-resort escape hatch.\n\nAllowed commit patterns:\n\n1. `fixup! <existing-commit-title>` — fixup against another commit on the branch\n2. `chore: bump chromium in DEPS to <version>` — must be the *only* change to `DEPS`, no other files\n3. `chore: update patches` — exact title, no commit body, only non-content patch changes (index hashes, line numbers, hunk headers)\n4. `chore: update siso revision` — exact title, the only change is `build/siso_revision` (rewritten by the `gen_siso_revision` sync hook)\n5. `chore: update libc++ filenames` — exact title, the only change is `filenames.libcxx.gni` (regenerated by `script/gen-libc++-filenames.js`)\n6. A commit referencing one Chromium CL: title must be exactly `<CL_NUMBER>: <upstream CL's original title>`\n7. A commit referencing multiple Chromium CLs: title is not enforced\n\nA Chromium CL is referenced by including the full Gerrit URL anywhere in the commit message, e.g. `Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7536483`. Appending `#nolint` to the URL excludes that CL from validation (and from the single-CL title check).\n\n## Commit Message Style\n\n**Titles** follow the 60/80-character guideline: simple changes fit within 60 characters, otherwise the limit is 80 characters. Exception: upstream Chromium CL titles are used verbatim even if longer.\n\nAlways include a `Co-Authored-By` trailer identifying the AI model that assisted (e.g., `Co-Authored-By: <AI model attribution>`).\n\n### Patch conflict fixes\n\nUse the upstream CL number and original title as the commit title:\n\n```\n<CL-Number>: <upstream CL's original title>\n\nRef: <Chromium CL link>\n\nCo-Authored-By: <AI model attribution>\n```\n\nUse the **upstream CL's original commit title** verbatim — do not paraphrase or rewrite it. To find it: `git log -1 --format=%s <chromium-commit-hash>`.\n\nFor a CL link in the format `https://chromium-review.googlesource.com/c/chromium/src/+/7536483` the `CL-Number` is `7536483`.\n\nOnly add a description body if it provides clarity beyond the title (e.g., when the patch adaptation is non-obvious). For straightforward context drift or simple API renames, the title + Ref is sufficient.\n\n### Upstreamed patch removal\n\nWhen patches are no longer needed (applied cleanly with \"already applied\" or confirmed upstreamed), group ALL removals into a single commit:\n\n```\nchore: remove upstreamed patches\n\nRef: <Chromium CL link for patch 1>\nRef: <Chromium CL link for patch 2>\n...\n\nCo-Authored-By: <AI model attribution>\n```\n\nIncluding multiple `Ref:` lines satisfies the linter (multi-CL commits skip the title format check). Extract each CL URL from the patch file's `Reviewed-on:` trailer (for cherry-picks) or by searching the upstream history (for non-cherry-pick patches).\n\nIf only one patch is being removed and you can identify its corresponding CL, prefer the single-CL format from \"Patch conflict fixes\" above so the commit conforms to the standard `<CL-Number>: <subject>` pattern. Fall back to `chore: remove upstreamed patches` (plural) only when grouping multiple removals.\n\n### Trivial patch updates\n\nAfter all fix commits, stage remaining trivial changes (index hashes, line numbers, context lines only):\n\n```bash\ngit add patches\ngit commit -m \"chore: update patches\"\n```\n\nThe commit message MUST be exactly `chore: update patches` — no qualifier, no body, no trailers. The linter rejects this commit if any patch file contains `+`/`-` content lines (lines that are not diff headers, hunk markers, or `index` lines).\n\n**Conflict resolution can produce trivial results.** A `git am` conflict doesn't always mean the patch content changed — context drift alone can cause a conflict. After resolving and exporting, inspect the patch diff: if only index hashes, line numbers, and context lines changed (not the patch's own `+`/`-` lines), it's trivial and belongs here, not in a `<CL-Number>: <subject>` commit.\n\n## Atomic Commits\n\nEach patch conflict fix gets its own commit with its own Ref — one commit per upstream CL.\n\nNever combine unrelated upstream CLs into one commit. Two CLs touching the same `.patch` file is NOT a relationship: when a single patch file contains hunks caused by different upstream CLs (e.g., a formatting CL and an API-removal CL that both drifted the same patch), stage per CL with `git add -p` and commit each CL's hunks separately, so each commit contains only the changes its own CL caused. Multiple `Ref:` lines in one commit are only for changes genuinely motivated by those CLs together (such as the grouped `chore: remove upstreamed patches` case above).\n\nIMPORTANT: Try really hard to find the CL reference per the instructions below. Each change you made should in theory have been in response to a change made in Chromium that you identified or can identify. Try for a while to identify and include the ref in the commit message. Do not give up easily.\n\n## Self-Contained Commits Help Bisecting (Advisory)\n\nMaintainers bisect rolls with build-tools' `e rcv`, which reconstructs intermediate\nChromium versions by cherry-picking this branch's commits, keyed on the Gerrit CL URL(s)\nin each commit message. Commits without a CL URL are skipped during reconstruction.\n\nThe preferences below make reconstructions more accurate. They are nice-to-haves, not\nrequirements — completing the roll always comes first:\n\n- Keep the `Ref:` on any commit that changes code or patch content. Reserve Ref-less\n  `chore: update patches` for metadata-only changes (index hashes, line numbers, hunk\n  headers).\n- When practical, fold a CL's patch-file fixes into that CL's own commit rather than a\n  later catch-all `chore: update patches` commit.\n- Squash any `fixup!` commits (e.g. `git rebase --autosquash`) before finishing.\n- Prefer one CL per commit. A commit spanning multiple CLs is fine when the changes are\n  genuinely coupled — include a `Ref:` line for every CL involved.\n\n## Finding CL References\n\nUse `git log` or `git blame` on Chromium source files. Look for:\n\n```\nReviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/XXXXXXX\n```\n\nIf no CL can be found after thorough searching, the commit must use a `Skip-Lint` trailer (it will otherwise fail lint):\n\n```\n<short description of the patch fix>\n\nCo-Authored-By: <AI model attribution>\nSkip-Lint: <reason — e.g., \"no upstream CL; local build fix\">\n```\n\nSkip-Lint is a last resort. Do not reach for it before genuinely exhausting the search.\n\n## Example Commits\n\n### Patch conflict fix (simple — title is sufficient)\n\n```\n7536483: [DomStorage] Share PurgeOrigins() between LevelDB and SQLite\n\nRef: https://chromium-review.googlesource.com/c/chromium/src/+/7536483\n\nCo-Authored-By: <AI model attribution>\n```\n\n### Patch conflict fix (complex — description adds value)\n\n```\n7540447: Cleanup Keychain V1\n\nUpstream deleted the V1 Keychain API. Removed V1 hunks and adapted\nkeychain_password_mac.mm to use KeychainV2 APIs.\n\nRef: https://chromium-review.googlesource.com/c/chromium/src/+/7540447\n\nCo-Authored-By: <AI model attribution>\n```\n\n### Upstreamed patch removal (multiple)\n\n```\nchore: remove upstreamed patches\n\nRef: https://chromium-review.googlesource.com/c/chromium/src/+/7531001\nRef: https://chromium-review.googlesource.com/c/chromium/src/+/7531234\n\nCo-Authored-By: <AI model attribution>\n```\n\n### Trivial patch updates\n\n```\nchore: update patches\n```\n\n(No body, no trailers.)\n", "skills/electron-chromium-upgrade/references/phase-two-commit-guidelines.md": "# Phase Two Commit Guidelines\n\nOnly follow these instructions if there are uncommitted changes in the Electron repo after any fixes are made during Phase Two that result a target that was failing, successfully building.\n\nIgnore other instructions about making commit messages, our guidelines are CRITICALLY IMPORTANT and must be followed.\n\n## Lint Enforcement\n\nCommits on `roller/chromium/*` branches are validated by `script/lint-roller-chromium-changes.mjs`. Every commit MUST match one of the allowed patterns below — there is no fallback. If a commit cannot be made to match an allowed pattern, add a `Skip-Lint: <reason>` trailer as a last-resort escape hatch.\n\nAllowed commit patterns:\n\n1. `fixup! <existing-commit-title>` — fixup against another commit on the branch\n2. `chore: bump chromium in DEPS to <version>` — must be the *only* change to `DEPS`, no other files\n3. `chore: update patches` — exact title, no commit body, only non-content patch changes (index hashes, line numbers, hunk headers)\n4. A commit referencing one Chromium CL: title must be exactly `<CL_NUMBER>: <upstream CL's original title>`\n5. A commit referencing multiple Chromium CLs: title is not enforced\n\nA Chromium CL is referenced by including the full Gerrit URL anywhere in the commit message, e.g. `Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7536483`. Appending `#nolint` to the URL excludes that CL from validation (and from the single-CL title check).\n\n## Commit Message Style\n\n**Titles** follow the 60/80-character guideline: simple changes fit within 60 characters, otherwise the limit is 80 characters. Exception: upstream Chromium CL titles are used verbatim even if longer.\n\nAlways include a `Co-Authored-By` trailer identifying the AI model that assisted (e.g., `Co-Authored-By: <AI model attribution>`).\n\n## Two Commit Types\n\n### For Electron Source Changes (shell/, electron/, etc.)\n\n```\n{CL-Number}: {upstream CL's original title}\n\nRef: {Chromium CL link}\n\nCo-Authored-By: <AI model attribution>\n```\n\nUse the **upstream CL's original commit title** — do not paraphrase or rewrite it. To find it: `git log -1 --format=%s <chromium-commit-hash>`.\n\nOnly add a description body if it provides clarity beyond what the title already says (e.g., when Electron's adaptation is non-obvious). For simple renames, method additions, or straightforward API updates, the title + Ref link is sufficient.\n\nEach change should have its own commit and its own Ref. Logically group into commits that make sense rather than one giant commit. Include multiple \"Ref\" links in one commit only when the changes are genuinely one inseparable adaptation motivated by those CLs together — never combine unrelated CLs into a single commit.\n\n**Check for an existing commit first — one commit per CL for the whole upgrade.** Before creating a `{CL-Number}: {title}` commit, check whether a commit referencing that CL already exists on the branch:\n\n```bash\ngit log --oneline --grep={CL-Number}\n```\n\nA commit for the same CL may already exist from Phase One (e.g., a patch fix for the same upstream change), from an earlier build-fix iteration, or from before a context compaction. If one exists, do NOT create a second commit with the same Ref — fold the new changes into the existing commit:\n\n```bash\ngit add <files>\ngit commit --fixup=<existing-commit-hash>\nGIT_SEQUENCE_EDITOR=: git rebase --autosquash -i <existing-commit-hash>^\n```\n\nIf the autosquash rebase hits conflicts, run `git rebase --abort` and keep the `fixup! ...` commit as-is — the linter allows it (pattern 1) and it keeps the pairing visible to reviewers.\n\nFor a CL link in the format `https://chromium-review.googlesource.com/c/chromium/src/+/2958369` the \"CL-Number\" is `2958369`.\n\nIMPORTANT: Try really hard to find the CL reference. Each change you made should in theory have been in response to a change in Chromium. Do not give up easily.\n\n### For Patch Updates (patches/chromium/*.patch)\n\nUse the same fixup workflow as Phase One and follow `references/phase-one-commit-guidelines.md` for the commit message format (`<CL-Number>: <upstream CL's original title>`).\n\n## Dependent Patch Header Updates\n\nAfter any patch modification, check for other affected patches:\n\n```bash\ngit status\n# If other .patch files show as modified with only index, line number, and context changes:\ngit add patches/\ngit commit -m \"chore: update patches\"\n```\n\nThe commit message MUST be exactly `chore: update patches` — no qualifier, no body, no trailers. The linter rejects this commit if any patch file contains `+`/`-` content lines (lines that are not diff headers, hunk markers, or `index` lines).\n\n\n### Required Patterns\n\nTo pass the linter, use specific Chromium CL formats instead of generic titles:\n- ✅ `7865783: Remove CookiePartitionKeyCollection::Todo()` (instead of generic \"fix build\")\n- ✅ `7860920: [GlowUp] Create rounded components/vector_icons/ icons` (instead of generic \"fix patches\")\n- ✅ `chore: update patches` (exactly these words, no body allowed, for metadata-only patch updates)\n\n## Self-Contained Commits Help Bisecting (Advisory)\n\nMaintainers bisect rolls with build-tools' `e rcv`, which reconstructs intermediate\nChromium versions by cherry-picking this branch's commits, keyed on the Gerrit CL URL(s)\nin each commit message. Commits without a CL URL are skipped during reconstruction.\n\nThe preferences below make reconstructions more accurate. They are nice-to-haves, not\nrequirements — completing the roll always comes first:\n\n- Keep the `Ref:` on any commit that changes code or patch content. Reserve Ref-less\n  `chore: update patches` for metadata-only changes (index hashes, line numbers, hunk\n  headers).\n- When practical, fold a CL's patch-file fixes into that CL's own commit rather than a\n  later catch-all `chore: update patches` commit.\n- Squash any `fixup!` commits (e.g. `git rebase --autosquash`) before finishing.\n- Prefer one CL per commit. A commit spanning multiple CLs is fine when the changes are\n  genuinely coupled — include a `Ref:` line for every CL involved.\n\n## Finding CL References\n\nUse git log or git blame on Chromium source files. Look for:\n\n```\nReviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/XXXXXXX\n```\n\nIf no CL can be found after thorough searching, the commit must use a `Skip-Lint` trailer (it will otherwise fail lint):\n\n```\n<short description of the change>\n\nCo-Authored-By: <AI model attribution>\nSkip-Lint: <reason — e.g., \"no upstream CL; local build fix\">\n```\n\nSkip-Lint is a last resort. Do not reach for it before genuinely exhausting the search.\n\n## Example Commits\n\n### Electron Source Fix (simple — title is self-explanatory)\n\n```\n7535923: Rename ozone buildflags\n\nRef: https://chromium-review.googlesource.com/c/chromium/src/+/7535923\n\nCo-Authored-By: <AI model attribution>\n```\n\n### Electron Source Fix (complex — description adds value)\n\n```\n7534194: Convert some functions in ui::Clipboard to async\n\nAdapted ExtractCustomPlatformNames calls to use RunLoop pattern\nconsistent with existing ReadImage implementation, since upstream\nconverted the API from synchronous return to callback-based.\n\nRef: https://chromium-review.googlesource.com/c/chromium/src/+/7534194\n\nCo-Authored-By: <AI model attribution>\n```\n", "skills/electron-node-upgrade/SKILL.md": "---\nname: electron-node-upgrade\ndescription: Guide for performing Node.js version upgrades in the Electron project. Use when working on the roller/node/main branch to fix patch conflicts during `e sync --3`. Covers the patch application workflow, conflict resolution, analyzing upstream Node.js changes, building, running the Node.js test suite, and proper commit formatting for patch fixes.\n---\n\n# Electron Node.js Upgrade: Phase One\n\n## Summary\n\nRun `e sync --3` repeatedly, fixing patch conflicts as they arise, until it succeeds. Then export patches and commit changes atomically.\n\n## Success Criteria\n\nPhase One is complete when:\n- `e sync --3` exits with code 0 (no patch failures)\n- All changes are committed per the commit guidelines\n\nDo not stop until these criteria are met.\n\n**CRITICAL** Do not delete or skip patches unless 100% certain the patch is no longer needed. For major version upgrades, patches that shim deprecated V8 APIs or backport upstream changes are often deletable because the new Node.js version already incorporates them — but verify before removing. 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.\n\n**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.\n\n## Context\n\nThe `roller/node/main` branch is created by automation to update Electron's Node.js dependency version in `DEPS`. No work has been done to handle breaking changes between the old and new versions.\n\nThere are two types of Node.js version updates:\n- **Bumps** (patch/minor): Automated by `electron-roller[bot]` with commit title `chore: bump node to v{version}`. Trivial patch index updates are handled automatically by `patchup[bot]`. These often land cleanly, but may require manual patch fixes.\n- **Major upgrades** (e.g., v22 → v24): Manual, large PRs with commit title `chore: upgrade Node.js to v{X}.{Y}.{Z}`. These typically involve deleting obsolete patches, adapting many others, and updating `@types/node` in `package.json`.\n\n**Key directories:**\n- Current directory: Electron repo (always run `e` commands here)\n- `../third_party/electron_node`: Node.js repo (where patches apply)\n- `patches/node/`: Patch files for Node.js\n- `docs/development/patches.md`: Patch system documentation\n\n## Pre-flight Checks\n\nRun these once at the start of each upgrade session:\n\n1. **Clear rerere cache** (if enabled): `git rerere clear` in both the electron and `../third_party/electron_node` repos. Stale recorded resolutions from a prior attempt can silently apply wrong merges.\n2. **Ensure pre-commit hooks are installed**: Check that `.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.\n3. **Look for the same roll on other branches**: fetch `roller/node/main` and any sibling `roller/node/{N}-x-y` branch for the same Node.js version. If they already carry fixes, reuse them verbatim (patch names, content, commit titles, `Ref:` lines) rather than re-deriving them. See \"Reuse Fixes From Sibling Roller Branches\" in `references/phase-one-commit-guidelines.md`.\n\n## Workflow\n\n1. Run `e sync --3` (the `--3` flag enables 3-way merge, always required)\n2. If succeeds → skip to step 5\n3. If patch fails:\n   - Identify target repo and patch from error output\n   - Analyze failure (see references/patch-analysis.md)\n   - Fix conflict in `../third_party/electron_node` working directory\n   - Run `git am --continue` in `../third_party/electron_node`\n   - Repeat until all patches for that repo apply\n   - IMPORTANT: Once `git am --continue` succeeds you MUST run `e patches node` to export fixes\n   - Return to step 1\n4. When `e sync --3` succeeds, run `e patches all`\n5. **Read `references/phase-one-commit-guidelines.md` NOW**, then commit changes following those instructions exactly.\n\n## Commands Reference\n\n| Command | Purpose |\n|---------|---------|\n| `e sync --3` | Clone deps and apply patches with 3-way merge |\n| `git am --continue` | Continue after resolving conflict (run in node repo) |\n| `e patches node` | Export commits from node repo to patch files |\n| `e patches all` | Export all patches from all targets |\n| `e patches node --commit-updates` | Export patches and auto-commit trivial changes |\n| `e patches --list-targets` | List targets and config paths |\n\n## Patch System Mental Model\n\n```\npatches/node/*.patch  →  [e sync --3]  →  ../third_party/electron_node commits\n                      ←  [e patches]   ←\n```\n\n## When to Edit Patches\n\n| Situation | Action |\n|-----------|--------|\n| During active `git am` conflict | Fix in node repo, then `git am --continue` |\n| Modifying patch outside conflict | Edit `.patch` file directly |\n| Creating new patch (rare, avoid) | Commit in node repo, then `e patches node` |\n\nFix existing patches 99% of the time rather than creating new ones.\n\n## Patch Fixing Rules\n\n1. **Preserve authorship**: Keep original author in TODO comments (from patch `From:` field)\n2. **Never change TODO assignees**: `TODO(name)` must retain original name\n3. **Update descriptions**: If upstream changed APIs or macros, update patch commit message to reflect current state\n4. **Never skip-and-recreate a patch**: If `git 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.\n\n# Electron Node.js Upgrade: Phase Two\n\n## Summary\n\nRun `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.\n\nRun Phase Two immediately after Phase One is complete.\n\n## Success Criteria\n\nPhase Two is complete when:\n- `e build -k 999 -- --quiet` exits with code 0 (no build failures)\n- `e start --version` has been run to check Electron launches\n- All changes are committed per the commit guidelines\n\nDo 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.\n\n## Context\n\nThe `roller/node/main` branch is created by automation to update Electron's Node.js dependency version in `DEPS`. No work has been done to handle breaking changes between the old and new versions. Node.js APIs (especially internal V8 integration, OpenSSL/BoringSSL compatibility, and build system files) frequently change between versions. In every case the code in Electron must be updated to account for the change in Node.js, strongly avoid making changes to the code in Node.js to fix Electron's build.\n\n**Key directories:**\n- Current directory: Electron repo (always run `e` commands here)\n- `../third_party/electron_node`: Node.js repo (do not touch this code to fix build issues, just read it to obtain context)\n\n## Workflow\n\n1. Run `e build -k 999 -- --quiet` (the `--quiet` flag suppresses per-target status lines, showing only errors and the final result)\n2. If succeeds → skip to step 6\n3. If build fails:\n    - Identify underlying file in \"electron\" from the compilation error message\n    - Analyze failure\n    - Fix build issue by adapting Electron's code for the change in Node.js\n    - Run `e build -t {target_that_failed}.o` to build just the failed target we were specifically fixing\n        - You can identify the target_that_failed from the failure line in the build log. E.g. `FAILED: 2e506007-8d5d-4f38-bdd1-b5cd77999a77 \"./obj/electron/shell/browser/api/electron_api_utility_process.o\" CXX obj/electron/shell/browser/api/electron_api_utility_process.o` the target name is `obj/electron/shell/browser/api/electron_api_utility_process.o`\n    - **Read `references/phase-two-commit-guidelines.md` NOW**, then commit changes following those instructions exactly.\n    - Return to step 1\n4. **CRITICAL**: After ANY commit (especially patch commits), immediately run `git status` in the electron repo\n    - Look for other modified `.patch` files that only have index/hunk header changes\n    - These are dependent patches affected by your fix\n    - Commit them immediately with: `git commit -am \"chore: update patches (trivial only)\"`\n5. Return to step 1\n6. When `e build` succeeds, run `e start --version`\n7. Check if you have any pending changes in the Node.js repo by running `git status` in `../third_party/electron_node`\n    - If you have changes follow the instructions below in \"A. Patch Fixes\" to correctly commit those modifications into the appropriate patch file\n\n## Commands Reference\n\n| Command | Purpose |\n|---------|---------|\n| `e build -k 999 -- --quiet` | Build Electron, continue on errors, suppress status lines |\n| `e build -t {target}.o` | Build just one specific target to verify a fix |\n| `e start --version` | Validate Electron launches after successful build |\n\n## Two Types of Build Fixes\n\n### A. Patch Fixes (for files in patched Node.js files)\n\nWhen the error is in a file that Electron patches (check with `grep -l \"filename\" patches/node/*.patch`):\n\n1. Edit the file in the Node.js source tree (`../third_party/electron_node/...`)\n2. Create a fixup commit targeting the original patch commit:\n    ```bash\n    cd ../third_party/electron_node\n    git add <modified-file>\n    git commit --fixup=<original-patch-commit-hash>\n    GIT_SEQUENCE_EDITOR=: git rebase --autosquash --autostash -i <commit>^\n    ```\n3. Export the updated patch: `e patches node`\n4. Commit the updated patch file following `references/phase-one-commit-guidelines.md`.\n\nTo find the original patch commit to fixup: `git log --oneline | grep -i \"keyword from patch name\"`\n\nThe base commit for rebase is the Node.js commit before patches were applied. Find it by checking the `refs/patches/upstream-head` ref.\n\n### B. Electron Code Fixes (for files in shell/, electron/, etc.)\n\nWhen the error is in Electron's own source code:\n\n1. Edit files directly in the electron repo\n2. Commit directly (no patch export needed)\n\n# Electron Node.js Upgrade: Phase Three\n\n## Summary\n\nRun the Node.js test suite via `script/node-spec-runner.js`, fix failing tests, and commit fixes until all tests pass. Certain tests are permanently disabled (listed in `script/node-disabled-tests.json`) and should not be run.\n\nRun Phase Three immediately after Phase Two is complete.\n\n## Success Criteria\n\nPhase Three is complete when:\n- `node script/node-spec-runner.js --default` exits with zero failures\n- All changes are committed per the commit guidelines\n\nDo not stop until these criteria are met.\n\n## Context\n\nElectron runs a subset of Node.js's upstream test suite using a custom runner (`script/node-spec-runner.js`). Tests are executed with the built Electron binary via `ELECTRON_RUN_AS_NODE=true`. Many tests need adaptation because Electron uses BoringSSL (not OpenSSL) and Chromium's V8 (which may differ from Node.js's bundled V8).\n\n**Key files:**\n- `script/node-spec-runner.js` — Test runner script\n- `script/node-disabled-tests.json` — Permanently disabled tests (do not try to fix these)\n- `../third_party/electron_node/test/` — Node.js test files (where patches apply)\n- `patches/node/fix_crypto_tests_to_run_with_bssl.patch` — BoringSSL crypto test adaptations\n- `patches/node/test_formally_mark_some_tests_as_flaky.patch` — Flaky test list\n\n## Workflow\n\n1. Run `node script/node-spec-runner.js --default` from the electron repo\n2. If all tests pass → Phase Three is complete\n3. If tests fail:\n    - Identify the failing test file(s) from the output\n    - Analyze each failure (see \"Common Failure Patterns\" below)\n    - Fix the test in `../third_party/electron_node/test/...`\n    - Re-run the specific failing test to verify: `node script/node-spec-runner.js {test-path}`\n        - The test path is relative to the node `test/` directory, e.g. `test/parallel/test-crypto-key-objects-raw.js`\n        - Do NOT use `--default` when running specific tests — it adds the full suite flags\n        - Do NOT run tests directly with `ELECTRON_RUN_AS_NODE` — the runner handles environment setup (e.g. temporarily switching `package.json` from ESM to CommonJS)\n    - Commit the fix using the fixup workflow and commit guidelines\n    - Return to step 1\n\n## Commands Reference\n\n| Command | Purpose |\n|---------|---------|\n| `node script/node-spec-runner.js --default` | Run full Node.js test suite |\n| `node script/node-spec-runner.js test/parallel/test-foo.js` | Run a single test |\n| `NODE_REGENERATE_SNAPSHOTS=1 node script/node-spec-runner.js test/test-runner/test-foo.mjs` | Regenerate snapshot for a snapshot-based test |\n\n## Common Failure Patterns\n\n### BoringSSL incompatibilities\n\nElectron builds Node.js against Chromium's BoringSSL instead of Node.js's bundled OpenSSL. As of the v24.18.0 roll this is wired up through a GN arg rather than large source patches:\n\n```gn\n# build/args/all.gn\n# Build Node.js against Chromium's BoringSSL instead of node's bundled OpenSSL.\nnode_openssl_path = \"//third_party/boringssl\"\n```\n\nUpstream Node.js now supports building against BoringSSL natively (see nodejs/node commits `677ca7e76c9` and `61b20f60a39`), so most of Electron's historical BoringSSL workarounds have been **eliminated**. During the v24.18.0 roll:\n\n- `fix_crypto_tests_to_run_with_bssl.patch` shrank from ~1100 lines to skipping just two test files.\n- `fix_handle_boringssl_and_openssl_incompatibilities.patch` dropped ~176 lines. What remains is C++-level shimming in `deps/ncrypto/ncrypto.cc`, `src/crypto/crypto_{common,context,hash}.cc`, `src/env.h`, `src/node_metadata.h`, and `src/node_options.h`.\n\nExpect to **delete** these workarounds over time rather than grow them. Only add a guard when a feature is genuinely still missing from BoringSSL; upstream tests increasingly self-skip when `process.features.openssl_is_boringssl` is set, so no Electron change is needed.\n\n**Preferred guard for a still-unsupported feature** — skip the whole test file at the top, and add it to `fix_crypto_tests_to_run_with_bssl.patch`:\n\n```js\nif (process.features.openssl_is_boringssl) {\n  common.skip('Skipping unsupported ML-DSA key tests');\n}\n```\n\nFor tests that can't be cleanly guarded inline, add the whole file to `script/node-disabled-tests.json` instead.\n\n**Still unsupported in Chromium's BoringSSL** (as of v24.18.0):\n\n| Feature | Current handling |\n|---------|------------------|\n| RSA-PSS keygen (deprecation path) | file-level `common.skip` in `test-crypto-keygen-deprecation` |\n| ML-DSA keys | file-level `common.skip` in `test-crypto-pqc-key-objects-ml-dsa` |\n| ML-KEM keys | disabled in `node-disabled-tests.json` (`test-crypto-pqc-key-objects-ml-kem`) |\n| FIPS mode | disabled (`test-crypto-fips`) |\n| Secure heap | disabled (`test-crypto-secure-heap`) |\n| Stateless DH | disabled (`test-crypto-dh-stateless`) |\n| Assorted keygen / WebCrypto keygen | disabled (`test-crypto-keygen`, `test-webcrypto-keygen`, `wpt/test-webcrypto`) |\n\n**Behavioral differences (assertion updates, not skips)** — some errors just changed shape:\n\n- Creating a private key from an unsupported OKP (Ed448) JWK now throws `Invalid JWK OKP key` (previously `Invalid JWK data`); see nodejs/node#62499. Electron's `spec/node.spec.ts` assertion was loosened to `/Invalid JWK/`.\n\nWhen you do need to guard a test, prefer a precise capability check (e.g. `ciphers.includes('aes-128-ccm')`) over a blanket `process.features.openssl_is_boringssl` check where the feature can be probed directly.\n\n### Snapshot test mismatches\n\nSome tests compare output against committed `.snapshot` files using `assert.strictEqual` — these are NOT wildcard comparisons. When Chromium's V8 produces different output (e.g. different stack traces due to V8 enhancements), the snapshot must be regenerated:\n\n```bash\nNODE_REGENERATE_SNAPSHOTS=1 node script/node-spec-runner.js test/test-runner/test-foo.mjs\n```\n\nThen inspect the diff to verify the changes are expected, and commit the updated snapshot into the appropriate patch.\n\n### V8 behavioral differences\n\nChromium's V8 may be ahead of Node.js's bundled V8. This can cause:\n- Different stack trace formats (e.g. thenable async stack frames)\n- Different error messages\n- Features available in Chromium V8 that aren't in stock Node.js V8 (or vice versa)\n\n## Two Types of Test Fixes\n\n### A. Patch Fixes (most common for test failures)\n\nMost test fixes go into existing patches in `patches/node/`. Use the fixup workflow:\n\n1. Edit the test file in `../third_party/electron_node/test/...`\n2. Find the relevant patch commit: `git log --oneline | grep -i \"keyword\"`\n    - Crypto/BoringSSL tests → `fix crypto tests to run with bssl`\n    - Snapshot tests → the specific snapshot patch (e.g. `test: accomodate V8 thenable`)\n    - Flaky tests → `test: formally mark some tests as flaky`\n3. Create a fixup commit:\n    ```bash\n    cd ../third_party/electron_node\n    git add test/path/to/test.js\n    git commit --fixup=<patch-commit-hash>\n    GIT_SEQUENCE_EDITOR=: git rebase --autosquash --autostash -i <commit>^\n    ```\n4. Export: `e patches node`\n5. **Read `references/phase-three-commit-guidelines.md` NOW**, then commit the updated patch file.\n\n### B. New Patches (rare)\n\nOnly create a new patch when the fix doesn't belong in any existing patch. The new patch commit in `../third_party/electron_node` must include a description explaining why the patch exists and when it can be removed — the lint check enforces this.\n\n## Adding to Disabled Tests\n\nOnly add a test to `script/node-disabled-tests.json` as a **last resort** — when the test is fundamentally incompatible with Electron's architecture (not just a BoringSSL difference that can be guarded). Tests disabled here are completely skipped and never run.\n\n# Critical: Read Before Committing\n\n- Before ANY Phase One commits: Read `references/phase-one-commit-guidelines.md`\n- Before ANY Phase Two commits: Read `references/phase-two-commit-guidelines.md`\n- Before ANY Phase Three commits: Read `references/phase-three-commit-guidelines.md`\n\n# High-Churn Patches\n\nThese patches consistently require the most work during Node.js upgrades:\n\n- **`fix_handle_boringssl_and_openssl_incompatibilities.patch`** — Electron uses BoringSSL (via Chromium) while Node.js expects OpenSSL. Historically large and complex, this patch was **greatly reduced** once Node.js gained native BoringSSL support (enabled via `node_openssl_path = \"//third_party/boringssl\"` in `build/args/all.gn`). It still shims some C++-level differences, and upstream OpenSSL/ncrypto API changes can break it.\n- **`fix_crypto_tests_to_run_with_bssl.patch`** — Companion to the above; adapts Node.js crypto tests for BoringSSL. Also **greatly reduced** now that upstream tests self-skip under BoringSSL — it mainly skips a handful of still-unsupported test files. See the \"BoringSSL incompatibilities\" section above.\n- **`support_v8_sandboxed_pointers.patch`** — V8 sandbox pointer support requires careful adaptation when V8 APIs change.\n- **`build_add_gn_build_files.patch`** — The GN build file patch is large and touches many build targets. Upstream build system changes frequently conflict.\n\n# Major Version Upgrades\n\nMajor Node.js version transitions (e.g., v22 → v24) are significantly more involved than patch bumps:\n\n1. **Expect patch deletions.** Electron uses Chromium's V8, which is often ahead of the V8 version bundled in Node.js. Many patches exist to bridge this gap — shimming newer V8 APIs that Chromium's V8 has but Node.js' older V8 doesn't. When Node.js bumps to a newer major version, its V8 catches up to Chromium's, and those bridge patches can be deleted. In the v22 → v24 upgrade, 17 patches were deleted for this reason.\n2. **Update `@types/node`** in `package.json` to match the new major version.\n3. **Post-upgrade regressions are expected.** Even after the upgrade lands, follow-up fix PRs for edge cases (ESM path handling, certificate loading, platform-specific issues) are normal.\n\n# Skill Directory Structure\nThis skill has additional reference files in `references/`:\n- patch-analysis.md - How to analyze patch failures\n- phase-one-commit-guidelines.md - Commit format for Phase One\n- phase-two-commit-guidelines.md - Commit format for Phase Two\n- phase-three-commit-guidelines.md - Commit format for Phase Three\n\nRead these when referenced in the workflow steps.\n", "skills/electron-node-upgrade/references/patch-analysis.md": "# Analyzing Patch Failures\n\n## Investigation Steps\n\n1. **Read the patch file** at `patches/node/{patch_name}.patch`\n\n2. **Examine current state** of the file in the Node.js repo at mentioned line numbers\n\n3. **Check recent upstream changes** to orient yourself:\n   ```bash\n   cd ../third_party/electron_node\n   git log --oneline -10 -- {file}\n   ```\n   This list tells you what has been happening in the file. It does not tell you which commit to cite; see [Finding the Upstream Commit for a Change](#finding-the-upstream-commit-for-a-change).\n\n4. **Find the introducing commit and its Node.js PR** in its commit message:\n   ```\n   PR-URL: https://github.com/nodejs/node/pull/{PR_NUMBER}\n   ```\n\n## Critical: Resolve by Intent, Not by Mechanical Merge\n\nWhen resolving a patch conflict, do NOT blindly preserve the patch's old code. Instead:\n\n1. **Understand the upstream commit's full scope** — not just the conflicting hunk.\n   Run `git show <commit> --stat` and read diffs for all affected files.\n   Upstream may have removed structs, members, or methods that the patch\n   references in other hunks or files.\n\n2. **Re-read the patch commit message** to understand its *intent* — what\n   behavior does it need to preserve or add?\n\n3. **Implement the intent against the new upstream code.** If the patch's\n   purpose is \"add BoringSSL compatibility\", add only the compatibility\n   layer — don't also restore old code that upstream separately removed.\n\n### Lesson: Upstream Removals Break Patch References\n\n- **Trigger:** Patch conflict involves an upstream refactor (not just context drift)\n- **Strategy:** After identifying the upstream commit, check its full diff for\n  removed types, members, and methods. If the patch's old code references\n  something removed, the resolution must use the new upstream mechanism.\n\n### Lesson: Separate Patch Purpose from Patch Implementation\n\n- **Trigger:** Conflict between \"upstream simplified code\" vs \"patch has older code\"\n- **Strategy:** Identify the *minimal* change the patch needs. If the patch\n  wraps code in a conditional, only add the conditional — don't restore old\n  code that was inside the conditional but was separately cleaned up upstream.\n\n### Lesson: Finish the Adaptation at Conflict Time\n\n- **Trigger:** A patch conflict involves an upstream API removal or replacement\n- **Strategy:** When resolving the conflict, fully adapt the patch to use the\n  new API in the same commit. Don't remove the old code and leave behind stale\n  references that will \"be fixed in Phase Two.\" Each patch fix commit should be\n  a complete resolution.\n\n## Common Failure Patterns\n\n| Pattern | Cause | Solution |\n|---------|-------|----------|\n| Context lines don't match | Surrounding code changed | Update context in patch |\n| File not found | File renamed/moved | Update patch target path |\n| Function not found | Refactored upstream | Find new function name |\n| OpenSSL → BoringSSL mismatch | Crypto API change | Update to BoringSSL-compatible API |\n| GYP/GN build change | Build system refactor | Adapt build patch to new structure |\n| Deleted code | Feature removed | Verify patch still needed |\n| V8 API bridge patch conflicts | Node.js caught up to Chromium's V8 | Patch may be deletable — verify the API is now in Node.js' V8 natively |\n\n## Finding the Upstream Commit for a Change\n\nAttribute a fix to the commit that introduced the code it responds to, never to the commit that most recently touched the file. Work against `refs/patches/upstream-head` (the unpatched Node.js commit) so the answer is an upstream commit and not one of Electron's own patches.\n\n```bash\ncd ../third_party/electron_node\n# by symbol: the commit that added or removed it\ngit log -S'{symbol}' refs/patches/upstream-head -- {file}\n# by lines: the commit that last wrote them\ngit blame -L {start},{end} refs/patches/upstream-head -- {file}\n# verify: the candidate's diff must contain the symbol\ngit show {commit_sha} -- {file} | grep -n '{symbol}'\ngit log -1 {commit_sha}  # Look for the PR-URL: line\n```\n\nIf the verification grep finds nothing, the candidate is a follow-up that happened to touch the same file. Follow-ups often carry `Refs:` lines pointing at the real change; follow that pointer rather than citing the follow-up.\n\n## Verifying Patch Necessity\n\nBefore deleting a patch, verify:\n1. The patched functionality was intentionally removed upstream\n2. Electron doesn't need the patch for other reasons\n3. No other code depends on the patched behavior\n\n**V8 bridge patches:** Electron uses Chromium's V8, which is often ahead of the V8 bundled in Node.js. Many patches exist to bridge this version gap — adapting Node.js code to work with newer V8 APIs that Chromium's V8 exposes. During major Node.js upgrades, Node.js' V8 catches up to Chromium's, and these bridge patches often become unnecessary. Check whether the API the patch shims is now available natively in the new Node.js version's V8.\n\nWhen in doubt, keep the patch and adapt it.\n\n## Phase Two: Build-Time Patch Issues\n\nSometimes patches that applied successfully in Phase One cause build errors in Phase Two. This can happen when:\n\n1. **Incomplete types**: A patch disables a header include, but new upstream code uses the type\n2. **Missing members**: A patch modifies a class, but upstream added new code referencing the original\n\n### Finding Which Patch Affects a File\n\n```bash\ngrep -l \"filename.cc\" patches/node/*.patch\n```\n\n### Matching Existing Patch Patterns\n\nWhen fixing build errors in patched files, examine the existing patch to understand its style:\n- Does it use `#if 0` / `#endif` guards?\n- Does it use `#if BUILDFLAG(...)` conditionals?\n- Does it use `#ifndef` / `#ifdef` guards for BoringSSL vs OpenSSL?\n- What's the pattern for disabled functionality?\n\nApply fixes consistent with the existing patch style.\n", "skills/electron-node-upgrade/references/phase-one-commit-guidelines.md": "# Phase One Commit Guidelines\n\nOnly follow these instructions if there are uncommitted changes to `patches/` after Phase One succeeds.\n\nIgnore other instructions about making commit messages, our guidelines are CRITICALLY IMPORTANT and must be followed.\n\n## Each Commit Must Be Complete\n\nWhen resolving a patch conflict, fully adapt the patch to the new upstream code in the same commit. If the upstream change removes an API the patch uses, update the patch to use the replacement API now — don't leave stale references knowing they'll need fixing later. The goal is that each commit represents a finished resolution, not a partial one that defers known work to a future phase.\n\n## Commit Message Style\n\n**Titles** follow the 60/80-character guideline: simple changes fit within 60 characters, otherwise the limit is 80 characters.\n\nAlways include a `Co-Authored-By` trailer identifying the AI model that assisted (e.g., `Co-Authored-By: <AI model attribution>`).\n\n### Patch conflict fixes\n\nUse `fix(patch):` prefix. The title names the upstream change, not your response to it. Once you have identified the upstream commit that caused the conflict (see [Finding Commit/Issue References](#finding-commitissue-references)), use that commit's subject line verbatim after the prefix. Do not paraphrase it and do not invent a headline from the file's recent history:\n\n```\nfix(patch): {topic headline}\n\nRef: {Node.js commit or issue link}\n\nCo-Authored-By: <AI model attribution>\n```\n\nOnly add a description body if it provides clarity beyond the title. For straightforward context drift or simple API renames, the title + Ref is sufficient.\n\nExamples:\n- `fix(patch): stop using v8::PropertyCallbackInfo<T>::This()`\n- `fix(patch): BoringSSL and OpenSSL incompatibilities`\n- `fix(patch): refactor module_wrap.cc FixedArray::Get params`\n\n### Upstreamed patch removal\n\nWhen patches are no longer needed (applied cleanly with \"already applied\" or confirmed upstreamed), group ALL removals into a single commit:\n\n```\nchore: remove upstreamed patch\n```\n\nor (if multiple):\n\n```\nchore: remove upstreamed patches\n```\n\nMost Node.js patches in Electron are Electron-authored (no upstream `PR-URL:`). If the patch originated from an upstream Node.js PR, no extra `Ref:` is needed. Otherwise, add a `Ref:` pointing to the relevant Node.js issue or commit if one exists.\n\n### Trivial patch updates\n\nAfter all fix commits, stage remaining trivial changes (index, line numbers, context only):\n\n```bash\ngit add patches\ngit commit -m \"chore: update patches (trivial only)\"\n```\n\n**Conflict resolution can produce trivial results.** A `git am` conflict doesn't always mean the patch content changed — context drift alone can cause a conflict. After resolving and exporting, inspect the patch diff: if only index hashes, line numbers, and context lines changed (not the patch's own `+`/`-` lines), it's trivial and belongs here, not in a `fix(patch):` commit.\n\n## Atomic Commits\n\nEach patch conflict fix gets its own commit with its own Ref.\n\nIMPORTANT: Try really hard to find the PR or commit reference per the instructions below. Each change you made should in theory have been in response to a change made in Node.js that you identified or can identify. Try for a while to identify and include the ref in the commit message. Do not give up easily.\n\n## Reuse Fixes From Sibling Roller Branches\n\nThe same Node.js version is usually rolled to `main` and to every supported release branch at about the same time, and the fixes are nearly always identical. Before writing a fix, check whether it already exists:\n\n```bash\ngit fetch https://github.com/electron/electron.git roller/node/main\ngit log --oneline HEAD..FETCH_HEAD -- patches/node/ filenames.auto.gni\n```\n\nAlso check the sibling `roller/node/{N}-x-y` branches for the same version. If a matching fix exists, reuse it: same patch file name, same patch content, same commit title and `Ref:`. Cherry-pick the commit when it applies cleanly. Diverge only when the code on your branch genuinely differs, and say so in the commit body. Two branches carrying the same fix under different file names or different attributions is a review blocker.\n\n## Finding Commit/Issue References\n\nThe `Ref:` must point at the upstream commit that *introduced* the code your fix responds to, not at whichever commit most recently touched the file. Recency queries such as `git log -10 -- {file}` are for orientation only; several later commits often touch the same file, and the newest one is usually the wrong answer.\n\nRequired procedure, in `../third_party/electron_node`:\n\n1. Name the exact symbol or lines your fix touches (for example the function you guarded, or the API that was renamed).\n2. Find the commit that introduced them. Use one of:\n   ```bash\n   git log -S'{symbol}' refs/patches/upstream-head -- {file}\n   git blame -L {start},{end} refs/patches/upstream-head -- {file}\n   ```\n   `refs/patches/upstream-head` is the unpatched Node.js commit, so results are upstream commits only.\n3. Verify the candidate before you cite it. Its diff must contain the symbol:\n   ```bash\n   git show {commit} -- {file} | grep -n '{symbol}'\n   ```\n   No match means you have the wrong commit. Go back to step 2.\n4. Take the reference from that commit's trailers:\n   ```\n   PR-URL: https://github.com/nodejs/node/pull/XXXXX\n   ```\n   and use its subject line as your commit title. A `Refs:` trailer in a *later* commit that mentions the same PR is not the introducing commit.\n\nFor Electron-authored patches with no upstream `PR-URL:`, the same procedure still finds the upstream commit that caused the conflict; cite that commit or its issue.\n\nIf no reference found after searching: `Ref: Unable to locate reference`\n\n## Example Commits\n\n### Patch conflict fix (simple — title is sufficient)\n\n```\nfix(patch): stop using v8::PropertyCallbackInfo<T>::This()\n\nRef: https://github.com/nodejs/node/issues/60616\n\nCo-Authored-By: <AI model attribution>\n```\n\n### Patch conflict fix (complex — description adds value)\n\n```\nfix(patch): BoringSSL and OpenSSL incompatibilities\n\nUpstream updated OpenSSL APIs that diverge from BoringSSL. Adapted\nthe compatibility shims in crypto patches to use the BoringSSL\nequivalents.\n\nRef: Unable to locate reference\n\nCo-Authored-By: <AI model attribution>\n```\n", "skills/electron-node-upgrade/references/phase-three-commit-guidelines.md": "# Phase Three Commit Guidelines\n\nOnly follow these instructions if there are uncommitted changes after fixing a test failure during Phase Three.\n\nIgnore other instructions about making commit messages, our guidelines are CRITICALLY IMPORTANT and must be followed.\n\n## Commit Message Style\n\n**Titles** follow the 60/80-character guideline: simple changes fit within 60 characters, otherwise the limit is 80 characters.\n\nAlways include a `Co-Authored-By` trailer identifying the AI model that assisted (e.g., `Co-Authored-By: <AI model attribution>`).\n\n## Commit Types\n\n### Patch updates (most test fixes)\n\nTest fixes go into existing patches via the fixup workflow. Use `fix(patch):` prefix with a descriptive topic:\n\n```\nfix(patch): {topic headline}\n\nRef: {Node.js commit or issue link}\n\nCo-Authored-By: <AI model attribution>\n```\n\nExamples:\n- `fix(patch): guard DH key test for BoringSSL`\n- `fix(patch): adapt new crypto tests for BoringSSL`\n- `fix(patch): correct thenable snapshot for Chromium V8`\n- `fix(patch): skip AES-KW tests with BoringSSL`\n\nGroup related test fixes into a single commit when they address the same root cause (e.g., multiple crypto tests all needing BoringSSL guards for the same missing cipher). Don't create one commit per test file if they share the same fix pattern.\n\n### Snapshot regeneration\n\nWhen a snapshot test fails because Chromium's V8 produces different output, regenerate it:\n\n```bash\nNODE_REGENERATE_SNAPSHOTS=1 node script/node-spec-runner.js test/test-runner/test-foo.mjs\n```\n\nThen commit the updated snapshot patch with a title describing what changed:\n\n```\nfix(patch): correct {name} snapshot for Chromium V8\n\nRef: {V8 CL or issue link if known}\n\nCo-Authored-By: <AI model attribution>\n```\n\n### Trivial patch updates\n\nAfter any patch modification, check for dependent patches that only have index/hunk header changes:\n\n```bash\ngit status\n# If other .patch files show as modified with only trivial changes:\ngit add patches/\ngit commit -m \"chore: update patches (trivial only)\"\n```\n\n## Finding References\n\nFor BoringSSL-related test fixes, the reference is typically the upstream Node.js PR that added the new test:\n\n```bash\ncd ../third_party/electron_node\ngit log --oneline -5 -- test/parallel/test-crypto-foo.js\ngit log -1 <commit> --format=\"%B\" | grep \"PR-URL\"\n```\n\nFor V8 behavioral differences, reference the Chromium CL:\n\n```\nRef: https://chromium-review.googlesource.com/c/v8/v8/+/NNNNNNN\n```\n\nIf no reference found after searching: `Ref: Unable to locate reference`\n", "skills/electron-node-upgrade/references/phase-two-commit-guidelines.md": "# Phase Two Commit Guidelines\n\nOnly follow these instructions if there are uncommitted changes in the Electron repo after any fixes are made during Phase Two that result a target that was failing, successfully building.\n\nIgnore other instructions about making commit messages, our guidelines are CRITICALLY IMPORTANT and must be followed.\n\n## Commit Message Style\n\n**Titles** follow the 60/80-character guideline: simple changes fit within 60 characters, otherwise the limit is 80 characters. Exception: upstream Node.js PR titles are used verbatim even if longer.\n\nAlways include a `Co-Authored-By` trailer identifying the AI model that assisted (e.g., `Co-Authored-By: <AI model attribution>`).\n\n## Two Commit Types\n\n### For Electron Source Changes (shell/, electron/, etc.)\n\nWhen the upstream Node.js commit has a `PR-URL:`:\n\n```\nnode#{PR-Number}: {upstream PR's original title}\n\nRef: {Node.js PR link}\n\nCo-Authored-By: <AI model attribution>\n```\n\nWhen there is no `PR-URL:` but there is an issue reference or commit:\n\n```\nfix: {description of the adaptation}\n\nRef: {Node.js issue or commit link}\n\nCo-Authored-By: <AI model attribution>\n```\n\nUse the **upstream commit's original title** when available — do not paraphrase or rewrite it. To find it: check the commit message in `../third_party/electron_node` for `PR-URL:` or `Refs:` lines.\n\nOnly add a description body if it provides clarity beyond what the title already says (e.g., when Electron's adaptation is non-obvious). For simple renames, method additions, or straightforward API updates, the title + Ref link is sufficient.\n\nEach change should have its own commit and its own Ref. Logically group into commits that make sense rather than one giant commit. You may include multiple \"Ref\" links if required.\n\nIMPORTANT: Try really hard to find a reference. Each change you made should in theory have been in response to a change in Node.js. Check `git log` and `git blame` in the Node.js repo. Do not give up easily.\n\n### For Patch Updates (patches/node/*.patch)\n\nUse the same fixup workflow as Phase One and follow `references/phase-one-commit-guidelines.md` for the commit message format (`fix(patch):` prefix, topic style).\n\n## Dependent Patch Header Updates\n\nAfter any patch modification, check for other affected patches:\n\n```bash\ngit status\n# If other .patch files show as modified with only index, line number, and context changes:\ngit add patches/\ngit commit -m \"chore: update patches (trivial only)\"\n```\n\n## Finding References\n\nFollow the procedure in `references/phase-one-commit-guidelines.md` under \"Finding Commit/Issue References\": identify the symbol the build break is about, find the commit that introduced it with `git log -S` or `git blame` against `refs/patches/upstream-head`, verify that commit's diff contains the symbol, and only then take its `PR-URL:` and subject line. The most recent commit to touch the file is not the answer unless that check passes.\n\nBefore writing any fix, also check `roller/node/main` and the sibling `roller/node/{N}-x-y` branches for the same version (phase one guidelines, \"Reuse Fixes From Sibling Roller Branches\"). Build breaks from a Node.js bump are the same on every branch, and the fix should be too.\n\nNote: Many Node.js patches in Electron are Electron-authored and won't have upstream `PR-URL:` lines. Check the patch's own commit message for `Refs:` lines, or use the procedure above to find which upstream commit caused the build break.\n\nIf no reference found after searching: `Ref: Unable to locate reference`\n\n## Example Commits\n\n### Electron Source Fix (with upstream PR)\n\n```\nnode#61898: src: stop using v8::PropertyCallbackInfo<T>::This()\n\nRef: https://github.com/nodejs/node/pull/61898\n\nCo-Authored-By: <AI model attribution>\n```\n\n### Electron Source Fix (with issue reference, no PR)\n\n```\nfix: adapt to v8::PropertyCallbackInfo<T>::This() removal\n\nUpdated NodeBindings to use HolderV2() after upstream Node.js\nstopped using the deprecated This() API.\n\nRef: https://github.com/nodejs/node/issues/60616\n\nCo-Authored-By: <AI model attribution>\n```\n", "skills/triage-prs/SKILL.md": "---\nname: triage-prs\ndescription: Triage open electron/electron pull requests by CI check status — lists PRs that are green/passing, failing, still pending, or have no checks at all, annotated with their Status on the \"PR Triage\" project board and with the new-pr label. Can scope to a single named check, e.g. PRs whose \"faraday/cage\" check is pending. Use when asked to triage PRs or do PR triage, list green/passing or mergeable PRs, find PRs with failing or pending CI, find PRs with no checks running, check faraday/cage status, or show each PR's triage board status. Also triggers on the bare words \"faraday\" or \"failing prs\".\n---\n\n# Triage PRs By CI Status\n\nLists open pull requests filtered by their GitHub checks. Backed by the bundled\nscript [`triage-prs.sh`](./triage-prs.sh), which lives alongside this file.\n\n## Shortcuts\n\n- **`faraday`** — when the user says just \"faraday\" (or \"faraday prs\",\n  \"pending faraday\", etc.), run:\n\n  ```bash\n  .claude/skills/triage-prs/triage-prs.sh --check \"faraday/cage\" --status pending\n  ```\n\n  This lists open PRs whose `faraday/cage` check is still pending.\n\n- **`failing`** — when the user says just \"failing prs\" (or \"failing ci\" in the\n  context of PR triage), run:\n\n  ```bash\n  .claude/skills/triage-prs/triage-prs.sh --status failing\n  ```\n\n  This lists open PRs whose checks are failing.\n\nBy default, evaluation is scoped to the **\"GitHub Actions Completed\"** check —\nElectron's umbrella check that reflects the overall GitHub Actions run. Pass\n`--check \"\"` to evaluate every check on the PR instead, or `--check \"<name>\"`\nfor a different single check.\n\nEach PR is classified as one of:\n\n| Status    | Icon | Meaning |\n|-----------|------|---------|\n| `green`   | ✅   | All checks succeeded (`SUCCESS`/`NEUTRAL`/`SKIPPED`). |\n| `failing` | ❌   | At least one check failed (`FAILURE`/`ERROR`/`CANCELLED`/`TIMED_OUT`/…). |\n| `pending` | 🟡   | Checks exist but some are still running (`PENDING`/`IN_PROGRESS`/…). |\n| `none`    | ⚪   | No checks are running at all. |\n\nEach listed PR is also annotated with its **Status** on the **\"PR Triage\"**\nGitHub project board (e.g. `[PR Triage: Needs Review]`). This is shown by\ndefault and requires the `gh` token to have the `read:project` scope; if the\nscope is missing the script prints a one-time note and omits the column.\n\n## Prerequisites\n\n- The [`gh`](https://cli.github.com/) CLI, authenticated (`gh auth login`).\n- `jq` on `PATH`.\n- To show the triage board Status column, the token needs the `read:project`\n  scope. Grant it with:\n\n  ```bash\n  gh auth refresh -s read:project\n  ```\n\n## Runtime\n\nThe script makes up to two `gh` calls per PR, sequentially, so a full scan at\nthe default `--limit 200` takes **several minutes** and consumes a few hundred\nAPI requests. Run it with an explicit long timeout (10 minutes is safe), or\nlower `--limit` for a quicker partial scan. Do not assume it has hung.\n\n## Usage\n\nRun the script from the repo root:\n\n```bash\n# Green PRs (default), 200 most recent open PRs in electron/electron\n.claude/skills/triage-prs/triage-prs.sh\n\n# Filter by a different status\n.claude/skills/triage-prs/triage-prs.sh --status failing\n.claude/skills/triage-prs/triage-prs.sh --status none\n.claude/skills/triage-prs/triage-prs.sh --status pending\n\n# Classify every scanned PR and show its status\n.claude/skills/triage-prs/triage-prs.sh --status all\n\n# Scan fewer PRs for a faster result\n.claude/skills/triage-prs/triage-prs.sh --status failing --limit 50\n\n# Target another repo, or change the check scope\n.claude/skills/triage-prs/triage-prs.sh --repo electron/forge --limit 50\n.claude/skills/triage-prs/triage-prs.sh --check \"\"          # evaluate all checks\n.claude/skills/triage-prs/triage-prs.sh --check \"macos-x64 / build / build\"\n\n# Scope to a single named check, e.g. find PRs whose faraday/cage is pending\n.claude/skills/triage-prs/triage-prs.sh --check \"faraday/cage\" --status pending\n.claude/skills/triage-prs/triage-prs.sh --check \"faraday/cage\" --status failing\n\n# Triage board Status column\n.claude/skills/triage-prs/triage-prs.sh --no-triage                  # hide the Status column\n.claude/skills/triage-prs/triage-prs.sh --triage-project \"PR Triage\" # read a different board\n```\n\nEnvironment variables `REPO`, `LIMIT`, `CHECK_NAME`, `STATUS`, `TRIAGE`, and\n`TRIAGE_PROJECT` are honored as defaults and can be overridden by the\ncorresponding flags.\n\nOutput is one entry per PR — an icon, a clickable\n[OSC 8 hyperlink](https://gist.github.com/egmontkob/eb114294efdcfddb1b38f3714a0de4d6)\non the PR number, the title, and any markers — with the raw URL on the next\nline:\n\n```text\n✅ #52533  feat: support `restrictOwnAudio` constraint  [PR Triage: Needs Review]\n     https://github.com/electron/electron/pull/52533\n```\n\n## Reporting results\n\nWhen summarizing to the user, render each PR as a Markdown link so it is\nclickable in chat, e.g. `[#52533](https://github.com/electron/electron/pull/52533) — feat: support restrictOwnAudio constraint`.\nThe script's output includes the PR URL on the second line for each entry, so\nuse that URL directly.\n\nWhen a PR carries the `new-pr` label (the script appends a `[new-pr]` marker),\nindicate it in the summary with the plain text `[new-pr]` rather than an emoji.\n\n## Interpreting results\n\n- Two categories of PR are **silently excluded** from every run, and neither is\n  reported in the totals. Say so when summarizing, so the output is not read as\n  the complete set of open PRs:\n  - **Draft** PRs.\n  - PRs whose **\"PR Triage\" board Status contains `WIP`** — these are treated as\n    not ready for review. Note that `--no-triage` skips the board lookup\n    entirely, so WIP PRs _are_ included when it is passed.\n- With a status filter (the default is `green`), only PRs whose classification\n  matches are listed; all others are omitted.\n- `none` means the PR genuinely has no checks at all (nothing has been\n  triggered yet), which is different from `pending` (checks exist but haven't\n  finished).\n- Because evaluation defaults to the **\"GitHub Actions Completed\"** check, a PR\n  reads as `pending` while its other checks run but that umbrella check has not\n  been posted yet, then flips to `green`/`failing` once the umbrella check\n  reports. A PR is only `none` when it has zero checks whatsoever. Use\n  `--check \"\"` to judge by all checks instead.\n- A `SKIPPED` umbrella check is not treated as a pass: Electron skips\n  \"GitHub Actions Completed\" when a required upstream job fails, so the script\n  falls back to the full check set to find the real status.\n", "skills/triage-prs/triage-prs.sh": "#!/usr/bin/env bash\n#\n# triage-prs.sh — list open PRs filtered by their CI status.\n#\n# Classifies each open (non-draft) PR by its GitHub checks:\n#   green    all checks succeeded (SUCCESS/NEUTRAL/SKIPPED)\n#   failing  at least one check failed (FAILURE/ERROR/CANCELLED/TIMED_OUT/...)\n#   pending  checks exist but some are still running (PENDING/IN_PROGRESS/...)\n#   none     no checks are running at all\n#\n# When scoped to a single named check (the default is the \"GitHub Actions\n# Completed\" umbrella check), a SKIPPED result on that check is not treated as\n# a pass: Electron skips the umbrella check when a required upstream job fails,\n# so classification falls back to the full check set to find the real status.\n#\n# Draft PRs are skipped, as are PRs whose \"PR Triage\" board Status contains WIP\n# (--no-triage skips the board lookup, so WIP PRs are included when it is set).\n#\n# Requires the `gh` CLI, authenticated via `gh auth login`, and `jq`.\n#\n# Usage:\n#   .claude/skills/triage-prs/triage-prs.sh                      # green PRs (default)\n#   .claude/skills/triage-prs/triage-prs.sh --status failing\n#   .claude/skills/triage-prs/triage-prs.sh --status none\n#   .claude/skills/triage-prs/triage-prs.sh --status all --limit 100\n#   .claude/skills/triage-prs/triage-prs.sh --check \"GitHub Actions Completed\"\n#   .claude/skills/triage-prs/triage-prs.sh --check \"faraday/cage\" --status pending\n#\n# Options:\n#   --status <s>          Which PRs to show: green | failing | pending | none | all\n#                         (default: green)\n#   --check <name>        Only consider the named check instead of all checks.\n#                         (default: \"GitHub Actions Completed\"). Pass an empty\n#                         string to evaluate every check on the PR.\n#   --triage / --no-triage\n#                         Show (default) or hide the Status field from the\n#                         \"PR Triage\" project next to each PR. Requires the\n#                         gh token to have the 'read:project' scope\n#                         (run: gh auth refresh -s read:project).\n#   --triage-project <n>  Name of the project board to read Status from\n#                         (default: \"PR Triage\").\n#   --repo <owner/name>   Target repository (default: electron/electron)\n#   --limit <n>           Max number of open PRs to scan (default: 200)\n#   -h, --help            Show this help and exit\n\nset -euo pipefail\n\nREPO=\"${REPO:-electron/electron}\"\nLIMIT=\"${LIMIT:-200}\"\nCHECK_NAME=\"${CHECK_NAME:-GitHub Actions Completed}\"\nSTATUS=\"${STATUS:-green}\"\nTRIAGE=\"${TRIAGE:-1}\"\nTRIAGE_PROJECT=\"${TRIAGE_PROJECT:-PR Triage}\"\n\n# Print the header comment block (everything between the shebang and the first\n# non-comment line) as help text. Deriving the range this way keeps --help in\n# sync when the header grows, unlike a hard-coded line range.\nusage() {\n  awk 'NR == 1 { next } /^#/ { sub(/^# ?/, \"\"); print; next } { exit }' \"$0\"\n}\n\nwhile [[ $# -gt 0 ]]; do\n  case \"$1\" in\n    --status)         STATUS=\"$2\";         shift 2 ;;\n    --check)          CHECK_NAME=\"$2\";     shift 2 ;;\n    --triage)         TRIAGE=1;            shift   ;;\n    --no-triage)      TRIAGE=0;            shift   ;;\n    --triage-project) TRIAGE_PROJECT=\"$2\"; shift 2 ;;\n    --repo)           REPO=\"$2\";           shift 2 ;;\n    --limit)          LIMIT=\"$2\";          shift 2 ;;\n    -h|--help) usage; exit 0 ;;\n    *) echo \"Unknown argument: $1\" >&2; usage; exit 1 ;;\n  esac\ndone\n\ncase \"$STATUS\" in\n  green|failing|pending|none|all) ;;\n  *) echo \"error: --status must be one of: green, failing, pending, none, all\" >&2; exit 1 ;;\nesac\n\nif ! command -v gh >/dev/null 2>&1; then\n  echo \"error: the GitHub CLI (gh) is required but was not found on PATH.\" >&2\n  exit 1\nfi\nif ! command -v jq >/dev/null 2>&1; then\n  echo \"error: jq is required but was not found on PATH.\" >&2\n  exit 1\nfi\n\nOWNER=\"${REPO%%/*}\"\nNAME=\"${REPO##*/}\"\n\n# Reading a ProjectV2 board's fields needs the 'read:project' token scope. If it\n# is missing, disable the triage column rather than failing every PR.\nif [[ \"$TRIAGE\" == \"1\" ]]; then\n  # Reading a project's `title` is what requires read:project, so probe that.\n  probe=$(gh api graphql -f owner=\"$OWNER\" -f name=\"$NAME\" -f query='\n    query($owner:String!,$name:String!){\n      repository(owner:$owner,name:$name){ projectsV2(first:1){ nodes{ title } } }\n    }' 2>&1 || true)\n  if grep -q 'INSUFFICIENT_SCOPES' <<<\"$probe\"; then\n    echo \"note: gh token lacks the 'read:project' scope, so the \\\"${TRIAGE_PROJECT}\\\" Status\" >&2\n    echo \"      column is disabled. Enable it with: gh auth refresh -s read:project\" >&2\n    echo >&2\n    TRIAGE=0\n  fi\nfi\n\n# Fetch the Status field value from the triage project for one PR (may be empty).\ntriage_status() {\n  gh api graphql \\\n    -f owner=\"$OWNER\" -f name=\"$NAME\" -F number=\"$1\" \\\n    -f query='\n      query($owner:String!,$name:String!,$number:Int!){\n        repository(owner:$owner,name:$name){\n          pullRequest(number:$number){\n            projectItems(first:20){\n              nodes{\n                project{ title }\n                fieldValueByName(name:\"Status\"){\n                  ... on ProjectV2ItemFieldSingleSelectValue { name }\n                }\n              }\n            }\n          }\n        }\n      }' 2>/dev/null |\n    jq -r --arg p \"$TRIAGE_PROJECT\" '\n      [ .data.repository.pullRequest.projectItems.nodes[]?\n        | select(.project.title == $p)\n        | (.fieldValueByName.name // empty) ] | first // \"\"\n    ' 2>/dev/null || printf ''\n}\n\n# Icon for each classification.\nicon_for() {\n  case \"$1\" in\n    green)   printf '✅' ;;\n    failing) printf '❌' ;;\n    pending) printf '🟡' ;;\n    none)    printf '⚪' ;;\n  esac\n}\n\nscope_desc=\"all checks\"\n[[ -n \"$CHECK_NAME\" ]] && scope_desc=\"the \\\"${CHECK_NAME}\\\" check\"\n\nif [[ \"$STATUS\" == \"all\" ]]; then\n  echo \"Scanning up to ${LIMIT} open PRs in ${REPO}, classifying by ${scope_desc}...\"\nelse\n  echo \"Scanning up to ${LIMIT} open PRs in ${REPO} for ${STATUS} PRs (by ${scope_desc})...\"\nfi\necho\n\nfound=0\n\n# List open, non-draft PR numbers, then inspect each PR's status check rollup.\nwhile read -r number; do\n  [[ -z \"$number\" ]] && continue\n\n  json=$(gh pr view \"$number\" --repo \"$REPO\" \\\n    --json statusCheckRollup,title,url,labels 2>/dev/null) || continue\n\n  # Classify the PR. statusCheckRollup mixes GitHub Actions CheckRun entries\n  # (status/conclusion) and legacy StatusContext entries (state). When --check\n  # is set, only that named check is considered; otherwise every check is.\n  # gh's --jq does not accept jq's --arg, so pipe raw JSON to jq for $name.\n  class=$(echo \"$json\" | jq -r --arg name \"$CHECK_NAME\" '\n    def state_of:\n      # CheckRun entries expose .status (QUEUED/IN_PROGRESS/COMPLETED) and,\n      # only once COMPLETED, a .conclusion. An in-progress CheckRun reports\n      # .conclusion as \"\" (empty string, not null), so key off .status\n      # first. StatusContext entries only expose .state.\n      if (.status != null and .status != \"COMPLETED\") then .status\n      elif ((.conclusion // \"\") != \"\") then .conclusion\n      elif ((.state // \"\") != \"\") then .state\n      else \"PENDING\"\n      end;\n    # Reduce a list of resolved states to a single classification, or null for\n    # an empty list.\n    def classify($s):\n      if ($s | length) == 0 then null\n      elif any($s[]; . == \"FAILURE\" or . == \"ERROR\" or . == \"CANCELLED\"\n                     or . == \"TIMED_OUT\" or . == \"ACTION_REQUIRED\"\n                     or . == \"STARTUP_FAILURE\" or . == \"STALE\") then \"failing\"\n      elif any($s[]; . == \"PENDING\" or . == \"EXPECTED\" or . == \"IN_PROGRESS\"\n                     or . == \"QUEUED\" or . == \"REQUESTED\"\n                     or . == \"WAITING\") then \"pending\"\n      else \"green\"\n      end;\n    (.statusCheckRollup // []) as $all\n    | ($all | map(state_of)) as $allStates\n    | ( if $name == \"\" then $all\n        else [ $all[] | select((.name // .context) == $name) ]\n        end ) as $matched\n    | ($matched | map(state_of)) as $s\n    | if $name == \"\" then\n        # Evaluating every check on the PR.\n        ( classify($s) // \"none\" )\n      elif ($s | length) == 0 then\n        # No matching check. Only \"none\" when the PR has zero checks at all;\n        # if other checks exist, the named (umbrella) check simply has not\n        # been posted yet, so CI is still pending.\n        ( if ($all | length) == 0 then \"none\" else \"pending\" end )\n      elif any($s[]; . == \"SKIPPED\") then\n        # The named (umbrella) check was SKIPPED. In Electron the \"GitHub\n        # Actions Completed\" umbrella check is skipped when a required upstream\n        # job failed, so it never ran to a real conclusion. A SKIPPED umbrella\n        # is therefore NOT a pass; fall back to the full check set to determine\n        # the true status.\n        ( classify($allStates) // \"green\" )\n      else\n        ( classify($s) // \"green\" )\n      end\n  ')\n\n  if [[ \"$STATUS\" != \"all\" && \"$class\" != \"$STATUS\" ]]; then\n    continue\n  fi\n\n  IFS=$'\\t' read -r title url < <(echo \"$json\" | jq -r '[.title, .url] | @tsv')\n\n  # Flag PRs that carry the \"new-pr\" label so they stand out as needing a first\n  # look. The label name includes a trailing emoji (\"new-pr 🌱\"), so match by\n  # prefix. jq exits non-zero-safely; default to empty if the label is absent.\n  new_pr_suffix=\"\"\n  if echo \"$json\" | jq -e '.labels[]? | select(.name | startswith(\"new-pr\"))' >/dev/null 2>&1; then\n    new_pr_suffix=\"  [new-pr]\"\n  fi\n\n  # Optionally look up the PR's Status on the triage project board.\n  triage=\"\"\n  if [[ \"$TRIAGE\" == \"1\" ]]; then\n    triage=$(triage_status \"$number\")\n  fi\n\n  # Exclude PRs marked WIP on the triage board; these are not ready for review.\n  if [[ \"$triage\" == *WIP* ]]; then\n    continue\n  fi\n\n  triage_suffix=\"\"\n  [[ -n \"$triage\" ]] && triage_suffix=\"  [${TRIAGE_PROJECT}: ${triage}]\"\n\n  # Emit an OSC 8 hyperlink so terminals that support it render a clickable\n  # link on the PR reference; the raw URL is printed too for plain terminals.\n  printf '%s \\e]8;;%s\\e\\\\#%s\\e]8;;\\e\\\\  %s%s%s\\n     %s\\n' \\\n    \"$(icon_for \"$class\")\" \"$url\" \"$number\" \"$title\" \"$new_pr_suffix\" \"$triage_suffix\" \"$url\"\n  found=$((found + 1))\ndone < <(gh pr list --repo \"$REPO\" --state open --limit \"$LIMIT\" \\\n  --json number,isDraft --jq '.[] | select(.isDraft | not) | .number')\n\necho\nif [[ \"$STATUS\" == \"all\" ]]; then\n  echo \"Done. ${found} non-draft PR(s) scanned and classified.\"\nelse\n  echo \"Done. ${found} ${STATUS} PR(s) (by ${scope_desc}).\"\nfi\n"}}
