Core plugin providing: - Skills: core CLI reference, PHP patterns, Go patterns - Commands: /core:remember for context persistence - Hooks: - PreToolUse: block dangerous commands (rm -rf, sed -i, grep -l |) - PreToolUse: enforce core CLI over raw go/php commands - PostToolUse: auto-format Go/PHP, check for debug statements - PostToolUse: warn about uncommitted work after git commit - PreCompact: save state to prevent amnesia after auto-compact - SessionStart: restore context from recent sessions (<3h) - MCP: core CLI server integration Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
18 lines
688 B
Bash
Executable file
18 lines
688 B
Bash
Executable file
#!/bin/bash
|
|
# Log PR URL and provide review command after PR creation
|
|
|
|
read -r input
|
|
COMMAND=$(echo "$input" | jq -r '.tool_input.command // empty')
|
|
OUTPUT=$(echo "$input" | jq -r '.tool_output.output // empty')
|
|
|
|
if [[ "$COMMAND" == *"gh pr create"* ]]; then
|
|
PR_URL=$(echo "$OUTPUT" | grep -oE 'https://github.com/[^/]+/[^/]+/pull/[0-9]+' | head -1)
|
|
if [[ -n "$PR_URL" ]]; then
|
|
REPO=$(echo "$PR_URL" | sed -E 's|https://github.com/([^/]+/[^/]+)/pull/[0-9]+|\1|')
|
|
PR_NUM=$(echo "$PR_URL" | sed -E 's|.*/pull/([0-9]+)|\1|')
|
|
echo "[Hook] PR created: $PR_URL" >&2
|
|
echo "[Hook] To review: gh pr review $PR_NUM --repo $REPO" >&2
|
|
fi
|
|
fi
|
|
|
|
echo "$input"
|