.claude/settings.json: PreToolUse hook: Edit/Write 前に miyabi gate locks を確認 PostToolUse hook: git commit 後にロック状態をリマインド scripts/hook-check-lock.sh: 他人がロック中のファイルへの書き込みを exit 2 でブロック ロックなしファイルの編集は警告のみ(ブロックしない) scripts/hook-post-bash.sh: git commit 後にロック残数を表示 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
24 lines
950 B
Bash
Executable file
24 lines
950 B
Bash
Executable file
#!/bin/bash
|
||
# Claude Code PostToolUse Hook: Bash 実行後にロック状態をリマインド
|
||
#
|
||
# git commit が実行された場合、post-commit hook が発火するので
|
||
# ここでは軽い状態表示のみ。
|
||
|
||
TOOL_INPUT="$1"
|
||
MIYABI_BIN="/Users/shunsukehayashi/dev/platform/miyabi-cli-standalone/target/release/miyabi"
|
||
STORE="/Users/shunsukehayashi/dev/platform/miyabi-cli-standalone/project_memory/tasks.json"
|
||
|
||
# miyabi バイナリがなければスキップ
|
||
if [ ! -x "$MIYABI_BIN" ]; then
|
||
exit 0
|
||
fi
|
||
|
||
# git commit を検出した場合にステータス表示
|
||
if echo "$TOOL_INPUT" | grep -q "git commit"; then
|
||
ACTIVE=$("$MIYABI_BIN" gate --store-path "$STORE" locks 2>/dev/null | grep -c "->")
|
||
if [ "$ACTIVE" -gt 0 ]; then
|
||
echo "ℹ️ POLARIS: $ACTIVE 件のファイルがまだロック中です。作業完了したら miyabi gate merge または miyabi gate manual-complete を実行してください。"
|
||
fi
|
||
fi
|
||
|
||
exit 0
|