feat(skills): publish the agent skills as their own npm package#899
Open
mlennie wants to merge 1 commit into
Open
feat(skills): publish the agent skills as their own npm package#899mlennie wants to merge 1 commit into
mlennie wants to merge 1 commit into
Conversation
The npm publish root is packages/server, so skills/ sits above it and cannot
reach the tarball. Skill bodies do reach npx users, inlined into the MCP prompt
bundle, but no skill files do, and the 25 reference/ files reach nobody: 19 live
reference/ pointers inside those prompt bodies name files the host cannot open.
A skills content edit also has to ride a joint sdk+app+server version bump,
because the only thing that carries it is the regenerated bundle.
@malloy-publisher/skills packs the 28 skills and their reference/ directories as
real files, on its own version line. It exports skillsDir and listSkills() so a
consumer can locate them without hardcoding a node_modules layout; listSkills()
parses frontmatter from the shipped files, so there is no generated manifest to
drift. The exports map keeps ./package.json and ./skills/* reachable, without
which require.resolve('pkg/package.json'), the usual way to find a package root,
fails outright.
skills/ stays at the repo root and prepack copies it in. A symlink named in
"files" packs to package.json alone, with exit 0 and no warning, so the copy is
load-bearing rather than a convenience, and check-pack packs for real and
compares the tarball against the source tree because that failure is otherwise
silent. The same shared predicate drives the copy, the audit and the tests, so
they cannot disagree about what may ship.
This does not make MCP any fresher. The server statically imports the bundle and
the bundler inlines it, so newer skills still need a server build. The package
buys the file channel and its own semver, nothing more.
Also replaces skills_bundle.spec.ts's "at least 24 skills" floor, which sat 4
behind reality and would pass a four-skill regression, with a regenerate-and-
compare against skills/.
Publishing is a separate manual dispatch and needs an npm trusted-publisher
entry, which cannot exist until the package does; the workflow documents the
order.
Signed-off-by: Monty Lennie <[email protected]>
Comment on lines
+27
to
+49
| name: Verify the published tarball | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install Bun | ||
| uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: ${{ env.BUN_VERSION }} | ||
|
|
||
| - name: Install dependencies | ||
| run: bun install --frozen-lockfile | ||
|
|
||
| # A skills/ dir that failed to copy packs as nothing at all, with exit 0 | ||
| # and no warning, so this is the only thing standing between a bad refactor | ||
| # and publishing an empty package. | ||
| - name: Check pack contents | ||
| run: bun run --cwd packages/skills check-pack | ||
|
|
||
| - name: Test | ||
| run: bun run --cwd packages/skills test | ||
|
|
||
| publish: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this solves
Publisher's 28 agent skills reach an npm user as MCP prompts, and only as MCP prompts. Those prompt bodies point at 25
reference/*.mdfiles that no npm consumer can open: 19 livereference/...pointers name files the host has no way to read. The publish root ispackages/server/, soskills/sits above it and nothing there can reach the tarball. Any host that reads skill files from disk (Claude Code, the Publisher plugin, a scaffolder) gets no files at all.A skills content edit also has to ride a joint sdk+app+server version bump. 3 of the last 10 commits touching
skills/were pure content edits whose only change underpackages/server/srcwas the regenerated bundle.What it does
Adds
@malloy-publisher/skills: the 28 skills and theirreference/directories as real files, on their own version line.skillsDirandlistSkills(), so a consumer can locate the files without hardcoding anode_moduleslayout.listSkills()parses frontmatter from the shipped files, so there is no generated manifest to drift. Theexportsmap keeps./package.jsonand./skills/*reachable, without whichrequire.resolve('pkg/package.json'), the usual way to find a package root, fails outright.skills/stays at the repo root andprepackcopies it in. That is not a style preference: a symlink named infilespacks topackage.jsonalone, with exit 0 and no warning, so the copy is load-bearing.check-packpacks for real and compares the tarball against the source tree, deriving every expectation instead of hardcoding a count. An empty tarball is otherwise completely silent.What it does not do
It does not make MCP any fresher.
mcp/server.tsstatically imports the bundle and the bundler inlines it intodist/server.mjs, so newer skills still need a server build. This buys the file channel and its own semver, nothing more.Also in here
Replaces
skills_bundle.spec.ts's "at least 24 skills" floor, which sat 4 behind reality and would have passed a four-skill regression, with a regenerate-and-compare againstskills/.Publishing
Publishing is a separate manual dispatch (
skills-npm.yml), deliberately outside the sdk/app/server lockstep release, since a skill edit should not need a server release. One thing worth flagging for whoever cuts it: npm configures trusted publishing per package, on the package's own settings page, so the entry cannot exist until the package does. The first publish of this name has to be done by hand by an@malloy-publisherowner, with scripts enabled, and the workflow takes over from the next version. The workflow comment spells out the order.Verification
examplesserving 3/3 packages.reference/files fromnode_modulesunder Node 24.