gemini-cli

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Gemini CLI - PPT Slide Reviewer

Gemini CLI - PPT SVG幻灯片审查器

SVG slide quality reviewer via
scripts/invoke-gemini-ppt.ts
. Evaluates layout, visual hierarchy, color harmony, typography, and readability. The script automatically tries fallback models if the primary model is unavailable.
通过
scripts/invoke-gemini-ppt.ts
实现的SVG幻灯片质量审查工具。评估布局、视觉层级、色彩协调性、排版和可读性。若主模型不可用,脚本会自动尝试备用模型。

Script Entry

脚本入口

bash
npx tsx scripts/invoke-gemini-ppt.ts \
  --role "<role>" \
  --prompt "<prompt>" \
  [--image "<path>"] \
  [--model "<model>"] \
  [--output "<path>"]
bash
npx tsx scripts/invoke-gemini-ppt.ts \
  --role "<role>" \
  --prompt "<prompt>" \
  [--image "<path>"] \
  [--model "<model>"] \
  [--output "<path>"]

Resource Usage

资源使用

  • Role prompts:
    references/roles/{role}.md
  • Execution script:
    scripts/invoke-gemini-ppt.ts
  • 角色提示词:
    references/roles/{role}.md
  • 执行脚本:
    scripts/invoke-gemini-ppt.ts

Roles

角色说明

RolePurposeCLI Flag
reviewerSVG slide quality review
--role reviewer
角色用途CLI参数
reviewerSVG幻灯片质量审查
--role reviewer

Workflow

工作流程

Step 1: Read the SVG source and style tokens

步骤1:读取SVG源文件和样式令牌

Before calling Gemini, read the SVG file content and the relevant style YAML so you can include them in the prompt. The reviewer needs the actual SVG source code to inspect element attributes (font-size, fill, opacity, coordinates).
在调用Gemini之前,读取SVG文件内容和相关的样式YAML文件,以便将它们包含在提示词中。审查器需要实际的SVG源代码来检查元素属性(字体大小、填充色、透明度、坐标)。

Step 2: Build the review prompt

步骤2:构建审查提示词

Construct a prompt that includes:
  • The full SVG source code (or relevant excerpts for very large files)
  • The style token values (colors, fonts, border-radius, gap)
  • The slide context (index, topic, presentation style name)
构建包含以下内容的提示词:
  • 完整的SVG源代码(或大文件的相关片段)
  • 样式令牌值(颜色、字体、圆角、间距)
  • 幻灯片上下文(索引、主题、演示文稿样式名称)

Step 3: Call Gemini

步骤3:调用Gemini

bash
npx tsx scripts/invoke-gemini-ppt.ts \
  --role reviewer \
  --prompt "$REVIEW_PROMPT" \
  --output "${RUN_DIR}/reviews/gemini-raw-${SLIDE_INDEX}.md"
The script tries models in order: default → gemini-2.5-pro → gemini-2.5-flash. If all fail, it exits with code 2.
bash
npx tsx scripts/invoke-gemini-ppt.ts \
  --role reviewer \
  --prompt "$REVIEW_PROMPT" \
  --output "${RUN_DIR}/reviews/gemini-raw-${SLIDE_INDEX}.md"
脚本会按以下顺序尝试模型:默认模型 → gemini-2.5-pro → gemini-2.5-flash。若所有模型均不可用,则以退出码2终止。

Step 4: Handle the result

步骤4:处理结果

  • Exit code 0: Gemini responded. Read the output file and extract the structured review.
  • Exit code 2: All Gemini models unavailable. Fall back to Claude self-review using the same quality standards from
    references/roles/reviewer.md
    . This is the expected degradation path — the review must still happen, just without the cross-model perspective.
  • Exit code 1: Script error (bad args, missing file). Fix and retry.
  • 退出码0:Gemini已响应。读取输出文件并提取结构化审查报告。
  • 退出码2:所有Gemini模型不可用。降级为Claude自审查,使用
    references/roles/reviewer.md
    中的相同质量标准。这是预期的降级路径——审查仍需进行,只是缺少跨模型验证视角。
  • 退出码1:脚本错误(参数错误、文件缺失)。修复后重试。

Step 5: Write the final review

步骤5:生成最终审查报告

Whether from Gemini or Claude fallback, write the structured review to
${run_dir}/reviews/review-{nn}.md
using the output format defined in
references/roles/reviewer.md
.

无论结果来自Gemini还是Claude降级审查,都需按照
references/roles/reviewer.md
定义的输出格式,将结构化审查报告写入
${run_dir}/reviews/review-{nn}.md

