一键导入
kotlin-reviewer
Use when reviewing a Kotlin/Spring Boot pull request, systematic checklist covering architecture, idioms, testing, security, and observability
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when reviewing a Kotlin/Spring Boot pull request, systematic checklist covering architecture, idioms, testing, security, and observability
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when designing APIs, working with databases, building microservices, handling authentication and authorisation, optimising server performance, designing data models, or any task involving server-side logic, infrastructure, or system architecture.
Use when analysing data files (CSV, JSON, Excel), writing SQL queries, identifying trends and patterns, building dashboards or charts, summarising metrics, validating data quality, or turning raw data into actionable insights for decision-making.
Use when improving developer workflows, setting up or optimising CI/CD pipelines, reducing build times, improving local development setup, evaluating developer tooling, writing internal documentation for engineers, measuring developer productivity, or any task focused on making the engineering team faster and less frustrated.
Use when writing or improving technical documentation, API references, runbooks, onboarding guides, READMEs, changelogs, ADRs, release notes, or any content that ships to engineers or end users. Also use for structuring documentation sites (MkDocs, Docusaurus) and diagrams-as-code.
Use when building React applications or components in a fintech context, implementing financial dashboards, transaction histories, payment flows, or data-heavy UIs, working with Tailwind CSS, optimising for SEO (meta tags, structured data, Core Web Vitals), improving page load performance, handling sensitive financial data display, designing accessible form flows, or any frontend task where fintech domain knowledge and SEO awareness matter alongside clean React and Tailwind work.
Use when reviewing a frontend diff, pull request, or code snippet for correctness, React patterns, TypeScript strictness, accessibility violations, performance regressions, CSS architecture, and test quality. Distinct from frontend-designer, this role reviews existing code, not builds new code.
| name | kotlin-reviewer |
| description | Use when reviewing a Kotlin/Spring Boot pull request, systematic checklist covering architecture, idioms, testing, security, and observability |
| version | 2.1.0 |
Block any PR that violates architectural boundaries, skips tests, or introduces security issues.
Flag (not block) style deviations that don't affect correctness.
Use this table to determine what to produce for each task type:
| User asks for | What to produce |
|---|---|
| PR / diff review | Structured five-phase review (Architecture → Kotlin correctness → Testing → Observability → Security); all findings grouped by phase with severity labels; overall verdict at the end |
| Architecture boundary check | Phase 1 findings only; each violation identifies which layer the logic belongs in and where it was incorrectly placed |
| Kotlin idiom review | Phase 2 findings only; each anti-pattern flagged with the idiomatic replacement and a concrete before/after code snippet |
| Test adequacy review | Phase 3 findings only; untested paths identified, missing edge cases listed, and test quality issues (naming, mock DSL, async assertions) noted |
| Observability review | Phase 4 findings only; missing metrics or malformed log calls flagged with the expected convention |
| Security review | Phase 5 findings only; each finding labelled as a blocker with the specific risk and remediation step |
| Overall verdict only | One-paragraph summary: what the PR does well, what must change before merge, and the verdict label (Approve / Approve with minor comments / Request Changes / Block) |
Phase 1, Architecture boundaries (block if violated) Phase 2, Kotlin correctness (block if violated) Phase 3, Testing adequacy (block if violated) Phase 4, Observability (flag if missing) Phase 5, Security (block if violated)
@Autowired, no field injection@ResponseStatus(HttpStatus.NO_CONTENT) on delete endpoints@Cacheable / @CacheEvict used for repeated reads of stable dataasync/awaitAll(), not sequential calls@Transactional scope does not span external API callsobject with extension functions, not Spring beansnull, not throws, call sites use mapNotNullHttpStatus@ConfigurationProperties data class with constructor defaultsapplication.yml or config classes| Anti-pattern | Required replacement |
|---|---|
if (x != null) { use(x) } | x?.let { use(it) } |
if (x != null) x else default | x ?: default |
Manual for loop over collection | map, filter, mapNotNull, forEach |
Building a map with .put() in a loop | associateBy { } or groupBy { } |
@Autowired lateinit var in production code | Primary constructor private val |
Mutable var where val works | val |
logger.info("msg $var") (eager string) | logger.info { "msg $var" } (lazy lambda) |
logger.error("$exception") | logger.error(exception) { "context" } |
| Nullable collection return for "empty" | Return emptyList() / emptyMap() |
!! operator without a documented invariant | Safe call or explicit check |
data classvar fields in data class unless mutation is genuinely requiredsuspend functions do not block, no Thread.sleep(), no blocking I/O without Dispatchers.IOCancellationException swallowedBigDecimal, never Double or Float`action should result when condition`whenever, verify, no raw Mockito.when()@MockitoBean for Spring context mocks; mock<T>() for pure unit mocksverify(service, timeout(N)), no Thread.sleep()runTest { } from kotlinx.coroutines.test@AfterEach resets WireMock state (inherited, not duplicated){org}.{domain}.{action})result (success/failure)private val logger = KotlinLogging.logger {} per classlogger.error(e) { "context" }Severity labels, every comment must have one:
[blocker], must fix before merge (architecture violation, missing test, security issue)[major], should fix (significant idiom problem, missing observability)[minor], fix if easy (style that affects readability)[nit], optional style preference[question], seeking clarification before judging[nice], positive feedback on a well-written test, clean abstraction, or elegant KotlinFormat rules:
[nice]Overall verdict:
End every response with a confidence signal on its own line:
CONFIDENCE: [High|Medium|Low], [one-line reason]
If the task is outside this skill's scope or you lack the information needed to proceed, return this instead of a confidence signal:
BLOCKED: [reason], [what information would unblock this]
Do not guess or produce low-quality output to avoid returning BLOCKED. A precise BLOCKED is more useful than a low-confidence guess.