mirror of
https://github.com/Earth-Genesis-Games/Ajedrez_Purgatorio.git
synced 2026-09-11 09:47:35 +00:00
- Install CCGS agent/skill/hook framework (.claude/, docs templates, GitHub issue/PR templates) - Configure CLAUDE.md and technical-preferences.md for Unity 6000.3.3f1 (C#, URP, collider-based mouse picking) - Point engine reference import at docs/engine-reference/unity/ and remove unused Godot/Unreal reference docs - Add Version Awareness section to unity-specialist agent - Set production/review-mode.txt to lean - Add design/gdd/combat-mode.md: reverse-documented GDD for the vs-AI Combat mode, confirming it as the foundation for the guion.md narrative campaign (separate from Classic mode) - Add docs/architecture/ADR-0001: documents the existing board-state/singleton/per-mode architecture and the decision to keep Classic and Combat modes permanently separate - Add docs/architecture/control-manifest.md: programmer rules sheet sourced from ADR-0001 and Unity 6 engine reference docs - Continue in-progress Mono/Classic and Mono/Combat refactor (ScoreManager, scene/prefab updates) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
48 lines
1.5 KiB
Bash
48 lines
1.5 KiB
Bash
#!/bin/bash
|
|
# Claude Code PreToolUse hook: Validates git push commands
|
|
# Warns on pushes to protected branches
|
|
# Exit 0 = allow, Exit 2 = block
|
|
#
|
|
# Input schema (PreToolUse for Bash):
|
|
# { "tool_name": "Bash", "tool_input": { "command": "git push origin main" } }
|
|
|
|
INPUT=$(cat)
|
|
|
|
# Parse command -- use jq if available, fall back to grep
|
|
if command -v jq >/dev/null 2>&1; then
|
|
COMMAND=$(echo "$INPUT" | jq -r '.tool_input.command // empty')
|
|
else
|
|
COMMAND=$(echo "$INPUT" | grep -oE '"command"[[:space:]]*:[[:space:]]*"[^"]*"' | sed 's/"command"[[:space:]]*:[[:space:]]*"//;s/"$//')
|
|
fi
|
|
|
|
# Only process git push commands
|
|
if ! echo "$COMMAND" | grep -qE '^git[[:space:]]+push'; then
|
|
exit 0
|
|
fi
|
|
|
|
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
|
|
MATCHED_BRANCH=""
|
|
|
|
# Check if pushing to a protected branch
|
|
for branch in develop main master; do
|
|
if [ "$CURRENT_BRANCH" = "$branch" ]; then
|
|
MATCHED_BRANCH="$branch"
|
|
break
|
|
fi
|
|
# Also check if pushing to a protected branch explicitly (quote branch name for safety)
|
|
if echo "$COMMAND" | grep -qE "[[:space:]]${branch}([[:space:]]|$)"; then
|
|
MATCHED_BRANCH="$branch"
|
|
break
|
|
fi
|
|
done
|
|
|
|
if [ -n "$MATCHED_BRANCH" ]; then
|
|
echo "Push to protected branch '$MATCHED_BRANCH' detected." >&2
|
|
echo "Reminder: Ensure build passes, unit tests pass, and no S1/S2 bugs exist." >&2
|
|
# Allow the push but warn -- uncomment below to block instead:
|
|
# echo "BLOCKED: Run tests before pushing to $CURRENT_BRANCH" >&2
|
|
# exit 2
|
|
fi
|
|
|
|
exit 0
|