#!/usr/bin/env bash set -euo pipefail # Kyberforge's Vale prefilter is duplicated into skill-audit and agent-audit's own # scripts/assets (per plugins/kyberforge/skills/skill-author/references/deployment-modes.md's # no-cross-skill-path rule: a plugin's cache-install copy only includes each skill's own files). # agent-audit's copy is canonical — it's the superset (Kyberforge + KyberforgeCopilot) that the # repo root's own pre-commit hook and .pre-commit-hooks.yaml both consume. This fails the build # if skill-audit's copy has drifted from it, since nothing else would catch a rule fix landing in # only one of the two. Run from repo root or pass REPO_ROOT as arg. REPO_ROOT="${1:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}" FAIL=0 err() { echo " FAIL: $1" >&2; FAIL=$((FAIL + 1)); } SKILL_AUDIT="$REPO_ROOT/plugins/kyberforge/skills/skill-audit" AGENT_AUDIT="$REPO_ROOT/plugins/kyberforge/skills/agent-audit" if [[ ! -d "$SKILL_AUDIT" || ! -d "$AGENT_AUDIT" ]]; then exit 0 fi if ! diff -q "$SKILL_AUDIT/scripts/vale-wrap.sh" "$AGENT_AUDIT/scripts/vale-wrap.sh" >/dev/null 2>&1; then err "scripts/vale-wrap.sh differs between skill-audit and agent-audit" fi if ! diff -rq "$SKILL_AUDIT/assets/vale/styles/Kyberforge" "$AGENT_AUDIT/assets/vale/styles/Kyberforge" >/dev/null 2>&1; then err "assets/vale/styles/Kyberforge differs between skill-audit and agent-audit" fi if [[ $FAIL -gt 0 ]]; then echo "Vale style sync check failed: $FAIL error(s). agent-audit's copy is canonical — run scripts/sync-vale-styles.sh to regenerate skill-audit's copy, then commit both." >&2 exit 1 fi