Skip to content

Repository files navigation

SkillGuard CLI

Security Audit CLI for AI Agent Skills

The command-line version of SkillGuard — zero infrastructure, same engine.

10 Dimensions · 109 Rules · A–F Risk Grading · Token Cost Estimation

Quick Start · Features · Dimensions · Architecture · CLI Reference · Skills


What is SkillGuard CLI?

SkillGuard CLI is the standalone command-line version of SkillGuard, the security audit platform for AI agent skills. While the original SkillGuard requires FastAPI, Celery, Redis, and SQLite, the CLI version packages the same scanning engine into a single npx command with zero infrastructure dependencies.

Paste a GitHub or ClawHub URL — get a full security report in your terminal.

Audit methodology is based on OWASP LLM Top 10, SLSA, and Google SAIF.

Quick Start

# Scan a GitHub skill repository
npx @clawmaster/skillguard-cli https://github.com/user/my-skill
# Scan a local skill directory
npx @clawmaster/skillguard-cli ./path/to/skill
# Scan a ClawHub skill
npx @clawmaster/skillguard-cli https://clawhub.ai/author/skill-name
# Scan all skills in a marketplace directory
npx @clawmaster/skillguard-cli ./marketplace --all

Features

🔍 Static Analysis

Pattern-based scanning across 10 security dimensions with 109 audit rules (67 built-in + 42 configurable). Covers OWASP LLM Top 10, SLSA supply chain, and Google SAIF framework — from prompt injection to license compliance, every risk surface is checked.

📊 A–F Risk Grading

One glance, one grade. Every skill gets a clear A–F letter rating with per-dimension score breakdown, severity distribution, and actionable remediation in both Chinese and English.

💰 Token Cost Estimation

4-level token analysis (L1 SKILL.md → L2 eager/lazy references → L3 all files) with multi-model cost projections across Claude Sonnet, Claude Opus, Gemini, and GPT. Know exactly how much a skill costs before you install it.

📦 Multi-Skill Detection

Drop a marketplace directory or monorepo — SkillGuard CLI automatically discovers every skill inside, scans them all, and generates an aggregated summary report.

🌐 Bilingual Reports

Full CN/EN remediation guidance for every finding. Switch with --lang zh or --lang en.

⚙️ Configurable Rules

YAML-based rule engine — enable, disable, adjust severity, or add whitelist entries. Ship your own security policy alongside the default 42-rule set with --rules.

📄 Multiple Output Formats

Terminal (colored), JSON (machine-readable), and Markdown (documentation-friendly). Pick the right format for your workflow.

Security Dimensions

#DimensionCoverage
1Prompt InjectionDirect/indirect injection patterns, zero-width chars, hidden instructions
2Permission EscalationMissing allowed-tools, sudo, chmod 777, dangerous tool combinations
3Data ExfiltrationCredential theft, env leaks, outbound HTTP, webhook tunneling
4Destructive OperationsPath traversal, sensitive file deletion, git force push
5Supply ChainPipe-to-shell, unpinned dependencies, unverified Docker images
6Code SecurityArbitrary eval, shell injection, SQL injection, XSS
7Credential LeaksHardcoded API keys, JWT tokens, PEM private keys
8Least PrivilegeMissing tool declarations, shell + network + write combos
9License ComplianceProprietary restrictions, non-commercial clauses
10Resource AbuseInfinite loops, excessive retries, recursive functions without base case

Architecture

