Skip to content

Commit 60499d3

Browse files
committed
feat(skills): version skills plugins via dedicated workspace package
Introduce @salesforce/b2c-agent-plugins (at skills/package.json, private) as the changesets target for skill-content changes. Its version syncs into the plugin manifest files (.claude-plugin/marketplace.json entries for b2c-cli and b2c, plus both .codex-plugin/plugin.json files) so installed plugins see a proper version bump when skills change. Publish workflow now tracks skills-only bumps with a `b2c-agent-plugins@X.Y.Z` GitHub release tag. Skills zips are only attached to releases where the plugins package actually changed. Skills installer resolves "latest" via a hybrid: GitHub REST API (paginated, asset-filtered) with a raw.githubusercontent.com fallback when the API is rate-limited. The resolved version is cached for 1 hour to avoid redundant lookups. Zip downloads continue to go through the GitHub CDN with no API calls. - skills/package.json: new private workspace package `@salesforce/b2c-agent-plugins` - pnpm-workspace.yaml: add `skills` - scripts/sync-plugin-versions.mjs: stamps version into plugin manifests - package.json: `version` script now runs changeset version + sync - .github/workflows/changesets.yml: action uses `pnpm run version` - .github/workflows/publish.yml: adds publish_plugins gate, re-gates skills zip steps, adds release-tag fallback - packages/b2c-tooling-sdk/src/skills/github.ts: adds resolveLatestVersion() with API→raw hybrid, replaces /releases/latest usage - .claude-plugin/marketplace.json: b2c-cli and b2c entries gain `version`
1 parent a8441f1 commit 60499d3

9 files changed

Lines changed: 257 additions & 64 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"license": "Apache-2.0",
1717
"source": "./skills/b2c-cli",
1818
"category": "productivity",
19-
"strict": false
19+
"strict": false,
20+
"version": "1.0.0"
2021
},
2122
{
2223
"name": "b2c",
@@ -27,7 +28,8 @@
2728
"license": "Apache-2.0",
2829
"source": "./skills/b2c",
2930
"category": "productivity",
30-
"strict": false
31+
"strict": false,
32+
"version": "1.0.0"
3133
},
3234
{
3335
"name": "b2c-dx-mcp",

.github/workflows/changesets.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
id: changesets
3838
uses: changesets/action@6a0a831ff30acef54f2c6aa1cbbc1096b066edaf # v1.7.0
3939
with:
40-
version: pnpm changeset version
40+
version: pnpm run version
4141
title: 'Next Release: changelog and version packages'
4242
commit: 'chore: version packages'
4343
env:

.github/workflows/publish.yml

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,13 @@ jobs:
9696
HAS_CHANGES=true
9797
fi
9898
fi
99+
# Also check agent-plugins tag
100+
if [ "$HAS_CHANGES" = "false" ]; then
101+
PLUGINS_VERSION=$(node -p "require('./skills/package.json').version")
102+
if ! git rev-parse "b2c-agent-plugins@${PLUGINS_VERSION}" >/dev/null 2>&1; then
103+
HAS_CHANGES=true
104+
fi
105+
fi
99106
if [ "$HAS_CHANGES" = "false" ]; then
100107
echo "skip=true" >> $GITHUB_OUTPUT
101108
echo "::notice::All package versions match npm — nothing to publish"
@@ -184,6 +191,16 @@ jobs:
184191
fi
185192
echo "@salesforce/b2c-docs: version=${DOCS_VERSION}"
186193
194+
# Check if agent-plugins version changed (private package — uses git tag)
195+
PLUGINS_VERSION=$(node -p "require('./skills/package.json').version")
196+
if git rev-parse "b2c-agent-plugins@${PLUGINS_VERSION}" >/dev/null 2>&1; then
197+
echo "publish_plugins=false" >> $GITHUB_OUTPUT
198+
else
199+
echo "publish_plugins=true" >> $GITHUB_OUTPUT
200+
echo "version_plugins=${PLUGINS_VERSION}" >> $GITHUB_OUTPUT
201+
fi
202+
echo "@salesforce/b2c-agent-plugins: version=${PLUGINS_VERSION}"
203+
187204
- name: Create snapshot versions
188205
if: steps.release-type.outputs.type == 'nightly'
189206
run: |
@@ -357,6 +374,13 @@ jobs:
357374
extract_latest docs/CHANGELOG.md
358375
echo ""
359376
fi
377+
378+
if [[ "${{ steps.packages.outputs.publish_plugins }}" == "true" && -f skills/CHANGELOG.md ]]; then
379+
echo "## Agent Skills Plugins"
380+
echo ""
381+
extract_latest skills/CHANGELOG.md
382+
echo ""
383+
fi
360384
} > /tmp/release-notes.md
361385
362386
- name: Create GitHub Release
@@ -375,6 +399,8 @@ jobs:
375399
RELEASE_TAG="b2c-vs-extension@${{ steps.packages.outputs.version_vsx }}"
376400
elif [[ "${{ steps.packages.outputs.publish_docs }}" == "true" ]]; then
377401
RELEASE_TAG="docs@${{ steps.packages.outputs.version_docs }}"
402+
elif [[ "${{ steps.packages.outputs.publish_plugins }}" == "true" ]]; then
403+
RELEASE_TAG="b2c-agent-plugins@${{ steps.packages.outputs.version_plugins }}"
378404
else
379405
echo "No packages published, skipping release"
380406
exit 0
@@ -385,7 +411,7 @@ jobs:
385411
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
386412

