{ "permissions": { "allow": [ "Bash(dotnet build:*)", "Bash(dotnet clean:*)", "Bash(dotnet restore:*)", "Bash(dotnet run:*)", "Bash(dotnet test:*)", "Bash(dotnet format:*)", "Bash(dotnet add:*)", "Bash(dotnet remove:*)", "Bash(dotnet sln:*)", "Bash(dotnet --list-sdks:*)", "Bash(dotnet tool install:*)", "Bash(dotnet ef:*)", "Bash(grpcurl:*)", "Bash(protogen:*)", "Bash(mkdir:*)", "Bash(ls:*)", "Bash(git status:*)", "Bash(git log:*)", "Bash(git diff:*)", "Bash(git branch:*)", "Bash(git stash:*)", "Bash(git add:*)", "Bash(git checkout:*)", "WebSearch", "WebFetch(domain:learn.microsoft.com)", "WebFetch(domain:github.com)", "WebFetch(domain:www.nuget.org)", "WebFetch(domain:stackoverflow.com)" ], "ask": [ "Bash(dotnet publish:*)", "Bash(dotnet pack:*)", "Bash(git push:*)", "Bash(git commit:*)" ] }, "hooks": { "PostToolUse": [ { "matcher": "Edit|Write", "hooks": [ { "type": "command", "command": "bash -c 'INPUT=$(cat); FILE=$(echo \"$INPUT\" | jq -r \".tool_input.file_path // empty\"); if [[ -n \"$FILE\" && \"$FILE\" == *.cs ]]; then dotnet format --include \"$FILE\" --no-restore --diagnostics IDE0005 IDE0055 IDE0161 2>/dev/null || true; fi'", "timeout": 15, "statusMessage": "Formatting..." } ] }, { "matcher": "Edit|Write", "hooks": [ { "type": "command", "command": "bash -c 'INPUT=$(cat); FILE=$(echo \"$INPUT\" | jq -r \".tool_input.file_path // empty\"); if [[ -n \"$FILE\" && \"$FILE\" == *.proto ]]; then dotnet build --no-restore 2>&1 | grep -E \"(error|warning)\" | head -10; fi'", "timeout": 30, "statusMessage": "Validating proto..." } ] } ], "Stop": [ { "matcher": "", "hooks": [ { "type": "command", "command": "bash -c 'BUILD=$(dotnet build --no-restore 2>&1); if echo \"$BUILD\" | grep -q \"Build FAILED\"; then echo \"BUILD FAILED — errors below:\" >&2; echo \"$BUILD\" | grep -E \"error CS\" >&2; exit 2; fi'", "timeout": 60, "statusMessage": "Verifying build..." } ] } ] } }