From 33682acd3644bd1c31fcecd3db4d10fc454029bd Mon Sep 17 00:00:00 2001 From: Gal Elmalah Date: Mon, 19 Jan 2026 11:32:03 +0200 Subject: [PATCH 1/4] feat(validation): Add script for skill validation This commit introduces a new script to automate the validation of skills within the repository. It leverages the `skills-ref` library to ensure all skills adhere to a defined schema and structure. - Adds `skills-ref` to `requirements.txt`. - Provides `scripts/validate.sh` to check all skills in the `skills/` directory or a specified skill path. - Outputs colored pass/fail status for each skill. - Generates a summary of validation results. - Exits with a non-zero status if any skill fails validation, facilitating integration into CI/CD pipelines. --- requirements.txt | 1 + scripts/validate.sh | 98 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 requirements.txt create mode 100755 scripts/validate.sh diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..6d06abb --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +skills-ref>=0.1.1 diff --git a/scripts/validate.sh b/scripts/validate.sh new file mode 100755 index 0000000..db099a7 --- /dev/null +++ b/scripts/validate.sh @@ -0,0 +1,98 @@ +#!/usr/bin/env bash +# +# Validate all skills in the repository using skills-ref +# +# Usage: ./scripts/validate.sh [skill-path] +# If no argument provided, validates all skills in skills/ directory +# If skill-path provided, validates only that skill + +set -euo pipefail + +# Colors for output +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +NC='\033[0m' # No Color + +# Track validation results +FAILED=0 +PASSED=0 +SKILLS_CHECKED=() + +validate_skill() { + local skill_dir="$1" + local skill_name + skill_name=$(basename "$skill_dir") + + echo -e "${YELLOW}Validating:${NC} $skill_dir" + + if skills-ref validate "$skill_dir"; then + echo -e "${GREEN}✓${NC} $skill_name passed validation" + ((PASSED++)) + else + echo -e "${RED}✗${NC} $skill_name failed validation" + ((FAILED++)) + fi + + SKILLS_CHECKED+=("$skill_name") + echo "" +} + +# Change to repo root +cd "$(dirname "$0")/.." + +# Check if skills-ref is installed +if ! command -v skills-ref &> /dev/null; then + echo -e "${RED}Error:${NC} skills-ref is not installed" + echo "Install it with: pip install -r requirements.txt" + exit 1 +fi + +# If a specific skill path is provided, validate only that +if [[ $# -gt 0 ]]; then + if [[ -d "$1" ]]; then + validate_skill "$1" + else + echo -e "${RED}Error:${NC} Directory not found: $1" + exit 1 + fi +else + # Find all skill directories (containing SKILL.md), excluding _template + echo "Searching for skills to validate..." + echo "" + + while IFS= read -r -d '' skill_file; do + skill_dir=$(dirname "$skill_file") + + # Skip _template directory + if [[ "$skill_dir" == *"/_template"* ]] || [[ "$skill_dir" == *"_template"* ]]; then + echo -e "${YELLOW}Skipping template:${NC} $skill_dir" + continue + fi + + validate_skill "$skill_dir" + done < <(find skills -name "SKILL.md" -print0 2>/dev/null || true) +fi + +# Summary +echo "========================================" +echo "Validation Summary" +echo "========================================" +echo -e "Skills checked: ${#SKILLS_CHECKED[@]}" +echo -e "${GREEN}Passed:${NC} $PASSED" +echo -e "${RED}Failed:${NC} $FAILED" +echo "" + +if [[ ${#SKILLS_CHECKED[@]} -eq 0 ]]; then + echo -e "${YELLOW}No skills found to validate.${NC}" + echo "Skills should be placed in skills/.curated/ or skills/.experimental/" + exit 0 +fi + +if [[ $FAILED -gt 0 ]]; then + echo -e "${RED}Validation failed!${NC}" + exit 1 +else + echo -e "${GREEN}All skills passed validation!${NC}" + exit 0 +fi From 42a60b1a7362457501c585855abd26ce4fc20576 Mon Sep 17 00:00:00 2001 From: Gal Elmalah Date: Mon, 19 Jan 2026 11:35:43 +0200 Subject: [PATCH 2/4] feat(ci): Add GitHub Actions workflow for skill validation Automatically validates skills on push/PR to master when relevant files change. --- .github/workflows/validate.yml | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/validate.yml diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 0000000..0e7f94c --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,38 @@ +name: Validate Skills + +on: + push: + branches: [master] + paths: + - 'skills/**' + - 'scripts/validate.sh' + - 'requirements.txt' + - '.github/workflows/validate.yml' + pull_request: + branches: [master] + paths: + - 'skills/**' + - 'scripts/validate.sh' + - 'requirements.txt' + - '.github/workflows/validate.yml' + +jobs: + validate: + name: Validate Skills + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + cache: 'pip' + + - name: Install dependencies + run: pip install -r requirements.txt + + - name: Run validation + run: ./scripts/validate.sh From bc62639f5316bb0979b88f865fc1535b5ad6dd75 Mon Sep 17 00:00:00 2001 From: Gal Elmalah Date: Mon, 19 Jan 2026 14:10:50 +0200 Subject: [PATCH 3/4] fix(ci): Use skills-cli package instead of skills-ref The correct PyPI package is skills-cli with the `skills` CLI command. --- requirements.txt | 2 +- scripts/validate.sh | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/requirements.txt b/requirements.txt index 6d06abb..6ae70ec 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -skills-ref>=0.1.1 +skills-cli>=0.1.3 diff --git a/scripts/validate.sh b/scripts/validate.sh index db099a7..4851c9e 100755 --- a/scripts/validate.sh +++ b/scripts/validate.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Validate all skills in the repository using skills-ref +# Validate all skills in the repository using skills-cli # # Usage: ./scripts/validate.sh [skill-path] # If no argument provided, validates all skills in skills/ directory @@ -26,7 +26,7 @@ validate_skill() { echo -e "${YELLOW}Validating:${NC} $skill_dir" - if skills-ref validate "$skill_dir"; then + if skills validate "$skill_dir"; then echo -e "${GREEN}✓${NC} $skill_name passed validation" ((PASSED++)) else @@ -41,9 +41,9 @@ validate_skill() { # Change to repo root cd "$(dirname "$0")/.." -# Check if skills-ref is installed -if ! command -v skills-ref &> /dev/null; then - echo -e "${RED}Error:${NC} skills-ref is not installed" +# Check if skills-cli is installed +if ! command -v skills &> /dev/null; then + echo -e "${RED}Error:${NC} skills-cli is not installed" echo "Install it with: pip install -r requirements.txt" exit 1 fi From 8a27b435b0097b484749247b0e281574572080d2 Mon Sep 17 00:00:00 2001 From: Gal Elmalah Date: Mon, 19 Jan 2026 14:15:43 +0200 Subject: [PATCH 4/4] fix(ci): Install skills-ref from GitHub repo The skills-ref package is not published to PyPI - install directly from the agentskills/agentskills GitHub repository. --- requirements.txt | 2 +- scripts/validate.sh | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/requirements.txt b/requirements.txt index 6ae70ec..4bc9313 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -skills-cli>=0.1.3 +skills-ref @ git+https://github.com/agentskills/agentskills.git#subdirectory=skills-ref diff --git a/scripts/validate.sh b/scripts/validate.sh index 4851c9e..db099a7 100755 --- a/scripts/validate.sh +++ b/scripts/validate.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Validate all skills in the repository using skills-cli +# Validate all skills in the repository using skills-ref # # Usage: ./scripts/validate.sh [skill-path] # If no argument provided, validates all skills in skills/ directory @@ -26,7 +26,7 @@ validate_skill() { echo -e "${YELLOW}Validating:${NC} $skill_dir" - if skills validate "$skill_dir"; then + if skills-ref validate "$skill_dir"; then echo -e "${GREEN}✓${NC} $skill_name passed validation" ((PASSED++)) else @@ -41,9 +41,9 @@ validate_skill() { # Change to repo root cd "$(dirname "$0")/.." -# Check if skills-cli is installed -if ! command -v skills &> /dev/null; then - echo -e "${RED}Error:${NC} skills-cli is not installed" +# Check if skills-ref is installed +if ! command -v skills-ref &> /dev/null; then + echo -e "${RED}Error:${NC} skills-ref is not installed" echo "Install it with: pip install -r requirements.txt" exit 1 fi