跳到正文
cccskills
免费在 GitHub 公开

code-review

Provides a structured framework for conducting thorough code reviews covering correctness, security, architecture alignment, performance, and technical debt.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md6.2 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Code Review

Review Axes

Every finding must reference exactly one axis. This prevents vague feedback and makes it actionable.

AxisWhat to check
CorrectnessDoes the logic handle all cases in the acceptance criteria?
SecurityInjection vectors, secret exposure, auth bypasses, insecure defaults
ArchitectureDoes the code follow existing patterns and module boundaries?
PerformanceN+1 queries, unnecessary allocations, blocking I/O in hot paths
Error handlingAre failure cases handled explicitly and safely?
Test coverageDo tests verify the acceptance criteria, not just happy paths?
ScopeAre there changes outside the stated task boundary?
Technical debtDoes the implementation introduce debt without acknowledging it?

Finding Categories

CRITICAL — must be resolved before merge

  • Logic failures that violate acceptance criteria
  • Security vulnerabilities (injection, auth bypass, secret exposure)
  • Data loss or corruption risk
  • Breaking changes to public API or shared contracts
  • Missing error handling that causes silent failures

WARNING — should be resolved before merge

  • Missing edge case coverage in tests
  • Scope creep (changes outside the task boundary)
  • Pattern inconsistency that will confuse future maintainers
  • Performance issue that will degrade under load
  • Missing input validation at system boundaries

SUGGESTION — optional improvement

  • Naming clarity improvements
  • Extracting a reusable abstraction
  • Test readability
  • Documentation gaps on non-obvious behavior

Review Report Format

## Review Report

**Task**: [objective from task card]
**Verdict**: [approved | approved with warnings | blocked]

---

### CRITICAL

- [ ] [C1] `path/to/file:line` — [description]
  Axis: [axis] | Evidence: `[quoted code]` | Required action: [what must change]

_(none)_ if no critical findings

### WARNING

- [ ] [W1] `path/to/file:line` — [description]
  Axis: [axis] | Recommended action: [what should change]

_(none)_ if no warning findings

### SUGGESTION

- [ ] [S1] — [description] | Rationale: [brief reason]

_(none)_ if no suggestions

### Summary

- Critical: [count] | Warning: [count] | Suggestion: [count]
- **Verdict justification**: [one sentence]

Verdict rules:

  • blocked — any CRITICAL finding present
  • approved with warnings — no CRITICAL, at least one WARNING
  • approved — no CRITICAL, no WARNING

What to Check — by Axis

Correctness

  • Does every acceptance criterion have a corresponding code path?
  • Are null/empty/zero values handled explicitly?
  • Are boundary conditions checked (off-by-one, empty collections, max values)?
  • Do conditional branches cover all cases (exhaustive when/switch)?

Security

Injection: SQL, command, LDAP, XML — is input sanitized or parameterized?
Auth: is the endpoint protected? are role checks correct?
Secrets: no hardcoded credentials, tokens, or keys in source
Headers: are security headers set (CSP, HSTS, X-Frame-Options)?
CORS: is the origin whitelist explicit, not wildcard?
Dependencies: are new dependencies from trusted sources?

Performance

N+1 queries: does a loop call the database per iteration?
Eager loading: are JOINs or includes used where needed?
Pagination: are all list endpoints paginated?
Caching: is expensive computation cached at an appropriate layer?
Index: do new query filters have corresponding DB indexes?

Error Handling

Are exceptions caught at the right layer (not swallowed silently)?
Is the error response format consistent with the rest of the API?
Is the original exception logged before translating to a user-facing error?
Are transient failures retried with backoff, or propagated immediately?

What NOT to Flag

Personal style preferences. If the code follows the project's established conventions, do not flag it because you would have written it differently.

Trivial naming. Variable names are a SUGGESTION at most, never a WARNING. Do not block a PR over naming unless the name is genuinely misleading.

Tests for trivial code. Do not demand tests for getters, setters, or data class construction. Test behavior, not boilerplate.

Refactors not in scope. If you notice an improvement opportunity outside the task boundary, log it as a SUGGESTION. Do not block the PR for work that was not requested.

Framework defaults. Do not second-guess framework conventions (Spring dependency injection, Next.js file-based routing). Trust the framework.

Exact Diff Recommendations

When a finding requires a code change, provide the exact replacement:

# Current code (path/to/file:42)
val user = userRepository.findById(id)
return user.name   // NPE if not found

# Recommended fix
val user = userRepository.findById(id)
  ?: throw NotFoundException("User $id not found")
return user.name

Vague instructions ("handle the null case") force the author to guess your intent. Exact diffs remove ambiguity and speed up the review cycle.

Prioritization Order

When multiple findings exist, address them in this order:

  1. Security — security issues can silently compromise users or data
  2. Correctness — broken behavior defeats the purpose of the change
  3. Error handling — silent failures are hard to debug in production
  4. Test coverage — gaps mean regressions will be invisible
  5. Performance — degrade gradually; fix before it causes incidents
  6. Architecture — inconsistency compounds over time
  7. Technical debt — acknowledge and track; do not always block for it
  8. Suggestions — apply at author's discretion

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Use when adding monitoring, metrics, logging, or tracing to Spring AI or LLM integration code. Covers token tracking, latency measurement, cost estimation, and prompt/response logging. Use when user mentions AI monitoring, token costs, or LLM observability.

中文简介正在准备中。当前显示原文说明。

lgzarturo/springboot-course32026年10月17日 更新

android

免费

Provides expert knowledge for building modern native Android apps using Kotlin, Jetpack Compose, Material Design 3, MVI architecture, Hilt dependency injection, and Media3/ExoPlayer.

中文简介正在准备中。当前显示原文说明。

lgzarturo/springboot-course32026年10月17日 更新

Design, implement, review, and audit Android Jetpack Compose UI/UX for phone interfaces. Use when a request concerns concrete Compose layout, components, interaction, accessibility, or visual behavior. Do not activate for framework or dependency presence alone; non-UI Android work is excluded.

中文简介正在准备中。当前显示原文说明。

lgzarturo/springboot-course32026年10月17日 更新

Provides expert knowledge for designing, implementing, and managing REST API versioning strategies with deprecation workflows.

中文简介正在准备中。当前显示原文说明。

lgzarturo/springboot-course32026年10月17日 更新

astro

免费

Provides expert knowledge for building Astro 5+ sites with Islands Architecture, Content Collections, TypeScript, and performance-first rendering strategies.

中文简介正在准备中。当前显示原文说明。

lgzarturo/springboot-course32026年10月17日 更新

Audits token storage mechanisms to prevent XSS-based JWT theft.

中文简介正在准备中。当前显示原文说明。

lgzarturo/springboot-course32026年10月17日 更新

查看 lgzarturo 的全部技能

报告此技能的问题