Repository navigation
fix(skills): read the site's compact catalog and fetch only the needed Skills (0.5.2) - #9
Merged
Merged
Conversation
…d Skills (0.5.2) On links slower than about 50 KB/s, common between mainland China and GitHub, `skills add` stopped before the entitlement check with "读取 Lovstudio Skills 目录失败:The operation was aborted due to timeout": the only catalog source was the GitHub API copy of skills.yaml, about 740 KB of base64 JSON, under a 15 s timeout. Reproduced with 0.5.1 through a 30 KB/s proxy. The catalog is now read from lovstudio.ai's /api/skills/catalog first (about 20 KB, only name, runtime_name, paid and depends_on). If the site fails, the CLI tries the GitHub API with the raw media type (sending GITHUB_TOKEN / GH_TOKEN only to api.github.com), then raw.githubusercontent.com, then jsDelivr. These fallbacks are carried over from the unmerged #7. A response without a skills list counts as a failure, and nothing installs when every source fails. Once past the catalog, free Skills (including a paid Skill's free dependencies, such as branding-consistency for koubo-media-creator) were installed by cloning the whole lovstudio/skills repository: 117.7 MB in 3,826 files at HEAD, which slow links cannot finish within the installer's 300 s clone limit. The CLI now makes a partial (--filter=blob:none) sparse clone of only the selected skills/<name> directories and installs from that local copy, as it already does for paid Skills. Blobs arrive over separate connections at checkout, so each git step is retried up to three times; a clone whose checkout failed is removed first. `npx skills update` skips local installs, so these Skills are updated by running `skills add` again. `skills add skills` (every free Skill) keeps the full clone. Through a 30 KB/s proxy, `skills add writing-style` (two free dependencies) now finishes in 19 s, moving about 24 KB from the site and 490 KB from GitHub. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Users on slow cross-border links (reported for
skills add koubo-media-creator) hit "读取 Lovstudio Skills 目录失败:The operation was aborted due to timeout" before any entitlement check. Two GitHub-heavy steps stood between them and an installed Skill.1. Catalog. 0.5.1 reads only
api.github.com/.../contents/skills.yaml: about 741 KB of base64 JSON under a 15 s timeout, so links below about 50 KB/s fail. Reproduced through a 30 KB/s proxy: exits at 15 s with exactly the reported message.${LOVSTUDIO_WEB_URL}/api/skills/catalogfirst (lovstudio/lovstudio-home#119, about 24 KB with onlyname,runtime_name,paid,depends_on).GITHUB_TOKEN/GH_TOKEN, sent only to api.github.com), then raw.githubusercontent.com, then jsDelivr. A response that is not a catalog counts as a failure, and nothing installs when every source fails.LOVSTUDIO_SKILLS_CATALOG_URLstill replaces the whole chain.2. Free Skills, including a paid Skill's free dependencies (koubo depends on
branding-consistency, about 98 KB). They were installed withnpx skills add https://github.com/lovstudio/skills.git, a full clone of 117.7 MB in 3,826 files at HEAD.skillskills a silent clone after 300 s, so links below about 280 KB/s would fail here next.git clone --depth 1 --filter=blob:none --sparse, thensparse-checkout set skills/<name>..., thennpx skills add <local copy> --skill ..., the same way paid Skills already install. Each git step is retried up to three times, because blobs arrive over separate connections at checkout and testing hit a dropped one.npx skills updateskips local-path installs, as it already does for paid Skills, so updating means runningskills addagain.skills add skills(every free Skill) keeps the full clone.Verification
npm test: 60 tests, 59 pass, 1 skipped (pre-existing), 0 fail. New tests cover the site-first catalog, site 503 → API fallback, the fix(skills): fall back to CDN mirrors when the catalog API is rate limited (0.5.1) #7 fallback cases, a partial sparse clone of a real local repository (an unselected 2 MB blob is not downloaded:.gitstays under 1 MB, while the same fixture without--filteris 2.2 MB), git retries and error reporting, and mocked end-to-end runs for a free install from the sparse copy, a dropped blob fetch, and the site catalog path.skills add koubo-media-creator: fails at 15 s with the reported error.skills add writing-style -g -y -a claude-code(two free dependencies), real GitHub and realskills@latest: exit 0 in 19 s, about 24 KB from the site and 490 KB from GitHub, three Skills copied into~/.claude/skills.Release
Deploy lovstudio/lovstudio-home#119 first, then merge this and run the "Publish npm" workflow. #7 can be closed once this merges.
🤖 Generated with Claude Code