publish-extension
VS Code Extension Release
Use this skill when the user asks to release, publish, or ship the VS Code extension — stable, nightly, or an emergency legacy hotfix — or to retire the leftover A/B rollout machinery.
Working directory: repo root. All workflows are dispatched from main (GitHub requires the workflow file on the default branch; each workflow checks out the refs it actually builds).The current era: standalone SDK extension from main
The legacy → SDK migration is complete. The PostHog flag ext-sdk-bundle-rollout reached 100% (verified empirically 2026-09-15: 200/200 /decide probes returned true), so every user on the combined VSIX runs the next (SDK, bun) bundle and the legacy/ half is dead weight. Stable releases now ship a plain build of main through ext-vscode-publish.yml — a copy of the A/B workflow with the loader, legacy/ bundle and stitching removed, and the same build-artifact-then-vsce publish --packagePath publish step. The combined A/B path (ext-vscode-ab-package.yml) is no longer used for releases and is pending deletion — see "Retiring the A/B machinery" at the bottom for what is still left to clean up and the one caveat (leave the flag at 100%).
Do not use ext-vscode-publish-stable.yml. Its publish step (bun run publish:marketplace → bare vsce publish, which re-runs vscode:prepublish and repacks the source tree) hung on all five attempts for v4.1.18 (2026-09-15/17), each exactly 180s after "Publishing ..." with Request timeout: /_apis/gallery. That path is the client's FIRST request (route discovery, no body) — the VSIX was never uploaded, so nothing about the artifact is the cause. The same code line went out as 4.1.19 through the prebuilt-artifact path in seconds. Root cause is not established (see the gotcha at the bottom); the stable workflow is kept only until the new one has shipped a release, then deleted.
History, for context only: the A/B era ran 4.1.0 → 4.1.19 (Jul–Sep 2026). Design docs remain at apps/vscode-rollout/README.md and PR #12253 until that directory is removed.
The listings and the workflows
| Channel | Marketplace ID | Workflow | Trigger | Version |
|---|---|---|---|---|
| Stable | saoudrizwan.claude-dev | ext-vscode-publish.yml | dispatch, from main | apps/vscode/package.json on main; the version input must equal it |
| Nightly | saoudrizwan.cline-nightly | ext-vscode-publish-nightly.yml | manual dispatch only (cron deliberately removed) | auto <major>.<minor>.<unix-ts> from main's apps/vscode/package.json |
| Legacy hotfix (emergency only) | saoudrizwan.claude-dev | ext-vscode-publish-legacy.yml | dispatch | apps/vscode/package.json on legacy-extension |
Stable runs four jobs: preflight (input regex, main-only publish, Marketplace monotonicity) and the reusable bun suite (ext-vscode-test.yml, tests the dispatch SHA) ungated → build (no environment; packages the .vsix as a run artifact, so publish=false rehearsals need no approval) → publish (publish environment — required reviewers approve in the Actions UI; uploads the artifact, then tag/release/Slack). Nightly uses PublishNightly (branch policy only). Nightly still builds the combined loader VSIX (loader + next/ + legacy/) until it is converted back to a plain build — that conversion is on the retirement list below.
Golden rules (read before any release)
- One listing, one version line.
claude-devhas been published from multiple workflows and branches. Every stable publish must use a version strictly above the highest version ever published to the listing from any branch — marketplace versions are monotonic and cannot be unpublished (supersede, never delete). Check what's live first:
```bash
curl -s -X POST "https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery" \
-H "Content-Type: application/json" -H "Accept: application/json;api-version=3.0-preview.1" \
-d '{"filters":[{"criteria":[{"filterType":7,"value":"saoudrizwan.claude-dev"}]}],"flags":16}' \
| python3 -c "import json,sys; v=json.load(sys.stdin)['results'][0]['extensions'][0]['versions'][0]; print(v['version'], v['lastUpdated'])"
```
ext-vscode-publish runs this same check twice (preflight, and again right before the upload — the approval wait can last days), so a non-monotonic dispatch fails in seconds. Still run the query yourself to pick the number. The legacy-extension branch sits at 4.0.12, so it cannot collide with the 4.1.x line, but a legacy hotfix would have to be numbered above the live stable version (see the emergency section).
versioninput == package version, enforced. The build job readsapps/vscode/package.jsonand hard-fails unless it equals theversioninput (plainX.Y.Z, nov). The input is a confirmation, not a stamp — bump the version onmainfirst. Thev<version>tag is created by the workflow *after* a successful Marketplace publish.
- Changelog lives at the repo ROOT (
CHANGELOG.md) — notapps/vscode/CHANGELOG.md(doesn't exist). The workflow hard-fails unless the first## [heading is exactly## [<version>]. The section body becomes the GitHub release notes and the Slack post (Slack copy is trimmed to 3000 chars with a link out; the release body stays whole).
- Ask before pushing commits or tags. Never approve the
publishenvironment gate yourself viagh api— hand the maintainer the run URL to click "Revi
