[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6X0NDXXSYQG4ST1GS4B7YV0":3,"skill-same:01M6X0NDXXSYQG4ST1GS4B7YV0":65},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":27,"commitSha":43,"skillDirectory":44,"forksCount":45,"repositoryHtmlUrl":46,"repositoryHomepageUrl":6,"ownerHtmlUrl":47,"ownerBlogUrl":48,"ownerDescription":49,"updatedAt":50,"install":51,"resources":64},"01M6X0NDXXSYQG4ST1GS4B7YV0","XMC Fix Nightly",null,"Investigates broken Nightly Examples E2E runs on main, performs root-cause triage across code regressions vs nightly cluster drift, implements minimal fixes in an isolated git worktree, opens a Draft PR, and proves the fix by triggering the nightly workflow on the PR branch.","google\u002Fxmc","google","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1342004?v=4","01M698VYEFDM0VJBZDYYJ2T83S","Google","01M6X0MD62T1HTQNBX4VJ5AXWK",8,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fxmc\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fxmc_fix_nightly\u002FSKILL.md",[],[19,5,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"fix","minimal","pr","fixes","cluster","across","draft","drift","main","root-cause","code","workflow","broken","draft pr","branch","git worktree","e2e","examples","worktree","2026-11-10 10:12:30",false,"---\nname: XMC Fix Nightly\ndescription: Investigates broken Nightly Examples E2E runs on main, performs root-cause triage across code regressions vs nightly cluster drift, implements minimal fixes in an isolated git worktree, opens a Draft PR, and proves the fix by triggering the nightly workflow on the PR branch.\n---\n\n# XMC Fix Nightly Playbook\n\n**Scope**: [`.github\u002Fworkflows\u002Fnightly-examples-e2e.yml`](..\u002F..\u002F..\u002F.github\u002Fworkflows\u002Fnightly-examples-e2e.yml) is the workflow this skill fixes and verifies on a PR branch. [`nightly-build.yml`](..\u002F..\u002F..\u002F.github\u002Fworkflows\u002Fnightly-build.yml) runs and their `deploy-gke-diagnostics` artifacts are read-only triage inputs (Layer B), and dispatching `nightly-build.yml` requires explicit user confirmation (Stage 5). [`nightly-visual-snapshot.yml`](..\u002F..\u002F..\u002F.github\u002Fworkflows\u002Fnightly-visual-snapshot.yml) is out of scope because it publishes the public GitHub Pages gallery.\n\n---\n\n## Stage 1 — Discover & Triage Broken Nightly Examples E2E Run on `main`\n\nRun [`tools\u002Fnightly_tests\u002Ftriage_nightly_run.py`](..\u002F..\u002F..\u002Ftools\u002Fnightly_tests\u002Ftriage_nightly_run.py) (see [`tools\u002Fnightly_tests\u002FREADME.md`](..\u002F..\u002F..\u002Ftools\u002Fnightly_tests\u002FREADME.md#5-nightly-failure-triage-cli-triage_nightly_runpy)) to fetch `origin\u002Fmain`, inspect recent nightly runs and open `nightly-failure` issues, download failed job logs and non-expired failure artifacts into `${ARTIFACT_DIR:-\u002Ftmp}\u002Fnightly_triage_\u003Crun_id>`, parse `failed_jobs[].result` (the `result-\u003Cid>\u002F\u003Cid>.json` object, including `id`, `status`, `launch_status`, `verify_status`, and `xid`) and bounded `failed_jobs[].error_excerpt` `##[error]` context lines, collect SHA-pinned `recent_commits`, and compute rollout skew in one turn:\n\n```bash\nPYTHONPATH=. python3 tools\u002Fnightly_tests\u002Ftriage_nightly_run.py\n```\n\nPass `--run-id \u003Crun_id>` to triage a specific historical run. **Stop Gate**: Stop and report to the user (along with any stale `open_issues`) if `status_summary` is not `\"failing\"` (`\"healthy\"`, `\"superseded\"`, `\"in_progress\"`, or `\"no_completed_runs\"`), unless the user explicitly requested triaging a `\"superseded\"` `--run-id`. Always review `warnings` (such as non-superseding `workflow_dispatch` green runs, equal-SHA Layer B\u002Fflake hints, recent-commit fallbacks, or missing build history) before trusting `recent_commits` or `rollout_skew` in Stage 2. When `failed_jobs[].result` and `failed_jobs[].error_excerpt` are insufficient to pinpoint the failure, delegate inspection of full `job_\u003Cid>.log` files or `deploy-gke-diagnostics` bundles to a subagent per [Subagent Delegation Guidelines](..\u002F..\u002Frules\u002Fskills_and_automation.md#4-subagent-delegation-guidelines).\n\n---\n\n## Stage 2 — Root-Cause Triage & Investigation\n\nInspect the JSON summary from Stage 1—`failed_jobs` (`result`, `error_excerpt`, `failed_steps`), `recent_commits` (pinned to `target_run.headSha`, with squash-merged `(#\u003Cpr>)` subjects), `downloaded_artifacts`, and `rollout_skew`—to classify the failure layer:\n\n### Layer A — Code, SDK, Example, Verifier, or Backend\u002FUI Regression on `main`\n- **Client \u002F SDK \u002F CLI Setup**: Packaging, proto-overlay, or import regressions in [`sdks\u002Fpython\u002Fxmc\u002F`](..\u002F..\u002F..\u002Fsdks\u002Fpython\u002Fxmc\u002F), [`sdks\u002Fpython\u002Fxdash\u002F`](..\u002F..\u002F..\u002Fsdks\u002Fpython\u002Fxdash\u002F), [`api\u002Fprotos\u002F`](..\u002F..\u002F..\u002Fapi\u002Fprotos\u002F), or [`deploy\u002Fcli\u002Finstall_xmanager.py`](..\u002F..\u002F..\u002Fdeploy\u002Fcli\u002Finstall_xmanager.py).\n- **E2E Verifiers & Shared Dirty-Environment Scoping**: Stale selectors, DOM text assumptions, or truncated first-page assumptions in [`tools\u002Fnightly_tests\u002Fverification\u002F`](..\u002F..\u002F..\u002Ftools\u002Fnightly_tests\u002Fverification\u002F) or [`tools\u002Fnightly_tests\u002Fexamples_verification\u002F`](..\u002F..\u002F..\u002Ftools\u002Fnightly_tests\u002Fexamples_verification\u002F) violating [Shared Dirty-Environment E2E & Pagination Testing](..\u002F..\u002Frules\u002Fcore_engineering.md#5-strict-testing-coverage--pr-granularity) and [`tools\u002Fnightly_tests\u002FREADME.md`](..\u002F..\u002F..\u002Ftools\u002Fnightly_tests\u002FREADME.md#step-1-implement-the-verifier-in-examples_verification).\n- **Backend \u002F UI \u002F Manifest Defect**: Regressions in [`cmd\u002F`](..\u002F..\u002F..\u002Fcmd\u002F), [`internal\u002F`](..\u002F..\u002F..\u002Finternal\u002F), [`pkg\u002F`](..\u002F..\u002F..\u002Fpkg\u002F), [`deploy\u002Fhelm\u002F`](..\u002F..\u002F..\u002Fdeploy\u002Fhelm\u002F), [`deploy\u002Fctk_v2\u002F`](..\u002F..\u002F..\u002Fdeploy\u002Fctk_v2\u002F), [`deploy\u002Faddons\u002F`](..\u002F..\u002F..\u002Fdeploy\u002Faddons\u002F), or [`deploy\u002Fclickhouse\u002F`](..\u002F..\u002F..\u002Fdeploy\u002Fclickhouse\u002F).\n\n### Layer B — Nightly Cluster (`xmc-nightly`) Rollout Skew or State Drift\n- **Client\u002FServer Rollout Skew**: `nightly-build.yml` deploys `xmc-nightly` at 01:00 UTC while `nightly-examples-e2e.yml` runs at 04:00 UTC (or on demand); inspect `rollout_skew.undeployed_commits` and `rollout_skew.cluster_deployed_files` from Stage 1 to see whether the failing example depends on undeployed server changes merged after `rollout_skew.last_green_build_run`.\n- **Addon \u002F Deployment Drift**: Missing pods, failed Helm hooks, or unapplied Gateway\u002FClickHouse\u002FMultiKueue state surfaced by `rollout_skew.active_build_run` and `deploy-gke-diagnostics`.\n\n> [!CAUTION]\n> **STRICT SHARED CLUSTER SAFETY INVARIANTS (`xmc-nightly`)**:\n> 1. **Never Mutate `xmc-nightly` Directly**: NEVER manually modify, apply manifests to, delete resources in, or upgrade `xmc-nightly` unless explicitly instructed by the user.\n> 2. **Isolate `KUBECONFIG` During Read-Only Triage**: Never overwrite default `~\u002F.kube\u002Fconfig`; pass `export KUBECONFIG=\"${ARTIFACT_DIR:-\u002Ftmp}\u002Fkubeconfig_nightly\"` for any read-only cluster inspection.\n\n---\n\n## Stage 3 — Create an Isolated Worktree & Implement the Fix\n\n1. **Create an Isolated Git Worktree from `origin\u002Fmain`**:\n   ```bash\n   SLUG=\"\u003Ckebab-case-slug>\"\n   WORKTREE_DIR=\"\u002Ftmp\u002Fxmc-fix-nightly-${SLUG}\"\n   BRANCH_NAME=\"fix\u002Fnightly-${SLUG}\"\n\n   git fetch origin main\n   git worktree add \"${WORKTREE_DIR}\" -b \"${BRANCH_NAME}\" origin\u002Fmain\n   ```\n\n2. **Implement & Verify a Minimal, Single-Responsibility Fix**:\n   Follow [XMC Feature Development](..\u002Fxmc_feature_development\u002FSKILL.md) and language rules under [`.agents\u002Frules\u002Flanguages\u002F`](..\u002F..\u002Frules\u002Flanguages\u002F):\n   - Fix the root cause without bundling unrelated refactors or cleanups.\n   - Add or update unit tests per [Strict Testing Coverage](..\u002F..\u002Frules\u002Fcore_engineering.md#5-strict-testing-coverage--pr-granularity). Never delete or weaken existing tests or assertions to make a nightly run pass.\n   - **Verifier fixes**: Keep `examples_verification\u002F\u003Cname>_test.py` entrypoints thin and place any cluster- or browser-independent parsing, normalization, or decision logic in [`tools\u002Fnightly_tests\u002Fverification\u002F`](..\u002F..\u002F..\u002Ftools\u002Fnightly_tests\u002Fverification\u002F) with a paired `*_test.py` unit test per [Nightly E2E Verifier Entrypoints](..\u002F..\u002Frules\u002Fcore_engineering.md#5-strict-testing-coverage--pr-granularity) and [`tools\u002Fnightly_tests\u002FREADME.md`](..\u002F..\u002F..\u002Ftools\u002Fnightly_tests\u002FREADME.md#1-architecture--execution-lifecycle).\n   - Stage explicit modified paths (never blind `git add -A`) and run `.\u002F.githooks\u002Fpre-commit` and affected Bazel tests until 100% green per [XMC Create PR — Pre-Commit Hooks & Commit Creation](..\u002Fxmc_create_pr\u002FSKILL.md#2-pre-commit-hooks--commit-creation) and [XMC Feature Development — Test Execution via Affected Tests Tool](..\u002Fxmc_feature_development\u002FSKILL.md#3-test-execution-via-affected-tests-tool).\n\n---\n\n## Stage 4 — Open a Draft PR\n\nDelegate commit creation, diff sizing check, confirmation gate, and Draft PR creation to [XMC Create PR — Pull Request Creation & PR Body Population](..\u002Fxmc_create_pr\u002FSKILL.md#3-pull-request-creation--pr-body-population), adding these nightly-specific details to `pr_body.md`:\n- Link the failing `main` workflow run\u002Fjob URL and state the root-cause classification from Stage 2.\n- Include `Fixes #\u003Cissue_number>` when an open `nightly-failure` GitHub Issue exists.\n- Push `fix\u002Fnightly-${SLUG}` to `origin` and keep the PR strictly in **Draft** state ([XMC Create PR — Draft PR to Open Conversion Policy](..\u002Fxmc_create_pr\u002FSKILL.md#6-draft-pr-to-open-conversion-policy-strict-confirmation-gate)).\n\n---\n\n## Stage 5 — Trigger Nightly Examples E2E on the PR Branch to Prove the Fix\n\n1. **Select Verification Workflow Scope**:\n   - **Client \u002F SDK \u002F Example \u002F Verifier \u002F Workflow Changes**: `nightly-examples-e2e.yml` builds example images and runs the branch's SDKs and verifiers directly against `xmc-nightly`. Pass `--input \"examples_filter=\u003Cids>\"` using the non-empty comma-separated `failed_jobs[].example_id` values from Stage 1 (validated pre-flight by [`dispatch_and_watch.py`](..\u002F..\u002F..\u002Ftools\u002Frelease\u002Fdispatch_and_watch.py)), or omit `--input` to run the full matrix when `example_id` is empty (non-matrix jobs such as `examples-import-check` or `build-example-images`) or when shared SDK\u002Finstaller\u002Fworkflow files changed.\n   - **Cluster-Deployed Backend \u002F UI \u002F Helm \u002F Addon Changes**: `nightly-examples-e2e.yml` tests against the server\u002FUI currently deployed on `xmc-nightly`. Proving a server\u002FUI change on `xmc-nightly` requires dispatching `nightly-build.yml` first (never `deploy-gke.yml` directly, whose `workflow_dispatch` defaults omit `xmc-nightly` addons). Because `nightly-build.yml` mutates shared `xmc-nightly` and pushes a `nightly-*` tag, **obtain explicit user confirmation first**, then run (and verify `conclusion == \"success\"`) before step 2 below:\n     ```bash\n     SLUG=\"${SLUG:-\u003Ckebab-case-slug>}\"\n     BRANCH_NAME=\"${BRANCH_NAME:-fix\u002Fnightly-${SLUG}}\"\n\n     PYTHONPATH=. python3 tools\u002Frelease\u002Fdispatch_and_watch.py --workflow nightly-build.yml --ref \"${BRANCH_NAME}\"\n     ```\n\n2. **Dispatch & Watch `nightly-examples-e2e.yml` on the Pushed PR Branch**:\n   Ensure `origin\u002F${BRANCH_NAME}` is pushed first (Stage 4). [`tools\u002Frelease\u002Fdispatch_and_watch.py`](..\u002F..\u002F..\u002Ftools\u002Frelease\u002Fdispatch_and_watch.py) fetches `origin\u002F${BRANCH_NAME}` and resolves `FETCH_HEAD` automatically when `--target-sha` is omitted (per [Workflow Orchestration & Remote Automation Invariants](..\u002F..\u002Frules\u002Fskills_and_automation.md#9-workflow-orchestration--remote-automation-invariants)), correlates the newly created `workflow_dispatch` run, and watches it to completion (`conclusion == \"success\"`):\n   ```bash\n   SLUG=\"${SLUG:-\u003Ckebab-case-slug>}\"\n   BRANCH_NAME=\"${BRANCH_NAME:-fix\u002Fnightly-${SLUG}}\"\n   EXAMPLES_FILTER=\"\u003Cmatrix_example_id_or_empty>\"\n\n   PYTHONPATH=. python3 tools\u002Frelease\u002Fdispatch_and_watch.py \\\n     --workflow nightly-examples-e2e.yml \\\n     --ref \"${BRANCH_NAME}\" \\\n     --input \"examples_filter=${EXAMPLES_FILTER}\" \\\n     --state-file \"${ARTIFACT_DIR:-\u002Ftmp}\u002Fnightly_verify_state.json\"\n   ```\n\n3. **Synchronize Draft PR Description & Report Proof**:\n   Once PR CI (`.\u002Ftools\u002Fpr_review\u002Fwait_for_ci.py \u003Cpr_number>` per [XMC Create PR — CI Wait Buffer Period](..\u002Fxmc_create_pr\u002FSKILL.md#5-ci-wait-buffer-period)) and the branch `nightly-examples-e2e.yml` run pass on `origin\u002F${BRANCH_NAME}`, update the Draft PR description via `.\u002Ftools\u002Fpr_review\u002Fupdate_pr_description.py` ([XMC Create PR — PR Description Updates via Helper Tool](..\u002Fxmc_create_pr\u002FSKILL.md#4-pr-description-updates-via-helper-tool)) with the passing verification run URL, create `.url.json` bookmark artifacts (`UserFacing: true`) for the Draft PR and verification run, and report back while keeping the PR in **Draft** state.\n","# XMC Fix Nightly Playbook\n\n**Scope**: [`.github\u002Fworkflows\u002Fnightly-examples-e2e.yml`](..\u002F..\u002F..\u002F.github\u002Fworkflows\u002Fnightly-examples-e2e.yml) is the workflow this skill fixes and verifies on a PR branch. [`nightly-build.yml`](..\u002F..\u002F..\u002F.github\u002Fworkflows\u002Fnightly-build.yml) runs and their `deploy-gke-diagnostics` artifacts are read-only triage inputs (Layer B), and dispatching `nightly-build.yml` requires explicit user confirmation (Stage 5). [`nightly-visual-snapshot.yml`](..\u002F..\u002F..\u002F.github\u002Fworkflows\u002Fnightly-visual-snapshot.yml) is out of scope because it publishes the public GitHub Pages gallery.\n\n---\n\n## Stage 1 — Discover & Triage Broken Nightly Examples E2E Run on `main`\n\nRun [`tools\u002Fnightly_tests\u002Ftriage_nightly_run.py`](..\u002F..\u002F..\u002Ftools\u002Fnightly_tests\u002Ftriage_nightly_run.py) (see [`tools\u002Fnightly_tests\u002FREADME.md`](..\u002F..\u002F..\u002Ftools\u002Fnightly_tests\u002FREADME.md#5-nightly-failure-triage-cli-triage_nightly_runpy)) to fetch `origin\u002Fmain`, inspect recent nightly runs and open `nightly-failure` issues, download failed job logs and non-expired failure artifacts into `${ARTIFACT_DIR:-\u002Ftmp}\u002Fnightly_triage_\u003Crun_id>`, parse `failed_jobs[].result` (the `result-\u003Cid>\u002F\u003Cid>.json` object, including `id`, `status`, `launch_status`, `verify_status`, and `xid`) and bounded `failed_jobs[].error_excerpt` `##[error]` context lines, collect SHA-pinned `recent_commits`, and compute rollout skew in one turn:\n\n```bash\nPYTHONPATH=. python3 tools\u002Fnightly_tests\u002Ftriage_nightly_run.py\n```\n\nPass `--run-id \u003Crun_id>` to triage a specific historical run. **Stop Gate**: Stop and report to the user (along with any stale `open_issues`) if `status_summary` is not `\"failing\"` (`\"healthy\"`, `\"superseded\"`, `\"in_progress\"`, or `\"no_completed_runs\"`), unless the user explicitly requested triaging a `\"superseded\"` `--run-id`. Always review `warnings` (such as non-superseding `workflow_dispatch` green runs, equal-SHA Layer B\u002Fflake hints, recent-commit fallbacks, or missing build history) before trusting `recent_commits` or `rollout_skew` in Stage 2. When `failed_jobs[].result` and `failed_jobs[].error_excerpt` are insufficient to pinpoint the failure, delegate inspection of full `job_\u003Cid>.log` files or `deploy-gke-diagnostics` bundles to a subagent per [Subagent Delegation Guidelines](..\u002F..\u002Frules\u002Fskills_and_automation.md#4-subagent-delegation-guidelines).\n\n---\n\n## Stage 2 — Root-Cause Triage & Investigation\n\nInspect the JSON summary from Stage 1—`failed_jobs` (`result`, `error_excerpt`, `failed_steps`), `recent_commits` (pinned to `target_run.headSha`, with squash-merged `(#\u003Cpr>)` subjects), `downloaded_artifacts`, and `rollout_skew`—to classify the failure layer:\n\n### Layer A — Code, SDK, Example, Verifier, or Backend\u002FUI Regression on `main`\n- **Client \u002F SDK \u002F CLI Setup**: Packaging, proto-overlay, or import regressions in [`sdks\u002Fpython\u002Fxmc\u002F`](..\u002F..\u002F..\u002Fsdks\u002Fpython\u002Fxmc\u002F), [`sdks\u002Fpython\u002Fxdash\u002F`](..\u002F..\u002F..\u002Fsdks\u002Fpython\u002Fxdash\u002F), [`api\u002Fprotos\u002F`](..\u002F..\u002F..\u002Fapi\u002Fprotos\u002F), or [`deploy\u002Fcli\u002Finstall_xmanager.py`](..\u002F..\u002F..\u002Fdeploy\u002Fcli\u002Finstall_xmanager.py).\n- **E2E Verifiers & Shared Dirty-Environment Scoping**: Stale selectors, DOM text assumptions, or truncated first-page assumptions in [`tools\u002Fnightly_tests\u002Fverification\u002F`](..\u002F..\u002F..\u002Ftools\u002Fnightly_tests\u002Fverification\u002F) or [`tools\u002Fnightly_tests\u002Fexamples_verification\u002F`](..\u002F..\u002F..\u002Ftools\u002Fnightly_tests\u002Fexamples_verification\u002F) violating [Shared Dirty-Environment E2E & Pagination Testing](..\u002F..\u002Frules\u002Fcore_engineering.md#5-strict-testing-coverage--pr-granularity) and [`tools\u002Fnightly_tests\u002FREADME.md`](..\u002F..\u002F..\u002Ftools\u002Fnightly_tests\u002FREADME.md#step-1-implement-the-verifier-in-examples_verification).\n- **Backend \u002F UI \u002F Manifest Defect**: Regressions in [`cmd\u002F`](..\u002F..\u002F..\u002Fcmd\u002F), [`internal\u002F`](..\u002F..\u002F..\u002Finternal\u002F), [`pkg\u002F`](..\u002F..\u002F..\u002Fpkg\u002F), [`deploy\u002Fhelm\u002F`](..\u002F..\u002F..\u002Fdeploy\u002Fhelm\u002F), [`deploy\u002Fctk_v2\u002F`](..\u002F..\u002F..\u002Fdeploy\u002Fctk_v2\u002F), [`deploy\u002Faddons\u002F`](..\u002F..\u002F..\u002Fdeploy\u002Faddons\u002F), or [`deploy\u002Fclickhouse\u002F`](..\u002F..\u002F..\u002Fdeploy\u002Fclickhouse\u002F).\n\n### Layer B — Nightly Cluster (`xmc-nightly`) Rollout Skew or State Drift\n- **Client\u002FServer Rollout Skew**: `nightly-build.yml` deploys `xmc-nightly` at 01:00 UTC while `nightly-examples-e2e.yml` runs at 04:00 UTC (or on demand); inspect `rollout_skew.undeployed_commits` and `rollout_skew.cluster_deployed_files` from Stage 1 to see whether the failing example depends on undeployed server changes merged after `rollout_skew.last_green_build_run`.\n- **Addon \u002F Deployment Drift**: Missing pods, failed Helm hooks, or unapplied Gateway\u002FClickHouse\u002FMultiKueue state surfaced by `rollout_skew.active_build_run` and `deploy-gke-diagnostics`.\n\n> [!CAUTION]\n> **STRICT SHARED CLUSTER SAFETY INVARIANTS (`xmc-nightly`)**:\n> 1. **Never Mutate `xmc-nightly` Directly**: NEVER manually modify, apply manifests to, delete resources in, or upgrade `xmc-nightly` unless explicitly instructed by the user.\n> 2. **Isolate `KUBECONFIG` During Read-Only Triage**: Never overwrite default `~\u002F.kube\u002Fconfig`; pass `export KUBECONFIG=\"${ARTIFACT_DIR:-\u002Ftmp}\u002Fkubeconfig_nightly\"` for any read-only cluster inspection.\n\n---\n\n## Stage 3 — Create an Isolated Worktree & Implement the Fix\n\n1. **Create an Isolated Git Worktree from `origin\u002Fmain`**:\n   ```bash\n   SLUG=\"\u003Ckebab-case-slug>\"\n   WORKTREE_DIR=\"\u002Ftmp\u002Fxmc-fix-nightly-${SLUG}\"\n   BRANCH_NAME=\"fix\u002Fnightly-${SLUG}\"\n\n   git fetch origin main\n   git worktree add \"${WORKTREE_DIR}\" -b \"${BRANCH_NAME}\" origin\u002Fmain\n   ```\n\n2. **Implement & Verify a Minimal, Single-Responsibility Fix**:\n   Follow [XMC Feature Development](..\u002Fxmc_feature_development\u002FSKILL.md) and language rules under [`.agents\u002Frules\u002Flanguages\u002F`](..\u002F..\u002Frules\u002Flanguages\u002F):\n   - Fix the root cause without bundling unrelated refactors or cleanups.\n   - Add or update unit tests per [Strict Testing Coverage](..\u002F..\u002Frules\u002Fcore_engineering.md#5-strict-testing-coverage--pr-granularity). Never delete or weaken existing tests or assertions to make a nightly run pass.\n   - **Verifier fixes**: Keep `examples_verification\u002F\u003Cname>_test.py` entrypoints thin and place any cluster- or browser-independent parsing, normalization, or decision logic in [`tools\u002Fnightly_tests\u002Fverification\u002F`](..\u002F..\u002F..\u002Ftools\u002Fnightly_tests\u002Fverification\u002F) with a paired `*_test.py` unit test per [Nightly E2E Verifier Entrypoints](..\u002F..\u002Frules\u002Fcore_engineering.md#5-strict-testing-coverage--pr-granularity) and [`tools\u002Fnightly_tests\u002FREADME.md`](..\u002F..\u002F..\u002Ftools\u002Fnightly_tests\u002FREADME.md#1-architecture--execution-lifecycle).\n   - Stage explicit modified paths (never blind `git add -A`) and run `.\u002F.githooks\u002Fpre-commit` and affected Bazel tests until 100% green per [XMC Create PR — Pre-Commit Hooks & Commit Creation](..\u002Fxmc_create_pr\u002FSKILL.md#2-pre-commit-hooks--commit-creation) and [XMC Feature Development — Test Execution via Affected Tests Tool](..\u002Fxmc_feature_development\u002FSKILL.md#3-test-execution-via-affected-tests-tool).\n\n---\n\n## Stage 4 — Open a Draft PR\n\nDelegate commit creation, diff sizing check, confirmation gate, and Draft PR creation to [XMC Create PR — Pull Request Creation & PR Body Population](..\u002Fxmc_create_pr\u002FSKILL.md#3-pull-request-creation--pr-body-population), adding these nightly-specific details to `pr_body.md`:\n- Link the failing `main` workflow run\u002Fjob URL and state the root-cause classification from Stage 2.\n- Include `Fixes #\u003Cissue_number>` when an open `nightly-failure` GitHub Issue exists.\n- Push `fix\u002Fnightly-${SLUG}` to `origin` and keep the PR strictly in **Draft** state ([XMC Create PR — Draft PR to Open Conversion Policy](..\u002Fxmc_create_pr\u002FSKILL.md#6-draft-pr-to-open-conversion-policy-strict-confirmation-gate)).\n\n---\n\n## Stage 5 — Trigger Nightly Examples E2E on the PR Branch to Prove the Fix\n\n1. **Select Verification Workflow Scope**:\n   - **Client \u002F SDK \u002F Example \u002F Verifier \u002F Workflow Changes**: `nightly-examples-e2e.yml` builds example images and runs the branch's SDKs and verifiers directly against `xmc-nightly`. Pass `--input \"examples_filter=\u003Cids>\"` using the non-empty comma-separated `failed_jobs[].example_id` values from Stage 1 (validated pre-flight by [`dispatch_and_watch.py`](..\u002F..\u002F..\u002Ftools\u002Frelease\u002Fdispatch_and_watch.py)), or omit `--input` to run the full matrix when `example_id` is empty (non-matrix jobs such as `examples-import-check` or `build-example-images`) or when shared SDK\u002Finstaller\u002Fworkflow files changed.\n   - **Cluster-Deployed Backend \u002F UI \u002F Helm \u002F Addon Changes**: `nightly-examples-e2e.yml` tests against the server\u002FUI currently deployed on `xmc-nightly`. Proving a server\u002FUI change on `xmc-nightly` requires dispatching `nightly-build.yml` first (never `deploy-gke.yml` directly, whose `workflow_dispatch` defaults omit `xmc-nightly` addons). Because `nightly-build.yml` mutates shared `xmc-nightly` and pushes a `nightly-*` tag, **obtain explicit user confirmation first**, then run (and verify `conclusion == \"success\"`) before step 2 below:\n     ```bash\n     SLUG=\"${SLUG:-\u003Ckebab-case-slug>}\"\n     BRANCH_NAME=\"${BRANCH_NAME:-fix\u002Fnightly-${SLUG}}\"\n\n     PYTHONPATH=. python3 tools\u002Frelease\u002Fdispatch_and_watch.py --workflow nightly-build.yml --ref \"${BRANCH_NAME}\"\n     ```\n\n2. **Dispatch & Watch `nightly-examples-e2e.yml` on the Pushed PR Branch**:\n   Ensure `origin\u002F${BRANCH_NAME}` is pushed first (Stage 4). [`tools\u002Frelease\u002Fdispatch_and_watch.py`](..\u002F..\u002F..\u002Ftools\u002Frelease\u002Fdispatch_and_watch.py) fetches `origin\u002F${BRANCH_NAME}` and resolves `FETCH_HEAD` automatically when `--target-sha` is omitted (per [Workflow Orchestration & Remote Automation Invariants](..\u002F..\u002Frules\u002Fskills_and_automation.md#9-workflow-orchestration--remote-automation-invariants)), correlates the newly created `workflow_dispatch` run, and watches it to completion (`conclusion == \"success\"`):\n   ```bash\n   SLUG=\"${SLUG:-\u003Ckebab-case-slug>}\"\n   BRANCH_NAME=\"${BRANCH_NAME:-fix\u002Fnightly-${SLUG}}\"\n   EXAMPLES_FILTER=\"\u003Cmatrix_example_id_or_empty>\"\n\n   PYTHONPATH=. python3 tools\u002Frelease\u002Fdispatch_and_watch.py \\\n     --workflow nightly-examples-e2e.yml \\\n     --ref \"${BRANCH_NAME}\" \\\n     --input \"examples_filter=${EXAMPLES_FILTER}\" \\\n     --state-file \"${ARTIFACT_DIR:-\u002Ftmp}\u002Fnightly_verify_state.json\"\n   ```\n\n3. **Synchronize Draft PR Description & Report Proof**:\n   Once PR CI (`.\u002Ftools\u002Fpr_review\u002Fwait_for_ci.py \u003Cpr_number>` per [XMC Create PR — CI Wait Buffer Period](..\u002Fxmc_create_pr\u002FSKILL.md#5-ci-wait-buffer-period)) and the branch `nightly-examples-e2e.yml` run pass on `origin\u002F${BRANCH_NAME}`, update the Draft PR description via `.\u002Ftools\u002Fpr_review\u002Fupdate_pr_description.py` ([XMC Create PR — PR Description Updates via Helper Tool](..\u002Fxmc_create_pr\u002FSKILL.md#4-pr-description-updates-via-helper-tool)) with the passing verification run URL, create `.url.json` bookmark artifacts (`UserFacing: true`) for the Draft PR and verification run, and report back while keeping the PR in **Draft** state.\n",{"name":5,"description":7},"b1030912467228f082e7c927bc210d9d59e00fce",".agents\u002Fskills\u002Fxmc_fix_nightly",0,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fxmc","https:\u002F\u002Fgithub.com\u002Fgoogle","https:\u002F\u002Fopensource.google\u002F","Google ❤️ Open Source","2026-11-14 11:47:55",{"source":8,"skillName":5,"commands":52,"prompt":62,"zipAvailable":63},[53,56,59],{"tool":54,"command":55},"npx","npx skills add google\u002Fxmc --skill \"XMC Fix Nightly\"",{"tool":57,"command":58},"bunx","bunx skills add google\u002Fxmc --skill \"XMC Fix Nightly\"",{"tool":60,"command":61},"pnpm","pnpm dlx skills add google\u002Fxmc --skill \"XMC Fix Nightly\"","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fxmc\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fxmc_fix_nightly\u002FSKILL.md",true,[],[66,84,106,129,151,174],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":38},"01M6X0PXHKB5KRZ6BESP7J4A3H","XMC Upgrade Environment","Upgrades an existing XManager on Cloud (XMC) environment on GKE to the latest current branch state using the deployment configuration YAML.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fxmc\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fxmc_upgrade\u002FSKILL.md",[],[73,68,74,33,75,76,77,78,79,80,81,82,83],"environment","upgrade","deployment","upgrades","Existing","state","gke","yaml","latest","cloud","configuration",{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":38},"01M6X0PQ36XYVZW78KRBR8MT9E","XMC Trajectory Comparison","Validates proposed skill or rule changes by executing concurrent A\u002FB benchmark subagents on clean baseline vs candidate worktrees, comparing trajectories, and tearing down test resources.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fxmc\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fxmc_trajectory_comparison\u002FSKILL.md",[],[86,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105],"comparison","trajectory","resources","down","clean","trajectories","candidate","test","changes","worktrees","baseline","benchmark","clean baseline","rule","subagents",{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":38},"01M6X0PFP96RZXZNJ9V4T2ZJK5","XMC Review PR","Interactive multi-agent PR review workflow enforcing code rules, open direction discussions, explicit confirmation gates, inline comment deduplication, and follow-up re-review verification.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fxmc\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fxmc_review_pr\u002FSKILL.md",[],[108,113,21,114,115,116,117,118,119,120,30,29,121,122,123,124,125,126,127,128],"review","review pr","direction","re","up","open","confirmation","deduplication","verification","inline","follow-up","multi-agent","pr review","Rules","interactive","gates",{"skillNo":130,"name":131,"nameZh":6,"description":132,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":133,"categories":134,"keywords":135,"publishedAt":38},"01M6X0P8K827HRQFZS32Y1KB2N","XMC Release","Orchestrates an end-to-end XMC release workflow — deploying the latest main to nightly, running and verifying e2e tests, capturing visual snapshot galleries, generating and iterating on structured release notes with the user, and publishing the release. Use when preparing, orchestrating, or publishing a formal XMC release from main.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fxmc\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fxmc_release\u002FSKILL.md",[],[131,136,137,138,139,140,27,35,141,142,143,30,144,145,146,147,81,148,149,150],"release","running","end","tests","publishing","release notes","use","when","visual","with","notes","e2e tests","snapshot","user","structured",{"skillNo":152,"name":153,"nameZh":6,"description":154,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":155,"categories":156,"keywords":157,"publishedAt":38},"01M6X0P20VKAAEP4R43HJQ9957","XMC PR Split Verification","Analyzes pull request diffs exceeding size thresholds (400 prod \u002F 1000 total \u002F 1000 docs) to enforce Single Responsibility Principle (SRP), evaluate vertical slice splitting feasibility, eliminate dead code, and plan gh-stack PR stacks.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fxmc\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fxmc_pr_split_verification\u002FSKILL.md",[],[21,153,158,121,159,160,161,162,163,164,165,29,166,167,168,169,170,171,172,173],"split","pull","thresholds","slice","enforce","diffs","single","gh","vertical slice","stack","plan","size","evaluate","pull request","request","dead code",{"skillNo":175,"name":176,"nameZh":6,"description":177,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":178,"categories":179,"keywords":180,"publishedAt":38},"01M6X0NV5ZP3T8RPKRYGGJ613G","XMC Iterative Reflection","Audits active session trajectory, thought history, and PR review comments to identify friction points, rule gaps, missing helper tools, and token inefficiencies. Use when requested by the user, after major implementations, or following PR review comment resolutions.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fxmc\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fxmc_iterative_reflection\u002FSKILL.md",[],[176,181,182,143,113,183,184,185,186,21,125,187,188,142,189,190,191,92,192,104],"reflection","pr review comments","active","token","Tools","history","session","missing","helper","comments","gaps","friction"]