shadcn-audit
Skill1 starsChanged 5 months agoMITView on GitHub
Security auditor for shadcn components from third-party registries. Use this skill whenever the user mentions installing, adding, or using a shadcn component from a third-party source — even if they just say "add @acme/button" or paste a shadcn registry URL. Trigger it proactively when you see `npx shadcn add`, a namespaced component like `@v0/...` or `@acme/...`, or any URL ending in `.json` that looks like a registry item. The skill fetches source with `npx shadcn@latest view` (no install), runs static analysis and semantic checks, and produces a SAFE / WARNING / BLOCK verdict before anything touches disk.
- Reads credentials
1 other project uses a version of this.
Adopted by
Most recently taken up by
- ruby-ui/ruby_uitheir own version, first seen Nov 2, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- ruby-ui/ruby_ui★ 1ksame name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository24 other files it gives its agents.
- api-designSkill
- brainstormingSkill
- councilSkill
- dispatching-parallel-agentsSkill
- document-toolkitSkill
- executing-plansSkill
- gui-input-automationSkill
- humanizeSkill
- hyprland-controlSkill
- incremental-implementationSkill
- issue-to-prSkill
- litreviewSkill
- mcp-builderSkill
- rust-reviewSkill
- screen-captureSkill
- session-handoffSkill
- spec-to-issuesSkill
- subagent-driven-developmentSkill
- teachSkill
- unslopSkill
- using-git-worktreesSkill
- visual-computer-use-loopSkill
- writing-flowSkill
- writing-plansSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 66
If either command fails or returns nothing, tell the user the component could not be fetched and stop — do not proceed without source.
- Distinctive: line 72
Check every file in the output against these patterns.
- Distinctive: line 125
Always produce a report in this exact structure:
- Very specific: line 218
Always fetch source first: Never give a verdict based on the component name alone — npx shadcn@latest view must succeed before any analysis.
- Very specific: line 219
The dry-run may fail: if the working directory has no package.json.
- Very specific: line 220
Check transitive local files: If a component imports a local utility (../lib/utils), view that file too before concluding.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
shadcn Component Security Auditor
Overview
The shadcn CLI lets anyone publish components at arbitrary URLs or namespaced registries (@acme/button, @v0/dashboard). Unlike npm packages, shadcn copies source code directly into your project — meaning it runs with full access to your environment and no sandbox. This skill intercepts that process: it fetches the component source using the shadcn CLI's view command (nothing is installed), audits the code for malicious or suspicious patterns, and gives a verdict before anything touches disk.
Table of Contents
- When to Use
- Instructions
- Step 1 — Fetch the Source
- Step 2 — Static Analysis
- Step 3 — Semantic Analysis
- Step 4 — Report
- Verdict Rules
- Examples
- Constraints and Warnings
When to Use
- User wants to install a shadcn component from a third-party registry (
@acme/...,@v0/..., etc.) - User pastes a registry URL ending in
.json - User runs or plans to run
npx shadcn@latest add <anything> - User asks "is this safe to install?" about a shadcn component
- User wants to audit an entire third-party registry before using it
Instructions
- Fetch the component source using
npx shadcn@latest view— do not install - Run static analysis against the defined checklist of patterns
- Run semantic analysis to catch intent mismatches the static rules miss
- Produce a structured report with a SAFE / WARNING / BLOCK verdict
- Give a clear next step — either the install command or a reason not to proceed
Step 1 — Fetch the Source
npx shadcn@latest view <component>For a whole registry, list items first then view each:
npx shadcn@latest search <@registry>
npx shadcn@latest view <@registry/item>Also run a dry-run to see every file that would be written to disk:
npx shadcn@latest add --dry-run <component>If either command fails or returns nothing, tell the user the component could not be fetched and stop — do not proceed without source.
Step 2 — Static Analysis
Check every file in the output against these patterns. A single CRITICAL finding is enough to block.
CRITICAL
| Pattern | Why it matters |
eval(, new Function(, setTimeout(string) | Dynamic code execution — runs arbitrary code |
| Hex/base64 blobs that decode to executable code | Obfuscation — hides malicious payload |
document.write( or dynamic <script> tag construction | Script injection |
fetch/XMLHttpRequest/WebSocket to hardcoded external URLs inside UI components | Data exfiltration |
Reading process.env or import.meta.env and sending the value outbound | Env var theft |
HIGH
| Pattern | Why it matters |
dangerouslySetInnerHTML with a non-literal value | XSS risk |
fs.readFile, fs.writeFile, fs.unlink in a UI component | Filesystem access where it shouldn't be |
import(variable) — computed dynamic import path | Can load arbitrary code at runtime |
| Code gated on specific dates, times, or env values | Logic bomb |
Dependencies not on npm or likely typosquats (lodahs, reacct) | Supply chain |
MEDIUM
| Pattern | Why it matters |
dangerouslySetInnerHTML with a literal string | Inspect the string itself |
| Fetch URL constructed from unsanitized user input | Potential SSRF or open redirect |
localStorage/sessionStorage reads followed by network calls | Data leakage |
crypto.subtle in a pure UI component | Unusual — flag for review |
| Re-exporting base components with modified prop handling | Could intercept sensitive values |
LOW
| Pattern | Why it matters |
| Heavily minified or obfuscated variable names | Obscures intent |
| Commented-out suspicious code | Worth noting |
console.log printing suspiciously named variables | Accidental or intentional leakage |
window.location, document.referrer, navigator.userAgent sent externally | Tracking |
Step 3 — Semantic Analysis
Static pattern matching won't catch everything. After the checklist, reason about the component holistically:
- Name vs. behavior mismatch — A
Buttonthat makes network requests, anAvatarthat reads env vars. Anything doing more than its name implies. - Dependency confusion — Imports a package that shadows a well-known one (a custom
react-dom, atailwindcssfork). - Data laundering — Encoding data into image request URLs, CSS custom properties, or artificial timing delays before sending it.
- Social engineering via props — Props like
onReady,apiKey,tokenthat silently forward user-provided values to an external endpoint. - Server component leaks — A server component passing
process.envor a full config object as props to a client component.
Step 4 — Report
Always produce a report in this exact structure:
## shadcn Audit Report
Component: <name or URL>
Registry: <registry or "direct URL">
Verdict: SAFE | WARNING | BLOCK
### Findings
| Severity | Rule | File | Line | Description |
|----------|------|------|------|-------------|
| ... | ... | ... | ... | ... |
(No findings → write "No issues found.")
### Summary
One paragraph. BLOCK: explain exactly what is dangerous and how.
WARNING: explain what is suspicious and what the user should manually verify.
SAFE: briefly confirm what was checked and why it passes.
### Next step
SAFE: `npx shadcn@latest add <component>`
WARNING: Review the flagged lines, then decide.
BLOCK: Do not install. Consider reporting to the registry maintainer.Verdict Rules
| Verdict | Condition |
| BLOCK | Any CRITICAL finding, or 2+ HIGH findings |
| WARNING | Any HIGH finding, or 3+ MEDIUM findings |
| SAFE | No findings, or only LOW/MEDIUM with clear benign explanations |
Examples
SAFE — Official component
## shadcn Audit Report
Component: button
Registry: https://ui.shadcn.com (official)
Verdict: SAFE
### Findings
No issues found.
### Summary
The button component is a 64-line React wrapper around Radix UI's Slot
primitive with CVA for variant management. It makes no network calls,
reads no environment variables, and its two dependencies (radix-ui,
class-variance-authority) are well-established packages.
### Next step
`npx shadcn@latest add button`BLOCK — Malicious third-party component
## shadcn Audit Report
Component: @acme/auth
Registry: @acme
Verdict: BLOCK
### Findings
| Severity | Rule | File | Line | Description |
|----------|------------------|----------|------|------------------------------------------------|
| CRITICAL | env-exfiltration | auth.tsx | 42 | process.env.NEXTAUTH_SECRET sent to remote URL |
### Summary
The component reads NEXTAUTH_SECRET from process.env and POSTs it to
https://telemetry.acme-cdn.com on every render. This is a credential
theft attack disguised as telemetry.
### Next step
Do not install. Consider reporting to the registry maintainer.Constraints and Warnings
- Always fetch source first. Never give a verdict based on the component name alone —
npx shadcn@latest viewmust succeed before any analysis. - The dry-run may fail if the working directory has no
package.json. That's fine — theviewoutput is sufficient for a full audit. - Check transitive local files. If a component imports a local utility (
../lib/utils), view that file too before concluding. - Official
@shadcnregistry is lower risk but still run all checks — only reserve BLOCK for clear evidence even on official components. - For a full registry scan, show a summary table (one row per component, verdict column) at the top, then detailed findings for any non-SAFE items below.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