387413
- name: Package skills artifacts
388-
if: steps.release-type.outputs.type == 'stable' && steps.changesets.outputs.skip != 'true' && steps.quick-check.outputs.skip != 'true'
414+
if: steps.release-type.outputs.type == 'stable' && steps.changesets.outputs.skip != 'true' && steps.quick-check.outputs.skip != 'true' && steps.packages.outputs.publish_plugins == 'true'
389415
run: |
390416
# Create b2c-skills.zip containing skills/b2c/skills/
391417
cd skills/b2c && zip -r ../../b2c-skills.zip skills/
@@ -397,9 +423,9 @@ jobs:
397423
ls -la *.zip
398424
399425
- name: Upload skills to release
400-
if: steps.release-type.outputs.type == 'stable' && steps.changesets.outputs.skip != 'true' && steps.quick-check.outputs.skip != 'true'
426+
if: steps.release-type.outputs.type == 'stable' && steps.changesets.outputs.skip != 'true' && steps.quick-check.outputs.skip != 'true' && steps.packages.outputs.publish_plugins == 'true'
401427
run: |
402-
# Determine the release tag (same logic as Create GitHub Release)
428+
# Determine the release tag (same priority as Create GitHub Release)
403429
if [[ "${{ steps.packages.outputs.publish_cli }}" == "true" ]]; then
404430
RELEASE_TAG="@salesforce/b2c-cli@${{ steps.packages.outputs.version_cli }}"
405431
elif [[ "${{ steps.packages.outputs.publish_sdk }}" == "true" ]]; then
@@ -410,9 +436,10 @@ jobs:
410436
RELEASE_TAG="@salesforce/mrt-utilities@${{ steps.packages.outputs.version_mrt }}"
411437
elif [[ "${{ steps.packages.outputs.publish_vsx }}" == "true" ]]; then
412438
RELEASE_TAG="b2c-vs-extension@${{ steps.packages.outputs.version_vsx }}"
439+
elif [[ "${{ steps.packages.outputs.publish_docs }}" == "true" ]]; then
440+
RELEASE_TAG="docs@${{ steps.packages.outputs.version_docs }}"
413441
else
414-
echo "No package release to upload to"
415-
exit 0
442+
RELEASE_TAG="b2c-agent-plugins@${{ steps.packages.outputs.version_plugins }}"
416443
fi
417444
418445
gh release upload "$RELEASE_TAG" b2c-skills.zip b2c-cli-skills.zip

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"skills:eval": "uv run skills/eval/run_eval.py --model us.anthropic.claude-sonnet-4-6 --verbose",
2222
"skills:eval:optimize": "uv run skills/eval/run_loop.py --model us.anthropic.claude-sonnet-4-6 --verbose",
2323
"changeset": "changeset",
24-
"version": "changeset version",
24+
"version": "changeset version && node scripts/sync-plugin-versions.mjs",
2525
"release": "echo 'Releases are handled by CI (publish.yml). Use workflow_dispatch for manual releases.' && exit 1"
2626
},
2727
"keywords": [],

0 commit comments

Comments
 (0)