Skip to main content

skill-guard

The quality gate for Agent Skills.

PyPI version License Python 3.11+

skill-guard is a CLI tool that validates, secures, and checks Agent Skills, with the default workflow centered on pre-merge repository gates.

The Problem

Agent Skills are powerful. They're also ungoverned. As soon as more than one person contributes skills to a shared agent, things break in hard-to-diagnose ways:

  • A new skill's description overlaps with an existing one → agent picks the wrong skill half the time
  • Skills with dangerous scripts get merged because nobody reviewed the scripts/ directory
  • Nobody knows what skills are installed, who owns them, or whether they still work
  • A skill passes every test in isolation but fails when the real agent uses it with 25 other skills loaded

skill-guard is the quality gate that catches these problems before they reach production.

What It Does

ONBOARDING (pre-merge, in CI):
  skill-guard validate   → format compliance + quality scoring
  skill-guard secure     → scan for dangerous patterns
  skill-guard conflict   → detect trigger overlap with existing skills
  skill-guard check      → runs validate + secure + conflict as a single gate

Quick Start

pip install skill-guard

# Initialize in your skills repo
skill-guard init

# Run the default gate
skill-guard check ./skills/my-skill/ --against ./skills/

If you only learn one command, learn check. It is the default pre-merge workflow and the command the GitHub Actions path is built around.

Advanced / Secondary Commands

Use these when you need to inspect one part of the gate in isolation or run non-default workflows:

# Format and metadata quality only
skill-guard validate ./skills/my-skill/

# Security only
skill-guard secure ./skills/my-skill/
skill-guard secure ./skills/my-skill/ --skip-references

# Conflict detection only
skill-guard conflict ./skills/my-skill/ --against ./skills/

Example Output

$ skill-guard validate ./skills/my-skill/

 skill-guard validate — my-skill
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Check                     ┃ Result                                           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ skill_md_exists           │ ✅ SKILL.md found                                │
│ valid_yaml_frontmatter    │ ✅ Valid YAML frontmatter                        │
│ name_field_present        │ ✅ name: my-skill                                │
│ description_field_present │ ✅ description field present                     │
│ directory_name_matches    │ ✅ Directory name matches skill name             │
│ description_trigger_hint  │ ✅ Description contains trigger hint ('Use when')│
│ no_broken_body_paths      │ ✅ No broken relative paths in SKILL.md body     │
│ evals_directory_exists    │ ⚠️ No evals/ directory found                     │
│                           │ → Create evals/evals.json or evals/config.yaml   │
│ metadata_has_author       │ ✅ author: my-team                               │
│ metadata_has_version      │ ✅ version: 1.0                                  │
└───────────────────────────┴──────────────────────────────────────────────────┘
Score: 97/100 | Grade: A | Blockers: 0 | Warnings: 1

Prerequisites

Requirement Version Notes
Python 3.11+ Required. 3.12 and 3.13 tested.
pip any recent Bundled with Python
typer ≥0.13.0 Installed automatically

Note: every skill-guard command works fully offline — no agent or API key needed.

The default offline path is already useful on its own: validate catches structure and metadata problems, secure catches risky patterns with remediation hints, conflict flags overlapping triggers, and check combines those static gates into one pre-merge decision.

Installation

# Core (static analysis — no agent required)
pip install skill-guard

# Optional embeddings support
pip install skill-guard[embeddings]

# Optional LLM-based conflict detection
pip install skill-guard[llm]

Conflict Detection Modes

# TF-IDF (default)
skill-guard conflict ./skills/my-skill/ --against ./skills/ --method tfidf

# Embeddings-based overlap detection
skill-guard conflict ./skills/my-skill/ --against ./skills/ --method embeddings

# Choose a different embeddings model
skill-guard conflict ./skills/my-skill/ --against ./skills/ --method embeddings --model all-MiniLM-L12-v2

# Offline embeddings (local model only; no downloads)
skill-guard conflict ./skills/my-skill/ --against ./skills/ --method embeddings \
  --model-path /models/all-MiniLM-L6-v2 --offline

# LLM-based overlap detection
export OPENAI_API_KEY=...
skill-guard conflict ./skills/my-skill/ --against ./skills/ --method llm

