Stats
Actions
Tags
From solana-ai-kit
Runs build verification, regression tests, scope guards, and lint checks across lifecycle events. Blocks Write/Edit tools on pre-tool checks. Executes bash scripts and writes files.
5 events · 8 hooks
Safety signals detected in this hook configuration
Where this hook configuration is defined
Defined in hooks/hooks.json
Event handlers and matchers — expand Raw Configuration for the full JSON
for f in $(git diff --cached --name-only 2>/dev/null); do
case "$f" in
*.rs) command -v rustfmt >/dev/null 2>&1 && rustfmt "$f" 2>/dev/null || true ;;
*.ts|*.tsx|*.js|*.jsx|*.json) command -v npx >/dev/null 2>&1 && npx prettier --write "$f" 2>/dev/null || true ;;
esac
doneBashset -e
echo "🔍 Running pre-commit checks..."
if [ -f "Anchor.toml" ] || grep -q "solana-program" Cargo.toml 2>/dev/null; then
cargo fmt --check || { cargo fmt; exit 1; }
cargo clippy --all-targets -- -D warnings || exit 1
cargo test --lib || exit 1
fi
if [ -f "package.json" ]; then
npx prettier --check "**/*.{ts,tsx,js,jsx,json}" || { npx prettier --write "**/*.{ts,tsx,js,jsx,json}"; exit 1; }
[ -f "tsconfig.json" ] && npx tsc --noEmit || exit 1
fi
echo "✅ Pre-commit checks passed"Bashset -e
echo "🚨 PRE-DEPLOY CHECKS"
NETWORK=$(solana config get | grep "RPC URL" | awk '{print $3}')
echo "Network: $NETWORK"
if echo "$NETWORK" | grep -q mainnet; then
echo "⚠️ MAINNET DEPLOY"
echo "Type 'DEPLOY TO MAINNET' to continue:";
read -r CONFIRM;
[ "$CONFIRM" = "DEPLOY TO MAINNET" ] || exit 1
fi
if [ -f "Anchor.toml" ]; then
ls target/deploy/*.so >/dev/null 2>&1 || { echo "❌ No build found"; exit 1; }
fi
echo "✅ Pre-deploy checks passed"Write|Editif [ -z "$CLAUDE_FILE_PATH" ]; then exit 0; fi
case "$CLAUDE_FILE_PATH" in
*.rs)
command -v rustfmt >/dev/null 2>&1 && rustfmt "$CLAUDE_FILE_PATH" || true
;;
*.ts|*.tsx|*.js|*.jsx|*.json|*.md)
command -v npx >/dev/null 2>&1 && npx prettier --write "$CLAUDE_FILE_PATH" || true
;;
esacBashecho ""
echo "📊 Test Summary:";
if [ "$CLAUDE_TOOL_EXIT_CODE" -eq 0 ]; then
echo "✅ All tests passed!"
else
echo "❌ Some tests failed. Review output above."
fiBashecho ""
echo "📊 .NET Test Summary:";
if [ "$CLAUDE_TOOL_EXIT_CODE" -eq 0 ]; then
echo "✅ All tests passed!"
else
echo "❌ Some tests failed. Review output above."
fiif [ -f "${CLAUDE_PROJECT_DIR:-.}/.claude/VERSION" ]; then exit 0; fi
V=$(awk 'NF{print $NF; exit}' "${CLAUDE_PLUGIN_ROOT}/VERSION" 2>/dev/null)
[ -n "$V" ] || V=dev
if [ -z "${NO_COLOR:-}" ] && printf %s "${COLORTERM:-}" | grep -qiE 'truecolor|24bit'; then
G1=$(printf '\033[38;2;153;69;255m'); G2=$(printf '\033[38;2;131;98;237m')
G3=$(printf '\033[38;2;109;126;220m'); G4=$(printf '\033[38;2;86;155;202m')
G5=$(printf '\033[38;2;64;184;184m'); G6=$(printf '\033[38;2;42;212;167m')
G7=$(printf '\033[38;2;20;241;149m')
DM=$(printf '\033[2m'); RS=$(printf '\033[0m')
else
G1=; G2=; G3=; G4=; G5=; G6=; G7=; DM=; RS=
fi
printf '%s%s%s\n' "$G1" ' _____ ____ __ ___ _ _____' "$RS"
printf '%s%s%s\n' "$G2" ' / ___// __ \/ / / | / | / / |' "$RS"
printf '%s%s%s\n' "$G3" ' \__ \/ / / / / / /| | / |/ / /| |' "$RS"
printf '%s%s%s\n' "$G4" ' ___/ / /_/ / /___/ ___ |/ /| / ___ |' "$RS"
printf '%s%s%s\n' "$G5" '/____/\____/_____/_/ |_/_/ |_/_/ |_|' "$RS"
printf '%s%s%s\n' "$G6" ' ▄▀█ █ █▄▀ █ ▀█▀' "$RS"
printf '%s%s%s\n' "$G7" ' █▀█ █ █ █ █ █' "$RS"
printf '%s\n\n' "${DM}v$V — by @SuperteamBR 🇧🇷${RS}"
if command -v solana >/dev/null 2>&1; then
echo "🔗 $(solana config get | grep 'RPC URL' | awk '{print $3}')"
echo "👛 $(solana address 2>/dev/null || echo 'No wallet configured')"
else
echo '⚠️ Solana CLI not found'
fiecho "🤖 Agent completed: ${CLAUDE_SUBAGENT_NAME:-unknown}"npx claudepluginhub solanabr/solana-ai-kit --plugin solana-ai-kit