[CLI] Generate hf-cli skill locally instead of downloading from bucket#4199
Draft
hanouticelina wants to merge 1 commit intomainfrom
Draft
[CLI] Generate hf-cli skill locally instead of downloading from bucket#4199hanouticelina wants to merge 1 commit intomainfrom
hanouticelina wants to merge 1 commit intomainfrom
Conversation
For the hf-cli skill specifically, both `hf skills add` and `hf skills update` now use `build_skill_md()` to generate the SKILL.md content from the installed CLI version, instead of downloading from the marketplace bucket. This ensures the installed skill always matches the user's CLI version. Other skills continue to use the normal bucket-based install/update flow. Co-authored-by: célina <hanouticelina@users.noreply.github.com>
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
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
For the
hf-cliskill specifically, bothhf skills addandhf skills updatenow usebuild_skill_md()(the same function used byhf skills preview) to generate the SKILL.md content from the installed CLI version, instead of downloading from the marketplace bucket.hf skills add/hf skills add hf-cli: callsbuild_skill_md()+install_skill_from_content()instead ofadd_skill()(which fetches from bucket)hf skills update: passesgenerated_content_overrides={DEFAULT_SKILL_ID: build_skill_md()}so the hf-cli skill is regenerated locally rather than re-downloadedneeds_marketplacecheck skips the API call)Changes
_skills.py:install_skill_from_content(name, content, destination_root, force)— writes generated content asSKILL.md+ managed marker, with the same atomic-replace and error handling as the bucket-based install_write_skill_content()helperupdate_skills()now acceptsgenerated_content_overrides: dict[str, str] | None— skills whose name matches an override key are updated from the provided content instead of the bucket_apply_single_update()checks for override content before falling back to marketplace lookupskills.py:_install_to()detectshf-cliby name and callsinstall_skill_from_content(DEFAULT_SKILL_ID, build_skill_md(), ...)instead ofadd_skill()skills_update()passesgenerated_content_overrides={DEFAULT_SKILL_ID: build_skill_md()}toupdate_skills()Decision: no code duplication
Per the instructions, the special-case branch directly calls
build_skill_md()— the same functionhf skills previewuses — rather than reimplementing any content generation logic.Slack Thread