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.
- License 许可
- Apache-2.0
- 所属仓库
- google/xmc
- 最近更新
- 2026-11-14
- Stars
- ★ 8
- Forks
- 0
01 前言 Front Matter
- name
- XMC Release
- description
- 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.
03 SKILL.md 正文
XMC Release Orchestration Playbook
This skill guides an agent through preparing, validating, and publishing an XMC release across 5 sequential phases.
[!IMPORTANT] All execution steps in this skill MUST strictly adhere to the policy rules defined in Core Engineering Standards and Skills & Automation Guidelines.
Resumption & Phase Selection
- Idempotency & Recent Run Check: If resuming an interrupted release or if
mainhas already been deployed and tested today, check for existing successful workflow runs targeting the currentorigin/maincommit before re-triggering using--find-existing:TARGET_SHA=$(git rev-parse origin/main) STATE_FILE="${ARTIFACT_DIR:-/tmp}/release_state.json" PYTHONPATH=. python3 tools/release/dispatch_and_watch.py \ --workflow nightly-build.yml \ --target-sha "${TARGET_SHA}" \ --find-existing \ --state-file "${STATE_FILE}" - Direct Entry: If deployment and E2E tests have already succeeded for the target
TARGET_SHAcommit, the agent may proceed directly to Phase 4 or Phase 5. LoadTARGET_SHAfrom"${STATE_FILE}"if unset:STATE_FILE="${STATE_FILE:-${ARTIFACT_DIR:-/tmp}/release_state.json}" if [[ -z "${TARGET_SHA:-}" && -f "${STATE_FILE}" ]]; then TARGET_SHA=$(jq -r '.target_sha' "${STATE_FILE}") fi - Post-Review Resumption: When resuming after the user approval gate, proceed with executing the publishing step in Phase 5 using the release notes at
"${ARTIFACT_DIR:-/tmp}/release_notes_v<version>.md"without re-running earlier phases.
[!CAUTION] STRICT INVARIANT: RELEASE CONFIRMATION GATES & SAFEGUARDS
- If any deployment or E2E test fails, ABORT IMMEDIATELY AND NOTIFY THE USER. Never proceed with subsequent steps or release generation on a broken build.
- NEVER create a git tag or publish a GitHub release without explicit, affirmative confirmation from the user in the current conversation turn (see Release Publishing Gate).
Prerequisites & Tools
- Ensure
ghCLI is installed and authenticated (gh auth status). - Ensure working directory is the root of the XMC repository (can be executed from any branch or git worktree).
- Fetch the latest remote tracking refs and tags to ensure local tooling has the latest commits and tags from
mainwithout needing to check out or switch branches:git fetch origin main --tags - Initialize & Persist Release Target SHA:
Resolve the target commit from
origin/mainand initialize state tracking (persisted to"${ARTIFACT_DIR:-/tmp}/release_state.json"):TARGET_SHA=$(git rev-parse origin/main) STATE_FILE="${ARTIFACT_DIR:-/tmp}/release_state.json" echo "{\"target_sha\": \"${TARGET_SHA}\"}" > "${STATE_FILE}" - Helper tools are executed via Python with
PYTHONPATH=.configured.
Phase 1: Deploy Newest Main to Nightly
Trigger the nightly build and deployment workflow using tools/release/dispatch_and_watch.py:
# Dispatch and watch nightly deployment
DEPLOY_RESPONSE=$(PYTHONPATH=. python3 tools/release/dispatch_and_watch.py \
--workflow nightly-build.yml \
--target-sha "${TARGET_SHA}" \
--state-file "${STATE_FILE}")
Notify the user:
"Triggered nightly deployment workflow (
nightly-build.yml) for commit<TARGET_SHA>. Monitoring progress..."
Phase 2: Verify Deployment Outcome & Gate
Inspect the JSON response from dispatch_and_watch.py:
DEPLOY_CONCLUSION=$(echo "${DEPLOY_RESPONSE}" | jq -r '.result.conclusion // empty')
DEPLOY_RUN_URL=$(echo "${DEPLOY_RESPONSE}" | jq -r '.result.url // empty')
Outcome Handling:
-
If
DEPLOY_CONCLUSION != "success"(FAILED / CANCELLED / SHA MISMATCH):- Inspect the outcome details:
echo "${DEPLOY_RESPONSE}" | jq -r '.result.conclusion // .conclusion' echo "${DEPLOY_RESPONSE}" | jq -r '.result.failed_jobs // empty' - ABORT THE RELEASE PIPELINE IMMEDIATELY.
- Notify the user with exact outcome details:
- If SHA Mismatch (
DEPLOY_CONCLUSION == "sha_mismatch"):"🚨 Release Aborted: Commit SHA mismatch detected for
nightly-build.yml."- Expected Commit:
<TARGET_SHA> - Dispatched Commit:
<echo "${DEPLOY_RESPONSE}" | jq -r '.result.head_sha'> - Run URL:
<DEPLOY_RUN_URL>
- Expected Commit:
- If Cancelled (
DEPLOY_CONCLUSION == "cancelled"):"🚨 Release Aborted: Nightly deployment run was cancelled (
<DEPLOY_RUN_URL>)." (Include superseded run ID if present). - If Failed (
DEPLOY_CONCLUSION == "failure"):"🚨 Release Aborted: Nightly deployment failed on
main."- Run URL:
<DEPLOY_RUN_URL> - Failed Jobs:
<List of failed jobs and steps from output JSON>
- Run URL:
- If SHA Mismatch (
- Stop execution and await user instructions.
- Inspect the outcome details:
-
If successful: Notify the user:
"Nightly deployment succeeded (
<DEPLOY_RUN_URL>). Proceeding to E2E test suite..."The successful completion of the deployment workflow on
mainserves as the prerequisite gate verifying that the nightly environment is updated before triggering E2E tests in Phase 3. Proceed to Phase 3.
Phase 3: Run End-to-End Test Suite & Abort on Failure
Trigger and monitor the nightly examples E2E test suite against the freshly deployed nightly environment using tools/release/dispatch_and_watch.py:
E2E_RESPONSE=$(PYTHONPATH=. python3 tools/release/dispatch_and_watch.py \
--workflow nightly-examples-e2e.yml \
--target-sha "${TARGET_SHA}" \
--state-file "${STATE_FILE}")
Inspect the test outcome:
E2E_CONCLUSION=$(echo "${E2E_RESPONSE}" | jq -r '.result.conclusion // .conclusion // empty')
E2E_RUN_URL=$(echo "${E2E_RESPONSE}" | jq -r '.result.url // .url // empty')
Outcome Handling:
- If
E2E_CONCLUSION != "success":- Inspect failed test jobs:
echo "${E2E_RESPONSE}" | jq -r '.result.failed_jobs // empty' - ABORT THE RELEASE PIPELINE IMMEDIATELY.
- Notify the user:
"🚨 Release Aborted: Nightly E2E test suite failed."
- Run URL:
<E2E_RUN_URL> - Failed Examples:
<List of failed test matrix items from output JSON>
- Run URL:
- Stop execution and await user instructions.
- Inspect failed test jobs:
- If all E2E tests pass:
Notify the user:
"All E2E tests passed (
<E2E_RUN_URL>). Proceeding to visual snapshot gallery..."
Phase 4: Generate Visual Snapshot Gallery
Generate and monitor the visual snapshot gallery verifying golden UI routes on the nightly deployment:
VISUAL_RESPONSE=$(PYTHONPATH=. python3 tools/release/dispatch_and_watch.py \
--workflow nightly-visual-snapshot.yml \
--target-sha "${TARGET_SHA}" \
--state-file "${STATE_FILE}")
Inspect the gallery generation outcome:
VISUAL_CONCLUSION=$(echo "${VISUAL_RESPONSE}" | jq -r '.result.conclusion // .conclusion // empty')
VISUAL_RUN_URL=$(echo "${VISUAL_RESPONSE}" | jq -r '.result.url // .url // empty')
PAGE_URL=$(echo "${VISUAL_RESPONSE}" | jq -r '.result.page_url // .page_url // empty')
Outcome Handling:
- If visual snapshot run fails:
- Inspect the failure details:
echo "${VISUAL_RESPONSE}" | jq -r '.result.failed_jobs // empty' - Notify the user with the failure details and ask whether to abort or proceed with release notes:
"⚠️ Visual Snapshot Gallery Failed: Review logs at
<VISUAL_RUN_URL>. Awaiting confirmation on whether to abort or proceed."
- Inspect the failure details:
- If successful:
Provide the user with the snapshot gallery URL:
"✅ Visual snapshot gallery generation completed."
- Run URL:
<VISUAL_RUN_URL> - Interactive Gallery Link:
<PAGE_URL>(defaults tohttps://google.github.io/xmc/)
- Run URL:
Phase 5: Generate Notes, Review, and Publish Release
Delegate the end-to-end release documentation, interactive user review, and publishing workflow to xmc_generate_release_notes:
-
Extract Metadata & Synthesize Notes: Follow Release Range & Discovery and Deterministic Metadata Extraction. Ensure
--target-ref "${TARGET_SHA}"is explicitly passed toextract_release_metadata.pyusing the persisted${TARGET_SHA}from Prerequisites:python3 ./tools/release/extract_release_metadata.py \ --base-ref <base_tag> \ --target-ref "${TARGET_SHA}" \ --approved-flags rod_deployment_enabled rodDeployment.enabled \ --output "${ARTIFACT_DIR:-/tmp}/release_metadata.json"Follow Semantic Commit Classification and Semantic Synthesis & Narrative Formatting to draft the release notes at
"${ARTIFACT_DIR:-/tmp}/release_notes_v<version>.md". -
Interactive Review: Follow Draft Generation & Interactive Review Gate to present the proposed version increment and draft notes to the user, refining content iteratively based on feedback.
-
Preflight Validation & Publishing Confirmation Gate: Before asking for user confirmation to publish, perform a non-mutating preflight dry-run targeting
${TARGET_SHA}:PYTHONPATH=. python3 ./tools/release/publish_release.py --tag <version> --notes-file <path_to_markdown_file> --target-commit "${TARGET_SHA}" --dry-runFollow Mandatory Confirmation Gate & Release Publishing to enforce the mandatory affirmative confirmation gate. Once approved by the user in chat, execute publication targeting
${TARGET_SHA}with--draft:PYTHONPATH=. python3 ./tools/release/publish_release.py --tag <version> --notes-file <path_to_markdown_file> --target-commit "${TARGET_SHA}" --draft(Note: Never pass
--force. If the tag already exists, abort and consult the user).
04 同仓库更多 Skills
XMC Upgrade Environment
Upgrades an existing XManager on Cloud (XMC) environment on GKE to the latest current branch state using the deployment configuration YAML.
XMC Trajectory Comparison
Validates proposed skill or rule changes by executing concurrent A/B benchmark subagents on clean baseline vs candidate worktrees, comparing trajectories, and tearing down test resources.
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.
XMC PR Split Verification
Analyzes pull request diffs exceeding size thresholds (400 prod / 1000 total / 1000 docs) to enforce Single Responsibility Principle (SRP), evaluate vertical slice splitting feasibility, eliminate dead code, and plan gh-stack PR stacks.
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.
XMC Generate Release Notes
Generates structured, intelligent release notes segmented into out-of-the-box user-facing changes, behind-the-flag preview features, and operational/dev progress.