[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7BYMMDKJHKA52Q4PVAAE1G4":3,"skill-same:01M7BYMMDKJHKA52Q4PVAAE1G4":43},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":13,"repositoryHtmlUrl":26,"repositoryHomepageUrl":6,"ownerHtmlUrl":27,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":28,"install":29,"resources":42},"01M7BYMMDKJHKA52Q4PVAAE1G4","agent-hub-release",null,"Cut or wire a frozen-binary + npm sidecar release for a GAIA agent (the email-agent CI pipeline: freeze -> Agent Hub Worker \u002Fpublish -> npm OIDC). Use when releasing or onboarding a sidecar agent under hub\u002Fagents\u002F, or authoring a release_agent_\u003Cid>.yml. For the standard wheel\u002FPyPI + Hub publish, defer to the author guide docs\u002Fguides\u002Fhub-publishing.mdx — this skill is the sidecar extension on top of it.","secure-workflows\u002Fgaia","secure-workflows","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F311422533?v=4","01M7BYM925H8FAXM1DRD7F5DQD","01M7BYM92V01EZBAV87C93HNKX",0,"MIT","https:\u002F\u002Fgithub.com\u002Fsecure-workflows\u002Fgaia\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fagent-hub-release\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: \"agent-hub-release\"\ndescription: \"Cut or wire a frozen-binary + npm sidecar release for a GAIA agent (the email-agent CI pipeline: freeze -> Agent Hub Worker \u002Fpublish -> npm OIDC). Use when releasing or onboarding a sidecar agent under hub\u002Fagents\u002F, or authoring a release_agent_\u003Cid>.yml. For the standard wheel\u002FPyPI + Hub publish, defer to the author guide docs\u002Fguides\u002Fhub-publishing.mdx — this skill is the sidecar extension on top of it.\"\n---\n\n# Releasing a GAIA Sidecar Agent (frozen binary + npm)\n\nHow to ship a **sidecar agent** — a frozen, no-Python REST binary plus a thin npm\nclient — to the GAIA Agent Hub and npm, via the tag-triggered CI release. The\n**email agent is the reference**: `hub\u002Fagents\u002Femail\u002Fpython\u002F` +\n`hub\u002Fagents\u002Femail\u002Fnpm\u002F` + `.github\u002Fworkflows\u002Frelease_agent_email.yml`.\n\nThis is a **phased process with one hard human gate** (the `agent-publish`\nenvironment). Stop and confirm before anything irreversible — pushing a release\ntag, approving the publish gate. Publishes are **immutable per filename**: a bad\nrelease is fixed by a new version, never an overwrite.\n\n> **Status — the email pipeline has not yet cut a real release.**\n> `hub\u002Fagents\u002Femail\u002Fnpm\u002Fbinaries.lock.json` still carries placeholder\n> `PENDING-1648` hashes and **#1648 is open**, so the freeze→publish→fetch-verify\n> path has never run end-to-end. Treat this skill as the design of record, not a\n> paved road, until the first real release lands and fills the lock. Likewise the\n> `agent-publish` environment + `GAIA_HUB_TOKEN` + hub vars are **maintainer\n> setup** (workflow header) — verify they exist before relying on them.\n\n## Relationship to the author guide (read first)\n\n[`docs\u002Fguides\u002Fhub-publishing.mdx`](..\u002F..\u002F..\u002Fdocs\u002Fguides\u002Fhub-publishing.mdx) is the\n**author-facing** guide for the standard distribution: a Python **wheel** published\nto the Hub + PyPI via `gaia agent publish` (or the no-token PR route). It owns the\nauthoritative rules for the **manifest, versioning, immutability, and the two\npublish routes** — don't restate or contradict them here.\n\nThis skill covers the **additional** channel an agent like email layers on top: a\n**frozen native binary + an `@amd-gaia\u002Fagent-\u003Cid>` npm client**, released through\n`release_agent_\u003Cid>.yml`. An agent can ship one or both channels. Where the two\noverlap (manifest, version rules), the guide is the source of truth.\n\n**Releasing an agent that has never shipped before?** Cutting the release is the\n*last* phase. An agent is not release-ready because its code runs — it needs a\ncapability-truth audit, a real scorecard, the doc bundle, and a day-one usability\ncheck first. Use [`porting-agent-to-hub`](..\u002Fporting-agent-to-hub\u002FSKILL.md) for\nthat flow, then come back here for the lane itself.\n\n## Distribution model (the mental picture)\n\n```\nfreeze.py (PyInstaller, native per-OS, no cross-compile)\n   └─ email-agent-\u003Cplatform>[.exe]   ← one-file binary, boots a FastAPI REST sidecar\n        └─ POST \u002Fpublish  →  Agent Hub Worker (workers\u002Fagent-hub\u002F) ── R2 bucket \"gaia-hub\"\n             • stores each object IMMUTABLY under agents\u002F\u003Cid>\u002F\u003Cver>\u002F\u003Cfile>\n             • computes SHA-256 server-side\n             • rebuilds index.json (the catalog the website reads)\n        download = plain public GET at hub.amd-gaia.ai\u002Fagents\u002F\u003Cid>\u002F\u003Cver>\u002F\u003Cfile>\n   └─ @amd-gaia\u002Fagent-\u003Cid> (npm)  ← typed client + fetch CLI + sidecar lifecycle\n        • binaries.lock.json maps platform → {filename, sha256, size}; the SHA-256\n          is the integrity gate the fetch CLI enforces on download\n        • published via npm OIDC trusted publishing (provenance, NO npm token)\n```\n\nThe Worker fronts the bucket; **CI never touches R2 directly** — it POSTs to\n`\u002Fpublish` so uploads are server-checksummed and the catalog is rebuilt atomically.\nThe manifest + README ride along inside the publish.\n\n## What a sidecar agent adds (email = reference)\n\nOn top of the normal agent package (manifest + code + README + `pyproject.toml`,\nper the guide), a sidecar agent adds:\n\n| Path | Role |\n|------|------|\n| `hub\u002Fagents\u002F\u003Cid>\u002Fpython\u002Fpackaging\u002F` | `freeze.py`, `smoke_test.py`, `server.py`, `gen_binaries_lock.py`, `publish_to_r2.py`, `HUB-UPLOAD.md` (manual fallback) |\n| `hub\u002Fagents\u002F\u003Cid>\u002Fnpm\u002Fpackage.json` | ESM-only client; `exports` `.` (Node) and `.\u002Fclient` (browser-safe, client-only — landed in **#1773**) |\n| `hub\u002Fagents\u002F\u003Cid>\u002Fnpm\u002Fbinaries.lock.json` | platform → artifact + **sha256** + size + `baseUrl` (placeholders until the first release) |\n| `hub\u002Fagents\u002F\u003Cid>\u002Fnpm\u002FREADME.md` (+ `CHANGELOG.md`) | client docs; CHANGELOG is recommended (Keep a Changelog), **not** required by publish |\n| `hub\u002Fagents\u002F\u003Cid>\u002Fnpm\u002Fsrc\u002F` | `client.ts`, `client-entry.ts` (browser entry, landed in #1773), `fetch.ts`, lifecycle, `types.ts`, `errors.ts`, `cli.ts` |\n| `.github\u002Fworkflows\u002Frelease_agent_\u003Cid>.yml` | the tag-triggered release (copy of `release_agent_email.yml`) |\n\nNotes:\n- **The npm client is ESM-only** (`\"type\": \"module\"`). Node consumers use the `.`\n  entry (fetch + spawn); browser\u002FElectron renderers use `.\u002Fclient` (client-only,\n  zero Node built-ins) — landed in **#1773**, documented by **#1776**.\n- **`binaries.lock.json` ships placeholder hashes** until the first real release.\n  While a hash is a placeholder the fetch CLI is **fail-loud** — a bad binary can\n  never be fetched. For local dev, point the lifecycle helpers at a locally-frozen\n  binary instead of `fetchBinary`.\n- **Manifest validation:** validate the author manifest with `gaia agent test\n  --lint`. Do **not** validate `gaia-agent.yaml` against\n  `workers\u002Fagent-hub\u002Fschemas\u002Fmanifest.schema.json` — that is the Hub's *server-side\n  aggregate* schema and requires fields you never hand-write (`versions`,\n  `latest_version`, `deprecated`, `security_tier`, `permissions`).\n- **Platform-name skew (easy bug):** the manifest's `requirements.platforms` uses\n  `win-x64`; `binaries.lock.json` + the CI matrix use `win32-x64`. Same agent, two\n  spellings — don't copy one into the other.\n\n## The three version numbers the release checks\n\nThe `Resolve + validate release version` step fails loudly unless all three are\nidentical:\n\n1. the **tag** (or `workflow_dispatch` input) — `agent-pkg-\u003Cid>-v\u003Cversion>` → `\u003Cversion>`\n2. `hub\u002Fagents\u002F\u003Cid>\u002Fnpm\u002Fpackage.json` → `.version`\n3. `hub\u002Fagents\u002F\u003Cid>\u002Fpython\u002Fgaia-agent.yaml` → `version`\n\nBump the Python side with **`gaia agent version patch|minor|major`** (it rewrites\n`gaia-agent.yaml` + `pyproject.toml` + `__init__.py` together — bumping **from the\n`gaia-agent.yaml` value**, ignoring whatever the npm `package.json` currently says),\nthen **manually set the npm `package.json`** to that same version — the release\ntooling checks all three agree. (Heads up: they can already be out of sync — e.g. a\npackage.json ahead of `gaia-agent.yaml` — so a blind `patch` bumps the yaml base, not\nthe npm value; the manual npm sync is what actually reconciles them.) Add the\nmatching `CHANGELOG.md` entry too if the agent keeps one (recommended, not required by publish). `binaries.lock.json`'s `agentVersion`\n+ `baseUrl` are **regenerated by CI** — don't hand-edit them for a release.\n\n## Cutting a release (existing agent)\n\n1. **Version-bump PR → main.** `gaia agent version \u003Cbump>`, sync the npm\n   `package.json`, add the CHANGELOG entry, merge to `main` (the workflow asserts the\n   release commit is a `main` ancestor — publishing is allowed only from main).\n2. **Pre-flight** in `hub\u002Fagents\u002F\u003Cid>\u002Fnpm\u002F`: `npm ci && npm run build && npm\n   test`, and `npm pack --dry-run` to confirm `README.md` ships (and `CHANGELOG.md`, if you keep one).\n3. **Tag from main** (or `workflow_dispatch` with the version):\n   ```bash\n   git tag agent-pkg-\u003Cid>-v\u003Cversion> && git push origin --tags\n   ```\n   Namespace is `agent-pkg-\u003Cid>-*` (NOT `v*`) — it deliberately does not fire the\n   core `publish.yml`.\n4. **Build stage** freezes on 4 platforms — `win32-x64`, `darwin-arm64`, `linux-x64`\n   **required**; `darwin-x64` (Intel) **best-effort** — smoke-tests each, hashes it.\n   (The smoke test proves the binary boots and the REST route answers; with no\n   Lemonade in CI it does **not** exercise real LLM triage — a 502\u002Ftimeout passes.)\n5. **Approve the gate.** The `publish` job pauses on the `agent-publish` environment\n   until a maintainer approves; the publish token isn't readable until then.\n6. **Publish stage** (atomic): POST every binary to `\u002Fpublish` → regenerate\n   `binaries.lock.json` with the **real** hashes → **fetch-verify every published\n   object** against the lock → `npm publish` via OIDC (provenance) → trigger\n   `deploy_website.yml` so the new catalog entry appears.\n\nMonitor with `gh run watch`. `npm publish` skips if that exact version already\nexists; `\u002Fpublish` is a verified 409 no-op for identical bytes.\n\n## Onboarding a NEW sidecar agent (one-time)\n\n1. **Scaffold** the normal agent first (`gaia agent init`, per the guide), then add\n   `packaging\u002F` and the `hub\u002Fagents\u002F\u003Cid>\u002Fnpm\u002F` client. Mirror email.\n2. **Adapt the packaging scripts.** `freeze.py` (its `NAME = \"email-agent\"` constant)\n   and `publish_to_r2.py` (the executable name + the `email-agent-` filename prefix it\n   parses) **hardcode `email-agent`** — copy + parameterize them for `\u003Cid>`.\n   `gen_binaries_lock.py` is already generic (driven by `published.json` + manifest\n   `id`); the `agents\u002Femail` hub prefix lives in the workflow's `HUB_PREFIX` env, not a\n   script.\n3. **Copy the workflow** `release_agent_email.yml` → `release_agent_\u003Cid>.yml` and\n   change: `PKG_DIR`, `MANIFEST`, `README`, `FREEZE_DIST`, `HUB_PREFIX`\n   (`agents\u002F\u003Cid>`), the tag trigger (`agent-pkg-\u003Cid>-*`), the artifact\u002Ffrozen names,\n   and the npm package name in the verify\u002Fpublish steps.\n4. **Register the npm trusted publisher** for `@amd-gaia\u002Fagent-\u003Cid>` against the\n   exact filename `release_agent_\u003Cid>.yml`. ⚠️ The OIDC subject is tied to the\n   filename — **renaming the workflow later breaks publish.**\n5. *(Maintainability)* per-agent copies of a ~550-line workflow + three hardcoded\n   scripts **will drift**. The durable fix is a reusable `workflow_call` release\n   workflow + scripts parameterized by `\u003Cid>`; the per-agent copy is interim.\n\n## One-time infrastructure (verify it exists)\n\nPer the workflow header (`release_agent_email.yml`), these are **maintainer setup**\n— confirm each before the first release:\n\n- **GitHub environment `agent-publish`** with **required reviewers**; restrict its\n  deployment branches\u002Ftags to `main` **and** the `agent-pkg-*` tag pattern (a\n  main-only rule blocks the tag-triggered gate).\n- **Secret `GAIA_HUB_TOKEN`** — Agent Hub Bearer token matching an entry in the\n  Worker's `PUBLISH_TOKENS`, scoped to the agent's `author`. Define it as an\n  **environment** secret on `agent-publish` (not a repo secret) so it's unreadable\n  until the gate is approved. (The workflow maps it into the publish script's\n  `AGENT_HUB_PUBLISH_TOKEN` env var — same token, different name inside the script.)\n- **Var `GAIA_HUB_BASE_URL`** — public Worker origin for downloads + the lock\n  `baseUrl` (default `https:\u002F\u002Fhub.amd-gaia.ai`).\n- **Var `GAIA_HUB_PUBLISH_URL`** — the Worker's **workers.dev** URL for uploads. The\n  free-plan WAF on the proxied `hub.amd-gaia.ai` custom domain blocks large binary\n  uploads (but not GETs). **Required** — the release fails loudly if it is unset (no\n  silent fallback to the custom domain).\n- **Railway `HUB_CATALOG_URL=https:\u002F\u002Fhub.amd-gaia.ai`** so the website rebuild\n  reflects the new entry.\n\n## Invariants & gotchas\n\n- **Immutable per filename.** The Worker `409`s on any re-POST of an existing\n  filename (it keys on the filename via `head()`, not a byte-compare). The publish\n  script then re-fetches and hashes the stored object: **identical bytes → idempotent\n  no-op**, a **hash mismatch → fail loudly**. Fix a bad release with a new version —\n  never an overwrite. (Same immutability the guide describes for `id@version`.)\n- **Publish only from main.** The job asserts the release commit is on `main`.\n- **`SCHEMA_VERSION` MAJOR is the compat gate.** Client and binary must agree on the\n  wire-contract MAJOR or `startSidecar` throws `VersionMismatchError`. Bump the npm\n  package and re-publish the binary together.\n- **Best-effort Intel.** `darwin-x64` builds on `macos-26-intel`, then is verified on\n  `macos-15-intel`. If it fails\u002Fabsent it's **dropped** (3-platform release) with a\n  loud `::warning::`; Intel users get a clear \"no binary for darwin-x64\" install\n  error, never a placeholder one.\n- **SHA-256 provenance.** `publish_to_r2.py` hashes each binary locally and the Worker\n  hashes it server-side; the script **asserts they match** on the `201` before that\n  (local, server-verified) hash is written to `binaries.lock.json`. The lock hash is\n  then the gate the npm `fetch` CLI enforces on download (`PlatformError` on a\n  placeholder, `IntegrityError` on a mismatch).\n- **Fetch-verify is the real gate.** After `\u002Fpublish`, CI re-fetches every object via\n  the npm `fetch` CLI and checks bytes-hash-to-lock (bounded retry for Cloudflare\n  edge propagation) before `npm publish`.\n- **Website is rebuilt, not patched.** Hub pages build from live `index.json`; the\n  publish job triggers `deploy_website.yml` on `main`. (A generic per-agent\n  auto-redeploy is still being wired — see the guide's Verify step.)\n- **Manual fallback:** `hub\u002Fagents\u002F\u003Cid>\u002Fpython\u002Fpackaging\u002FHUB-UPLOAD.md` documents the\n  by-hand rclone path to the `gaia-hub` bucket — identical objects + lock as CI.\n- **Write the CHANGELOG entry, PR body, and your status reports** per [CLAUDE.md → How You\n  Communicate](..\u002F..\u002F..\u002FCLAUDE.md#how-you-communicate): lead with what changes for someone\n  installing the agent, put versions, hashes, and workflow mechanics underneath. Always say\n  which platforms actually shipped — a dropped Intel build is the headline, not a footnote.\n\n## Reference files\n\n- `.github\u002Fworkflows\u002Frelease_agent_email.yml` — the canonical release workflow (its\n  header comments document the whole contract).\n- `docs\u002Fguides\u002Fhub-publishing.mdx` — the author guide (manifest, versioning, wheel +\n  PR publish routes). The overlap's source of truth.\n- `hub\u002Fagents\u002Femail\u002Fpython\u002Fgaia-agent.yaml` — manifest reference.\n- `hub\u002Fagents\u002Femail\u002Fnpm\u002F{package.json,binaries.lock.json,README.md}` —\n  client package reference.\n- `hub\u002Fagents\u002Femail\u002Fpython\u002Fpackaging\u002F{freeze,smoke_test,publish_to_r2,gen_binaries_lock}.py`,\n  `HUB-UPLOAD.md` — packaging + publish tooling.\n- `workers\u002Fagent-hub\u002F{README.md,schemas\u002Fmanifest.schema.json,src\u002F}` — the Worker, the\n  `\u002Fpublish` contract, and the server-side aggregate schema.\n","# Releasing a GAIA Sidecar Agent (frozen binary + npm)\n\nHow to ship a **sidecar agent** — a frozen, no-Python REST binary plus a thin npm\nclient — to the GAIA Agent Hub and npm, via the tag-triggered CI release. The\n**email agent is the reference**: `hub\u002Fagents\u002Femail\u002Fpython\u002F` +\n`hub\u002Fagents\u002Femail\u002Fnpm\u002F` + `.github\u002Fworkflows\u002Frelease_agent_email.yml`.\n\nThis is a **phased process with one hard human gate** (the `agent-publish`\nenvironment). Stop and confirm before anything irreversible — pushing a release\ntag, approving the publish gate. Publishes are **immutable per filename**: a bad\nrelease is fixed by a new version, never an overwrite.\n\n> **Status — the email pipeline has not yet cut a real release.**\n> `hub\u002Fagents\u002Femail\u002Fnpm\u002Fbinaries.lock.json` still carries placeholder\n> `PENDING-1648` hashes and **#1648 is open**, so the freeze→publish→fetch-verify\n> path has never run end-to-end. Treat this skill as the design of record, not a\n> paved road, until the first real release lands and fills the lock. Likewise the\n> `agent-publish` environment + `GAIA_HUB_TOKEN` + hub vars are **maintainer\n> setup** (workflow header) — verify they exist before relying on them.\n\n## Relationship to the author guide (read first)\n\n[`docs\u002Fguides\u002Fhub-publishing.mdx`](..\u002F..\u002F..\u002Fdocs\u002Fguides\u002Fhub-publishing.mdx) is the\n**author-facing** guide for the standard distribution: a Python **wheel** published\nto the Hub + PyPI via `gaia agent publish` (or the no-token PR route). It owns the\nauthoritative rules for the **manifest, versioning, immutability, and the two\npublish routes** — don't restate or contradict them here.\n\nThis skill covers the **additional** channel an agent like email layers on top: a\n**frozen native binary + an `@amd-gaia\u002Fagent-\u003Cid>` npm client**, released through\n`release_agent_\u003Cid>.yml`. An agent can ship one or both channels. Where the two\noverlap (manifest, version rules), the guide is the source of truth.\n\n**Releasing an agent that has never shipped before?** Cutting the release is the\n*last* phase. An agent is not release-ready because its code runs — it needs a\ncapability-truth audit, a real scorecard, the doc bundle, and a day-one usability\ncheck first. Use [`porting-agent-to-hub`](..\u002Fporting-agent-to-hub\u002FSKILL.md) for\nthat flow, then come back here for the lane itself.\n\n## Distribution model (the mental picture)\n\n```\nfreeze.py (PyInstaller, native per-OS, no cross-compile)\n   └─ email-agent-\u003Cplatform>[.exe]   ← one-file binary, boots a FastAPI REST sidecar\n        └─ POST \u002Fpublish  →  Agent Hub Worker (workers\u002Fagent-hub\u002F) ── R2 bucket \"gaia-hub\"\n             • stores each object IMMUTABLY under agents\u002F\u003Cid>\u002F\u003Cver>\u002F\u003Cfile>\n             • computes SHA-256 server-side\n             • rebuilds index.json (the catalog the website reads)\n        download = plain public GET at hub.amd-gaia.ai\u002Fagents\u002F\u003Cid>\u002F\u003Cver>\u002F\u003Cfile>\n   └─ @amd-gaia\u002Fagent-\u003Cid> (npm)  ← typed client + fetch CLI + sidecar lifecycle\n        • binaries.lock.json maps platform → {filename, sha256, size}; the SHA-256\n          is the integrity gate the fetch CLI enforces on download\n        • published via npm OIDC trusted publishing (provenance, NO npm token)\n```\n\nThe Worker fronts the bucket; **CI never touches R2 directly** — it POSTs to\n`\u002Fpublish` so uploads are server-checksummed and the catalog is rebuilt atomically.\nThe manifest + README ride along inside the publish.\n\n## What a sidecar agent adds (email = reference)\n\nOn top of the normal agent package (manifest + code + README + `pyproject.toml`,\nper the guide), a sidecar agent adds:\n\n| Path | Role |\n|------|------|\n| `hub\u002Fagents\u002F\u003Cid>\u002Fpython\u002Fpackaging\u002F` | `freeze.py`, `smoke_test.py`, `server.py`, `gen_binaries_lock.py`, `publish_to_r2.py`, `HUB-UPLOAD.md` (manual fallback) |\n| `hub\u002Fagents\u002F\u003Cid>\u002Fnpm\u002Fpackage.json` | ESM-only client; `exports` `.` (Node) and `.\u002Fclient` (browser-safe, client-only — landed in **#1773**) |\n| `hub\u002Fagents\u002F\u003Cid>\u002Fnpm\u002Fbinaries.lock.json` | platform → artifact + **sha256** + size + `baseUrl` (placeholders until the first release) |\n| `hub\u002Fagents\u002F\u003Cid>\u002Fnpm\u002FREADME.md` (+ `CHANGELOG.md`) | client docs; CHANGELOG is recommended (Keep a Changelog), **not** required by publish |\n| `hub\u002Fagents\u002F\u003Cid>\u002Fnpm\u002Fsrc\u002F` | `client.ts`, `client-entry.ts` (browser entry, landed in #1773), `fetch.ts`, lifecycle, `types.ts`, `errors.ts`, `cli.ts` |\n| `.github\u002Fworkflows\u002Frelease_agent_\u003Cid>.yml` | the tag-triggered release (copy of `release_agent_email.yml`) |\n\nNotes:\n- **The npm client is ESM-only** (`\"type\": \"module\"`). Node consumers use the `.`\n  entry (fetch + spawn); browser\u002FElectron renderers use `.\u002Fclient` (client-only,\n  zero Node built-ins) — landed in **#1773**, documented by **#1776**.\n- **`binaries.lock.json` ships placeholder hashes** until the first real release.\n  While a hash is a placeholder the fetch CLI is **fail-loud** — a bad binary can\n  never be fetched. For local dev, point the lifecycle helpers at a locally-frozen\n  binary instead of `fetchBinary`.\n- **Manifest validation:** validate the author manifest with `gaia agent test\n  --lint`. Do **not** validate `gaia-agent.yaml` against\n  `workers\u002Fagent-hub\u002Fschemas\u002Fmanifest.schema.json` — that is the Hub's *server-side\n  aggregate* schema and requires fields you never hand-write (`versions`,\n  `latest_version`, `deprecated`, `security_tier`, `permissions`).\n- **Platform-name skew (easy bug):** the manifest's `requirements.platforms` uses\n  `win-x64`; `binaries.lock.json` + the CI matrix use `win32-x64`. Same agent, two\n  spellings — don't copy one into the other.\n\n## The three version numbers the release checks\n\nThe `Resolve + validate release version` step fails loudly unless all three are\nidentical:\n\n1. the **tag** (or `workflow_dispatch` input) — `agent-pkg-\u003Cid>-v\u003Cversion>` → `\u003Cversion>`\n2. `hub\u002Fagents\u002F\u003Cid>\u002Fnpm\u002Fpackage.json` → `.version`\n3. `hub\u002Fagents\u002F\u003Cid>\u002Fpython\u002Fgaia-agent.yaml` → `version`\n\nBump the Python side with **`gaia agent version patch|minor|major`** (it rewrites\n`gaia-agent.yaml` + `pyproject.toml` + `__init__.py` together — bumping **from the\n`gaia-agent.yaml` value**, ignoring whatever the npm `package.json` currently says),\nthen **manually set the npm `package.json`** to that same version — the release\ntooling checks all three agree. (Heads up: they can already be out of sync — e.g. a\npackage.json ahead of `gaia-agent.yaml` — so a blind `patch` bumps the yaml base, not\nthe npm value; the manual npm sync is what actually reconciles them.) Add the\nmatching `CHANGELOG.md` entry too if the agent keeps one (recommended, not required by publish). `binaries.lock.json`'s `agentVersion`\n+ `baseUrl` are **regenerated by CI** — don't hand-edit them for a release.\n\n## Cutting a release (existing agent)\n\n1. **Version-bump PR → main.** `gaia agent version \u003Cbump>`, sync the npm\n   `package.json`, add the CHANGELOG entry, merge to `main` (the workflow asserts the\n   release commit is a `main` ancestor — publishing is allowed only from main).\n2. **Pre-flight** in `hub\u002Fagents\u002F\u003Cid>\u002Fnpm\u002F`: `npm ci && npm run build && npm\n   test`, and `npm pack --dry-run` to confirm `README.md` ships (and `CHANGELOG.md`, if you keep one).\n3. **Tag from main** (or `workflow_dispatch` with the version):\n   ```bash\n   git tag agent-pkg-\u003Cid>-v\u003Cversion> && git push origin --tags\n   ```\n   Namespace is `agent-pkg-\u003Cid>-*` (NOT `v*`) — it deliberately does not fire the\n   core `publish.yml`.\n4. **Build stage** freezes on 4 platforms — `win32-x64`, `darwin-arm64`, `linux-x64`\n   **required**; `darwin-x64` (Intel) **best-effort** — smoke-tests each, hashes it.\n   (The smoke test proves the binary boots and the REST route answers; with no\n   Lemonade in CI it does **not** exercise real LLM triage — a 502\u002Ftimeout passes.)\n5. **Approve the gate.** The `publish` job pauses on the `agent-publish` environment\n   until a maintainer approves; the publish token isn't readable until then.\n6. **Publish stage** (atomic): POST every binary to `\u002Fpublish` → regenerate\n   `binaries.lock.json` with the **real** hashes → **fetch-verify every published\n   object** against the lock → `npm publish` via OIDC (provenance) → trigger\n   `deploy_website.yml` so the new catalog entry appears.\n\nMonitor with `gh run watch`. `npm publish` skips if that exact version already\nexists; `\u002Fpublish` is a verified 409 no-op for identical bytes.\n\n## Onboarding a NEW sidecar agent (one-time)\n\n1. **Scaffold** the normal agent first (`gaia agent init`, per the guide), then add\n   `packaging\u002F` and the `hub\u002Fagents\u002F\u003Cid>\u002Fnpm\u002F` client. Mirror email.\n2. **Adapt the packaging scripts.** `freeze.py` (its `NAME = \"email-agent\"` constant)\n   and `publish_to_r2.py` (the executable name + the `email-agent-` filename prefix it\n   parses) **hardcode `email-agent`** — copy + parameterize them for `\u003Cid>`.\n   `gen_binaries_lock.py` is already generic (driven by `published.json` + manifest\n   `id`); the `agents\u002Femail` hub prefix lives in the workflow's `HUB_PREFIX` env, not a\n   script.\n3. **Copy the workflow** `release_agent_email.yml` → `release_agent_\u003Cid>.yml` and\n   change: `PKG_DIR`, `MANIFEST`, `README`, `FREEZE_DIST`, `HUB_PREFIX`\n   (`agents\u002F\u003Cid>`), the tag trigger (`agent-pkg-\u003Cid>-*`), the artifact\u002Ffrozen names,\n   and the npm package name in the verify\u002Fpublish steps.\n4. **Register the npm trusted publisher** for `@amd-gaia\u002Fagent-\u003Cid>` against the\n   exact filename `release_agent_\u003Cid>.yml`. ⚠️ The OIDC subject is tied to the\n   filename — **renaming the workflow later breaks publish.**\n5. *(Maintainability)* per-agent copies of a ~550-line workflow + three hardcoded\n   scripts **will drift**. The durable fix is a reusable `workflow_call` release\n   workflow + scripts parameterized by `\u003Cid>`; the per-agent copy is interim.\n\n## One-time infrastructure (verify it exists)\n\nPer the workflow header (`release_agent_email.yml`), these are **maintainer setup**\n— confirm each before the first release:\n\n- **GitHub environment `agent-publish`** with **required reviewers**; restrict its\n  deployment branches\u002Ftags to `main` **and** the `agent-pkg-*` tag pattern (a\n  main-only rule blocks the tag-triggered gate).\n- **Secret `GAIA_HUB_TOKEN`** — Agent Hub Bearer token matching an entry in the\n  Worker's `PUBLISH_TOKENS`, scoped to the agent's `author`. Define it as an\n  **environment** secret on `agent-publish` (not a repo secret) so it's unreadable\n  until the gate is approved. (The workflow maps it into the publish script's\n  `AGENT_HUB_PUBLISH_TOKEN` env var — same token, different name inside the script.)\n- **Var `GAIA_HUB_BASE_URL`** — public Worker origin for downloads + the lock\n  `baseUrl` (default `https:\u002F\u002Fhub.amd-gaia.ai`).\n- **Var `GAIA_HUB_PUBLISH_URL`** — the Worker's **workers.dev** URL for uploads. The\n  free-plan WAF on the proxied `hub.amd-gaia.ai` custom domain blocks large binary\n  uploads (but not GETs). **Required** — the release fails loudly if it is unset (no\n  silent fallback to the custom domain).\n- **Railway `HUB_CATALOG_URL=https:\u002F\u002Fhub.amd-gaia.ai`** so the website rebuild\n  reflects the new entry.\n\n## Invariants & gotchas\n\n- **Immutable per filename.** The Worker `409`s on any re-POST of an existing\n  filename (it keys on the filename via `head()`, not a byte-compare). The publish\n  script then re-fetches and hashes the stored object: **identical bytes → idempotent\n  no-op**, a **hash mismatch → fail loudly**. Fix a bad release with a new version —\n  never an overwrite. (Same immutability the guide describes for `id@version`.)\n- **Publish only from main.** The job asserts the release commit is on `main`.\n- **`SCHEMA_VERSION` MAJOR is the compat gate.** Client and binary must agree on the\n  wire-contract MAJOR or `startSidecar` throws `VersionMismatchError`. Bump the npm\n  package and re-publish the binary together.\n- **Best-effort Intel.** `darwin-x64` builds on `macos-26-intel`, then is verified on\n  `macos-15-intel`. If it fails\u002Fabsent it's **dropped** (3-platform release) with a\n  loud `::warning::`; Intel users get a clear \"no binary for darwin-x64\" install\n  error, never a placeholder one.\n- **SHA-256 provenance.** `publish_to_r2.py` hashes each binary locally and the Worker\n  hashes it server-side; the script **asserts they match** on the `201` before that\n  (local, server-verified) hash is written to `binaries.lock.json`. The lock hash is\n  then the gate the npm `fetch` CLI enforces on download (`PlatformError` on a\n  placeholder, `IntegrityError` on a mismatch).\n- **Fetch-verify is the real gate.** After `\u002Fpublish`, CI re-fetches every object via\n  the npm `fetch` CLI and checks bytes-hash-to-lock (bounded retry for Cloudflare\n  edge propagation) before `npm publish`.\n- **Website is rebuilt, not patched.** Hub pages build from live `index.json`; the\n  publish job triggers `deploy_website.yml` on `main`. (A generic per-agent\n  auto-redeploy is still being wired — see the guide's Verify step.)\n- **Manual fallback:** `hub\u002Fagents\u002F\u003Cid>\u002Fpython\u002Fpackaging\u002FHUB-UPLOAD.md` documents the\n  by-hand rclone path to the `gaia-hub` bucket — identical objects + lock as CI.\n- **Write the CHANGELOG entry, PR body, and your status reports** per [CLAUDE.md → How You\n  Communicate](..\u002F..\u002F..\u002FCLAUDE.md#how-you-communicate): lead with what changes for someone\n  installing the agent, put versions, hashes, and workflow mechanics underneath. Always say\n  which platforms actually shipped — a dropped Intel build is the headline, not a footnote.\n\n## Reference files\n\n- `.github\u002Fworkflows\u002Frelease_agent_email.yml` — the canonical release workflow (its\n  header comments document the whole contract).\n- `docs\u002Fguides\u002Fhub-publishing.mdx` — the author guide (manifest, versioning, wheel +\n  PR publish routes). The overlap's source of truth.\n- `hub\u002Fagents\u002Femail\u002Fpython\u002Fgaia-agent.yaml` — manifest reference.\n- `hub\u002Fagents\u002Femail\u002Fnpm\u002F{package.json,binaries.lock.json,README.md}` —\n  client package reference.\n- `hub\u002Fagents\u002Femail\u002Fpython\u002Fpackaging\u002F{freeze,smoke_test,publish_to_r2,gen_binaries_lock}.py`,\n  `HUB-UPLOAD.md` — packaging + publish tooling.\n- `workers\u002Fagent-hub\u002F{README.md,schemas\u002Fmanifest.schema.json,src\u002F}` — the Worker, the\n  `\u002Fpublish` contract, and the server-side aggregate schema.\n",{"name":5,"description":7},"main","11039b64e036dca33313350b4cd1d6c2a791eb15",".claude\u002Fskills\u002Fagent-hub-release","https:\u002F\u002Fgithub.com\u002Fsecure-workflows\u002Fgaia","https:\u002F\u002Fgithub.com\u002Fsecure-workflows","2026-10-26 10:48:34",{"source":8,"skillName":5,"commands":30,"prompt":40,"zipAvailable":41},[31,34,37],{"tool":32,"command":33},"npx","npx skills add secure-workflows\u002Fgaia --skill agent-hub-release",{"tool":35,"command":36},"bunx","bunx skills add secure-workflows\u002Fgaia --skill agent-hub-release",{"tool":38,"command":39},"pnpm","pnpm dlx skills add secure-workflows\u002Fgaia --skill agent-hub-release","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fsecure-workflows\u002Fgaia\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fagent-hub-release\u002FSKILL.md",true,[],[44,51,58,65,72,79],{"skillNo":45,"name":46,"nameZh":6,"description":47,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":48,"categories":49,"keywords":50,"publishedAt":18},"01M7BYXGPPQJGVVD0DPS2WK3FS","web-search","Search the web via the Brave Search API. Use when the user asks about current events or external facts.","https:\u002F\u002Fgithub.com\u002Fsecure-workflows\u002Fgaia\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskills\u002Fweb-search\u002FSKILL.md",[],[],{"skillNo":52,"name":53,"nameZh":6,"description":54,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":18},"01M7BYXDF2TM5JPMEQKMMHW0VJ","triage-support-ticket","Triage an inbound support ticket end to end. Use when the user pastes a support ticket or asks to triage one.","https:\u002F\u002Fgithub.com\u002Fsecure-workflows\u002Fgaia\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskills\u002Ftriage-support-ticket\u002FSKILL.md",[],[],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":18},"01M7BYXAHWNBMJ8Y1Q51EZ53K7","tool-mismatch","Declares a tool its tools.py never registers. Used to prove validation fails loudly with no partial load.","https:\u002F\u002Fgithub.com\u002Fsecure-workflows\u002Fgaia\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskills\u002Ftool-mismatch\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":18},"01M7BYX6CZ63AM6HB90PPNXKF7","report-archive","Archive a generated report to the user's reports folder and register it with the team's report index. Use when the user asks to file, archive, or publish a finished report.","https:\u002F\u002Fgithub.com\u002Fsecure-workflows\u002Fgaia\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskills\u002Freport-archive\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":18},"01M7BYX4PM4HGNZ0QBZ54BTG1N","local-capability","Writes files on the local workspace. Used to prove Phase 1 refuses local-capability permissions.","https:\u002F\u002Fgithub.com\u002Fsecure-workflows\u002Fgaia\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskills\u002Flocal-capability\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":18},"01M7BYX1KVPKHHZ5Z3R3BB0QQA","incident-review","Run an incident postmortem. Stands in for a Claude Code skill library imported read-only from .claude\u002Fskills\u002F.","https:\u002F\u002Fgithub.com\u002Fsecure-workflows\u002Fgaia\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskills\u002Fincident-review\u002FSKILL.md",[],[]]