From fe9d06aaf712924deb134e53943226261ab0ae53 Mon Sep 17 00:00:00 2001 From: elliotllliu <55885132+elliotllliu@users.noreply.github.com> Date: Sun, 15 Mar 2026 20:19:02 +0000 Subject: [PATCH] feat: add pre-commit hooks for skills check and update Add .pre-commit-hooks.yaml so external projects can integrate skills checks into their pre-commit workflow: - skills-check: runs `npx skills check` on commit (fails if updates are available) - skills-update: runs `npx skills update -y` as a manual stage Usage in .pre-commit-config.yaml: repos: - repo: https://github.com/vercel-labs/skills rev: main hooks: - id: skills-check Closes #525 --- .pre-commit-hooks.yaml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .pre-commit-hooks.yaml diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml new file mode 100644 index 00000000..677b168e --- /dev/null +++ b/.pre-commit-hooks.yaml @@ -0,0 +1,33 @@ +# Pre-commit hooks for the skills CLI. +# Usage: add the following to your .pre-commit-config.yaml: +# +# repos: +# - repo: https://github.com/vercel-labs/skills +# rev: main +# hooks: +# - id: skills-check +# +# See https://pre-commit.com for more information. + +- id: skills-check + name: Check for skill updates + entry: npx -y skills check + language: system + pass_filenames: false + always_run: true + stages: [pre-commit] + description: >- + Check whether installed skills are up to date. + Fails with a non-zero exit code when updates are available. + +- id: skills-update + name: Update skills + entry: npx -y skills update -y + language: system + pass_filenames: false + always_run: true + stages: [manual] + description: >- + Update all installed skills to the latest version. + Recommended as a manual stage — run with + `pre-commit run --hook-stage manual skills-update`.