跳到正文
Skillpedia
通用编程33k · #8445

code-review

它能做什么

这个技能审阅代码的结构和设计质量。适合希望对自己的改动有一次经验丰富的第二次审视的开发者。

适用场景

  • ✓当你想审阅某个文件或改动的设计和结构问题的时候。
  • ✓当代码难以测试,而你想知道原因的时候。
  • ✓当你想在合并前根据编码标准检查改动的时候。

技能链接

https://github.com/Donchitos/Claude-Code-Game-Studios/blob/main/.claude/skills/code-review/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/Donchitos/Claude-Code-Game-Studios/blob/main/.claude/skills/code-review/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请审阅这个战斗系统文件,看看是否存在架构问题和可测试性问题。”

每周 5 个新技能,1 分钟读完。

工作原理

它会读取目标代码,并依据编码标准和设计原则(例如 SOLID、可测试性和性能)进行检查。它会报告发现的问题,并指出受影响的代码部分。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

!bash "${CLAUDE_SKILL_DIR}/../../hooks/yaml-helper.sh" resolve_config --keys automation

Code Review

Every AskUserQuestion call follows .claude/docs/automation-modes.md (collaborative asks always · guided major-only · autonomous logs and proceeds; automation_always_ask categories always prompt).

Insufficient input — check this before producing any report

If the inputs this skill needs do not exist, the answer is "could not run" — not a filled-in report. Check first, and stop if the check fails.

  1. List the inputs this skill reads (data files, prior reports, profiler output, test results, registries, source code).
  2. For each, record FOUND or ABSENT — not "assumed present".
  3. If any input required for a section is ABSENT, that section is NOT ASSESSED — NO DATA. Do not estimate it, do not infer it from an adjacent artifact, and do not leave a mandated cell to be filled by whoever reads the template next.
  4. If every required input is ABSENT, stop and report NOT ASSESSED — NO DATA as the whole verdict, naming what was missing and which skill produces it.

A verdict of NOT ASSESSED is a success. It is the correct, useful answer to "what does the data say?" when there is no data. The failure mode this prevents is specific: a report whose verdict enum has no "could not run" state produces false clean passes — an asset audit returning COMPLIANT on a project with no assets and no standards, or a performance profile reporting ">99% headroom against a 16.67ms budget" with zero profiler data and no budget ever set.

Absence of evidence is never evidence of absence. A scan that finds no matches because there are no files to scan has not verified anything. Say which of the two happened — a reader cannot tell from a green result.


Phase 1: Load Target Files

Read the target file(s) in full. Read CLAUDE.md for project coding standards.


Phase 2: Identify Engine Specialists

Read the specialists block from project.yaml; if it is absent, fall back to the ## Engine Specialists section of .claude/docs/technical-preferences.md. Note:

  • The Primary specialist — <engine>-specialist derived from engine.name (Godot→godot-specialist, Unity→unity-specialist, Unreal→unreal-specialist); used for architecture and broad engine concerns
  • The Language/Code Specialist — specialists.code — used when reviewing the project's primary language files
  • The Shader Specialist — specialists.shader — used when reviewing shader files
  • The UI Specialist — specialists.ui — used when reviewing UI code

A value of null means UNSET — treat that key as absent and skip its specialist. Never spawn it as an agent name. The v1.0 migration writes null for any specialist the legacy file did not name, and it writes the whole block whenever one member is set — so a project that configured only its code specialist carries shader: null and ui: null. The config reader returns the four-character string "null" for these, which is not empty and therefore reads as configured. null, empty, and missing are the same state here.

If no engine is configured (no engine.name in project.yaml, and technical-preferences.md reads [TO BE CONFIGURED] or is missing), skip engine specialist steps. Record Engine validation: NOT ASSESSED — no engine configured (`engine.name` unset in `project.yaml`) in this run's output. A skipped check that says nothing is indistinguishable from a check that passed; the reader cannot tell engine guidance was never sought.


Phase 3: ADR Compliance Check

Argument: /code-review [file(s)] may optionally include a story file path as the last argument (e.g., /code-review Assets/Scripts/Combat/Attack.cs production/epics/combat/story-001.md). If a story path is provided, read it to extract the governing ADR reference.

Search for ADR references in, in priority order:

  1. The story file (if provided as argument)
  2. Header comments at the top of the implementation files
  3. Commit messages referencing these files (git log --oneline -- [file])

Look for patterns like ADR-NNNN or docs/architecture/adr- (either case).

If no ADR references found, note: "No ADR references found — ADR compliance check skipped. For full ADR compliance review, provide the story path: /code-review [files] [story-path]."

For each referenced ADR, load **only the sections this check needs — never an unbounded f

常见问题

它的主要关注点是什么?

架构和设计质量,例如标准、SOLID 原则和可测试性。

它是安全审查吗?

不是。它关注的是架构、标准和可维护性。

它可以修复代码吗?

它只报告发现的问题,任何修复都是你选择的单独步骤。

详情

作者的原始描述

Architectural code review — coding standards, SOLID, testability, performance concerns.

repo: Donchitos/Claude-Code-Game-Studios

热度

GitHub 星标
33k
排名
#8445
许可证
MIT
更新时间
2026/10/18

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能