gemini

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Gemini

Gemini

Overview

概述

Run Gemini CLI as a required decision and planning partner before coding actions. This skill enforces
--approval-mode plan
(read-only) and structured prompts, and supports continuing the same Gemini conversation with
--resume
.
在执行编码操作前,将Gemini CLI作为必需的决策与规划伙伴使用。该技能强制启用
--approval-mode plan
(只读模式)和结构化提示词,并支持通过
--resume
继续同一场Gemini对话。

Mandatory Workflow

强制工作流

  1. Gather context first from local files, logs, and constraints.
  2. Call Gemini before major decisions, planning, debugging, and hard problem solving:
    • scripts/gemini-consult.sh ask --mode <mode> --task "<task>" ...
  3. If the answer is incomplete, continue the same conversation:
    • scripts/gemini-consult.sh followup --resume latest --prompt "<follow-up question>"
  4. Implement only after synthesizing Gemini's recommendations with local repo evidence.
  1. 首先从本地文件、日志和约束条件中收集上下文信息。
  2. 在做出重大决策、规划、调试和解决难题前调用Gemini:
    • scripts/gemini-consult.sh ask --mode <mode> --task "<task>" ...
  3. 如果回答不完整,继续同一场对话:
    • scripts/gemini-consult.sh followup --resume latest --prompt "<follow-up question>"
  4. 仅在结合Gemini的建议与本地仓库实际情况后再进行实现。

Evidence-First Quality Rule

证据优先质量规则

  • Gemini must inspect relevant codebase artifacts before giving decisions or plans.
  • Output must include explicit evidence:
    • codebase paths and key symbols/literals used for conclusions
    • external source URLs in format
      URL (accessed YYYY-MM-DD)
      when external/version-sensitive claims are made
  • Unknowns must be explicitly marked as
    UNVERIFIED
    ; no unstated assumptions.
  • If evidence is insufficient, return
    UNVERIFIED
    findings and next evidence-gathering steps instead of definitive conclusions.
  • Output must not include tool-control chatter (for example: "submitting plan", "exit plan mode").
  • Gemini在给出决策或规划前必须检查相关的代码库工件。
  • 输出内容必须包含明确的证据:
    • 用于得出结论的代码库路径和关键符号/字面量
    • 当涉及外部或版本敏感的声明时,需以
      URL (accessed YYYY-MM-DD)
      格式标注外部源链接
  • 未知内容必须明确标记为
    UNVERIFIED
    ;不得有未说明的假设。
  • 如果证据不足,应返回
    UNVERIFIED
    的结论以及下一步收集证据的步骤,而非给出确定性结论。
  • 输出内容不得包含工具控制类的冗余信息(例如:"submitting plan", "exit plan mode")。

Code Reference Rule

代码参考规则

  • frontend
    tasks: consultation is mandatory and must return full implementation package output.
  • Non-frontend tasks: before editing code, request Gemini code references when needed.
  • For non-frontend modes, force full implementation package output with:
    • scripts/gemini-consult.sh ask --mode <mode> --implementation-package --task "<task>"
  • frontend
    任务:必须进行咨询,且返回结果需包含完整的实现包输出。
  • 非前端任务:在编辑代码前,必要时请求Gemini提供代码参考。
  • 对于非前端模式,可通过以下命令强制输出完整实现包:
    • scripts/gemini-consult.sh ask --mode <mode> --implementation-package --task "<task>"

Mode Selection

模式选择

Use the right mode when running
ask
:
  • decision
    : Compare options, tradeoffs, and make a recommendation.
  • plan
    : Build a step-by-step execution plan with risk controls.
  • debug
    : Produce a root-cause-first debugging strategy.
  • problem-solving
    : Decompose hard/ambiguous problems and pick an approach.
  • pre-implement
    : Produce implementation strategy before writing code.
  • frontend
    : Produce implementation-ready FE plan with code-level detail.
运行
ask
命令时,请选择合适的模式:
  • decision
    :对比选项、权衡利弊并给出推荐方案。
  • plan
    :构建包含风险控制的分步执行计划。
  • debug
    :生成以根因为先的调试策略。
  • problem-solving
    :拆解复杂/模糊的问题并选择合适的解决方法。
  • pre-implement
    :在编写代码前制定实现策略。
  • frontend
    :生成可直接实现的前端计划,包含代码级细节。

Frontend Rule (Strict)

前端规则(严格)

