用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/docevilOck/agent-skills-hook --skill ddev-code-review命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | ddev-code-review |
| description | 在 ddev-gate 工作流中执行代码质量审查。使用 codegraph 做结构影响分析,覆盖安全、性能、可维护性,按严重程度分级输出。 |
ddev-gate 工作流的代码质量审查阶段。使用 codegraph 做结构影响分析,覆盖安全、代码质量、性能、最佳实践和可维护性,按严重程度分级输出报告。
由 ddev-gate skill 在清理阶段之后、编码规范审查之前调度。也可独立触发于以下场景:
C 项目注意:
ddev-gate工作流中 C 项目不再单独调用本 skill。代码质量审查职责已由ddev-c-pro吸收(统一完成规范审查 + 代码质量审查)。非 C 项目仍走ddev-code-review+ 语言规范审查的分离流程。独立触发(用户直接要求 review)时 C 项目可正常使用。
Always load tool-routing alongside this skill to ensure correct codegraph/grep dispatch during structural analysis.
Delegates to the code-reviewer agent for deep analysis. The agent follows a 4-phase pipeline:
git diff (or git diff --staged) to find changed files and symbolsgit log to understand recent commit contextBefore reading any source file, understand the architecture:
| Step | Tool | Purpose |
|---|---|---|
| 2a | codegraph_codegraph_context | For each changed symbol, get architectural context: entry points, related symbols, key code |
| 2b | codegraph_codegraph_impact | Assess change radius — what downstream code could be affected |
| 2c | codegraph_codegraph_callers | Trace who calls changed symbols — identify all integration points |
| 2d | codegraph_codegraph_search | Find related symbols by name — catch hidden coupling |
| 2e | codegraph_codegraph_trace | For data flow changes, trace from entry point to sink |
Rule: Never start code-level review without first completing Phase 2. The structural analysis drives scope and reveals hidden risks that grep alone misses.
Structured output with severity ratings, file:line evidence, concrete fixes, and approval recommendation.
| Severity | Meaning | Action |
|---|---|---|
| CRITICAL | Security vulnerability, data loss, crash | Must fix before merge |
| HIGH | Bug, major code smell, perf regression | Should fix before merge |
| MEDIUM | Minor issue, technical debt | Fix when possible |
| LOW | Style, nitpick, suggestion | Consider fixing |
Dispatch to the code-reviewer agent with a prompt covering all 4 phases:
CODE REVIEW TASK
Scope: [files changed from git diff, or specific files/dirs]
PHASE 1 — Identify: Run git diff, list changed files and symbols.
PHASE 2 — Structural Analysis (MANDATORY): For each changed symbol, use:
- codegraph_codegraph_context to understand architecture
- codegraph_codegraph_impact to assess change radius
- codegraph_codegraph_callers to find integration points
- codegraph_codegraph_trace for data flow paths
PHASE 3 — Deep Review: Check security, quality, performance, best practices, maintainability.
PHASE 4 — Report: Structured output (see Output Format below).
Every review MUST end with this exact structure:
CODE REVIEW REPORT
==================
Files Reviewed: <N>
Total Issues: <N>
CRITICAL (<N>)
--------------
<#> file:line
Issue: <description>
Risk: <impact>
Fix: <concrete solution>
HIGH (<N>)
----------
...
MEDIUM (<N>)
------------
...
LOW (<N>)
---------
...
RECOMMENDATION: APPROVE | REQUEST CHANGES | COMMENT
#define/enum/static const),并在注释中说明取值依据。超时毫秒数、缓冲区大小、重试次数、状态值、寄存器地址等一律不得裸写数字;缓冲区/容量等大数字(≥1024)必须写成 128 * 1024 / 16 * 1024 * 1024 这种可读乘法表达式 + 命名常量,禁止直接裸写 16384/4194304 等大数APPROVE — No CRITICAL or HIGH issues, minor improvements only REQUEST CHANGES — CRITICAL or HIGH issues present COMMENT — Only LOW/MEDIUM issues, no blocking concerns