flowchart TD
CLI((CLI — npx @clawmaster/skillguard-cli)) -->|"URL or Path"| Fetcher[Repo Fetcher]
Fetcher -->|"GitHub Tarball / Git Clone"| GitHub[(GitHub)]
Fetcher -->|"ClawHub ZIP API"| ClawHub[(ClawHub)]
Fetcher -->|"Local Path"| Local[(Local Dir)]
Fetcher --> Scanner[Static Scan Engine — 10 Dimensions]
Scanner --> Rules[YAML Rules Engine — 42 Configurable]
Scanner --> Token[Token Estimator — L1/L2/L3]
Token --> Cost[Multi-Model Cost Calculator]
Scanner --> Renderer[Output Renderer]
Cost --> Renderer
Renderer -->|"--json"| JSON[JSON Output]
Renderer -->|"--md"| Markdown[Markdown Report]
Renderer -->|"default"| Terminal[Terminal — Colored]
classDef startEndStyle fill:#e8f5e8,stroke:#4caf50,stroke-width:3px,color:#000
classDef processStyle fill:#e3f2fd,stroke:#2196f3,stroke-width:2px,color:#000
classDef decisionStyle fill:#fff3e0,stroke:#ff9800,stroke-width:2px,color:#000
classDef dataStyle fill:#f3e5f5,stroke:#9c27b0,stroke-width:2px,color:#000
classDef outputStyle fill:#fce4ec,stroke:#e91e63,stroke-width:2px,color:#000
class CLI startEndStyle
class Fetcher,Scanner,Rules,Token,Cost processStyle
class GitHub,ClawHub,Local dataStyle
class Renderer decisionStyle
class JSON,Markdown,Terminal outputStyle
Loading

How it differs from SkillGuard

SkillGuard (Web)SkillGuard CLI
InterfaceWeb UI + WebSocketTerminal
InfrastructureFastAPI + Celery + Redis + SQLiteNone — single npx command
Deep ScanLLM-driven (Phase 2 in CLI)Stubs ready, coming soon
OutputHTML reportsTerminal, JSON, Markdown
DistributionSelf-hostednpm install -g @clawmaster/skillguard-cli
Scan engineSame 109 rulesSame 109 rules

CLI Reference

skillguard <target> [options]
Arguments:
target Local directory, GitHub URL, or ClawHub URL
Options:
--all Scan all skill subdirectories (marketplace mode)
--json [file] Output as JSON (stdout or file)
--md <file> Output as Markdown report
--rules <path> Custom rules.yaml file
--min-level <A-F> Filter by minimum risk level (default: A)
--min-severity <severity> Filter by minimum severity (default: INFO)
--lang <en|zh> Output language (default: en)
-V, --version Show version
-h, --help Show help

Examples

# Quick audit with terminal output
npx @clawmaster/skillguard-cli https://github.com/anthropics/claude-code
# JSON report to file
npx @clawmaster/skillguard-cli ./my-skill --json report.json
# Markdown report
npx @clawmaster/skillguard-cli ./my-skill --md audit-report.md
# Chinese remediation text
npx @clawmaster/skillguard-cli ./my-skill --lang zh
# Only show HIGH and CRITICAL findings
npx @clawmaster/skillguard-cli ./my-skill --min-severity HIGH
# Marketplace scan with custom rules
npx @clawmaster/skillguard-cli ./skills-directory --all --rules custom-rules.yaml

Claude Code Skills

SkillGuard CLI ships with three Claude Code Skills for integrated usage:

SkillDescription
skills/audit/Run security audits directly from Claude Code
skills/explain-report/Explain findings, assess real risk vs false positives
skills/suggest-fixes/Generate concrete code fixes for findings

Tech Stack

ComponentTechnologyRole
LanguageTypeScriptType-safe scanning engine
RuntimeNode.js ≥ 18ESM module system
CLI FrameworkCommanderArgument parsing and help generation
Rule Enginejs-yaml109 configurable rules in YAML format
Terminal OutputchalkColored severity badges and risk grades
GitHub FetchertarTarball download + extraction
ClawHub FetcherunzipperZIP download + extraction
Token EstimatorBuilt-in4-level (L1/L2-eager/L2-lazy/L3) token & cost projection
BuildtsupSingle-file ESM bundle (85KB)
TestsvitestFast unit and integration testing

Versioning

This project follows Pride Versioning (PROUD.DEFAULT.SHAME):

  • PROUD — bumped when releasing features we're genuinely proud of
  • DEFAULT — bumped for ordinary, acceptable releases
  • SHAME — bumped when fixing embarrassing bugs

Current version: 0.1.0

License

This project is licensed under the MIT License.

You are free to use, modify, and distribute SkillGuard CLI in both personal and commercial projects. See the LICENSE file for full terms.


CLI version of SkillGuard · Built for the AI Agent ecosystem · ClawHub

About

Security audit CLI for AI agent skills — 10 dimensions, 109 rules, A-F risk grading. CLI version of SkillGuard.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages