multi-model-discovery

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
<!-- S0 META-IDENTITY -->
<!-- S0 META-IDENTITY -->

Multi-Model Discovery Skill

多模型发现Skill



LIBRARY-FIRST PROTOCOL (MANDATORY)

库优先协议(强制要求)

Before writing ANY code, you MUST check:
在编写任何代码前,你必须检查:

Step 1: Library Catalog

步骤1:库目录

  • Location:
    .claude/library/catalog.json
  • If match >70%: REUSE or ADAPT
  • 位置:
    .claude/library/catalog.json
  • 如果匹配度>70%:复用或适配

Step 2: Patterns Guide

步骤2:模式指南

  • Location:
    .claude/docs/inventories/LIBRARY-PATTERNS-GUIDE.md
  • If pattern exists: FOLLOW documented approach
  • 位置:
    .claude/docs/inventories/LIBRARY-PATTERNS-GUIDE.md
  • 如果模式已存在:遵循文档记录的方法

Step 3: Existing Projects

步骤3:现有项目

  • Location:
    D:\Projects\*
  • If found: EXTRACT and adapt
  • 位置:
    D:\Projects\*
  • 如果找到:提取并适配

Decision Matrix

决策矩阵

MatchAction
Library >90%REUSE directly
Library 70-90%ADAPT minimally
Pattern existsFOLLOW pattern
In projectEXTRACT
No matchBUILD (add to library after)

匹配度操作
库匹配度>90%直接复用
库匹配度70-90%最小程度适配
模式已存在遵循模式
存在于项目中提取
无匹配项开发(完成后添加到库中)

Kanitsal Cerceve (Evidential Frame Activation)

Kanitsal Cerceve(证据框架激活)

Kaynak dogrulama modu etkin.
源验证模式已激活。

Purpose

目标

Use Gemini CLI's Google Search grounding capability to discover existing solutions before implementing from scratch. This skill embodies the principle: "Don't reinvent the wheel."
利用Gemini CLI的Google Search grounding功能,在从零开始实现前发现现有解决方案。本Skill遵循原则:“不要重复造轮子。”

When to Use This Skill

何时使用本Skill

  • Before implementing a new feature (find existing solutions first)
  • When researching best practices for a technology
  • When looking for code examples or patterns
  • When evaluating libraries or frameworks
  • When unsure if a problem has already been solved
  • Before writing boilerplate code that might exist
  • 在实现新功能前(先查找现有解决方案)
  • 研究某项技术的最佳实践时
  • 寻找代码示例或模式时
  • 评估库或框架时
  • 不确定问题是否已被解决时
  • 编写可能已存在的样板代码前

When NOT to Use This Skill

何时不使用本Skill

  • For implementation tasks (use codex-iterative-fix instead)
  • When you already know the solution exists in the codebase
  • For debugging existing code (use smart-bug-fix)
  • For codebase analysis (use gemini-codebase-onboard)
  • 用于实现任务(改用codex-iterative-fix)
  • 你已知道解决方案存在于代码库中时
  • 用于调试现有代码(改用smart-bug-fix)
  • 用于代码库分析(改用gemini-codebase-onboard)

Workflow

工作流程

Phase 1: Research Query Formulation

阶段1:研究查询构建

  1. Analyze the implementation goal
  2. Formulate search queries for:
    • Existing libraries/packages
    • Code examples on GitHub
    • Best practice guides
    • Common patterns
  1. 分析实现目标
  2. 构建以下搜索查询:
    • 现有库/包
    • GitHub上的代码示例
    • 最佳实践指南
    • 常见模式

Phase 2: Gemini Discovery Execution

阶段2:Gemini发现执行

bash
undefined
bash
undefined

Execute via delegate.sh wrapper

通过delegate.sh包装器执行

./scripts/multi-model/delegate.sh gemini "Find existing solutions for: {goal}"
./scripts/multi-model/delegate.sh gemini "Find existing solutions for: {goal}"

Or via gemini-yolo.sh

或通过gemini-yolo.sh执行

./scripts/multi-model/gemini-yolo.sh "How do others implement {feature}? Find code examples and libraries." task-id research
undefined
./scripts/multi-model/gemini-yolo.sh "How do others implement {feature}? Find code examples and libraries." task-id research
undefined

Phase 3: Results Synthesis

阶段3:结果整合

  1. Claude synthesizes Gemini's findings
  2. Evaluate options:
    • Use existing library
    • Adapt existing pattern
    • Build from scratch (last resort)
  3. Document decision rationale
  1. Claude整合Gemini的发现结果
  2. 评估选项:
    • 使用现有库
    • 适配现有模式
    • 从零开始开发(最后选择)
  3. 记录决策理由

Success Criteria

