// arch-sync-check.js // PostToolUse hook: detects git commit/push and reminds to sync architecture docs // Reads tool input from stdin, outputs reminder if git operation detected const CHUNKS = []; process.stdin.on('data', (c) => CHUNKS.push(c)); process.stdin.on('end', () => { try { const input = JSON.parse(Buffer.concat(CHUNKS).toString()); const toolName = input.tool_name || ''; const toolInput = input.tool_input || {}; // Only check Bash tool calls if (toolName !== 'Bash') return; const cmd = (toolInput.command || '').trim(); // Detect git commit or git push const isGitCommit = cmd.startsWith('git commit') || cmd.includes('&& git commit'); const isGitPush = cmd.startsWith('git push') || cmd.includes('&& git push'); if (isGitCommit || isGitPush) { console.log('[arch-sync] Architecture docs may need updating. Run /sync-arch or update CLAUDE.md §13 + ARCHITECTURE_BRIEF.md as part of §8.3 completion flow.'); } } catch { // Silently ignore parse errors } });