| name | release-process |
| description | Complete release automation for VS Code Marketplace publishing |
| tier | standard |
| applyTo | **/*release*,**/*publish*,**/*.vsix,**/CHANGELOG* |
| inheritance | master-only |
Release Process Skill
Inheritance: master-only (contains PAT handling, marketplace credentials)
Purpose
Comprehensive knowledge for releasing Alex Cognitive Architecture to VS Code Marketplace and managing version lifecycle.
Quick Reference
Release Commands
# From repo root
.\scripts\release-vscode.ps1 -BumpType patch # Stable release
.\scripts\release-vscode.ps1 -BumpType minor -PreRelease # Pre-release
.\scripts\release-vscode.ps1 -BumpType patch -DryRun # Test without publishing
Manual Publishing
cd platforms/vscode-extension
npx vsce publish --pre-release
npx vsce publish
PAT (Personal Access Token) Setup
โ ๏ธ IMPORTANT: PATs expire frequently and may only work for a single publish session.
Always create a fresh PAT before each release to avoid 401 errors.
Creating a New PAT
-
Via Marketplace (Recommended):
-
Via Azure DevOps:
- Go to: https://dev.azure.com/
- Click User Settings (gear icon) โ Personal Access Tokens
- Click "New Token"
- Name:
vsce-marketplace (or similar)
- Organization:
All accessible organizations
- Expiration: Set appropriate duration (max 1 year)
- Scopes: Select
Marketplace โ Manage
- Click Create, copy token
Storing the PAT
Option 1: Environment Variable (Session only)
$env:VSCE_PAT = "your-token-here"
Option 2: .env File (Persistent, gitignored)
# platforms/vscode-extension/.env
VSCE_PAT=your-token-here
Dual .env Warning: Both Alex_Plug_In/.env (root) AND platforms/vscode-extension/.env (heir)
may contain a VSCE_PAT. The publish command runs from the heir directory and reads the heir's .env.
If you update the root, also update the heir โ or vice versa. PAT mismatch between these files has
caused 401 errors across consecutive releases (v5.9.11, v5.9.12).
Option 3: System Environment (Persistent)
[Environment]::SetEnvironmentVariable("VSCE_PAT", "your-token", "User")
PAT Troubleshooting
| Error | Cause | Solution |
|---|
| 401 Unauthorized | PAT expired or invalid | Create new PAT |
| 401 Unauthorized | Wrong scope | Ensure "Marketplace (Manage)" scope |
| 401 Unauthorized | Wrong .env updated | Ensure platforms/vscode-extension/.env has the token |
| 403 Forbidden | Not publisher owner | Check publisher membership |
| Token not found | .env not loaded | Check file path, run preflight |
Retry After PAT Fix
When publish fails with 401 and you've already built a valid .vsix, skip the full prepublish cycle:
# Set new PAT and publish pre-built package (skips sync/quality-gate/compile)
$env:VSCE_PAT = "new-token"; npx vsce publish --packagePath alex-cognitive-architecture-X.Y.Z.vsix
This saves ~2 minutes vs a full npx vsce publish which re-runs the entire prepublish pipeline.
Version Strategy
Semantic Versioning
MAJOR.MINOR.PATCH
โ โ โโโ Bug fixes, docs
โ โโโโโโโโโ New features, non-breaking
โโโโโโโโโโโโโโโ Breaking changes
Pre-Release vs Stable
| Type | Flag | Visibility | Use Case |
|---|
| Pre-release | --pre-release | Opt-in only | Beta testing |
| Stable | (none) | Everyone | Production ready |
VS Code Marketplace Rule: Pre-release versions must use the --pre-release flag, NOT semver suffixes like -beta.1.
Version Files to Update
When bumping version, these files need synchronization:
platforms/vscode-extension/package.json โ version field
platforms/vscode-extension/.github/copilot-instructions.md โ **Version**: line
CHANGELOG.md โ New ## [X.Y.Z] section
The release-vscode.ps1 script handles all of these automatically.
Release Workflow
Automated (Recommended)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ .\scripts\release-vscode.ps1 -BumpType patch -PreRelease โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ 0. PAT Check โโโโโถโ 1a. Sync Heir โโโโโถโ 1b. Preflight โ
โ - Load .env โ โ - build-pkg.ps1 โ โ - Version sync โ
โ - Validate โ โ - MasterโHeir โ โ - Build/Lint โ
โ โ โ โ โ - Manifest checkโ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ 2. Version Bump โโโโโถโ 3. CHANGELOG โโโโโถโ 4. Git Commit โ
โ - package.json โ โ - Add entry โ โ - Commit โ
โ - heir version โ โ - Date stamp โ โ - Tag โ
โ โ โ โ โ - Push โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ
โ 5. Publish โ
โ - vsce publish โ
โ - --pre-release โ
โโโโโโโโโโโโโโโโโโโ
Definition of Done Verification
Before publishing, verify ALL 8 criteria from ROADMAP.md:
| # | Criterion | Validation Method |
|---|
| 1 | Builds clean | npm run compile exits 0 with zero errors |
| 2 | No dead code | All imports resolve, no orphaned modules |
| 3 | Counts match reality | Slash commands, tools, skills, trifectas in docs = actual code |
| 4 | F5 smoke test passes | Extension activates, welcome view renders, 3 random commands work |
| 5 | Version aligned | package.json = CHANGELOG = copilot-instructions |
| 6 | Heir sync clean | sync-architecture.cjs runs with 0 errors, no contamination |
| 7 | No non-functional features | If in UI/command palette, it works. If broken, removed. |
| 8 | CHANGELOG documents delta | Every user-visible change has a line item |
Pattern: Use regression checklist as DoD tracker:
- Create a regression checklist (e.g.,
VXXX-REGRESSION-CHECKLIST.md)
- Track verification status for each criterion
- Document evidence (commit hashes, test counts, sync output)
- Automated tests provide objective quality signal (test count = confidence metric)
Quality Gate: If ANY criterion fails, DO NOT publish. Fix first.
Manual Checklist
If not using the script:
Preflight Checks
The release-preflight.ps1 script validates:
| Check | What It Does |
|---|
| PAT | Verifies VSCE_PAT is available in env or .env |
| Version Sync | package.json = CHANGELOG = Master instructions = heir instructions |
| BUILD-MANIFEST | Checks heir was synced recently (warns if > 24h old) |
| README Skill Count | Verifies documented skill count matches actual |
| ROADMAP Version | Warns if ROADMAP.md version differs |
| Build | npm run compile succeeds |
| Lint | npm run lint passes |
| Tests | npm test passes (can skip with -SkipTests) |
| Git Status | Shows uncommitted changes |
| Git Tags | Warns if tag already exists |
| Package | Creates VSIX (with -Package flag) |
File Structure
Alex_Plug_In/
โโโ scripts/
โ โโโ release-preflight.ps1 # Pre-release validation
โ โโโ release-vscode.ps1 # Full release automation
โ โโโ build-extension-package.ps1 # Heir sync
โโโ platforms/vscode-extension/
โ โโโ package.json # Version source of truth
โ โโโ .env # PAT storage (gitignored)
โ โโโ .github/
โ โ โโโ copilot-instructions.md # Heir version
โ โโโ *.vsix # Built packages
โโโ CHANGELOG.md # Version history
Common Issues
"The pre-release version is not valid"
Cause: Used semver suffix like 3.7.4-beta.1
Solution: Use plain version 3.7.4 with --pre-release flag
"401 Unauthorized"
Cause: PAT expired, invalid, or wrong scope
Solution:
- Create new PAT at marketplace.visualstudio.com/manage/publishers
- Ensure "Marketplace (Manage)" scope
- Update .env or environment variable
"Version already exists"
Cause: Trying to publish same version twice
Solution: Bump version first, or delete existing version from marketplace
Build succeeds but publish fails
Cause: Often network or auth issues
Solution:
- Check internet connection
- Verify PAT is valid
- Try
npx vsce login <publisher-name> first
Links