Prompt Templates

提示词模板

Role: reviewer — SVG Quality Review

角色:reviewer — SVG质量审查

bash
npx tsx scripts/invoke-gemini-ppt.ts \
  --role reviewer \
  --output "${RUN_DIR}/reviews/gemini-raw-${N}.md" \
  --prompt "
bash
npx tsx scripts/invoke-gemini-ppt.ts \
  --role reviewer \
  --output "${RUN_DIR}/reviews/gemini-raw-${N}.md" \
  --prompt "

Task

任务

Review the SVG presentation slide for design quality.
审查SVG演示文稿幻灯片的设计质量。

Slide Content

幻灯片内容

${SVG_CONTENT}
${SVG_CONTENT}

Style Reference

样式参考

${STYLE_NAME} style with tokens: ${STYLE_TOKENS}
${STYLE_NAME} 样式,令牌值:${STYLE_TOKENS}

Review Criteria

审查标准

  1. Layout Balance: card arrangement, visual weight distribution, whitespace usage
  2. Color Harmony: palette consistency, contrast ratios, accent usage
  3. Typography: hierarchy clarity, font size appropriateness, line spacing
  4. Readability: text legibility at presentation resolution, information flow
  5. Information Density: content-to-whitespace ratio, cognitive load
  1. 布局平衡:卡片排列、视觉权重分布、留白使用
  2. 色彩协调:调色板一致性、对比度、强调色使用
  3. 排版:层级清晰度、字体大小合理性、行间距
  4. 可读性:演示分辨率下的文本易读性、信息流
  5. 信息密度:内容与留白比例、认知负荷

Output Format

输出格式

Structured review with:
  • overall_score: 1-10
  • pass: true/false (pass if >= 7)
  • per-criterion scores and notes
  • issues: list of specific problems with severity (critical/major/minor)
  • fixes: actionable suggestions for each issue with specific values "

---
结构化审查报告包含:
  • overall_score: 1-10分
  • pass: true/false(≥7分通过)
  • 各标准的分数和说明
  • issues: 具体问题列表及严重程度(严重/主要/次要)
  • fixes: 每个问题的可操作修复建议及具体数值 "

---

Fallback Strategy

降级策略

The dual-model approach (Claude generates, Gemini reviews) provides value through independent perspective. When Gemini is unavailable, the review-core agent should:
  1. Read
    references/roles/reviewer.md
    for quality standards and methodology.
  2. Apply the same structured review process: 5 criteria, numeric scores, pass/fail gate, issue severity, actionable fixes.
  3. Mark the review as "Claude self-review" in the output header so downstream consumers know it was not cross-model validated.
The review quality standards (14px min font, 20px min gap, WCAG AA contrast, 7±2 info units) are the same regardless of which model performs the review.

双模型方案(Claude生成内容,Gemini审查)通过独立视角提升价值。当Gemini不可用时,review-core agent应:
  1. 读取
    references/roles/reviewer.md
    中的质量标准和方法。
  2. 应用相同的结构化审查流程:5项标准、数字评分、通过/未通过门槛、问题严重程度、可操作修复建议。
  3. 在输出头部标记为“Claude自审查”,以便下游消费者知晓该报告未经过跨模型验证。
无论由哪个模型执行审查,审查质量标准(最小14px字体、最小20px间距、WCAG AA对比度、7±2个信息单元)保持一致。

Constraints

约束条件

RequiredForbidden
MUST attempt Gemini via script firstSkip Gemini without trying
MUST fall back to self-review on exit 2Fail the entire review if Gemini is down
MUST use reviewer role quality standardsSend generic/empty prompts to Gemini
MUST persist output to run_dir artifactsDiscard Gemini output
Review MUST produce structured scoresReturn vague qualitative-only feedback
MUST include SVG source in the promptReview based on filename alone
必须执行禁止操作
必须首先通过脚本尝试调用Gemini未尝试直接跳过Gemini
退出码为2时必须降级为自审查若Gemini不可用则终止整个审查流程
必须使用reviewer角色的质量标准向Gemini发送通用/空提示词
必须将输出保存到run_dir工件目录丢弃Gemini的输出结果
审查必须生成结构化评分返回模糊的纯定性反馈
必须在提示词中包含SVG源代码仅根据文件名进行审查

Collaboration

协作机制

  1. review-core agent invokes
    reviewer
    role for SVG quality assessment
  2. Review output feeds back to slide-core for fix iterations
  1. review-core agent调用
    reviewer
    角色进行SVG质量评估
  2. 审查结果反馈给slide-core以进行迭代修复