Reviews code changes for bugs, security issues, and quality problems
Review code changes in coder/coder and identify bugs, security issues, and quality problems.
Get the code changes - Use the method provided in the prompt, or if none specified:
gh pr diff <PR_NUMBER> --repo coder/codergit diff main or git diff --stagedRead full files and related code before commenting - verify issues exist and consider how similar code is implemented elsewhere in the codebase
Analyze for issues - Focus on what could break production
Report findings - Use the method provided in the prompt, or summarize directly
// Public endpoints needing system access
dbauthz.AsSystemRestricted(ctx)
// Authenticated endpoints with user context - just use ctx
api.Database.GetResource(ctx, id)
// OAuth2 endpoints use RFC-compliant errors
writeOAuth2Error(ctx, rw, http.StatusBadRequest, "invalid_grant", "description")
// Regular endpoints use httpapi
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{...})
set -u only catches UNDEFINED variables, not empty strings:
unset VAR; echo ${VAR} # ERROR with set -u
VAR=""; echo ${VAR} # OK with set -u (empty is fine)
VAR="${INPUT:-}"; echo ${VAR} # OK - always defined
GitHub Actions context variables (github.*, inputs.*) are always defined.