Skip to content

feat(cli): serve the bundled skill with trx skills - #28

Merged
Railly merged 3 commits into
mainfrom
feat/skills-command
Aug 7, 2026
Merged

feat(cli): serve the bundled skill with trx skills#28
Railly merged 3 commits into
mainfrom
feat/skills-command

Conversation

@Railly

@Railly Railly commented Aug 7, 2026

Copy link
Copy Markdown
Member

Fixes #25. Fixes #26.

What

trx now serves its own agent manual, so an agent loads it with one command instead of installing it out of band:

trx skills list
trx skills get trx --full

Why it matters here

skills was never in package.json files, so packages/cli/skills/ never entered the npm tarball. Nobody consumed it from an install, and that is how the bundled skill sat at 0.5.0 while the CLI shipped 0.6.1 without anyone noticing.

Prior art

Modeled on agent-browser, which serves its skills the same way. There is no compile-time embedding involved: skill files are plain markdown that travel in the package and are read from disk at runtime, with resolution relative to the entry point and an env var as the escape hatch.

Surface

Command Does
trx skills list Table with name, one-line description, and the exact command to fetch it. Default subcommand.
trx skills get <name> Raw markdown to stdout, for pasting into context
trx skills get <name> --full Appends references/ and templates/ with --- path --- separators
trx skills get --all Every skill
trx skills path [name] Filesystem path

--output json works on all of them and returns the same {success, data} envelope the other trx commands use. TRX_SKILLS_DIR overrides resolution.

Two bugs found by running it

Both were invisible until the command was executed, not read:

  1. trx skills tried to transcribe the skills directory. The shorthand router matched against a hardcoded subcommand array that did not include skills. It now derives the list from program.commands, so adding a command no longer requires remembering to update a second place.

  2. description came back as "|". The frontmatter parser did not handle YAML block scalars, and this skill's description is one. Now parsed, with a regression test asserting it is not the block marker.

Verification

The acceptance criterion from #26 was a clean global install, since path-relative skill resolution is exactly what broke @native-sdk/cli on this machine. Packed the real tarball and installed it into an isolated prefix:

$ npm pack --dry-run | grep skills
skills/trx/references/whisper-fixes.md
skills/trx/SKILL.md

$ BUN_INSTALL=<scratch> bun add -g crafter-trx-0.7.0.tgz
$ trx skills list          # resolves, returns the skill
$ trx skills get trx --full # includes whisper-fixes.md
$ trx skills path          # <prefix>/node_modules/@crafter/trx/skills

It works because bun links the bin as a symlink into the package and import.meta.url resolves to the real file, so ../skills lands inside the installed package.

  • 43 tests pass, 0 fail (9 new, covering list, get, --full, both error paths, path, block-scalar frontmatter, and TRX_SKILLS_DIR)
  • bun run build in packages/website succeeds, 0.7.0 renders in the changelog
  • Version 0.6.1 to 0.7.0, minor because this adds surface

Note on the skill content

This branch leaves skills/trx/SKILL.md at its current content on main. The version bump and the merge of the divergent copy are in #27, which should land first or be rebased.

@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
trx Ready Ready Preview Aug 7, 2026 7:45pm
trx-website Ready Ready Preview Aug 7, 2026 7:45pm

Railly added 3 commits August 7, 2026 16:44
Agents can now load the skill without installing it out of band:

  trx skills list
  trx skills get trx --full

Adds skills to package.json files, so the directory actually ships to
npm. It never did, which is why the bundled skill sat at 0.5.0 while the
CLI shipped 0.6.1 with nobody noticing: nothing consumed it.

Resolution order is TRX_SKILLS_DIR, then ../skills relative to this
file, then a walk up for repo checkouts. Verified against a real global
install from the packed tarball, the layout that broke skill resolution
for another CLI on this machine.

The shorthand router now derives its subcommand list from
program.commands instead of a hardcoded array. It did not know about
skills, so trx skills tried to transcribe the skills directory.

Fixes #25
Fixes #26
The skill now tells an agent how to load the skill, which is the point
of shipping it with the CLI.
@Railly
Railly force-pushed the feat/skills-command branch from 0a4fa1e to 90a707a Compare August 7, 2026 19:45
@Railly
Railly merged commit 0fa1cfb into main Aug 7, 2026
5 checks passed
@Railly
Railly deleted the feat/skills-command branch August 7, 2026 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant