awesome-review
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "awesome-review":https://skillpi.com/zh/skills/deepskill-b0897a3679d2f01bfe8067de6ac4a597f9141c030f823b6e31ea25f4bc62c0e5。安装前核对上游来源和版本:https://skillhub.cn/skills/user_73e65841/awesome-review。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
skillhub.cn
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
用于项目审查、评审、代码审查、审查流程、检查改动、回归分析、影响分析和变更评审;将分支变更与主干(master/main)进行对比,并输出结构化的风险点、回归范围和测试清单。
介绍来源: third_party · user_73e65841 · 1.0.0 参考来源
SkillPi 解读
- 能完成的任务
- Use for 项目审查, review, code review, review 流程, 检查改动, 回归分析, 影响分析 and change review; reviews branch changes against master/main and outputs structured风险点, 回归范围 and 测试清单.
- 输入和输出
- ALL review outputs MUST be saved under the project root's `AIReview/` directory**, NOT `.claude/review/`. The output directory naming convention: Where: `{YYYYMMDD}` = current date (e.g., `20260604`) `{branch-slug}` = current branch name with `/` replaced by `-` (e.g., `feat_example_0520`) Example:** `AIReview/20260604-feat_example_0520-review报告/`
- 软件、账号及付费要求
- 翻译待完成,请参阅来源文档。
- 实测状态
- 未测试
文件浏览
Frontmatter
name: awesome-review
description: "Use for 项目审查, review, code review, review 流程, 检查改动, 回归分析, 影响分析 and change review; reviews branch changes against master/main and outputs structured风险点, 回归范围 and 测试清单."
version: 2.6.0
argument-hint: "[--tier=lite|standard|deep] [branch-name] [prd-file-path]"
allowed-tools: [Read, Write, Edit, Bash, Glob, Grep, Agent, AskUserQuestion]Project Review Skill
Execute a structured review flow for the current branch's changes against master/main.
Tier System (NEW in v2.6)
This skill runs in one of three tiers. Default is standard.
| Tier | 定位 | 一句话 | 产物 |
|---|---|---|---|
| lite | 快查风险 | 「diff 看完,告诉我哪有坑、要测啥」 | 1 个 review.md(3 节) |
| standard | 加调用链感知 | lite + 「这次改动会牵连到哪些其他地方」 | 1 个 review.md(4 节) |
| deep | 全维度审查 + 知识沉淀 | 「为这次改动建立长期架构记忆」 | 多文件 + ADR + 组件画像 + project-overview + 全套图 |
核心原则:
- lite vs standard 的差异 = standard 多一节"影响分析(调用链 + 重组件点名)"。
- standard vs deep 的差异 = deep 是唯一会写
AIReview/components/、project-overview.md、ADR 的档位。standard 做完即走,不留长期资产。 - 兼容性 / 性能 / 代码味道扫描 / 图谱输出 → 全部归 deep 独占。standard 不做这些,避免做不深变成噪音。
详细每档的 phase 行为见下方 "Tier Behavior Matrix"。
Phase order:
- Phase 0 — Setup output directory + parse tier
- Phase 0.3 — Project Conventions Scan (runs every tier)
- Phase 0.5 — PRD-Driven Architecture Alignment (deep only, only if PRD provided)
- Phase 1 → 3 — Knowledge graph, requirement Q&A, impact analysis (depth varies by tier)
- Phase 3.5 — Code Smell Scan (deep only)
- Phase 4 — Compatibility (deep only)
- Phase 5 — Performance (deep only)
- Phase 6 → 7 — Regression / final docs (lite & standard write a single
review.md; deep writes the full set)
Why Phase 0.3 exists: earlier versions of this skill applied a generic review rubric without first reading the project's own conventions (README, lint config, etc.), which caused false positives (e.g. flagging console.log in a project whose .eslintrc explicitly allows it) and missed project-specific risks (e.g. not knowing the project specifically calls out memory leak hot-spots). Phase 0.3 fixes that by extracting the project's own constraints and using them as the first-priority rubric in later phases.
Current branch: !git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "unknown"
Default branch: !git remote show origin 2>/dev/null | grep 'HEAD branch' | awk '{print $NF}' || echo "master"
Changed files: !git diff --name-only $(git merge-base HEAD origin/master 2>/dev/null || git merge-base HEAD origin/main 2>/dev/null) HEAD 2>/dev/null | head -30
⚠️ CRITICAL: Output Directory Convention
ALL review outputs MUST be saved under the project root's AIReview/ directory, NOT .claude/review/.
The output directory naming convention:
AIReview/{YYYYMMDD}-{branch-slug}-review报告/
Where:
{YYYYMMDD}= current date (e.g.,20260604){branch-slug}= current branch name with/replaced by-(e.g.,feat_example_0520)
Example: AIReview/20260604-feat_example_0520-review报告/
Directory Structure
AIReview/
├── project-overview.md # ⭐ Shared across ALL reviews — read & update each time
├── components/ # Shared across all reviews — key component profiles
│ └── {ComponentName}/
│ └── {ComponentName}.md # e.g. floatIcon/floatIcon.md
├── {YYYYMMDD}-{branch-slug}-review报告/ # Per-review outputs
│ ├── impact-report.md
│ ├── regression-scope.md
│ ├── test-checklist.md
│ └── images/
│ ├── overall-changes.png # 变更文件依赖总览图
│ ├── {ComponentName}-refactor.png # 每个重组件的新旧重构对比图
│ └── {SharedModule}-impact.png # 每个共享模块的影响范围图
└── {YYYYMMDD}-{other-branch}-review报告/
└── ...
Key rules:
AIReview/project-overview.mdis a shared, persistent file at the top level — read before each review, update after each review with newly discovered features/modules. Do NOT recreate it per review.AIReview/components/is a shared, persistent folder — one subfolder per key component. It is NOT duplicated per review. The datedreview报告/folders contain per-branch artifacts only.
How to compute the output directory
At the beginning of the review, compute and store the output path:
BRANCH=$(git rev-parse --abbrev-ref HEAD | sed 's|/|-|g')
DATE=$(date +%Y%m%d)
OUTPUT_DIR="AIReview/${DATE}-${BRANCH}-review报告"
mkdir -p "${OUTPUT_DIR}/images"
mkdir -p "AIReview/components"
Then use $OUTPUT_DIR as the base for all file writes.
IMPORTANT: All subsequent references to .claude/review/ in this skill are replaced with {OUTPUT_DIR} (i.e., AIReview/{date}-{branch}-review报告/). Do NOT write to .claude/review/.
⚠️ CRITICAL: Diff Baseline Definition
The ONLY diff that matters is: master vs current branch HEAD.
git diff origin/master...HEAD
This is the SOLE source of truth for "what this branch changes." Specifically:
- "新增" means: exists on this branch but NOT on master. It does NOT matter if the code was added in commit 1 or commit 5 of this branch.
- "修改" means: the code exists on master AND on this branch, but differs between them.
- "未改动" means: identical on master and this branch.
DO NOT compare commits within the branch against each other. The branch's internal commit history is irrelevant. git log on the branch is only useful for understanding developer intent, NOT for determining what changed.
Example of WRONG analysis: "setBlackURL was not modified in this branch" — when in fact setBlackURL calls are NEW relative to master.
Example of CORRECT analysis: "This branch introduces new calls to setBlackURL (not present on master) in upLoad.vue mounted and handleVisibilityChange."
When analyzing any function/method/component, ALWAYS compare its state on master vs its state on HEAD. If it doesn't exist on master, it's NEW. If it exists on both but differs, it's MODIFIED. If it's identical on both, it's UNCHANGED.
Phase 0: Setup Output Directory & Resolve Tier
Before any analysis, do two things in order:
0.1 Parse and resolve $TIER
Resolve the tier from the user's invocation:
- If user passed
--tier=lite|standard|deep→ use that. - If user typed a typo (e.g.
--tier=heavy,--tier=full) → stop and report:❌ Unknown tier "heavy". Available: lite | standard | deep. - If no
--tierflag → default tostandard.
Store as $TIER. Print the tier banner to the conversation:
📊 Tier: standard (default)
- lite diff-driven 风险点 + 测试要点(1 个 review.md,3 节)
- standard lite + 影响分析(调用链 + 重组件点名)(1 个 review.md,4 节)
- deep 全维度审查 + ADR/画像/project-overview 知识沉淀(多文件 + 全套图)
切换:/project-review --tier=lite 或 --tier=deep
(Adjust the highlighted line to match the actually-resolved tier.)
0.2 Auto-suggest a tier (soft hint, never blocks)
After $TIER is set, run a quick heuristic on the diff:
DIFF_LINES=$(git diff origin/master...HEAD | wc -l)
SHARED_FILES=$(git diff --name-only origin/master...HEAD | grep -E '^(src/)?(store|utils|api|bridge|services)/' | wc -l)
TOTAL_FILES=$(git diff --name-only origin/master...HEAD | wc -l)
- Suggest lite when
$TIER == standardandDIFF_LINES < 50andTOTAL_FILES <= 2andSHARED_FILES == 0. - Suggest deep when
$TIER != deepand ANY of:DIFF_LINES > 500,SHARED_FILES >= 3, PRD file was provided, or a brand-new file with caller-count ≥5 was introduced.
If a suggestion fires, ask via AskUserQuestion:
- Header:
Tier 建议 - Question:
检测到 [reason],建议切换为 [suggested_tier]。是否切换?(当前: $TIER) - Options:
切换为 [suggested_tier]/保持当前档位 ($TIER)
If the user accepts, update $TIER. Otherwise continue with current tier.
0.3 Edge-case validation (tier × inputs)
| Situation | Action |
|---|---|
--tier=lite + PRD provided |
Warn: ⚠️ lite 不做 PRD 对齐。是否升级到 deep? (options: 升 deep / 忽略 PRD 继续 lite / 取消) |
--tier=standard + PRD provided |
Warn: ⚠️ standard 不读写 ADR、不做 PRD 对齐。PRD 对齐请用 --tier=deep。 (options: 升 deep / 忽略 PRD 继续 standard / 取消) |
--tier=deep + no PRD |
Skip Phase 0.5 silently; rest of deep behavior unchanged. |
--tier=deep + ADR exists + no PRD |
Skip 0.5; Phase 3.2b still reads ADR for conflict checks. |
0.4 Create the output directory
The shape of {OUTPUT_DIR} depends on tier:
BRANCH=$(git rev-parse --abbrev-ref HEAD | sed 's|/|-|g')
DATE=$(date +%Y%m%d)
OUTPUT_DIR="AIReview/${DATE}-${BRANCH}-review报告"
mkdir -p "${OUTPUT_DIR}"
# Tier-specific extras:
if [ "$TIER" = "standard" ] || [ "$TIER" = "deep" ]; then
mkdir -p "${OUTPUT_DIR}/images" # standard: only overall-changes.png lives here (skipped in v2.6 — see note)
fi
if [ "$TIER" = "deep" ]; then
mkdir -p "AIReview/components"
fi
echo "TIER=${TIER}"
echo "OUTPUT_DIR=${OUTPUT_DIR}"
NOTE on
images/for standard: in v2.6 standard does NOT generate any image (the overall-changes graph moved to deep-only). Theimages/dir is created lazily only if standard ever decides to add a graph in the future; for now, standard runs without it. Deep keeps the full image set.
Use this OUTPUT_DIR for ALL file writes throughout the review.
Output Templates for review.md (lite & standard)
For lite and standard tiers, the entire review fits in a single file: {OUTPUT_DIR}/review.md. Each phase appends its content to the appropriate section of this file rather than writing standalone files. Use the templates below verbatim as the starting structure.
lite — review.md template (3 sections)
# {分支名} 快速 Review (lite)
基线: origin/master | 日期: {YYYY-MM-DD} | 档位: lite
## 1. 改动概览
(2-3 句说清这次 PR 在干嘛 + 改动文件清单 + 行数)
## 2. 风险点
> 仅列 caller≥10 的高风险变更和明确的代码质量问题。每条带 依据 列。
| 问题 | 文件:行 | 等级 | 依据 | 修复建议 |
|------|---------|------|------|---------|
| ... | ... | P0/P1/P2 | README.md#xxx / .eslintrc:Lxx / skill 默认 | ... |
## 3. 测试要点
> 必测项编号列表,合并回归范围。无 P2/可忽略项。
1. [模块] 测什么 — 平台(如适用)
2. ...
standard — review.md template (4 sections)
# {分支名} Review 报告 (standard)
基线: origin/master | 日期: {YYYY-MM-DD} | 档位: standard
## 1. 改动概览
(2-3 句说清这次 PR 在干嘛 + 改动文件清单 + 行数 + 主要模块分组)
## 2. 风险点
| 问题 | 文件:行 | 等级 | 依据 | 修复建议 |
|------|---------|------|------|---------|
## 3. 影响分析 ← standard 比 lite 多的核心章节
### 3.1 高风险变更(caller ≥ 5)
| 文件 | 函数/组件 | 调用方数 | 风险等级 | 原因 |
|------|----------|---------|---------|------|
### 3.2 重组件点名
> Phase 1.3 候选清单中、本次 diff 触及的重组件。仅点名,不写画像文件。
- `{ComponentName}` (`{path}`, caller={N}) — 一句话说本次怎么动的、要重点回归什么。
- ...
## 4. 测试要点
| 模块 | 测试项 | 优先级 | 平台 |
|------|--------|-------|------|
注意: lite/standard 都不生成 impact-report.md、regression-scope.md、test-checklist.md、images/*.png、AIReview/components/*、AIReview/project-overview.md。所有内容收敛进 review.md。
deep — multi-file output
deep 仍然按 v2.5 的多文件结构产出(impact-report.md / regression-scope.md / test-checklist.md / images/ / AIReview/components/{name}/{name}.md / AIReview/project-overview.md / AIReview/ADR-*.md)。详见 Phase 7。
Phase 0.3: Project Conventions Scan (MANDATORY, runs every time)
Goal: read the project's own conventions BEFORE applying generic review rules, so that subsequent phases align with what this repo actually requires — not with this skill's default rubric.
Output: an in-memory object $PROJECT_CONVENTIONS. Do NOT write this to disk. README is the source of truth; persisting a copy here would create "two truths" that drift apart.
0.3.1 Read the source files
Read these in order. Existence is optional — skip silently if missing. Do NOT recurse into linked docs in this phase; just record the pointer.
| Priority | File(s) | Why |
|---|---|---|
| Must (try first) | README.md, README.*.md (zh/en variants) |
Primary convention source — directory roles, error handling, perf notes |
| Should (read if present) | AGENTS.md |
Some repos use this for AI/agent collaboration rules |
| Should (read if present) | Project root CLAUDE.md |
Already loaded by harness, but re-read here to extract project rules into $PROJECT_CONVENTIONS |
| Should (read if present) | CONTRIBUTING.md |
Workflow / commit / PR rules |
| Should (read if present) | .eslintrc*, .prettierrc* |
Code style relaxations and overrides |
| Pointer-only | docs/, knowledge-base/, .trae/documents/ |
If README links to these, record the path; do NOT read recursively now |
Strategy: README is the primary source — find it first. AGENTS.md / CLAUDE.md / CONTRIBUTING.md may or may not exist; read them only if they're present (don't error out, don't ask the user). After reading whatever exists, proceed to extraction without further confirmation.
0.3.2 Extract structured conventions
From the files above, extract a structured object with these 6 categories. Leave a category empty if the project says nothing about it — do NOT invent defaults:
$PROJECT_CONVENTIONS = {
directory_responsibilities: [], // e.g. "API requests must live under store/", "shared helpers in utils/"
error_handling: [], // e.g. "server-side calls must try-catch and report via XYZ"
performance_concerns: [], // e.g. "watch out for Vue2 watcher / mixin memory leaks"
platform_targets: [], // e.g. "iOS WebView ≥ 14, Android WebView ≥ 80, native bridge required"
lint_relaxations: [], // e.g. ".eslintrc allows `console.*`", "no-unused-vars set to warn"
doc_pointers: [], // e.g. "API docs at docs/api.md", "knowledge base at .trae/documents/"
}
Each entry should include the source (e.g. "README.md#目录职责", ".eslintrc.js:L25") so later phases can cite it in findings.
0.3.3 Surface the extracted conventions (NO confirmation needed)
Print $PROJECT_CONVENTIONS to the conversation as a brief summary so the user can SEE what was extracted (transparency), but do NOT ask for approval — proceed directly to Phase 0.5/1.
Format: a compact list, grouped by the 6 categories. Skip empty categories. Each entry shows the source citation (README.md#章节, .eslintrc.js:L25, etc.).
Why no confirmation: the user has read their own README; asking them to re-validate it adds friction without adding signal. If extraction is wrong, the user will notice when a Phase 3/4/5 finding cites a bogus source — they can correct it then. This skill optimizes for "start fast, course-correct on real findings" over "front-load validation".
0.3.4 Handle the empty / thin README case
If after 0.3.2 all 6 categories are empty (no README, no AGENTS.md, no CLAUDE.md, no lint config — or all of them are clearly boilerplate < 300 chars total):
→ Print a one-line warning to the conversation:
⚠️ 未发现可解析的项目规范文件(README/AGENTS/CLAUDE 等均缺失或过简)。本次 review 将使用 skill 内置通用规则,所有 finding 的"依据"列将统一标注为
skill 默认。
→ Then proceed. Do NOT block the review with a question. The user can decide whether to act on the warning by either writing project conventions or accepting the generic rubric.
This is a soft signal, not a gate.
0.3.5 How later phases USE $PROJECT_CONVENTIONS
This is the key contract — every Phase 3 / 4 / 5 finding MUST be filtered through these conventions before being reported:
For each candidate finding:
1. Look up relevant entries in $PROJECT_CONVENTIONS.
2. If a project rule covers this case:
- The project rule wins. Report (or suppress) according to the project rule.
- Tag the finding with 依据: <source from $PROJECT_CONVENTIONS>
3. If no project rule covers this case:
- Apply skill default rules.
- Tag the finding with 依据: skill 默认
4. If project rule and skill default DISAGREE on severity:
- Use the project rule's severity (project knows its own risk surface best).
Examples (using a Vue2 WebView project's typical README):
console.log("xxx")found in diff →lint_relaxationssays ".eslintrc allows console" → suppress the finding (was P2 by skill default).setIntervalinmountedwithout cleanup →performance_concernssays "watch out for memory leaks" → promote to P0 (was P1 by skill default).- HTTP request placed directly in a
.vuecomponent →directory_responsibilitiessays "requests must live in store/" → report as P1 with 依据: README#目录职责 (instead of generic "consider extracting").
0.3.6 Finding format change
The Code Quality table in impact-report.md MUST add a 依据 column:
| 问题 | 文件:行 | 等级 | 依据 | 修复建议 |
|------|---------|------|------|---------|
| ... | ... | ... | README.md#错误处理 / .eslintrc:L25 / skill 默认 | ... |
Same column applies to the Compatibility and Performance tables. This makes it obvious to the user which findings are project-grounded and which are generic — they can dismiss the generic ones faster if they don't apply.
Phase 0.5: PRD-Driven Architecture Alignment (DEEP TIER ONLY)
Tier gate:
$TIER == lite→ skip entirely. (If a PRD was provided, the warning was already shown in Phase 0.3.)$TIER == standard→ skip entirely. standard does not read or write ADR. (Same warning applies.)$TIER == deepAND no PRD provided → skip silently, jump to Phase 1.$TIER == deepAND PRD provided → run the full sub-flow below.
0.5.1 Identify the PRD & ADR
Ask the user which PRD file to use (or use the one passed via argument-hint). Then:
- Read the PRD file(s). Distinguish original PRD extracts from AI-generated analysis — the original is authoritative.
- Identify the feature name and locate the corresponding ADR: check if
AIReview/ADR-{feature-name}.mdexists. - If the ADR does NOT exist: run the prd-adr workflow first — compare PRD vs master, confirm unclear decisions with user, generate the ADR. Then continue to 0.5.2.
- If the ADR EXISTS: read it. Then run prd-adr update — compare the current PRD version against master, update any changed decisions, append new ones. Then continue to 0.5.2.
0.5.2 Analyze PRD Against Current Diff
Compare the PRD requirements against the current diff (not master). For each PRD requirement:
- ✅ Implemented & matches PRD → pass
- ⚠️ Implemented but deviates from PRD → flag for ADR cross-reference
- ❌ Missing / not implemented → flag for ADR cross-reference
- ⛔ Incorrect / contradicts business logic → flag for ADR cross-reference
0.5.3 Cross-Reference Issues with ADR (INTERACTIVE)
For EACH flagged issue, check the ADR:
Case A — ADR documents this deviation with a specific reason:
→ Ask the user via AskUserQuestion:
- Header: short label (≤12 chars), e.g. "Upload Flow"
- Question: "PRD requires [X], but code does [Y]. ADR-00N explains this as [ADR's reason]. Is this acceptable?"
- Options:
- "符合要求" — the ADR's rationale is valid, this deviation is intentional
- "不符合要求,计入 P0" — the ADR's explanation is insufficient or outdated, this is a real issue
Case B — ADR does NOT document this deviation (no relevant ADR entry): → Do NOT ask the user. Immediately log as a P0 issue:
- "PRD requires [X], but code does [Y]. No ADR entry explains this deviation."
- This goes into
impact-report.mdunder "P0 — PRD Compliance Issues".
0.5.4 Loop Until Clean
Continue step 0.5.3 until ALL flagged issues are resolved (user confirmed "符合要求" or logged as P0). Only then proceed to Phase 1.
0.5.5 Output
After this phase, the impact-report.md will start with a "PRD Compliance" section listing:
- P0 issues (ADR doesn't explain the deviation, or user rejected it)
- Confirmed deviations (user accepted with ADR reference)
Phase 1: Knowledge Graph & Key Component Profiling
Tier behavior summary:
- lite: skip 1.2 and 1.3 entirely. Only run 1.1 if Phase 3 needs codegraph for the high-risk subset.
- standard: run 1.1 and 1.2 (read-only — never write or update
project-overview.md). Skip 1.3 (no component profile files written; Phase 3 will name-drop key components insidereview.mdinstead). - deep: run all of 1.1, 1.2, 1.3 as written.
1.1 Ensure CodeGraph Index
Check if the project has a CodeGraph index via codegraph_status.
If CodeGraph is not installed in the current environment, stop and ask the user to install and initialize it first:
-
Install:
npx @colbymchenry/codegraph -
Init index:
codegraph init -i -
If the index exists and is healthy, proceed.
-
If the index does not exist, ask the user: "项目尚未初始化 CodeGraph 索引,是否运行
codegraph init -i构建索引?" -
Wait for the index to be ready before continuing.
1.2 Project Overview Document
lite: skip this step entirely.
standard: read AIReview/project-overview.md if it exists (use as background for Phase 3 reasoning). Never create it, never update it. standard does not maintain long-term knowledge.
deep: Check if AIReview/project-overview.md exists.
If it does NOT exist:
Use codegraph_context with the project root + read package.json / project config files to generate a comprehensive project overview. The document MUST include:
- 技术栈(框架、构建工具、主要依赖及版本)
- 项目结构与模块划分
- 各模块职责说明
- 关键入口文件
- 构建/部署方式
- 目标运行环境(浏览器、APP WebView、小程序等)
- 已知的设备/平台适配约束(如最低版本要求)
Save to AIReview/project-overview.md.
If it DOES exist:
Read the existing document. In subsequent phases, if the review reveals new information (architecture changes, new modules, new platform constraints), mark the updates needed and apply them in Phase 7 (Final Update). The project-overview is a living document that accumulates knowledge across all reviews.
IMPORTANT: AIReview/project-overview.md is shared across ALL reviews. Do NOT create a per-review copy. Always read from and write to AIReview/project-overview.md.
1.3 Identify and Profile Key Components ("重组件")
Tier gate:
$TIER == lite→ skip entirely. lite does not identify key components.$TIER == standard→ partial run. Identify candidates (caller≥5 OR shared-infra path) and list them in memory only for use in Phase 3's "重组件点名" sub-section. Do NOT writeAIReview/components/{name}/{name}.mdfiles. Do NOT prompt the user viaAskUserQuestion— standard automatically uses all qualifying candidates.$TIER == deep→ full run (all sub-steps below, including the user-confirmation step).
A "key component" (重组件) is defined STRICTLY as a component/module that meets AT LEAST ONE of:
| Condition | How to verify |
|---|---|
| High reference count — imported/referenced by 5+ other files | codegraph_callers |
| Shared infrastructure — utils, bridge methods, API wrappers, state stores, constants | Check if path contains utils/, api/, store/, constant/, bridge/ |
A file is NOT a key component just because it appears in the diff. Page-level index.vue, display-only components, or files with only 1-2 callers do NOT need profiles.
Workflow
-
Scan and filter: Scan every changed file in the diff. For each, check whether it qualifies as a key component using ONLY the two strict criteria above. For files that do NOT qualify, explicitly note the reason (e.g., "page-level index.vue — 0 callers", "sub-component — 1 caller").
-
MANDATORY — Present candidates to the user for confirmation: Before writing ANY component profile files, assemble a candidate summary table and present it to the user via
AskUserQuestion. The table MUST include for every candidate:- File path
- Qualifying criterion met (caller count ≥5, or which shared-infra path prefix)
- Codegraph caller count (exact number)
- Brief (≤12 words) summary of what changed in this branch
The
AskUserQuestionMUST let the user approve or reject each candidate individually (multiSelect). Only candidates the user explicitly approves become key components for this review. The question header should be"Phase 1.3 重组件确认".After receiving the user's answers, continue to step 3 ONLY with the approved candidates. Do NOT write profiles for rejected or non-qualifying files.
-
For each user-confirmed key component:
- Check if
AIReview/components/{ComponentName}/{ComponentName}.mdalready exists. - Does NOT exist → Generate a new profile (10-item template below). Create the subfolder:
mkdir -p AIReview/components/{ComponentName}. - Already exists → Read the existing profile. Note discrepancies; update in Phase 7.
- Check if
-
For non-qualifying or user-rejected files → Skip. Do NOT create a profile. Only record the change in
impact-report.md. -
For historically profiled key components that are NOT in this diff but ARE impacted → Read existing profile; update Change History in Phase 7.
Profile Template (key components only)
Save to AIReview/components/{ComponentName}/{ComponentName}.md:
- Component name & file path
- Props / Parameters — type, default, required
- Emit events — event name, payload type, trigger timing
- Slots (Vue/React) — named slots and their scopes
- Expose / Public API — exposed methods or refs
- Upstream callers — which parent components pass which props (use
codegraph_callers) - Downstream listeners — which components listen to which emit events
- Call count — total reference/call sites
- Platform/device constraints — any platform-specific restrictions
- Performance characteristics — heavy computation, frequent rendering, large data, etc.
Phase 2: Requirement Understanding & Interactive Q&A
2.1 Analyze the Diff
Run:
git diff origin/master...HEAD
IMPORTANT: This single diff is the ONLY input for analysis. Do NOT run git log to compare branch-internal commits. Every line in this diff is either:
- Added (+): NEW code relative to master — treat as "本次新增"
- Removed (-): Code that EXISTS on master but was DELETED/REPLACED on this branch — treat as "本次删除/替换"
Produce a structured summary:
- Files changed (grouped by module/directory)
- Functions/components 新增 (not on master at all), 修改 (exists on master but changed), or 删除 (removed from master)
- Lines added/removed statistics
- For each modified function: what specifically changed vs master (not vs an earlier commit on this branch)
2.2 Ask the User (MANDATORY)
Present the diff summary, then ask:
lite: ask only Q1 / Q3 / Q5 below (核心意义、风险、平台范围). Skipping Q2/Q4 keeps lite ceremony low.
standard / deep: ask all 5 questions.
Use AskUserQuestion:
- 本次需求的核心意义是什么? — What is the primary goal of this change?
- 这是否是未来一段时间内的重点维护需求? — Will this area receive continued development?
- 是否有已知的风险点或特殊约束? — Any known risks, constraints, or edge cases?
- 是否有相关的设计文档或需求文档可以参考? — Any design docs or specs to reference?
- 目标设备/平台范围? — Which devices/platforms/OS versions must be supported? (iOS version range, Android version range, specific WebView environments, etc.)
2.3 Record Context
Store the user's answers in memory for use in subsequent phases. Also inform the user:
"在后续的分析过程中,如果我遇到不理解的业务逻辑或技术决策,我会及时向你提问。"
Phase 3: Impact Analysis
Tier behavior:
- lite: only flag changes whose modified function/component has caller count ≥10 (high-risk only). No ADR cross-check. No 重组件 sub-section. Output goes into
review.md"风险点" section. - standard: flag caller count ≥5. Add a "影响分析" section to
review.mdwith two parts: (a) high-risk changes table; (b) 重组件点名 — list any qualifying key components (from in-memory Phase 1.3 candidates) that this diff touches, plus a one-line risk summary each. No ADR cross-check (standard does not read ADR). No component profile files. - deep: flag caller count ≥5. Run 3.2b ADR conflict check. Update component profiles (mark for Phase 7 update). Output goes into
impact-report.md.
3.1 Identify High-Impact Changes
For every function/component modified in the diff:
- Use
codegraph_callersto get the call count and caller list - Use
codegraph_impactto get the full impact graph - Flag any function/component where:
- Caller count >= 5 (medium risk) — standard/deep threshold
- Caller count >= 10 (high risk) — lite threshold (lite only flags these)
- The function is in a shared utility/common module (high risk)
3.2 Cross-Reference with Key Components
Check if any of the changes touch the key components profiled in Phase 1. If yes, detail EXACTLY what changed in that component and assess the risk:
- Props changed? — Could break parent components passing old props
- Emit signature changed? — Could break listeners
- Internal logic changed? — Could cause behavioral regression in all callers
- Return value / exposed API changed? — Could break consumers
3.2b ADR Conflict Check for Key Components (DEEP TIER ONLY, when ADR exists)
Tier gate: lite and standard skip this step entirely (neither reads ADR). Only $TIER == deep runs it.
If $TIER == deep AND the ADR file exists (from Phase 0.5 or previously), for EACH key component that was modified:
- Read the ADR and find all decisions relevant to this component.
- Check if the current diff conflicts with any documented architectural decision:
- Does the change reverse a previously adopted approach?
- Does it introduce a pattern the ADR explicitly rejected?
- Does it bypass a trade-off the ADR documented as intentional?
- If a conflict is found:
→ Ask the user via
AskUserQuestion:- Header: short label, e.g. "Component ADR Conflict"
- Question: "This change to [component] conflicts with ADR-00N which decided [decision]. The diff introduces [new behavior]. Is this intentional?"
- Options:
- "是有意变更,请更新 ADR" — intentional, update the ADR entry accordingly
- "是违规变更,计入 P0" — this should not happen, flag as P0 issue
- If no conflict found: → continue to 3.3.
If no ADR file exists: skip this step.
3.3 Update Component Profiles (mark for update)
For each key component affected, note what needs updating in the profile:
- A "Change History" section noting this change
- Updated risk assessment
- Updated props/emit/API if changed
(Actual file update happens in Phase 7)
3.4 Ask If Unclear
If any business logic in the changed code is unclear, ask the user for clarification before continuing. Do NOT guess.
3.5 Output Impact Report
Produce a structured impact report and save to {OUTPUT_DIR}/impact-report.md:
# Impact Report
## Summary
- Total files changed: N
- High-risk changes: N
- Key components affected: N
## High-Risk Changes
| File | Function/Component | Callers | Risk Level | Reason |
|------|-------------------|---------|------------|--------|
| ... | ... | ... | ... | ... |
## Key Component Impact
- ComponentA: [what changed, what could break]
- ComponentB: [what changed, what could break]
## Code Quality Issues
### P0 (must fix before merge)
- [issue description + file:line + 依据 + suggested fix]
### P1 (should fix)
- [issue description + file:line + 依据 + suggested fix]
### P2 (cleanup)
- [issue description + file:line + 依据 + suggested fix]
依据 field is REQUIRED — see Phase 0.3.5 / 0.3.6. Each issue must cite either a project source (e.g. README.md#错误处理, .eslintrc:L25) or skill 默认.
Phase 3.5: Code Smell Scan (DEEP TIER ONLY)
Tier gate:
$TIER == lite→ skip entirely.$TIER == standard→ skip entirely. (v2.6 design decision: standard 只做"必看"维度,代码味道做不深变噪音,归 deep 独占。)$TIER == deep→ run all 5 categories (A–E), no truncation.
Goal: catch the "this works but it's messy" class of issues that Phases 3/4/5 don't see — magic values, duplication, oversized functions, copy-pasted shapes. These are the things that turn a codebase into 屎山 over time.
Critical scope rule — only report NEW smell, not pre-existing smell:
For every candidate finding, check git blame (or compare against master baseline) to determine whether the smelly line is introduced by this branch or pre-existing.
- New smell (added in this branch) → report
- Pre-existing smell (this branch only touched the file, didn't add the smell) → silently skip
- Pre-existing smell that this branch makes worse (e.g. magic value count went 2 → 4) → report, but tag as "本次加重"
The reason: this skill must not become a static-analysis tool that re-flags 500 existing issues every review. Reviewers will start ignoring it. Only the marginal smell delta matters.
3.5.1 What to scan
Five categories. Each has detection signals + severity caps.
A. Magic values (魔法值)
Signal: the same string/number literal appears ≥3 times in the same file, OR the same literal appears in ≥2 changed files.
- Scope: numeric literals (excluding
0,1,-1,100), string literals length ≥2, hex colors, URLs. - Exclude: literals inside
// commentor/* */, test files (*.spec.*,*.test.*). - Detection: for each changed file, grep all literals matching the pattern, count occurrences.
Severity cap: P2. Bump to P1 if:
- The literal is a status code, type ID, or platform tag (these are the ones that bite later when servers add new types).
$PROJECT_CONVENTIONS.directory_responsibilitiesmentions a constants directory (e.g.constant/) — using inline literals when the project has a constants convention is a project-rule violation, not just style.
Examples (from real reviews):
promotionType: targetType === AI_TEXT_TYPE_KEY ? '3' : targetTypewith'3'/'1'/'2'/'4'/'5'scattered across 6+ call sites → P1 (status-code-like + project hasconstant/shareMaterialsConstants.js)'#FA2314'hex color appearing in 4+ Vue files → P2 (style)'AI参与创作'Banner text inline → P2 (i18n risk)
B. Duplication (重复代码)
Signal: ≥5 consecutive lines (after normalizing whitespace and identifier names) appear identically in ≥2 changed files, OR ≥2 places in the same changed file.
- Detection: normalize each function body (strip whitespace, replace identifiers with
$1/$2/...), then hash-compare across the diff. Off-the-shelf tools (jscpd) are overkill here — a simple grep + hash works for review scope. - Exclude: matching template HTML structure (Vue/React), import blocks, configuration objects ≤3 lines.
Severity cap: P1 if duplicated logic affects ≥3 files; P2 otherwise.
Examples:
- 4 textManager config objects in
index.vue:initTextStreamManagers— 80% of fields are mechanical string-key duplication → P1 (could beObject.entries(MANAGER_CONFIGS).forEach(...)) - Same
if (utils.env === 'harmony' || utils.env === 'android') { ... }block in 3 different components → P1 (extract toutils/platform.js)
C. Oversized functions / files (超长函数/文件)
Signal:
- Single function body ≥80 lines (excluding declaration line and closing brace) → P2
- Single function body ≥150 lines → P1
- Single
.vue<script>block ≥600 lines → P2 - Single
.vue<script>block ≥1000 lines → P1
Detection: use codegraph_node to get function spans, or count lines between matching { } in the diff.
Important: if the oversized function existed on master and this branch only added 5 lines to it → don't report (pre-existing smell). If this branch grew it from 80 → 200 lines → report as "本次加重".
D. Inline structures that should be extracted (内联结构)
Signal:
- Hardcoded option arrays with ≥3 items inline in
data()(Vue) or component state — should beconst FOO_OPTIONS = [...]at module top OR inconstant/dir. - Inline image/icon URLs in template that look like CDN URLs (long path, hash-like ID).
- Inline regex patterns ≥20 chars.
- Inline RGB/hex color sequences when the project has a theme/token file (check Phase 0.3 doc_pointers).
Severity cap: P2.
Examples:
textTypeOptions: [{value:0,label:'营销段子'},{value:1,...},{value:2,...}]indata()→ P2 (extract const)- 3 inline channel icon URLs in
ShareDialog/index.vue:36-41→ P2 (move to constants)
E. Copy-paste-then-modify smell (改一半的复制粘贴)
Signal: two functions/components in the diff with very similar names (fetchProductText / fetchLineReportText / fetchAiText) and ≥70% identical body. This usually means the developer copied one and renamed identifiers — it's the precursor to drift bugs.
Severity cap: P1. The risk is high: when the original gets a bugfix, copies don't.
Detection: for each pair of similarly-named functions in diff, normalize and compare body similarity. ≥70% match = report.
Examples:
fetchProductText/fetchLineReportText/fetchAiText/fetchCommandTextinindex.vue— 4 near-identical 30-line functions differing only by manager name and config keys → P1 (drive by config table, not 4 functions)
3.5.2 Apply $PROJECT_CONVENTIONS filter (MANDATORY)
Before reporting any smell finding, check $PROJECT_CONVENTIONS:
- Project has a relevant convention (e.g. README says "常量统一放 constant/") → cite it as
依据, possibly bump severity (project rule > skill default). - Project explicitly relaxes this (e.g. README says "本项目历史包袱重,新增允许直接内联") → suppress finding, or downgrade to "提醒".
- No project rule either way → use skill default severity, tag
依据: skill 默认.
This phase is the most likely to produce noise. The convention filter is what keeps it useful.
3.5.3 Output
Append a "Code Smell Scan" section to {OUTPUT_DIR}/impact-report.md:
## Code Smell Scan (Phase 3.5)
> 范围:本次 diff 中新引入的代码味道。已剔除存量问题(git blame 验证)。
> 共扫描 5 类:魔法值 / 重复代码 / 超长函数 / 内联结构 / 复制粘贴
### A. 魔法值
| 字面量 | 出现次数 | 文件 | 等级 | 依据 | 建议 |
|---|---|---|---|---|---|
| `'3'` (promotionType) | 6 处 | `index.vue` 多处 | P1 | README#目录职责(constant/)+ 已有 shareMaterialsConstants.js | 抽到 `constant/shareMaterialsConstants.js` 作为 `PROMOTION_TYPE.AI = '3'` |
### B. 重复代码
| 模式 | 文件 | 等级 | 依据 | 建议 |
|---|---|---|---|---|
| 4 套 textManager 配置对象(80% 字段相同) | `index.vue:initTextStreamManagers` | P1 | skill 默认 | 用 `MANAGER_CONFIGS = {...}` + `Object.entries(...).forEach()` 驱动 |
### C. 超长函数 / 文件
| 函数/文件 | 行数 | 等级 | 依据 | 建议 |
|---|---|---|---|---|
### D. 内联结构
| 内容 | 位置 | 等级 | 依据 | 建议 |
|---|---|---|---|---|
### E. 复制粘贴
| 函数对 | 相似度 | 等级 | 依据 | 建议 |
|---|---|---|---|---|
### Suppressed (项目规范豁免)
- [list any findings dropped because $PROJECT_CONVENTIONS allows them — keeps the suppression visible]
3.5.4 What this phase does NOT do
- Does not lint style (use eslint).
- Does not flag readability nitpicks (variable naming, comment density, etc.).
- Does not report on pre-existing smell that this branch didn't touch.
- Does not block merge — all severities cap at P1, never P0. Code smell is rarely merge-blocking; it's accumulation that hurts.
3.5.5 Tier behavior (v2.6)
- lite: skip entirely.
- standard: skip entirely (代码味道扫描在 v2.6 改为 deep 独占)。
- deep: run all 5 categories, no cap.
Phase 4: Device & Platform Compatibility Analysis (DEEP TIER ONLY)
Tier gate:
$TIER == lite→ skip entirely. 兼容性需要详细排查,lite 不做(如有强需求请升 standard/deep)。$TIER == standard→ skip entirely. v2.6 设计决策:兼容性做不深就是噪音,归 deep 独占。$TIER == deep→ run all sub-steps below.
4.1 Identify Platform-Sensitive Code
Scan the diff for code patterns that have device/platform implications:
- Native bridge calls —
window._cordova,window.webkit,JSBridge,postMessage, etc. - Platform detection —
navigator.userAgent,utils.env, version checks (compareVersion) - API availability — Web APIs with limited browser support (Clipboard API, IntersectionObserver, etc.)
- CSS features — vendor prefixes, viewport units, features with limited support
- Touch/gesture handling — touchmove, touchstart, passive listeners
- Storage APIs — localStorage, sessionStorage, IndexedDB (quota differences across platforms)
4.2 Compatibility Matrix
For each platform-sensitive code path found, produce an analysis:
| Code | iOS | Android | WebView | Browser | Risk |
|---|---|---|---|---|---|
| [specific code] | [behavior] | [behavior] | [behavior] | [behavior] | [level] |
4.3 Version Gate Analysis
For any version-gated code (e.g., compareVersion("3.13.78")):
- What happens on versions BELOW the gate? (graceful degradation? complete feature loss? error?)
- What happens on versions ABOVE the gate?
- Is the version gate documented in the project overview?
4.4 Identify Compatibility Risks
Flag issues such as:
- Untested code paths — new platform branches with no fallback
- Missing error handling — bridge calls without try-catch
- Implicit platform assumptions — code that assumes iOS/Android behavior without checking
- Regression on old devices — changes that may break on older OS versions
- WebView quirks — WKWebView vs UIWebView vs Android WebView differences
4.5 Output Compatibility Report
Append a "Device & Platform Compatibility" section to {OUTPUT_DIR}/impact-report.md:
## Device & Platform Compatibility
### Platform-Sensitive Changes
| Location | API/Feature | iOS | Android | Fallback | Risk |
|----------|------------|-----|---------|----------|------|
| file:line | [feature] | [status] | [status] | [yes/no] | [H/M/L] |
### Version Gates
| Location | Gate Condition | Below-Gate Behavior | Above-Gate Behavior |
|----------|---------------|--------------------|--------------------|
| file:line | [condition] | [behavior] | [behavior] |
### Compatibility Issues
- [P0/P1/P2] [description + suggested fix]
Phase 5: Performance Analysis (DEEP TIER ONLY)
Tier gate:
$TIER == lite→ skip entirely.$TIER == standard→ skip entirely. v2.6 设计决策:性能扫描归 deep 独占,避免 standard 写浅了变噪音。$TIER == deep→ run all sub-steps below.
5.1 Identify Performance-Sensitive Patterns
Scan the diff for code patterns with performance implications:
Runtime Performance:
- Frequent event listeners — scroll, resize, touchmove, visibilitychange without throttle/debounce
- DOM manipulation — frequent reads/writes, layout thrashing, forced reflows
- Large loops / heavy computation — in hot paths or render cycles
- Memory leaks — event listeners not removed, closures holding references, global variable accumulation
- Reactive watchers — Vue watchers on complex objects, deep watch without necessity
Network Performance:
- Unnecessary requests — duplicate API calls, requests on every visibility change
- Missing caching — same data fetched repeatedly
- Large payloads — base64 images in memory, unbounded list growth
- Waterfall requests — sequential requests that could be parallelized
Rendering Performance:
- Unnecessary re-renders — state changes triggering full component re-render
- Large list rendering — without virtual scrolling
- Image handling — uncompressed images, missing lazy loading
- CSS performance — expensive selectors, layout-triggering properties in animations
5.2 Analyze Each Finding
For each performance concern found, assess:
- Severity — Will users notice? Under what conditions?
- Frequency — How often does this code path execute?
- Scale — How much data/DOM elements are involved?
- Fix complexity — How hard is it to optimize?
5.3 Memory Leak Check
Specifically check for:
- Event listeners added in
mounted/createdbut not removed inbeforeDestroy/unmounted - Global window properties set but never cleaned up
- setInterval/setTimeout without clearInterval/clearTimeout
- Closures that capture large objects unnecessarily
5.4 Output Performance Report
Append a "Performance Analysis" section to {OUTPUT_DIR}/impact-report.md:
## Performance Analysis
### Performance Concerns
| Location | Pattern | Severity | Frequency | Suggested Fix |
|----------|---------|----------|-----------|---------------|
| file:line | [pattern] | H/M/L | [freq] | [fix] |
### Memory Leak Risks
- [location] — [description + evidence + fix]
### Network Efficiency
- [location] — [description + optimization opportunity]
### Performance Recommendations
#### Must-fix (affects UX)
- [recommendation]
#### Should-fix (preventive)
- [recommendation]
#### Nice-to-have (optimization)
- [recommendation]
Phase 6: Regression Scope & Test Checklist
Tier output routing:
- lite: produce a compact "测试要点" section appended to
{OUTPUT_DIR}/review.md. Merge regression scope (必测 only) and test checklist into one bullet list. - standard: produce a "测试要点" section appended to
{OUTPUT_DIR}/review.md. Merge regression scope (必测 + 建议回归) and test checklist into a single section. Do NOT writeregression-scope.mdortest-checklist.mdas separate files. - deep: write standalone
{OUTPUT_DIR}/regression-scope.mdand{OUTPUT_DIR}/test-checklist.md(full original behavior).
6.1 Compute Regression Scope
Based on Phase 3-5's analysis, determine the regression testing scope:
Must-test (必测):
- All directly changed pages/features
- All parent components that pass changed props
- All listeners of changed events
- All platform-specific code paths (test on each target platform)
- Any code path flagged as performance-sensitive
Should-test (建议回归):
- Pages/features that use key components affected by this change
- Shared utilities that were modified, and their consumers
- Edge cases identified in compatibility analysis
Can-skip (可忽略):
- Modules with no dependency on any changed code
- Pure style/copy changes with no logic impact
Output:
- lite / standard: append to
{OUTPUT_DIR}/review.md"测试要点" section. - deep: save to
{OUTPUT_DIR}/regression-scope.md.
6.2 Generate Test Checklist
Based on all previous phases, generate a comprehensive test checklist.
For each test item, include:
- Module/Page it belongs to
- Test description — what to verify
- Priority — P0 (blocker) / P1 (critical) / P2 (normal)
- Expected result — what correct behavior looks like
- Risk source — which change triggers this test need
- Test platform — which devices/platforms this must be tested on (if platform-specific)
The checklist MUST include:
- Functional test cases (from Phase 3)
- Device/platform-specific test cases (from Phase 4) — deep only, since lite/standard skip Phase 4
- Performance-related test cases (from Phase 5, e.g., "verify no memory leak after repeated back/forth navigation") — deep only
Output:
- lite: condensed bullet list inside
{OUTPUT_DIR}/review.md"测试要点" section. Drop the table — just a numbered list of "测什么 / 哪个平台(如适用)". - standard: table inside
{OUTPUT_DIR}/review.md"测试要点" section. Columns: 模块 / 测试项 / 优先级 / 平台. - deep: save full table to
{OUTPUT_DIR}/test-checklist.md.
Phase 7: Final Documentation Update
Tier gate (sub-step level):
- 7.1 Update Component Profiles → DEEP ONLY (lite/standard never wrote profiles)
- 7.2 Update Project Overview → DEEP ONLY (lite/standard never wrote/updated it)
- 7.3 Generate Review Images → DEEP ONLY (lite/standard generate no images in v2.6)
- 7.4 Final Summary → ALL tiers (format differs by tier)
7.1 Update Component Profiles (DEEP ONLY)
For each key component affected by this change, update AIReview/components/{ComponentName}/{ComponentName}.md:
- Update props/emit/API if changed
- Add a "Change History" entry with date and branch name
- Update risk assessment
- Update platform constraints if any were introduced
7.2 Update Project Overview (DEEP ONLY)
If the review revealed new information about the project (new platform constraints, new architectural patterns, new dependencies), update AIReview/project-overview.md. This file is shared across all reviews and accumulates knowledge over time.
What to update:
- 新增模块/组件 — New modules or key components discovered during this review
- 新增平台约束 — New device/OS/WebView constraints identified
- 架构变更 — Architectural pattern changes or new dependency introductions
- 新增功能区域 — New feature areas that future reviews should be aware of
How to update: Read AIReview/project-overview.md, append or modify the relevant sections, and save. Do NOT recreate the file from scratch — it should grow incrementally.
7.3 Generate Review Images (DEEP ONLY)
Tier gate: lite and standard generate ZERO images. Skip 7.3 entirely for those tiers.
For deep tier, at the end of every review, generate MULTIPLE graph images — one overall dependency overview + one per-component refactoring comparison + one per shared-module impact analysis. Reference the 20260604 review's images/ folder as the standard.
All .dot files MUST be deleted after PNG generation. Only keep .png files.
Step 7.3.1: Overall Changes Graph — overall-changes.png
Generate ONE overall dependency graph showing all changed files and their relationships.
- Use
codegraph_callersandcodegraph_calleesto collect dependency data for each changed file - Write
{OUTPUT_DIR}/images/overall-changes.dot:- Changed files as colored nodes (red=high risk, orange=medium, green=low)
- Upstream callers/dependencies as blue nodes
- Caller/callee relationships as directed edges
- Group related components in subgraph clusters by module
- Include a legend explaining node colors
- Title should include the branch name: e.g.,
"示例分支变更文件依赖关系图\nfeat_example_0520 vs master"
- Render:
dot -Tpng -Gdpi=150 {OUTPUT_DIR}/images/overall-changes.dot -o {OUTPUT_DIR}/images/overall-changes.png - Delete
.dot:rm {OUTPUT_DIR}/images/overall-changes.dot
Step 7.3.2: Per-Component Refactoring Comparison Graphs — {ComponentName}-refactor.png
For EACH key component that was significantly refactored (逻辑重构、API变更、生命周期变更), generate a before/after comparison graph using Graphviz subgraph cluster to show old vs new side-by-side.
Pattern (see AIReview/20260604-.../images/component-flow.png and shared-widget-refactor.png):
-
For each refactored component, write
{OUTPUT_DIR}/images/{ComponentName}-refactor.dot:- Use TWO
subgraph clusterblocks:- 🔴
cluster_old(left/top): Master version — red/pink color scheme, labeled "Master (旧版)" - 🟢
cluster_new(right/bottom): Branch version — green color scheme, labeled "{branch} (新版)"
- 🔴
- Inside each cluster, model the component's internal flow as nodes + edges:
- Function calls, event listeners, data flow, lifecycle hooks
- Mark bugs/anti-patterns in the old version with ❌ and warning-colored nodes
- Mark fixes/improvements in the new version with ✅ and green-colored nodes
- Use
noteshape for annotations explaining bugs and fixes - Title format:
"{ComponentName} 重构对比\n🔴 Master(旧) vs 🟢 {branch}(新)"
- Use TWO
-
Render:
dot -Tpng -Gdpi=150 {OUTPUT_DIR}/images/{ComponentName}-refactor.dot -o {OUTPUT_DIR}/images/{ComponentName}-refactor.png -
Delete
.dot:rm {OUTPUT_DIR}/images/{ComponentName}-refactor.dot
Step 7.3.3: Shared-Module Impact Graphs — {ModuleName}-impact.png
For EACH shared module (utils, services, stores) that was touched, generate an impact scope graph showing all consumers.
Pattern (see AIReview/20260604-.../images/shared-service-impact.png):
-
For each shared module, write
{OUTPUT_DIR}/images/{ModuleName}-impact.dot:- Center the shared module as the hub node (orange/red, wider)
- Surround with consumer/caller nodes:
- 🔧
fillcolor="#E3F2FD"for consumers that were ALSO changed in this branch - Default blue for unchanged consumers
- 🔧
- Group related consumers in subgraph clusters by module
- Include a legend
- Title format:
"{ModuleName} 影响范围\n{functionName} 调用方分析"
-
Render:
dot -Tpng -Gdpi=150 {OUTPUT_DIR}/images/{ModuleName}-impact.dot -o {OUTPUT_DIR}/images/{ModuleName}-impact.png -
Delete
.dot:rm {OUTPUT_DIR}/images/{ModuleName}-impact.dot
Image Generation Checklist
Before finishing Phase 7.3, verify:
- [ ]
overall-changes.png— one overall dependency graph of all changed files - [ ]
{ComponentName}-refactor.png— one per refactored key component (may be multiple) - [ ]
{ModuleName}-impact.png— one per touched shared module (may be multiple) - [ ] All
.dotfiles deleted — only.pngfiles remain inimages/ - [ ] All images include the branch name in their titles for traceability
7.4 Final Summary
Format differs by tier.
lite:
## Review 完成 (lite)
产物: {OUTPUT_DIR}/review.md (3 节: 改动概览 / 风险点 / 测试要点)
### Top 风险
[最多 3 条]
### 建议
[1-2 句]
standard:
## Review 完成 (standard)
产物: {OUTPUT_DIR}/review.md (4 节: 改动概览 / 风险点 / 影响分析 / 测试要点)
### 关键发现
[Top 3-5 findings]
### 重组件触及清单
[Phase 1.3 candidates this diff touched, with one-line summary each]
### 建议
[fix before merge / fix later / acceptable risk]
deep:
## Review 完成 (deep)
### Output Files
| File | Content |
|------|---------|
| AIReview/project-overview.md | 项目概览(共享,本次已增量更新) |
| AIReview/components/{name}/{name}.md | 重组件画像(共享,本次新建/更新 N 份) |
| AIReview/ADR-{feature}.md | 架构决策记录(如有 PRD,本次新建/更新) |
| {OUTPUT_DIR}/impact-report.md | 影响分析 + 兼容性 + 性能 + Code Smell |
| {OUTPUT_DIR}/regression-scope.md | 回归范围 |
| {OUTPUT_DIR}/test-checklist.md | 测试清单 |
| {OUTPUT_DIR}/images/overall-changes.png | 变更文件依赖总览图 |
| {OUTPUT_DIR}/images/{name}-refactor.png | 各组件新旧重构对比图(N张) |
| {OUTPUT_DIR}/images/{name}-impact.png | 各共享模块影响范围图(N张) |
### 知识库变更摘要
- 新建/更新 ADR: [list]
- 新建/更新 组件画像: [list]
- project-overview 更新区块: [list]
### 关键发现
[Top 3-5 findings ranked by severity]
### 建议
[Actionable recommendations: fix before merge / fix later / acceptable risk]
Execution Notes
- Phase order by tier (v2.6):
- lite: 0 → 0.3 → 1.1 → 2 (3 questions) → 3 (caller≥10 only) → 6 → 7.4. Skip 0.5 / 1.2 / 1.3 / 3.2b / 3.5 / 4 / 5 / 7.1 / 7.2 / 7.3.
- standard: 0 → 0.3 → 1.1 → 1.2 (read-only) → 1.3 (in-memory only, no file writes) → 2 (5 questions) → 3 (caller≥5, no ADR check) → 6 → 7.4. Skip 0.5 / 3.2b / 3.5 / 4 / 5 / 7.1 / 7.2 / 7.3.
- deep: 0 → 0.3 → [0.5 if PRD] → 1 → 2 → 3 (incl. 3.2b if ADR) → 3.5 → 4 → 5 → 6 → 7. Full flow.
- Phase 0 MUST run first to resolve
$TIERand create the output directory structure appropriate for that tier. - Phase 0.3 MUST run for every tier to populate
$PROJECT_CONVENTIONSbefore any judgment is made. - Project conventions outrank skill defaults. Every finding must be tagged with its
依据source. - Tier gates are explicit. Do NOT run a phase whose tier gate excludes
$TIER. The phase header marks which tiers it runs in. - Output routing differs by tier:
- lite/standard write a single
{OUTPUT_DIR}/review.md(templates above). - deep writes the multi-file set (see Phase 7).
- lite/standard write a single
- If at any point business logic is unclear, ask the user immediately.
- Use codegraph tools for all structural queries — do NOT fall back to grep for "who calls X" type questions.
- All output files should be in Chinese where describing business logic, English for technical terms.
- 🔴 报告和图例全部用中文 — review.md / impact-report / regression-scope / test-checklist 等所有 Markdown 报告正文用中文撰写。Graphviz DOT 图(仅 deep 生成)中的所有 label、legend、title、subgraph cluster label、note 标注文字必须使用中文(英文技术术语如 API 名、组件名、变量名除外)。
- Long-term knowledge files are deep-only.
AIReview/project-overview.md,AIReview/components/*,AIReview/ADR-*.mdare never created or modified by lite/standard. standard may readproject-overview.mdfor context, but never writes. - DOT 文件用完即删 — deep 生成的每张
.dot渲染为 PNG 后,立即删除.dot文件。 - 🔴 MUST ASK when unclear — If the AI encounters business logic, technical decisions, or code changes whose purpose is unclear, it MUST stop and ask the user via
AskUserQuestionbefore continuing. Do NOT guess. Do NOT assume. Do NOT skip. This applies to all phases. Examples: unclear why a function was refactored, unfamiliar API usage, ambiguous platform-specific code, seemingly redundant changes.
当前收录版本
1.0.0
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- 提供 lite/standard/deep 三档审查深度,适配不同变更规模
- 结构化输出风险点、影响分析、回归范围和测试清单,显著提升代码审查效率
- 支持 PRD 对齐和 ADR 冲突检测,增强架构一致性保障
亮点
- 触发词覆盖全面,包括中英文变体及核心场景关键词
- 边界清晰,不易与其他 Skill 重叠
待提升项
-
部分章节标题层级不一致 原报告严重程度:轻微
Phase 0.3 下使用 '### 0.3.1 Read the source files',但后续子节使用 '#### Workflow',层级跳跃
改进建议:统一使用连续层级(如全部采用 ### 或 ####)
亮点
- Phase 划分逻辑清晰,执行流程完整
- 输出目录结构和模板定义明确,便于用户理解
待提升项
-
Phase 0.3 文件读取未处理编码异常 原报告严重程度:重大
读取 README.md 等文件时未指定编码或处理乱码/二进制文件异常
改进建议:添加编码指定(如 UTF-8)和二进制文件跳过逻辑
-
个别命令未加错误重定向 原报告严重程度:轻微
如 'git rev-parse' 等命令未统一添加 '2>/dev/null' 错误抑制
改进建议:统一添加错误重定向以保证脚本健壮性
亮点
- 关键操作(如 ADR 更新、组件画像写入)均有用户确认机制
- CodeGraph 索引缺失时有明确安装指引和交互提示
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
-
删除文件
先确认绝对路径及作用范围,保留可恢复备份;不要直接对重要目录运行示例命令。
主文档提及 · 第 1078 行 -
安装或获取外部依赖
使用官方来源并锁定版本,在隔离环境检查安装脚本。当前文档检查不覆盖后续下载的代码。
主文档提及 · 第 432 行
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
翻译待完成,请参阅来源文档。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。