.claude/settings.json
|
{ "hooks": { "PreToolUse": [ { "matcher": "Bash", "hooks": [ { "type": "command", "if": "Bash(git commit*)", "shell": "powershell", "command": "Write-Output '{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"additionalContext\":\"PRE-COMMIT REMINDER: Before committing, verify: (1) examples/ still accurate — no stale function names, removed commands, or wrong ordering? (2) README Exported Cmdlets and Included Tools match current module state? (3) CHANGELOG [Unreleased] covers this change?\"}}'", "statusMessage": "Checking docs reminder..." } ] }, { "matcher": "PowerShell|Bash", "hooks": [ { "type": "command", "shell": "powershell", "command": "$j=[Console]::In.ReadToEnd()|ConvertFrom-Json; $c=\"$($j.tool_input.command)\"; if($c -match 'Publish-(PSResource|Module)' -and $c -notmatch '-WhatIf'){git describe --exact-match --tags HEAD *>$null; if($LASTEXITCODE -ne 0){Write-Output '{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"deny\",\"permissionDecisionReason\":\"PSGallery publish blocked: git HEAD is not at a tag. Tag the release first (git tag -a vX.Y.Z then git push origin vX.Y.Z) before publishing.\"}}'}}", "statusMessage": "Verifying release is tagged..." } ] } ] } } |