一键导入
code-review-and-quality
Five-axis code review before merge. Use for quality passes after implementation, before merge, and when asked to review a diff.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Five-axis code review before merge. Use for quality passes after implementation, before merge, and when asked to review a diff.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | code-review-and-quality |
| description | Five-axis code review before merge. Use for quality passes after implementation, before merge, and when asked to review a diff. |
| context | fork |
Review every non-trivial change before it lands on the main branch. Use five axes: correctness, readability, architecture, security, performance.
Approval bar: Approve when the change clearly improves or preserves overall code health and matches project conventions. Do not block because you would have written it differently. Do block on real defects, security issues, or violations of agreed patterns.
| Mode | Use when | Required context |
|---|---|---|
| Local review | Reviewing uncommitted local changes | git status, git diff, full changed files |
| PR review | Reviewing a GitHub PR number or URL | PR metadata, PR diff, full changed files at PR head |
| Self-review | Finishing an implementation slice | Touched files, completed task, checks run |
For PR review, read full changed files, not only diff hunks. Diffs show what changed; full files show whether the change fits the surrounding design.
data, result, tempsrc/ structure: components in components/, pure utils in utils/, types in types/, context in context/, form logic in form/@/* alias rather than deep relative paths (../../../)event.origin before processingdangerouslySetInnerHTML without sanitizationuseMemo)data, result, temp when the domain is known.console.log in application code.onEvent; internal handlers are handleEvent.memo + default export pattern: export default memo(ComponentName).{ComponentName}Props.classNames from classnames, not template literals.Select the smallest set that proves the change:
| Change type | Expected validation |
|---|---|
| Component / hook / util | npm run lint |
| Type changes, new interfaces | npm run lint + npm run build |
| Context or form schema changes | npm run lint + npm run build |
| Broad cross-cutting change | npm run lint + npm run build |
| UI change | lint + build + manual visual check in dev server |
Record skipped checks with a reason. A review without a verification story is incomplete.
| Label | Meaning |
|---|---|
| (none) or Required: | Must fix before merge |
| Critical: | Blocks merge — security, data loss, broken contract |
| Nit: | Optional — style, minor preference |
| Optional: / Consider: | Worth discussing, not blocking |
| FYI: | Context only |
| Verdict | Use when |
|---|---|
| Approve | No blocking issues; relevant checks are green or CI covers it |
| Approve/comment | Only optional or low-risk improvements remain |
| Request changes | Required issues, failing checks, missing tests for risky behavior |
| Block | Security issue, data loss risk, broken public contract, secrets exposure |
| Comment only | Draft PR, exploratory review, or user asked for non-blocking feedback |
## Review: [title]
### Context
- [ ] I understand intent and expected behavior
### Correctness
- [ ] Matches spec/task
- [ ] Edge and error paths covered
- [ ] Tests adequate and meaningful
### Readability
- [ ] Clear names and flow
- [ ] No unnecessary complexity
### Architecture
- [ ] Fits src/ structure (components, utils, types, context, form)
- [ ] No business logic or API calls inside components
- [ ] postMessage handlers verify origin
- [ ] Extensionless TypeScript source imports
- [ ] @/* alias used instead of deep relative paths
### Security
- [ ] postMessage origin validated
- [ ] User input validated with zod at boundaries
- [ ] No secrets; XSS-safe rendering
### Performance
- [ ] No avoidable re-renders; memoization where appropriate
- [ ] No sync heavy work in render
### Component conventions
- [ ] memo + default export pattern used
- [ ] Props interface named {ComponentName}Props
- [ ] classNames used for conditional classes
- [ ] UI kit components preferred over raw HTML
### RTL parity
- [ ] Logical Tailwind classes used (ms-/me-, ps-/pe-, start-/end-)
- [ ] Directional icons mirrored with rtl:scale-x-[-1]
### Verification
- [ ] npm run lint passes
- [ ] npm run build passes (when types/interfaces changed)
- [ ] Manual/visual check noted if UI
### Verdict
- [ ] Approve | [ ] Request changes (list blocking items)
| Excuse | Response |
|---|---|
| "It works, ship it" | Readability, security, and architecture debt still compound. |
| "Tests pass, so it's good" | Tests don't replace architecture or security review. |
| "We'll clean up later" | Cleanup before merge unless true emergency + tracked follow-up. |
Design-to-code workflow for Figma designs. Use when the user shares a Figma URL or asks to implement a design into the codebase.
Researches feature directions before implementation. Use when the user asks to investigate approaches, compare options, assess risks/trade-offs, and recommend an implementation path.