SuperAPI AI 工具集

gemini-explore

通用与其它

查看项目

更新于 10-16 06:46

技能介绍

用途:把整个代码库的探索工作委托给 Gemini CLI,借助其大上下文窗口生成结构化 Markdown 报告,供 Claude 读取和使用。适用于开始接触不熟悉的代码库、代码库超出 Claude 有效工作上下文(约 50K tokens)、需要在实现前全面理解架构,或跨 monorepo 映射依赖关系时。

前置条件:已安装并配置 Gemini CLI(npm install -g @google/gemini-cli 或 brew install gemini-cli);环境中已配置有效的 Google AI API 密钥。

用法:命令为 /google-ecosystem:gemini-explore [scope] [--output <path>]。第一个参数可选,默认为 all。scope 可选 architecture(高层结构、模块、入口点)、dependencies(包依赖、导入、关系)、patterns(设计模式、约定、代码风格)、all(全面探索)。--output <path> 指定报告输出路径,默认 docs/ai-artifacts/explorations/。--pro 强制使用 Gemini Pro 模型,适合超大代码库(超过 1M tokens)。

执行流程:先估算 token 数,再据此或 --pro 标志选择模型,默认使用 Gemini Flash(gemini-2.5-flash),超过约 1M tokens 或指定 --pro 时使用 gemini-2.5-pro;接着按 scope 构建提示词,收集源码文件(自动排除 node_modules、.git、dist、build、pycache、.next 等目录),调用 gemini 执行探索,解析结果并生成带 YAML frontmatter 的 Markdown 报告,最后保存到指定目录。

token 阈值指引:小于 50K 建议用 Claude 原生探索;50K–500K 用 Gemini Flash;500K–1M 用 Gemini Flash 分块;超过 1M 用 Gemini Pro(加 --pro)。

限制与说明:默认使用 Flash 模型以控制成本;报告默认保存到 git 跟踪的 docs/ai-artifacts/explorations/,并报告 token 用量以便成本感知;输出专为 Claude 阅读和后续操作设计。具体价格与平台可用性资料未提供。