feat: add Rust crate support via crate: prefix#69
Closed
Conversation
Adds `skilld add crate:<name>` for generating skills from crates.io docs. Routed through the new prefix parser alongside npm/gh/@-prefixes. - SkillSource gains a `crate` variant; `resolveSkillName` returns `crate:<name>` - New resolveCrateDocsWithAttempts hits crates.io, prefers docs.rs for versioned URLs, enriches from GitHub when applicable, and discovers llms.txt - Rate-limited via shared createRateLimitedRunner; SKILLD_USER_AGENT constant and retry-on-429/5xx for ofetch consumers - Storage/identity split: lockfile stores crate:<name>, cache/symlinks use @skilld-crate/<name> to avoid colliding with npm packages of the same name - Single-package path serializes crate syncs (respects crates.io rate limit) while npm batches keep the parallel path - toStoragePackageName applied to prepare/install/status/search-helpers so restore, doc counts, and search index lookups resolve crate cache paths - Bulk `skilld update` now includes all installed crate skills
Collaborator
Author
|
Superseded — pushed the rewrite directly onto #4 so review stays in one place. |
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.
Summary
skilld add crate:<name>resolves from crates.io (docs.rs for versioned URLs, GitHub repo enrichment, llms.txt discovery)@skilld-crate/<name>) prevents collisions with npm packages of the same nametoStoragePackageNamehelper applied across prepare/install/status/search-helpers so restore, doc counts, and search indexes resolve crate cache paths correctlyWhat changed
SkillSourcegains acratevariant;resolveSkillName('crate:x')→'crate:x'src/sources/crates.tswith rate-limited crates.io clientSKILLD_USER_AGENT,createRateLimitedRunner,isLikelyCodeHostUrl, retry-on-429/5xxcrate:<name>identity; cache/symlinks use@skilld-crate/<name>storageskilld updatere-resolves all installed crate skills (cache short-circuits unchanged versions)Test plan
pnpm typecheck— passespnpm test:run --project unit— 793/793 pass (includes 40 new crate tests)pnpm build— dist emitsresolveCrateDocsWithAttemptsskilld add crate:serdeend-to-endskilld updatewith an installed crate skill re-resolves against crates.ioCloses #4 (supersedes that PR).