Agent-First Slug v0.4: The Tool Installs Its Own Skill
A slug library is a few hundred lines; the hard part was never the transliteration table. v0.1 made every policy explicit at the call site so the code states which surface it targets. But explicit policy only pays off if the agent reaches for afslug and knows how it reasons — knowledge that used to sit in a README the agent might never open. v0.4 ships that knowledge as a skill the binary installs itself: `afslug skill install` drops the Agent-First Slug skill into Codex, Claude Code, opencode, or Hermes, bundling SKILL.md and its Codex agent interface as one tree. And `afslug --version` now answers in the shared structured protocol — name, display name, version, and the git SHA it was built from — the same shape every agent-first CLI reports.
A slug library is a few hundred lines. The hard part was never the transliteration table — it’s getting an agent to stop guessing. v0.1 made every policy explicit at the call site, so the code says which surface it targets: a local path, a URL segment, a legacy system, each with its own rules stated where you can see them.
But explicit policy only pays off if the agent reaches for afslug in the first place and knows how it thinks. That knowledge lived in a README the agent might never open.
v0.4 ships it as a skill the tool installs itself.
afslug skill install
afslug now carries the Agent-First Slug skill inside the binary and writes it into whichever agent runtime you use:
# install into every personal skills directory afslug knows about
afslug skill install
# or target one agent
afslug skill install --agent claude-code
Four targets: Codex ($CODEX_HOME/skills), Claude Code (~/.claude/skills),
opencode, and Hermes. --scope workspace writes into the current project
instead of your home directory; --skills-dir points at an explicit path.
A skill is a directory, not a file. The install writes SKILL.md and the
bundled agents/openai.yaml — Codex’s agent interface — together, as one tree.
That comes from adopting afdata v0.22’s skill-admin
toolkit,
which treats a skill’s assets as first-class, so status can tell a complete
install from a SKILL.md-only one and a plain reinstall repairs it:
afslug skill status --agent claude-code
afslug skill uninstall --agent claude-code
Every subcommand emits an AFDATA structured result, so a wrapper reads fields
instead of scraping text. --force overwrites or removes a skill afslug didn’t
install; without it, afslug leaves skills it doesn’t own alone.
--version speaks the protocol
The other half is provenance. afslug --version now answers in the same
structured protocol every agent-first CLI uses:
$ afslug --version --output json
{"kind":"result","result":{"code":"version","name":"afslug",
"display_name":"Agent-First Slug","version":"0.4.0","build":"2a74839"},"trace":{}}
The name, human-readable display name, package version, and the git SHA the
binary was built from — machine-readable, identical in shape to afdata, afhttp,
and the rest. Built from a crates.io tarball with no .git nearby, build is
simply absent rather than a fabricated value. Plain afslug --version still
prints a human line.
Install
cargo add agent-first-slug --no-default-features # the library, no CLI deps
cargo install agent-first-slug # the afslug CLI
Then afslug skill install, and the agent has both the tool and the
instructions for using it well.