协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
audit-code-review【开发与工程】Review a PR or diff for correctness, security, and maintainability. Use for a pull request, a named change set, or "review my changes". Repo-wide anti-patterns → audit-code-quality. Bulk transforms → audit-codemod-safety.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Degree of freedom: MIXED — Phases 1–2 judgment [HIGH freedom];
mandatory pre-review git/docs [LOW freedom — run exactly].
Review this PR or named diff. Repo-wide anti-patterns → audit-code-quality.
Bulk transform semantics → audit-codemod-safety.
Observe: new
GET /api/invoices/:idreturnsInvoice.findById(id)with nouserIdpredicate (app/api/invoices/[id]/route.tsin this diff). Interpret: any authenticated caller reads another user's invoice. Classify: blocking (IDOR). Severity: Critical — must fix before merge. Finding:[id]/route.ts| add ownership check | blocking
Before reviewing code:
README.md (project conventions)
src/[domain]/@_[domain]-README.md (domain-specific patterns)
CONTRIBUTING.md (code standards)
If reviewing a PR or commit:
git log --oneline -10 # recent context
git diff <base>..HEAD --stat # files changed
git diff <base>..HEAD # full diff
If reviewing a specific file, read the FULL file for context — not just the changed lines.
Use Grep and SemanticSearch to verify:
If the change touches error-prone code, check if related Sentry issues exist:
sentry:search_issues
{
"organizationSlug": "<ORG_SLUG>",
"query": "issues related to <component or function being changed>",
"projectSlugOrId": "<PROJECT_SLUG>",
"regionUrl": "<REGION_URL>",
"limit": 10
}
This reveals: does the code being changed have known production issues? Does this change fix or risk introducing them?
If the code uses a pattern you want to verify:
firecrawl:firecrawl_search
{
"query": "<framework> <pattern> best practice <current year>",
"limit": 5,
"sources": [{ "type": "web" }]
}
Before line-by-line review:
any, no overly broad unions)src/components/)Use severity levels:
### Critical (must fix before merge)
**[File:Line]** — [Description]
Why: [Impact if not fixed]
Fix: [Specific suggestion]
### Suggestion (recommended improvement)
**[File:Line]** — [Description]
Why: [Benefit of the change]
Alternative: [How to improve]
### Nitpick (optional, non-blocking)
**[File:Line]** — [Description]
### Praise (good patterns to reinforce)
**[File:Line]** — [What's done well and why]
any, unchecked casts)// BLOCK: any types
const data: any = response;
// BLOCK: unhandled promises
fetchData(); // missing await or .catch()
// BLOCK: implicit type coercion in conditions
if (value) // when value could be 0 or ""
// SUGGEST: magic strings
if (status === 'active') // use a constant or union type
// BLOCK: missing key in lists
{items.map(item => <Item {...item} />)}
// BLOCK: stale closure in useEffect
useEffect(() => {
setInterval(() => console.log(count), 1000); // captures stale count
}, []);
// SUGGEST: inline object creation in props
<Component style={{ margin: 10 }} /> // new object each render
-- BLOCK: SQL injection vector
WHERE name = '${userInput}'
-- SUGGEST: missing index
SELECT * FROM orders WHERE user_id = ? -- is user_id indexed?
-- SUGGEST: SELECT *
SELECT * FROM users -- select only needed columns
File:Line from the diff, not "this could be better"audit-code-quality; bulk transform → audit-codemod-safety## Code Review: [PR Title / File]
### Summary
[1-2 sentence overall assessment — is this ready to merge?]
### Critical (blocking)
[List any must-fix findings]
### Suggestions (recommended)
[List recommended improvements]
### Praise
[Highlight good practices — reinforces positive patterns]
### Questions
[Clarifying questions about intent or design decisions]
### Research Notes
[If patterns were verified via Firecrawl/Context7, note what was confirmed]
Blocking findings are correctness bugs, security holes, data-loss paths, and gaps between what the change claims and what it does; suggestions and nits follow the Feedback Format above. Each finding names the line, the consequence, and a fix. Style that the linter or the codebase's own conventions already cover is not a finding at any tier. Read the surrounding code before judging a hunk, and where intent is unclear, ask in the Questions section rather than assume.