Files
ai-proj-helper/hooks/git/pre-commit
T
johnQ 04e20babc1
skill-gate / gate (pull_request) Waiting to run
feat(skill): 本地 git 门禁 + 项目级安装 + 覆盖率与第三方扫描
- hooks/git/{pre-commit,pre-push} + scripts/install-git-hooks.sh(Gitea Actions 无 runner,本地兜底)
- install-skills.sh: --scope project --project-dir(装到项目 .agents/skills)
- scripts/scan-installed.sh: 扫第三方已装技能(33 个,0 高危)
- generate-catalog: has_evals/has_docs + coverage;validate --coverage + 路由一致性检查
- SCOPE 覆盖率路线图(3-4 周补齐 40 个技能的 evals 与四段式文档)
- MAINTENANCE/README/CHANGELOG 同步
2026-11-01 05:04:14 +08:00

19 lines
829 B
Bash
Executable File

#!/usr/bin/env bash
# skill-gate 本地门禁:Gitea Actions 没有 runner,靠这个兜底。
# 跳过:SKILL_GATE_SKIP=1 git commit ...(需在提交信息里说明原因)
set -uo pipefail
[ "${SKILL_GATE_SKIP:-0}" = "1" ] && { echo "[skill-gate] skipped by SKILL_GATE_SKIP=1"; exit 0; }
cd "$(git rev-parse --show-toplevel)" || exit 1
fail=0
echo "[skill-gate] validate --strict"
python3 scripts/validate-skills.py --strict || fail=1
echo "[skill-gate] scan"
./scripts/scan-skill.sh >/tmp/skill-gate-scan.log 2>&1 || { fail=1; tail -5 /tmp/skill-gate-scan.log; }
echo "[skill-gate] catalog --check"
python3 scripts/generate-catalog.py --check || fail=1
if [ "$fail" -ne 0 ]; then
echo "[skill-gate] 未通过:先修复,或用 SKILL_GATE_SKIP=1 并在提交信息里说明原因"
exit 1
fi
echo "[skill-gate] OK"