In @.agent/tools/api/better-auth.md:
- Around line 40-53: Replace the non-null assertions for environment variables
in the betterAuth config by first reading and validating them (e.g., const
GOOGLE_CLIENT_ID = process.env.GOOGLE_CLIENT_ID) and throwing or returning a
clear error if missing; update the socialProviders.google block in the auth
configuration to use those validated constants instead of
process.env.GOOGLE_CLIENT_ID! and process.env.GOOGLE_CLIENT_SECRET! so runtime
failures are prevented and errors show which variable is absent.
In @.agent/tools/api/drizzle.md:
- Around line 222-249: The seed.ts script's seed() currently calls
db.delete(posts) and db.delete(users) unconditionally which will wipe production
data; modify seed() (and its invocation) to require an explicit,
environment-gated opt-in before performing destructive deletes: check NODE_ENV
(or a new env var like ALLOW_DB_WIPE) and refuse to run deletes when NODE_ENV
=== "production" unless ALLOW_DB_WIPE === "true" (or a CLI flag) is set; add a
clear, logged confirmation prompt or fail-fast error if the safety gate isn't
satisfied, and ensure the script exits without deleting when the guard blocks
the operation.
In @.agent/tools/api/hono.md:
- Around line 127-133: The middleware registered via app.use("/api/admin/*",
...) only checks for existence of the Authorization header
(c.req.header("Authorization")) but never validates the token; update this
middleware to parse the header (e.g., check "Bearer " scheme), validate/verify
the token using your auth utility or JWT verifier, return 401 on missing or
invalid token, and attach the decoded user/claims to the context (e.g.,
c.req.user or c.set("user", ...)) before calling await next() so downstream
handlers can trust the authenticated identity.
- Around line 209-221: The upload handler at app.post("/api/upload") currently
trusts the parsed File and reads its arrayBuffer without checks; add security
guards by enforcing a MAX_FILE_SIZE constant and rejecting requests when
file.size exceeds it before calling file.arrayBuffer(), validate file.type
against an explicit whitelist of allowed MIME types and return a 400 when
mismatched, and sanitize file.name (remove/normalize path segments and
disallowed chars or generate a safe server-side filename) before using it;
ensure you perform these checks on the parsed "file" variable in the same
handler and return clear JSON error responses for size/type/name failures.
In @.agent/tools/api/vercel-ai-sdk.md:
- Around line 124-217: The assistant HTML is rendered with
dangerouslySetInnerHTML using marked.parse in AIChatSidebar (inside the
displayMessages.map), which allows XSS; fix by sanitizing the parsed HTML before
insertion (e.g., import DOMPurify and replace __html: marked.parse(part.text)
with __html: DOMPurify.sanitize(marked.parse(part.text))). Add DOMPurify (and
types) to deps and ensure only assistant message parts use the sanitized HTML
path in the mapping where dangerouslySetInnerHTML is used.
In @.agent/tools/ui/i18next.md:
- Line 8: Frontmatter currently sets the boolean key "bash: false" while the
document contains a shell validation script; update the frontmatter to "bash:
true" so the subagent can run the validation script programmatically (or
explicitly state in the frontmatter that the included script is for manual
execution) — locate and edit the "bash" frontmatter key in this file to enable
bash execution for the validation script.
Unactioned Review Feedback
Source PR: #152
File:
generalReviewers: coderabbit
Findings: 1
Max severity: critical
CRITICAL: coderabbit (coderabbitai[bot])
Actionable comments posted: 6
🤖 Fix all issues with AI agents
🧹 Nitpick comments (6)
View comment
Auto-generated by
quality-feedback-helper.sh scan-merged. Review each finding and either fix the code or dismiss with a reason.