成功标准

  • Existing solution found and evaluated
  • Build vs buy decision made with evidence
  • Time saved by avoiding reinvention
  • Quality improved by using proven patterns
  • 找到并评估现有解决方案
  • 基于证据做出自研 vs 选用的决策
  • 通过避免重复造轮子节省时间
  • 通过使用已验证的模式提升质量

Example Usage

使用示例

Example 1: Auth Implementation

示例1:身份验证实现

text
User: "Implement user authentication"

Discovery Process:
1. Gemini search: "What are best practices for auth in Node.js?"
2. Gemini search: "Find existing auth libraries: passport, next-auth, lucia"
3. Gemini search: "Code examples for JWT authentication Node.js"

Output:
- Recommended: next-auth (well-maintained, 40k+ stars)
- Alternative: lucia-auth (newer, type-safe)
- Pattern found: middleware-based validation
text
用户:"实现用户身份验证"

发现流程:
1. Gemini搜索:"Node.js身份验证的最佳实践有哪些?"
2. Gemini搜索:"查找现有身份验证库:passport、next-auth、lucia"
3. Gemini搜索:"Node.js的JWT身份验证代码示例"

输出结果:
- 推荐:next-auth(维护良好,40k+星标)
- 替代方案:lucia-auth(较新,类型安全)
- 找到模式:基于中间件的验证

Example 2: PDF Generation

示例2:PDF生成

text
User: "Generate PDF reports from data"

Discovery Process:
1. Gemini search: "PDF generation libraries JavaScript 2024"
2. Gemini search: "Compare pdfkit vs puppeteer vs react-pdf"
3. Gemini search: "Production PDF generation best practices"

Output:
- Simple PDFs: pdfkit (lightweight)
- Complex layouts: puppeteer (HTML to PDF)
- React apps: react-pdf
text
用户:"根据数据生成PDF报告"

发现流程:
1. Gemini搜索:"2024年JavaScript PDF生成库"
2. Gemini搜索:"对比pdfkit、puppeteer和react-pdf"
3. Gemini搜索:"生产环境PDF生成最佳实践"

输出结果:
- 简单PDF:pdfkit(轻量)
- 复杂布局:puppeteer(HTML转PDF)
- React应用:react-pdf

Integration with Meta-Loop

与Meta-Loop的集成

META-LOOP PROPOSE PHASE:
    |
    +---> multi-model-discovery
    |         |
    |         +---> Gemini: Find existing solutions
    |         +---> Claude: Evaluate options
    |         +---> Decision: Build vs Adapt vs Use
    |
    +---> Continue to IMPLEMENT phase
META-LOOP提议阶段:
    |
    +---> multi-model-discovery
    |         |
    |         +---> Gemini: 查找现有解决方案
    |         +---> Claude: 评估选项
    |         +---> 决策:自研 vs 适配 vs 选用
    |
    +---> 进入实现阶段

Memory Integration

内存集成

Results stored at:
  • Key:
    multi-model/discovery/{project}/{task_id}
  • Tags: WHO=multi-model-discovery, WHY=avoid-reinvention
结果存储于:
  • 键:
    multi-model/discovery/{project}/{task_id}
  • 标签:WHO=multi-model-discovery, WHY=avoid-reinvention

Invocation Pattern

调用模式

bash
undefined
bash
undefined

Via router (automatic detection)

通过路由器(自动检测)

./scripts/multi-model/multi-model-router.sh "Find existing solutions for X"
./scripts/multi-model/multi-model-router.sh "Find existing solutions for X"

Direct Gemini call

直接调用Gemini

bash -lc "gemini 'How do others implement X? Find code examples and libraries.'"
undefined
bash -lc "gemini 'How do others implement X? Find code examples and libraries.'"
undefined

Related Skills

相关Skill

  • gemini-research
    : General research with search grounding
  • gemini-megacontext
    : Full codebase analysis
  • codex-iterative-fix
    : After discovery, for implementation
  • literature-synthesis
    : Academic research synthesis
<!-- S4 SUCCESS CRITERIA -->
  • gemini-research
    : 基于搜索grounding的通用研究
  • gemini-megacontext
    : 全代码库分析
  • codex-iterative-fix
    : 发现完成后用于实现
  • literature-synthesis
    : 学术研究整合
<!-- S4 SUCCESS CRITERIA -->

Verification Checklist

验证清单

  • Gemini search executed with clear queries
  • Multiple solutions discovered and compared
  • Build vs buy decision documented
  • Memory-MCP updated with findings
  • Decision rationale captured
<!-- PROMISE -->
[commit|confident] <promise>MULTI_MODEL_DISCOVERY_COMPLETE</promise>
  • 使用清晰的查询执行Gemini搜索
  • 发现并对比多种解决方案
  • 记录自研 vs 选用的决策
  • 更新Memory-MCP以保存发现结果
  • 记录决策理由
<!-- PROMISE -->
[commit|confident] <promise>MULTI_MODEL_DISCOVERY_COMPLETE</promise>