This guide explains how to publish AgentSpec packages to npm under @agentspec.
We use npm Trusted Publishing via GitHub Actions OIDC — no static token secrets needed.
- No secrets to manage — uses GitHub's short-lived OIDC tokens
- Cannot leak — tokens expire immediately after each workflow run
- Automatic provenance — npm links packages to source commit
- Follows modern security best practices
You must publish each package once manually to claim the package name, then configure Trusted Publishing on npm.org.
Step 1 — Publish manually to claim the package names:
npm login # requires 2FA
cd packages/sdk
npm publish --access public
cd ../adapter-langgraph
npm publish --access public
cd ../cli
npm publish --access publicStep 2 — Configure Trusted Publishing on npm.org:
For each package (@agentspec/sdk, @agentspec/adapter-langgraph, @agentspec/cli):
- Go to
https://www.npmjs.com/package/@agentspec/PACKAGE_NAME/access - Under "GitHub Actions", add the repository:
- Repository:
agents-oss/agentspec - Workflow:
publish.yml
- Repository:
- Click "Add"
After this, all future releases are fully automated — no NPM_TOKEN secret required.
# Patch (0.1.0 → 0.1.1)
pnpm version patch --recursive
# Minor (0.1.0 → 0.2.0)
pnpm version minor --recursive
# Major (1.0.0)
pnpm version major --recursive# Document changes under the new version section
## [0.2.0] - 2026-02-27
### Added
- @agentspec/adapter-crewai package
### Fixed
- Resolver bug with nested $secret: refsgit add packages/sdk/package.json packages/cli/package.json packages/adapter-langgraph/package.json CHANGELOG.md
git commit -m "chore: bump version to 0.2.0"
git tag v0.2.0
git push origin main
git push origin v0.2.0Go to Actions → Publish to npm in the GitHub repo. The workflow will:
- Build all packages
- Run all tests
- Publish each package to npm with provenance
- Create a GitHub Release
If a tag-based publish fails partway, you can re-trigger manually:
- Actions → Publish to npm → Run workflow
- Enter version (e.g.,
0.2.0) - Click Run workflow
npm view @agentspec/sdk
npm view @agentspec/adapter-langgraph
npm view @agentspec/cli
# Test installation
npx @agentspec/cli@latest validate examples/gymcoach/agent.yaml- Confirm you completed the first-time manual publish above
- Confirm Trusted Publishing is configured on npm.org for the package
- Confirm
id-token: writepermission is set inpublish.yml(already done)
# Check what's published
npm view @agentspec/sdk version
# Bump again and retag
pnpm version patch --recursive
git add -A && git commit -m "chore: bump version"
git tag v0.1.1
git push origin main --tagsThis means npm publish was used instead of pnpm publish. The workflow uses
pnpm publish intentionally — pnpm replaces workspace:* with the real version
number before uploading the tarball. Do not change pnpm publish to npm publish.
pnpm install
pnpm lint
pnpm typecheck
pnpm build
pnpm test