| name | skill-guardian |
| description | Pre-installation security gate for agent skills. This skill should be used when the user or agent attempts to install any skill โ including requests like "install X", "add X skill", "help me set up the X skill", "npx skills add", or when the agent autonomously decides to install a skill. Also triggers on skill cleanup and audit requests like "clean up my skills", "check installed skills", "any unused skills", "review my skills", or "audit my skill list". Do NOT use for MCP server installation, npm/pip package installation, or non-skill tooling.
|
Skill Guardian
Pre-installation security scan + necessity assessment gate. Cleanup auditor for installed skills.
Hard Rule
Before executing ANY npx skills add, complete ALL steps in the Installation Gate below.
- Never install without completing the full gate.
- Never install without explicit user confirmation.
- Never skip steps for efficiency.
- Never install silently in the background.
Installation Gate
Execute these 4 steps sequentially when intercepting any skill installation request.
Step 1: Security Scan
-
Parse the target skill: extract <owner>/<repo> and <skill-name>.
-
Clone to temp โ do NOT install to the agent skill directory:
git clone --depth 1 https://github.com/<owner>/<repo>.git /tmp/sg-scan-$$
-
Run security scanner. Try in order, use the first available:
Option A โ snyk-agent-scan (preferred; requires SNYK_TOKEN env var):
uvx snyk-agent-scan@latest --skills /tmp/sg-scan-$$/<skill-name>/SKILL.md --json
Option B โ Legacy mcp-scan (no token needed, outdated):
uvx mcp-scan@latest --skills /tmp/sg-scan-$$/<skill-name>/SKILL.md
Option C โ Neither available โ skip to Step 1b.
-
Interpret scan results by issue code prefix:
| Code prefix | Severity | Action |
|---|
E (E001โE006) | Critical | Block. Report threat details. No override option. |
TF (TF001โTF002) | Critical | Block. Toxic multi-tool attack chain detected. |
W (W007โW013) | Warning | Warn user with specifics. Ask whether to proceed. |
| None | Clean | Continue to Step 2. |
-
Clean up temp: rm -rf /tmp/sg-scan-$$
Step 1b: skills.sh Audit Data (supplementary or fallback)
No public API exists. Fetch audit pages via web fetch and extract risk levels:
https://skills.sh/<owner>/<repo>/<skill-name>/security/snyk
https://skills.sh/<owner>/<repo>/<skill-name>/security/agent-trust-hub
Risk levels to look for: Safe, Low Risk, Med Risk, High Risk, Critical.
If unreachable โ note "audit data unavailable", continue. Do not block on this.
Step 2: Necessity Assessment
Run npx skills list to get all installed skills. Evaluate three dimensions:
Duplicates โ Compare the new skill's name and description against every installed skill.
Flag if functional overlap exists.
โ pdf already installed โ installing nano-pdf adds nothing.
โ web-search already installed โ installing tavily-search duplicates it.
Environment overlap โ Check if existing MCP tools or agent built-in capabilities
already cover the same functionality.
โ Exa Search MCP installed โ web-search skill is redundant.
โ Agent has built-in file read/write โ file-util skill adds no value.
Quality signals โ Fetch from the skill's page on skills.sh if available:
| Signal | Red flag |
|---|
| Install count | < 100 |
| Source repo stars | < 10 |
| Last updated | > 6 months ago |
| Publisher | Not a verified org (anthropics/, vercel-labs/, microsoft/) |
Step 3: Report and Confirm
Present a single consolidated report covering:
- Security โ scan result and specific findings
- Duplicates โ overlap with installed skills (if any)
- Environment โ overlap with existing MCP tools (if any)
- Quality โ signal summary
- Recommendation โ one of:
Install / Install with caution / Skip recommended / Blocked
CRITICAL: Wait for explicit user confirmation before proceeding. Do not auto-install.
Step 4: Execute
- User confirms โ
npx skills add <owner>/<repo>/<skill-name> โ verify with npx skills list.
- User declines โ report "Installation cancelled." Clean up any remaining temp files.
Cleanup Mode
Trigger: user asks to clean up, audit, or review installed skills.
- Run
npx skills list to enumerate all installed skills.
- Assess each skill:
- Redundant with another installed skill?
- Covered by an existing MCP tool or agent built-in?
- Source repo still maintained? (check GitHub last push date)
- New security issues? (re-check skills.sh audit pages)
- Present numbered removal recommendations with reasons.
- User selects items โ run
npx skills remove <skill> for each. Confirm each removal.
Fallback Behavior
| Condition | Action |
|---|
snyk-agent-scan unavailable, no SNYK_TOKEN | Try legacy mcp-scan. If also unavailable โ skills.sh only. |
| skills.sh unreachable | Note "audit data unavailable". Continue with scanner results. |
| Scanner + skills.sh both unavailable | Warn user: no security data could be obtained. Recommend manual review. Still require user confirmation before install. |