search-first

研究优先于编码的工作流程。在编写自定义代码之前,搜索现有的工具、库和模式。调用研究员代理。

351 stars

Best use case

search-first is best used when you need a repeatable AI agent workflow instead of a one-off prompt. It is especially useful for teams working in multi. 研究优先于编码的工作流程。在编写自定义代码之前,搜索现有的工具、库和模式。调用研究员代理。

研究优先于编码的工作流程。在编写自定义代码之前,搜索现有的工具、库和模式。调用研究员代理。

Users should expect a more consistent workflow output, faster repeated execution, and less time spent rewriting prompts from scratch.

Practical example

Example input

Use the "search-first" skill to help with this workflow task. Context: 研究优先于编码的工作流程。在编写自定义代码之前,搜索现有的工具、库和模式。调用研究员代理。

Example output

A structured workflow result with clearer steps, more consistent formatting, and an output that is easier to reuse in the next run.

When to use this skill

  • Use this skill when you want a reusable workflow rather than writing the same prompt again and again.

When not to use this skill

  • Do not use this when you only need a one-off answer and do not need a reusable workflow.
  • Do not use it if you cannot install or maintain the related files, repository context, or supporting tools.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/search-first/SKILL.md --create-dirs "https://raw.githubusercontent.com/xu-xiang/everything-claude-code-zh/main/docs/zh-CN/skills/search-first/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/search-first/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How search-first Compares

Feature / Agentsearch-firstStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

研究优先于编码的工作流程。在编写自定义代码之前,搜索现有的工具、库和模式。调用研究员代理。

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# /search-first — 编码前先研究

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

## 触发时机

在以下情况使用此技能:

* 开始一项很可能已有解决方案的新功能
* 添加依赖项或集成
* 用户要求“添加 X 功能”而你准备开始编写代码
* 在创建新的实用程序、助手或抽象之前

## 工作流程

```
┌─────────────────────────────────────────────┐
│  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. 这是常见问题吗? → 搜索 npm/PyPI
2. 有相关的 MCP 吗? → 检查 `~/.claude/settings.json` 并搜索
3. 有相关的技能吗? → 检查 `~/.claude/skills/`
4. 有 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
")
```

## 按类别搜索快捷方式

### 开发工具

* Linting → `eslint`, `ruff`, `textlint`, `markdownlint`
* Formatting → `prettier`, `black`, `gofmt`
* Testing → `jest`, `pytest`, `go test`
* Pre-commit → `husky`, `lint-staged`, `pre-commit`

### AI/LLM 集成

* Claude SDK → 使用 Context7 获取最新文档
* 提示词管理 → 检查 MCP 服务器
* 文档处理 → `unstructured`, `pdfplumber`, `mammoth`

### 数据与 API

* HTTP 客户端 → `httpx` (Python), `ky`/`got` (Node)
* 验证 → `zod` (TS), `pydantic` (Python)
* 数据库 → 首先检查是否有 MCP 服务器

### 内容与发布

* Markdown 处理 → `remark`, `unified`, `markdown-it`
* 图片优化 → `sharp`, `imagemin`

## 集成点

### 与规划器代理

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

* 研究员识别可用的工具
* 规划器将它们纳入实施计划
* 避免在计划中“重新发明轮子”

### 与架构师代理

架构师应向研究员咨询:

* 技术栈决策
* 集成模式发现
* 现有参考架构

### 与迭代检索技能

结合进行渐进式发现:

* 循环 1:广泛搜索 (npm, PyPI, MCP)
* 循环 2:详细评估顶级候选方案
* 循环 3:测试与项目约束的兼容性

## 示例

### 示例 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
```

## 反模式

* **直接跳转到编码**:不检查是否存在就编写实用程序
* **忽略 MCP**:不检查 MCP 服务器是否已提供该能力
* **过度定制**:对库进行如此厚重的包装以至于失去了其优势
* **依赖项膨胀**:为了一个小功能安装一个庞大的包

Related Skills

market-research

351
from xu-xiang/everything-claude-code-zh

开展市场研究、竞争分析、投资者尽职调查和行业情报收集,提供来源引用和决策导向的总结。适用于用户需要市场规模测算、竞争对手比较、基金研究、技术扫描或为业务决策提供信息支持的研究场景。

plankton-code-quality

351
from xu-xiang/everything-claude-code-zh

使用 Plankton 实现编写时代码质量强制执行 —— 通过钩子在每次文件编辑时进行自动格式化、代码检查,并由 Claude 驱动自动修复。

autonomous-loops

351
from xu-xiang/everything-claude-code-zh

自主运行 Claude Code 循环的模式与架构 —— 从简单的顺序流水线到 RFC 驱动的多智能体 DAG 系统。

visa-doc-translate

351
from xu-xiang/everything-claude-code-zh

将签证申请文件(图片)翻译成英文,并创建包含原文和译文的双语PDF

swiftui-patterns

351
from xu-xiang/everything-claude-code-zh

SwiftUI 架构模式,使用 @Observable 进行状态管理,视图组合,导航,性能优化,以及现代 iOS/macOS UI 最佳实践。

swift-protocol-di-testing

351
from xu-xiang/everything-claude-code-zh

基于协议的依赖注入,用于可测试的Swift代码——使用聚焦协议和Swift Testing模拟文件系统、网络和外部API。

swift-concurrency-6-2

351
from xu-xiang/everything-claude-code-zh

Swift 6.2 可接近的并发性 — 默认单线程,@concurrent 用于显式后台卸载,隔离一致性用于主 actor 类型。

swift-actor-persistence

351
from xu-xiang/everything-claude-code-zh

在 Swift 中使用 actor 实现线程安全的数据持久化——基于内存缓存与文件支持的存储,通过设计消除数据竞争。

skill-stocktake

351
from xu-xiang/everything-claude-code-zh

用于审计Claude技能和命令的质量。支持快速扫描(仅变更技能)和全面盘点模式,采用顺序子代理批量评估。

regex-vs-llm-structured-text

351
from xu-xiang/everything-claude-code-zh

选择在解析结构化文本时使用正则表达式还是大型语言模型的决策框架——从正则表达式开始,仅在低置信度的边缘情况下添加大型语言模型。

liquid-glass-design

351
from xu-xiang/everything-claude-code-zh

iOS 26 液态玻璃设计系统 — 适用于 SwiftUI、UIKit 和 WidgetKit 的动态玻璃材质,具有模糊、反射和交互式变形效果。

foundation-models-on-device

351
from xu-xiang/everything-claude-code-zh

苹果FoundationModels框架用于设备上的LLM——文本生成、使用@Generable进行引导生成、工具调用,以及在iOS 26+中的快照流。