Expand description
Spec parsing for ask.json library entries — Rust port of
packages/cli/src/spec.ts.
The spec string is the user-facing identifier; the library name is the slug
used for .ask/docs/<name>@<ver>/ and .claude/skills/<name>-docs/. Slug
derivation:
npm:next→nextnpm:@mastra/client-js→mastra-client-js(scoped flatten)github:vercel/next.js→next.js
Enums§
- Parsed
Spec - A parsed
ask.jsonspec string. Discriminated the same way as the TSParsedSpecunion.
Functions§
- library_
name_ from_ spec - The library slug for a spec (
parse_spec(spec).name()). - parse_
spec - Parse a spec string into its ecosystem-tagged form.
- slugify_
npm_ name @mastra/client-js→mastra-client-js. Scoped npm names are not valid as.ask/docs/<dir>or Claude Code skill dir names, so we flatten them the same way the registry server does. Non-scoped names pass through unchanged.- split_
explicit_ version - Split an inline
@versionsuffix off a spec — port ofsplitExplicitVersionincommands/ensure-checkout.ts.