gradio: Skill for Claude Code

.agents/skills/frontend-unit-testing/SKILL.md

frontend-unit-testing is a skill for Claude Code, Codex from gradio-app/gradio. It costs 37 tokens per session (4,077 once invoked), scanned A, original, Apache-2.0.

A testing tool for Gradio’s Svelte frontend components. It uses Vitest, Playwright, and related test utilities to check what users can see and do.

In plain words
What is it for?
Use it to write unit tests for clicks, typing, visibility, component data updates, returned state, and events in Gradio frontend components.
Why use it?
It helps catch broken interface behaviour before release, without relying on internal code details. It also checks how components exchange data and events.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is gradio-app/gradio's own configuration. It tells Claude Code and Codex how to work on gradio itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything gradio configures →

About the project

Gradio is a Python package for building web interfaces around machine learning models, APIs, or ordinary Python functions. It is used by developers and data scientists to create and share interactive demos without writing frontend code.

gradio-app/gradio · 44,010 stars · on GitHub · gradio.app

Reuse

Borrowing it

Nothing to install: this file belongs to gradio-app/gradio. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/gradio-app/gradio/main/.agents/skills/frontend-unit-testing/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/gradio-app/gradio

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for frontend-unit-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/gradio-app/gradio/frontend-unit-testing/github.svg)](https://agentmods.dev/skills/gradio-app/gradio/frontend-unit-testing)
Your own site
<a href="https://agentmods.dev/skills/gradio-app/gradio/frontend-unit-testing"><img src="https://agentmods.dev/badge/skills/gradio-app/gradio/frontend-unit-testing/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for frontend-unit-testing

Your own site · 80×15
<a href="https://agentmods.dev/skills/gradio-app/gradio/frontend-unit-testing"><img src="https://agentmods.dev/badge/skills/gradio-app/gradio/frontend-unit-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,077 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Snyk pass 7 Sept 2026
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium MCP Rug Pull · line 155
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00037 $0.04077
Opus 5.5 $0.00015 $0.01631
Sonnet 5.5 $0.00007 $0.00815
Haiku 4.5 $0.00004 $0.00408

Measured 2mo ago against content hash 60e252cf0757, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

frontend-unit-testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/frontend-unit-testing/SKILL.md · 382 lines

How it starts

The opening of the file, as written. The whole thing — 382 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Frontend Unit Testing Skill

You are an expert at writing unit tests for Gradio's Svelte frontend components. Follow these instructions precisely.

Core Principles (Non-Negotiable)

  1. Test everything. Unit tests are cheap. Having too many is a problem we want to have. When in doubt, write the test. Multiple tests per feature/argument is fine and encouraged.

  2. Test behaviour, not implementation. Never assert on implementation details like CSS class names, internal state, or DOM structure for its own sake. Instead, test observable behaviour.

    • BAD: assert that an input has a step attribute set to 5
    • GOOD: type a value, click the increment button, and assert the value increased by 5
    • BAD: assert that a container has class hidden
    • GOOD: assert that the element is not visible with toBeVisible()
  3. Test Gradio-specific functionality. Every component has get_data, set_data, and dispatches events. These must be tested, including their interactions with props.

    • set_data -> verify the DOM reflects the change
    • get_data -> verify it returns the current state
    • set_data -> get_data round-trips
    • User interaction -> get_data reflects it
    • Events: change, input, submit, blur, focus, clear, upload, select, custom_button_click, etc.
  4. Real browser environment. Tests run in Vitest browser mode with a Playwright provider. This is a real browser, not jsdom. Do not mock or stub unless absolutely unavoidable (e.g., navigator.clipboard, MediaStream). If you must mock, explain why in a comment.

  5. Test sub-components in isolation when they have meaningful standalone logic (e.g., a utility function, a shared inner component). These tests are in addition to full Index.svelte integration tests.

  6. Never refactor production code for testability without explicit user approval. If a refactor would help, recommend it and wait for a go-ahead.

  7. Visual-only props get test.todo placeholders. If a prop or argument results in a purely visual change (colours, spacing, fonts, border styles, shadows, etc.) that cannot be meaningfully asserted with behavioural queries, do NOT skip it silently. Instead:

    • Add a test.todo("description") explaining that it needs a visual regression test
    • The description should state what prop/value is being tested and what the expected visual outcome is
    • This ensures visual-only behaviour is tracked and not forgotten

Read the full file on GitHub · 382 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 382 lines · 37 tokens per session scan A 60e252cf0757

Subscribe to this mod's changes

frontend-unit-testing is a skill published in the GitHub repository gradio-app/gradio (44,010 stars, last pushed yesterday), licensed Apache-2.0. It adds 37 tokens to every session and 4,077 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

frontend-unit-testing compared with skills from other repositories

frontend-unit-testing next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
frontend-unit-testinggradio-app/gradioSkill44kyesterdayApache-2.0A37Claude Code, Codex
temporal-python-testingwshobson/agentsSkill42kyesterdayMITA45Claude Code
python-testingmicrosoft/agent-frameworkSkill15kyesterdayMITA29Claude Code, Codex
release-safetytamagui/tamaguiSkill14ktodayMITA0Claude Code
pytest-suitevstorm-co/full-stack-ai-agent-templateSkill2.0k7d agoMITA59Claude Code
adk-verify-snippetsgoogle/adk-pythonSkill22kyesterdayApache-2.0C149Claude Code, Codex
adk-setupgoogle/adk-pythonSkill22kyesterdayApache-2.0C146Claude Code