feat(openclaw)!: bundle all 13 skills in the npm tarball (0.4.0)#20
Merged
Conversation
BREAKING: skills now live under `openclaw/skills/` and ship pre-built
inside `@xpr-agents/openclaw`. The previous layout had skills under
`openclaw/starter/agent/skills/` outside the npm `files` glob, so
harness users who installed the plugin via npm got 72 tools but ZERO
skills. And non-Docker standalone deployments silently lost any skill
without a committed `dist/` (the agent runner does `require()` on
`src/index.ts` and Node has no ts-node hook at runtime).
This commit fixes both at once.
## What moves
- 12 domain skill folders: `openclaw/starter/agent/skills/{creative,
web-scraping, code-sandbox, structured-data, defi, nft, tax, lending,
governance, xmd, smart-contracts, shellbook}` →
`openclaw/skills/<name>`
- `xpr-agent-operator` already lived at `openclaw/skills/`, so its
duplicate copy under `starter/agent/skills/` is deleted
## What gets built
- New `openclaw/scripts/build-skills.mjs` compiles each skill's
`src/index.ts` → `dist/index.js` using the exact compile flags the
Dockerfile previously used (no `--strict` — skills use dynamic
`await import('@xpr-agents/openclaw')` which resolves to `any` and
would fail strict null checks)
- `openclaw/package.json` `build` now runs `build:plugin` then
`build:skills`; `clean` clears `skills/*/dist`; `prepublishOnly` runs
the full pipeline so npm-publish always ships fresh dist
- The 5 skills that import `@xpr-agents/openclaw` for `createCliApi`
(defi, governance, lending, nft, xmd) get a `// @ts-ignore` on the
dynamic-import line — the package can't self-reference at compile
time, but Node resolves it fine at runtime through the consumer's
node_modules
## What the runner does differently
- `openclaw/starter/agent/src/index.ts` swaps the 12 hardcoded
`path.resolve(__dirname, '../skills/<name>')` lines for a
`resolveSkillDir(name)` helper that uses
`require.resolve('@xpr-agents/openclaw/package.json')` and falls
back to a repo-relative path for monorepo dev
- `xpr-agent-operator` SKILL.md candidate list reorders to put the
npm-package path first (was last)
- `/deliverables/:jobId` route now `require()`s the skill's `dist/`
entry, not its TS source — fixes the silent fall-through on
non-Docker installs
## What the Dockerfile drops
- Removed the 12-line tower of per-skill `npx tsc ...` commands.
`npm install` now pulls in pre-built `dist/` from the npm package,
so the Dockerfile just does `npm install && npm run build` like a
normal Node service
## What the manifest declares
- `openclaw.plugin.json` `skills` array goes from 1 entry to 13.
Harnesses that auto-load skills from the manifest will pick up all
domain skills automatically
## What changes for harness users
- v0.3.x: install plugin → 72 tools, no skills. Domain capabilities
(DeFi, NFT, etc.) silently absent unless you separately installed
each ClawHub skill
- v0.4.0: install plugin → 72 tools + 13 skills, full agent
capability out of the box. ClawHub installs are now additive, not
required
## Verification
- All 13 skills compile under `npm run build:skills`
- All 80 openclaw tests pass
- 225 SDK tests pass; 81 indexer tests pass
- Runtime resolver probe confirms all 13 skill directories resolve via
`require.resolve('@xpr-agents/openclaw/package.json')` with
skill.json, SKILL.md, and dist/index.js present
## Added runtime dependency
- `@shellbook/sdk@^0.2.4` — required by the shellbook skill's
`import { Shellbook } from '@shellbook/sdk'`. Previously hoisted
from the agent runner's node_modules; now declared on the package
that ships the skill
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.
Breaking change: skills now live under
openclaw/skills/and ship pre-built inside@xpr-agents/openclaw. Bumps to 0.4.0.Why
Two latent bugs both blocked by the same architectural issue:
Harness users got 72 tools, ZERO domain skills. Skills lived under
openclaw/starter/agent/skills/— outsideopenclaw/package.json'sfilesglob — sonpm install @xpr-agents/openclawshipped only the plugin code, no DeFi / NFT / lending / etc. handlers. Pinata operators silently lost ~150 domain tools.Non-Docker standalone deploys silently lost most skills. The agent runner does
require()on<skill>/src/index.tswhen nodist/exists, but production launches via plainnode dist/index.jswith no ts-node hook.dist/is gitignored, sonpx create-xpr-agentusers got skills only for the 4 folders that happened to have a stale committeddist/. The other 8 fell silently into the[skill] Failed to load: ...catchblock.This PR fixes both at once by making skills first-class members of the npm package.
What moves
openclaw/starter/agent/skills/{creative, web-scraping, code-sandbox, structured-data, defi, nft, tax, lending, governance, xmd, smart-contracts, shellbook}→openclaw/skills/<name>xpr-agent-operatoralready lived atopenclaw/skills/; duplicate copy understarter/agent/skills/deletedWhat gets built
openclaw/scripts/build-skills.mjscompiles each skill'ssrc/index.ts→dist/index.jsusing the exact flags the Dockerfile previously used (notably without--strict— skills use dynamicawait import('@xpr-agents/openclaw')which resolves toanyand would fail strict null checks)openclaw/package.jsonbuildnow runsbuild:pluginthenbuild:skills;cleanclearsskills/*/dist;prepublishOnlyruns the full pipeline so npm-publish always ships fresh dist@xpr-agents/openclawforcreateCliApi(defi, governance, lending, nft, xmd) get a single// @ts-ignoreon the dynamic-import line — the package can't self-reference at compile time, but Node resolves it fine at runtime via the consumer's node_modulesWhat the runner does differently
openclaw/starter/agent/src/index.tsswaps the 12 hardcodedpath.resolve(__dirname, '../skills/<name>')lines for oneresolveSkillDir(name)helper that usesrequire.resolve('@xpr-agents/openclaw/package.json')and falls back to a repo-relative path for monorepo devxpr-agent-operatorSKILL.md candidate list reorders to put the npm-package path first (previously last)/deliverables/:jobIdrouterequire()s the skill'sdist/entry, not its TS source — fixes the silent fall-through on non-Docker installsWhat the Dockerfile drops
Removed the 12-line tower of per-skill
npx tsc ...commands.npm installnow pulls in pre-builtdist/from the npm package, so the Dockerfile is justnpm install && npm run build.What the manifest declares
openclaw.plugin.jsonskillsarray goes from 1 entry to 13. Harnesses that auto-load skills from the manifest pick up all domain skills automatically.What changes for users
npm install @xpr-agents/openclaw)npx create-xpr-agent)Added runtime dependency
@shellbook/sdk@^0.2.4— required by the shellbook skill'simport { Shellbook } from '@shellbook/sdk'. Previously hoisted from the agent runner's node_modules; now declared on the package that ships the skill.Verification
npm run build:skillsrequire.resolve('@xpr-agents/openclaw/package.json')withskill.json+SKILL.md+dist/index.jspresentAfter merge: publish
@xpr-agents/openclaw@0.4.0to npm so harness users get the bundled skills.