Search first

From SiniyaYousuf/everything_claudecode · View interactive version

Search first is an AI agent skill from the GitHub repository SiniyaYousuf/everything_claudecode. 研究优先于编码的工作流程。在编写自定义代码之前,搜索现有的工具、库和模式。调用研究员代理。

How to use this skill

Skill file

/search-first — 编码前先研究

系统化“在实现之前先寻找现有解决方案”的工作流程。

触发时机

在以下情况使用此技能:

工作流程

┌─────────────────────────────────────────────┐
│  1. NEED ANALYSIS                           │
│     Define what functionality is needed      │
│     Identify language/framework constraints  │
├─────────────────────────────────────────────┤
│  2. PARALLEL SEARCH (researcher agent)      │
│     ┌──────────┐ ┌──────────┐ ┌──────────┐  │
│     │  npm /   │ │  MCP /   │ │  GitHub / │  │
│     │  PyPI    │ │  Skills  │ │  Web      │  │
│     └──────────┘ └──────────┘ └──────────┘  │
├─────────────────────────────────────────────┤
│  3. EVALUATE                                │
│     Score candidates (functionality, maint, │
│     community, docs, license, deps)         │
├─────────────────────────────────────────────┤
│  4. DECIDE                                  │
│     ┌─────────┐  ┌──────────┐  ┌─────────┐  │
│     │  Adopt  │  │  Extend  │  │  Build   │  │
│     │ as-is   │  │  /Wrap   │  │  Custom  │  │
│     └─────────┘  └──────────┘  └─────────┘  │
├─────────────────────────────────────────────┤
│  5. IMPLEMENT                               │
│     Install package / Configure MCP /       │
│     Write minimal custom code               │
└─────────────────────────────────────────────┘

决策矩阵

| 信号 | 行动 |

|--------|--------|

| 完全匹配,维护良好,MIT/Apache 许可证 | 采纳 — 直接安装并使用 |

| 部分匹配,基础良好 | 扩展 — 安装 + 编写薄封装层 |

| 多个弱匹配 | 组合 — 组合 2-3 个小包 |

| 未找到合适的 | 构建 — 编写自定义代码,但需基于研究 |

使用方法

快速模式(内联)

在编写实用程序或添加功能之前,在脑中过一遍:

  1. 这已经在仓库中存在吗? → 首先通过相关模块/测试检查 rg
  2. 这是一个常见问题吗? → 搜索 npm/PyPI
  3. 有对应的 MCP 吗? → 检查 ~/.claude/settings.json 并进行搜索
  4. 有对应的技能吗? → 检查 ~/.claude/skills/
  5. 有 GitHub 上的实现/模板吗? → 在编写全新代码之前,先运行 GitHub 代码搜索以查找维护中的开源项目

完整模式(代理)

对于非平凡的功能,启动研究员代理:

Task(subagent_type="general-purpose", prompt="
  Research existing tools for: [DESCRIPTION]
  Language/framework: [LANG]
  Constraints: [ANY]

  Search: npm/PyPI, MCP servers, Claude Code skills, GitHub
  Return: Structured comparison with recommendation
")

按类别搜索快捷方式

开发工具

AI/LLM 集成

数据与 API

内容与发布

集成点

与规划器代理

规划器应在阶段 1(架构评审)之前调用研究员:

与架构师代理

架构师应向研究员咨询:

与迭代检索技能

结合进行渐进式发现:

示例

示例 1:“添加死链检查”

Need: Check markdown files for broken links
Search: npm "markdown dead link checker"
Found: textlint-rule-no-dead-link (score: 9/10)
Action: ADOPT — npm install textlint-rule-no-dead-link
Result: Zero custom code, battle-tested solution

示例 2:“添加 HTTP 客户端包装器”

Need: Resilient HTTP client with retries and timeout handling
Search: npm "http client retry", PyPI "httpx retry"
Found: got (Node) with retry plugin, httpx (Python) with built-in retry
Action: ADOPT — use got/httpx directly with retry config
Result: Zero custom code, production-proven libraries

示例 3:“添加配置文件 linter”

Need: Validate project config files against a schema
Search: npm "config linter schema", "json schema validator cli"
Found: ajv-cli (score: 8/10)
Action: ADOPT + EXTEND — install ajv-cli, write project-specific schema
Result: 1 package + 1 schema file, no custom validation logic

反模式

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.