embeddings uses the all-MiniLM-L6-v2 sentence-transformers model by default (override with --model, --model-path, or conflict.embeddings_model/conflict.embeddings_model_path) and caches downloads under conflict.embeddings_cache_dir (default .skill-guard-cache/embeddings/). On first download, it prints a "Downloading model..." message to stderr. Use --offline to require a local/cached model and skip downloads. llm uses the OpenAI Chat API with gpt-4o-mini by default.

Ignoring known conflicts

Add conflict_ignore to your SKILL.md frontmatter to skip comparisons against specific skills:

---
name: my-skill
description: "Use when ..."
conflict_ignore:
  - legacy-skill
  - skills/legacy-skill/SKILL.md
---

Documentation

Anthropic Spec Validation

skill-guard validate includes Anthropic AgentSkills spec compliance checks by default. Set validate.anthropic_spec: false in skill-guard.yaml if you need to disable those additional findings.

Exit Codes

  • 0: success
  • 1: validation/security failures
  • 2: warnings only (when fail_on_warning is false)
  • 3: config error
  • 4: parse error

Pre-commit

Use pre-commit to enforce checks before skill changes land:

repos:
  - repo: https://github.com/vaibhavtupe/skill-guard
    rev: v0.9.0
    hooks:
      - id: skill-guard-validate
      - id: skill-guard-secure
      - id: skill-guard-check

These hooks run against changed SKILL.md files, deduplicate by skill root, and then execute the corresponding skill-guard command for each affected skill.

Templates

Use skill-guard init --template base to scaffold a new skill, or skill-guard init --list-templates to see the available scaffolds. Generated templates include SKILL.md, evals/evals.json, references/, scripts/, and assets/ so they validate immediately.

GitHub Actions

name: skill-guard PR Gate

on:
  pull_request:
    paths:
      - "skills/**"

jobs:
  skill-guard:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.12"
      - run: python -m pip install skill-guard
      - run: |
          skill-guard check skills/ \
            --changed \
            --base-ref "${{ github.event.pull_request.base.sha }}" \
            --head-ref "${{ github.sha }}" \
            --format md > skill-guard-summary.md

See docs/ci-integration.md for the canonical workflow, JSON + markdown artifact strategy, and the checked-in example at .github/workflows/skill-guard-pr-gate.yml.

What skill-guard Does NOT Do

  • Does not replace Anthropic's skill-creator for writing skills
  • Does not host or serve skills — skills live in your repo
  • Does not modify skills — it reports issues, authors fix them
  • Does not require a database or server — everything runs from files in your repo

Contributing

See CONTRIBUTING.md. We welcome contributions of all kinds.

For planning and release discipline:

  • ROADMAP.md is the canonical scope source
  • docs/automation-policy.md defines PM ↔ Dev workflow
  • docs/release-gate.md is the required pre-release checklist

License

Apache 2.0. See LICENSE.

Metadata

Release files for skill-guard 0.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for skill-guard 0.9.0
File Size Uploaded
skill_guard-0.9.0.tar.gz 110.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for skill-guard 0.9.0
File Interpreter ABI Platform
skill_guard-0.9.0-py3-none-any.whl Python 3 none any Details

Total release size: 168.9 kB

Release files / skill_guard-0.9.0.tar.gz

Download URL skill_guard-0.9.0.tar.gz
Size 110.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b4020e1d078287e22db7a0df29a8547a448ae223def196df5bc73a2aba6e160c
BLAKE2b-256 checksum
How to use checksums
963bba93befbe5382117c452c8d88ae1f2ad59e28facec7e06342d11e2524ab4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.

Transparency log

Release files / skill_guard-0.9.0-py3-none-any.whl

Download URL skill_guard-0.9.0-py3-none-any.whl
Size 58.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e993ff43288051a09ba42eee4a738856e421ba1dce5f21199368fe7254d042cc
BLAKE2b-256 checksum
How to use checksums
9f9d070a36f6159ea22e51d147258c3f83a94f3d4fb282e54fa8ea4a3811d27c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.9.0 This release

2 release files

0.8.0

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page