AI coding assistants like Claude Code, Cursor, Codex, and OpenCode can write better Gradio code when they have access to up-to-date API knowledge. Gradio skills solve this — they are structured reference files that get loaded into your assistant's context so it knows exactly how Gradio components, events, and whole ecosystem work.
The gradio skills add command installs these reference files into the right location for your chosen assistant, so it can use them automatically.
Make sure you have Gradio installed along with a recent version of huggingface_hub:
pip install --upgrade gradio huggingface_hub
huggingface_hub >= 1.4.0is required for the skills command.
The general Gradio skill gives your assistant comprehensive knowledge of the Gradio API — components, event listeners, layout patterns, and working examples.
To install, pass the flag for your assistant:
gradio skills add --cursor # or --claude, --codex, --opencodeThis downloads two files (SKILL.md and examples.md) into a central location (.agents/skills/gradio/) and creates symlinks from each assistant's skills directory (e.g., .claude/skills/gradio/ for Claude Code) pointing to the central copy. This avoids duplicating files when you install for multiple assistants.
By default, skills are installed locally in your current project directory. This means the assistant only has Gradio knowledge when working in that project.
To install globally (user-level, available in all projects):
gradio skills add --claude --globalOr using the short flag:
gradio skills add --claude -gOne of the most powerful features is generating a skill for any public HuggingFace Space. This gives your assistant full knowledge of that Space's API — endpoints, parameters, return types, and ready-to-use code snippets.
gradio skills add abidlabs/english-translator --claudeThis connects to the Space, extracts its API schema, and generates a SKILL.md file with:
For private Spaces, set your Hugging Face token:
export HF_TOKEN=hf_xxxxx
gradio skills add my-org/private-space --claudeIf a skill is already installed, the command will exit with an error. To overwrite it:
gradio skills add --claude --force| File | Contents |
|---|---|
SKILL.md |
Core API reference — component signatures, event listeners, layout patterns, ChatInterface, and links to detailed guides |
examples.md |
Complete working Gradio apps covering common patterns (forms, chatbots, streaming, image processing, etc.) |
| File | Contents |
|---|---|
SKILL.md |
Auto-generated API reference for the Space's endpoints, with code snippets in Python, JavaScript, and cURL |
Here's a typical workflow using skills with Claude Code:
Install the skill in your project:
cd my-project
gradio skills add --claudeStart Claude Code and ask it to build a Gradio app:
> Build me a Gradio app with an image input that applies a sepia filter
and displays the resultClaude Code now has full knowledge of gr.Image, gr.Interface, event listeners, and can write correct, idiomatic Gradio code.
Add a Space skill if you want to integrate with an existing Space:
gradio skills add abidlabs/english-translator --claudeNow you can ask:
> Use the english-translator Space API to add a translation feature
to my app