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.
Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/gradio-app/gradio/frontend-unit-testingnpx skills add gradio-app/gradio --skill frontend-unit-testinggit clone --depth 1 https://github.com/gradio-app/gradioWrote 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.
[](https://agentmods.dev/skills/gradio-app/gradio/frontend-unit-testing)<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="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00037 | $0.04077 |
| Opus 5 | $0.00018 | $0.02039 |
| Sonnet 5 | $0.00007 | $0.00815 |
| Haiku 4.5 | $0.00004 | $0.00408 |
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 6d 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.
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)
-
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.
-
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
stepattribute set to5 - 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()
- BAD: assert that an input has a
-
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 changeget_data-> verify it returns the current stateset_data->get_dataround-trips- User interaction ->
get_datareflects it - Events:
change,input,submit,blur,focus,clear,upload,select,custom_button_click, etc.
-
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. -
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.svelteintegration tests. -
Never refactor production code for testability without explicit user approval. If a refactor would help, recommend it and wait for a go-ahead.
-
Visual-only props get
test.todoplaceholders. 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
- Add a
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.
- 6d ago First seen · 382 lines · 37 tokens per session scan A 60e252cf0757
frontend-unit-testing is a skill published in the GitHub repository gradio-app/gradio (43,478 stars, last pushed today), licensed Apache-2.0. It adds 37 tokens to every session and 4,077 once invoked, about $0.0002 per session on Opus 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.
Other skills, from other repositories
addressing-pr-review-comments
Address all valid review comments on a PR for the current branch in the streamlit/streamlit repo. Covers both inline review comments and general PR (issue) comments. Use when a PR has reviewer feedback to address, including code changes, style fixes, and documentation updates.
understanding-streamlit-architecture
Explains Streamlit's internal architecture including backend runtime, frontend rendering, and WebSocket communication. Use when debugging cross-layer issues, understanding how features work end-to-end, planning architectural changes, or onboarding to the codebase. Covers ForwardMsg/BackMsg protocol, script rerun…
fixing-streamlit-ci
Analyze and fix failed GitHub Actions CI jobs for the current branch/PR. Use when CI checks fail, PR checks show failures, or you need to diagnose lint/type/test errors and verify fixes locally.
implementing-feature
Implement a feature from a product/tech spec, URL, GitHub issue, or by auto-selecting the next papercut enhancement. Reads the spec, implements the feature following Streamlit patterns, and creates a merge-ready PR. Use when given a spec folder path, document URL, or issue link to implement, or when asked to implement…
assessing-external-test-risk
Assesses whether branch or PR changes are high-risk for externally hosted or embedded Streamlit usage and recommends whether external e2e coverage with @pytest.mark.externaltest is needed. Use during code review, PR triage, or test planning when changes touch routing, auth, websocket/session behavior, embedding…
updating-internal-docs
Review internal documentation (.md files) against the current codebase state and propose updates for outdated or incorrect information.