mergegate/scripts/hook-post-bash.sh
林 駿甫 (Shunsuke Hayashi) 263adf87cd feat(protocol): expand Obsidian wikilinks in attach_context
When attaching Obsidian notes, extract [[wikilinks]] from the note
content and resolve them to actual vault files. Linked notes are
attached as "obsidian_wikilink" type, bounded by remaining_tokens.

Supports both [[Note]] and [[Note|Display]] syntax.

Closes #102

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 10:21:01 +09:00

26 lines
995 B
Bash
Executable file
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# Claude Code PostToolUse Hook: Bash 実行後にロック状態をリマインド
#
# git commit が実行された場合、post-commit hook が発火するので
# ここでは軽い状態表示のみ。
TOOL_INPUT="$1"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
MIYABI_BIN="${MIYABI_BIN:-$REPO_ROOT/target/release/miyabi}"
STORE="${POLARIS_TASK_STORE:-$REPO_ROOT/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