mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-19 02:17:09 +00:00
- Add ai_docs/tests/precommit_audit_hook_runbook.md (9-step E2E test for skillshare audit -p as pre-commit hook) - Fix cli-e2e-test SKILL.md: clarify init -p has separate flag set from global init; add audit rule ID vs pattern name guidance; add project mode init example to container templates; add two new checklist items - Update CHANGELOG.md with pre-commit hook, audit TUI filter, O(N) cross-skill rewrite, and SARIF line-0 fix entries
2.0 KiB
2.0 KiB
sidebar_position
| sidebar_position |
|---|
| 3 |
Recipe: Pre-commit Hook
Run
skillshare auditautomatically on every commit using the pre-commit framework.
When to Use
The pre-commit hook is most valuable when:
- Multiple contributors edit skills — team members may inadvertently introduce dangerous commands (
curl | bash,sudo rm -rf). The hook catches these before they enter version control. - Skills come from external sources — copying skills from GitHub, community repos, or AI-generated content makes manual review difficult. Automated scanning provides a safety net.
- You want instant feedback — CI catches issues too, but only after push. The hook gives developers immediate, local feedback in seconds.
You can skip it when:
- You are the sole author and trust all your skills
- Skills rarely change (the hook only runs when
.skillshare/orskills/files are modified)
Setup
Add to your project's .pre-commit-config.yaml:
repos:
- repo: https://github.com/runkids/skillshare
rev: v0.16.8 # use latest release tag
hooks:
- id: skillshare-audit
Then install the hook:
pre-commit install
How It Works
The hook runs skillshare audit -p whenever you commit changes to files matching .skillshare/ or skills/ directories. If any findings exceed the configured threshold, the commit is blocked.
Configuration
The hook respects your project's .skillshare/config.yaml settings:
audit:
block_threshold: high # block on HIGH+ findings
Skipping the Hook
For a one-time skip:
SKIP=skillshare-audit git commit -m "your message"
Requirements
skillshareCLI must be installed and available inPATH- Project must be initialized with
skillshare init -p
Combining with CI
The pre-commit hook catches issues locally, while CI/CD validation provides a safety net for the whole team. Use both for defense in depth.