Skip to content

[CLI] Generate hf-cli skill locally instead of downloading from bucket#4199

Draft
hanouticelina wants to merge 1 commit intomainfrom
cursor/hf-cli-skill-local-install-6e6f
Draft

[CLI] Generate hf-cli skill locally instead of downloading from bucket#4199
hanouticelina wants to merge 1 commit intomainfrom
cursor/hf-cli-skill-local-install-6e6f

Conversation

@hanouticelina
Copy link
Copy Markdown
Contributor

Summary

For the hf-cli skill specifically, both hf skills add and hf skills update now use build_skill_md() (the same function used by hf 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: calls build_skill_md() + install_skill_from_content() instead of add_skill() (which fetches from bucket)
  • hf skills update: passes generated_content_overrides={DEFAULT_SKILL_ID: build_skill_md()} so the hf-cli skill is regenerated locally rather than re-downloaded
  • All other skills: behavior is completely unchanged — they still go through the normal marketplace bucket install/update flow
  • Bonus: when only hf-cli needs updating, the bucket is not contacted at all (the needs_marketplace check skips the API call)

Changes

_skills.py:

  • Added install_skill_from_content(name, content, destination_root, force) — writes generated content as SKILL.md + managed marker, with the same atomic-replace and error handling as the bucket-based install
  • Added _write_skill_content() helper
  • update_skills() now accepts generated_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 lookup

skills.py:

  • _install_to() detects hf-cli by name and calls install_skill_from_content(DEFAULT_SKILL_ID, build_skill_md(), ...) instead of add_skill()
  • skills_update() passes generated_content_overrides={DEFAULT_SKILL_ID: build_skill_md()} to update_skills()

Decision: no code duplication

Per the instructions, the special-case branch directly calls build_skill_md() — the same function hf skills preview uses — rather than reimplementing any content generation logic.

Slack Thread

Open in Web Open in Cursor 

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>
@bot-ci-comment
Copy link
Copy Markdown

bot-ci-comment Bot commented May 6, 2026

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants