gemini
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGemini
Gemini
Overview
概述
Run Gemini CLI as a required decision and planning partner before coding actions.
This skill enforces (read-only) and structured prompts, and supports continuing the same Gemini conversation with .
--approval-mode plan--resume在执行编码操作前,将Gemini CLI作为必需的决策与规划伙伴使用。该技能强制启用(只读模式)和结构化提示词,并支持通过继续同一场Gemini对话。
--approval-mode plan--resumeMandatory Workflow
强制工作流
- Gather context first from local files, logs, and constraints.
- Call Gemini before major decisions, planning, debugging, and hard problem solving:
scripts/gemini-consult.sh ask --mode <mode> --task "<task>" ...
- If the answer is incomplete, continue the same conversation:
scripts/gemini-consult.sh followup --resume latest --prompt "<follow-up question>"
- Implement only after synthesizing Gemini's recommendations with local repo evidence.
- 首先从本地文件、日志和约束条件中收集上下文信息。
- 在做出重大决策、规划、调试和解决难题前调用Gemini:
scripts/gemini-consult.sh ask --mode <mode> --task "<task>" ...
- 如果回答不完整,继续同一场对话:
scripts/gemini-consult.sh followup --resume latest --prompt "<follow-up question>"
- 仅在结合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 when external/version-sensitive claims are made
URL (accessed YYYY-MM-DD)
- Unknowns must be explicitly marked as ; no unstated assumptions.
UNVERIFIED - If evidence is insufficient, return findings and next evidence-gathering steps instead of definitive conclusions.
UNVERIFIED - 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
代码参考规则
- tasks: consultation is mandatory and must return full implementation package output.
frontend - 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- : Compare options, tradeoffs, and make a recommendation.
decision - : Build a step-by-step execution plan with risk controls.
plan - : Produce a root-cause-first debugging strategy.
debug - : Decompose hard/ambiguous problems and pick an approach.
problem-solving - : Produce implementation strategy before writing code.
pre-implement - : Produce implementation-ready FE plan with code-level detail.
frontend
运行命令时,请选择合适的模式:
ask- :对比选项、权衡利弊并给出推荐方案。
decision - :构建包含风险控制的分步执行计划。
plan - :生成以根因为先的调试策略。
debug - :拆解复杂/模糊的问题并选择合适的解决方法。
problem-solving - :在编写代码前制定实现策略。
pre-implement - :生成可直接实现的前端计划,包含代码级细节。
frontend
Frontend Rule (Strict)
前端规则(严格)
For FE work, always use and require output that is immediately implementable, including:
--mode frontend- 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
undefinedbash
undefinedNew 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
--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
--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
--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
--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
--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
--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"
--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"
--resume latest
--prompt "Refine step 3 with concrete React component code"
Inspect available sessions
查看可用会话
scripts/gemini-consult.sh sessions
undefinedscripts/gemini-consult.sh sessions
undefinedHard 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 (enforced by script).
--approval-mode plan - 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
资源
- : Wrapper for read-only Gemini consultation and session continuation.
scripts/gemini-consult.sh - : Prompt recipes and quality checklist by mode.
references/prompt-recipes.md
- :用于只读Gemini咨询及会话续接的封装脚本。
scripts/gemini-consult.sh - :按模式分类的提示词模板及质量检查清单。
references/prompt-recipes.md