For FE work, always use
--mode frontend
and require output that is immediately implementable, including:
  • Component/page hierarchy and responsibilities
  • State and data flow design
  • API contract expectations and error/loading states
  • Responsive behavior (mobile + desktop)
  • Accessibility requirements
  • Styling/theming strategy
  • Complete file tree for the target feature/page
  • Full copy-paste-ready code for core files (not pseudocode)
  • At least one test file with runnable test logic
  • Short runbook (deps, wiring steps, run command)
If Gemini returns only high-level guidance or partial snippets, continue with:
  • scripts/gemini-consult.sh followup --resume latest --prompt "Regenerate as full implementation package with complete file contents."
对于前端工作,始终使用
--mode frontend
,且要求输出内容可直接用于实现,包括:
  • 组件/页面层级结构及职责划分
  • 状态与数据流设计
  • API契约预期以及错误/加载状态处理
  • 响应式行为(移动端+桌面端)
  • 无障碍访问要求
  • 样式/主题策略
  • 目标功能/页面的完整文件目录
  • 核心文件的可直接复制粘贴的完整代码(而非伪代码)
  • 至少一个包含可运行测试逻辑的测试文件
  • 简短的操作手册(依赖项、配置步骤、运行命令)
如果Gemini仅返回高层级指导或部分代码片段,请通过以下命令继续对话:
  • scripts/gemini-consult.sh followup --resume latest --prompt "Regenerate as full implementation package with complete file contents."

Commands

命令示例

bash
undefined
bash
undefined

New consultation

新的咨询会话

scripts/gemini-consult.sh ask
--mode pre-implement
--task "Implement optimistic UI for comment posting"
--context-file docs/requirements.md
--context-file src/features/comments/api.ts
scripts/gemini-consult.sh ask
--mode pre-implement
--task "Implement optimistic UI for comment posting"
--context-file docs/requirements.md
--context-file src/features/comments/api.ts

Frontend-specific consultation (must include code-level plan)

前端专属咨询(必须包含代码级计划)

scripts/gemini-consult.sh ask
--mode frontend
--task "Redesign checkout page for mobile-first UX and keep desktop parity"
--context-file src/pages/checkout.tsx
scripts/gemini-consult.sh ask
--mode frontend
--task "Redesign checkout page for mobile-first UX and keep desktop parity"
--context-file src/pages/checkout.tsx

Non-frontend: request full code reference package when needed

非前端场景:必要时请求完整代码参考包

scripts/gemini-consult.sh ask
--mode pre-implement
--implementation-package
--task "Refactor token refresh flow in auth middleware"
--context-file src/auth/middleware.ts
scripts/gemini-consult.sh ask
--mode pre-implement
--implementation-package
--task "Refactor token refresh flow in auth middleware"
--context-file src/auth/middleware.ts

Continue the same Gemini conversation

继续同一场Gemini对话

scripts/gemini-consult.sh followup
--resume latest
--prompt "Refine step 3 with concrete React component code"
scripts/gemini-consult.sh followup
--resume latest
--prompt "Refine step 3 with concrete React component code"

Inspect available sessions

查看可用会话

scripts/gemini-consult.sh sessions
undefined
scripts/gemini-consult.sh sessions
undefined

Hard Constraints

硬性约束

  • Allow Gemini to use read-only tools for codebase exploration and web/documentation lookup.
  • Never use Gemini to modify codebase files in this workflow.
  • Keep Gemini in read-only mode via
    --approval-mode plan
    (enforced by script).
  • Default model is fixed to
    gemini-3.1-pro-preview
    .
  • Treat Gemini output as decision support; verify against local code before implementing.
  • 允许Gemini使用只读工具探索代码库、查阅网页/文档。
  • 在此工作流中,绝不使用Gemini修改代码库文件。
  • 通过脚本强制将Gemini保持在只读模式(
    --approval-mode plan
    )。
  • 默认模型固定为
    gemini-3.1-pro-preview
  • 将Gemini的输出视为决策支持;在实现前需与本地代码进行验证。

Resources

资源

  • scripts/gemini-consult.sh
    : Wrapper for read-only Gemini consultation and session continuation.
  • references/prompt-recipes.md
    : Prompt recipes and quality checklist by mode.
  • scripts/gemini-consult.sh
    :用于只读Gemini咨询及会话续接的封装脚本。
  • references/prompt-recipes.md
    :按模式分类的提示词模板及质量检查清单。