search-first
affaan-m/ECC
연구 에이전트를 호출하여 사용자 정의 코드를 작성하기 전에 기존 도구, 라이브러리 및 패턴을 조사하십시오.
...모든 것을 확장하십시오/search-first — 코딩하기 전에 조사하기
"구현 전에 기존 해결책을 먼저 찾아보는" 워크플로를 체계화합니다.
트리거
다음과 같은 경우에 이 기술을 활용하세요:
- 기존 해결책이 있을 가능성이 높은 새로운 기능을 시작할 때
- 의존성이나 통합 기능을 추가할 때
- 사용자가 "X 기능을 추가해 주세요"라고 요청했고, 코드를 작성하려 할 때
- 새로운 유틸리티, 헬퍼 또는 추상화 클래스를 생성하기 전
워크플로우
┌─────────────────────────────────────────────┐
│ 0. TOOL AVAILABILITY PREFLIGHT │
│ Check search channels before relying on │
│ them; report skipped channels honestly │
├─────────────────────────────────────────────┤
│ 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/아파치 라이선스 | 채택 — 바로 설치 및 사용 |
| 부분 일치, 기반이 탄탄함 | 확장 — 설치 후 간단한 래퍼 작성 |
| 여러 개의 약한 일치 | 조합 — 2~3개의 작은 패키지를 결합 |
| 적합한 항목 없음 | 빌드 — 연구를 바탕으로 맞춤형 코드 작성 |
사용 방법
0단계: 도구 사용 가능 여부 사전 점검
이 문서는 에이전트용 지침이며, 실행 가능한 설정 스크립트가 아닙니다. 현재 진행 중인 작업 및 프로젝트와 관련된 채널만 확인하십시오.
| 채널 | 확인 | 누락된 경우 |
|---|---|---|
| 리포지토리 검색 | rg --files 및 대상 rg 쿼리 |
표시된 파일만 검사했음을 명시 |
| 패키지 레지스트리 | npm --version, python -m pip --version또는 프로젝트 패키지 관리자 |
웹/문서 검색을 사용하고 레지스트리 커버리지를 주장하지 마십시오 |
| GitHub CLI | gh auth status |
공개 웹 또는 로컬 Git 히스토리만 사용하십시오 |
| MCP/문서 도구 | 사용 가능한 도구 목록 또는 로컬 MCP 구성 | 공식 문서/웹 검색으로 대체 |
| 스킬 디렉터리 | ls ~/.claude/skills ~/.codex/skills 해당되는 경우 |
로컬 스킬 카탈로그가 없다고 가정 |
빠른 모드(인라인)
유틸리티를 작성하거나 기능을 추가하기 전에 다음 사항을 머릿속으로 훑어보세요:
- 이 기능이 리포지토리에 이미 존재하나요? →
rg먼저 관련 모듈/테스트를 훑어보세요 - 이것이 흔한 문제인가? → npm/PyPI에서 검색해 보세요
- 이것에 대한 MCP가 있나요? → 확인
~/.claude/settings.json하고 검색해 보세요 - 이것에 대한 스킬이 있나요? → 확인
~/.claude/skills/ - GitHub에 구현 사례나 템플릿이 있나요? → 완전히 새로운 코드를 작성하기 전에 유지보수 중인 OSS에 대해 GitHub 코드 검색을 실행하세요
전체 모드 (에이전트)
비단순한 기능의 경우, 리서처 에이전트를 실행하세요:
Agent(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
")
구버전 Claude Code 문서에서는 이를 Task(...)라고 부를 수 있습니다. 활성 하네스에서 제공하는 최신 에이전트/서브에이전트
도구 이름을 사용하십시오.
카테고리별 검색 바로가기
개발 도구
- 린팅 →
eslint,ruff,textlint,markdownlint - 서식 지정 →
prettier,black,gofmt - 테스트 →
jest,pytest,go test - 커밋 전 →
husky,lint-staged,pre-commit
AI/LLM 통합
- Claude SDK → 최신 문서를 보려면 Context7
- 프롬프트 관리 → MCP 서버 확인
- 문서 처리 →
unstructured,pdfplumber,mammoth
데이터 및 API
- HTTP 클라이언트 →
httpx(Python),ky/undici(Node) - 유효성 검사 →
zod(TS),pydantic(파이썬) - 데이터베이스 → 먼저 MCP 서버 확인
콘텐츠 및 게시
- 마크다운 처리 →
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: "구성 파일 린터 추가"
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 서버가 이미 해당 기능을 제공하는지 확인하지 않음
- 무음 건너뛰기: 검색 채널을 사용할 수 없을 때 “찾은 항목 없음”으로 보고하는 경우
- 과도한 맞춤화: 라이브러리를 지나치게 래핑하여 본래의 장점을 상실하게 만드는 경우
- 의존성 부풀리기: 작은 기능 하나를 위해 방대한 패키지를 설치하는 것
---
name: search-first
description: Research existing tools, libraries, and patterns before writing custom code by invoking a researcher agent.
---
# /search-first — Research Before You Code
Systematizes the "search for existing solutions before implementing" workflow.
## Trigger
Use this skill when:
- Starting a new feature that likely has existing solutions
- Adding a dependency or integration
- The user asks "add X functionality" and you're about to write code
- Before creating a new utility, helper, or abstraction
## Workflow
```
┌─────────────────────────────────────────────┐
│ 0. TOOL AVAILABILITY PREFLIGHT │
│ Check search channels before relying on │
│ them; report skipped channels honestly │
├─────────────────────────────────────────────┤
│ 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 │
└─────────────────────────────────────────────┘
```
## Decision Matrix
| Signal | Action |
|--------|--------|
| Exact match, well-maintained, MIT/Apache | **Adopt** — install and use directly |
| Partial match, good foundation | **Extend** — install + write thin wrapper |
| Multiple weak matches | **Compose** — combine 2-3 small packages |
| Nothing suitable found | **Build** — write custom, but informed by research |
## How to Use
### Step 0: Tool Availability Preflight
This is agent guidance, not an executable setup script. Check only the channels
that are relevant to the task and project in front of you.
| Channel | Check | If missing |
|---------|-------|------------|
| Repository search | `rg --files` and targeted `rg` queries | State that only visible files were inspected |
| Package registry | `npm --version`, `python -m pip --version`, or project package manager | Use web/docs search and avoid claiming registry coverage |
| GitHub CLI | `gh auth status` | Use public web or local git history only |
| MCP/docs tools | Available tool list or local MCP config | Fall back to official docs/web search |
| Skills directory | `ls ~/.claude/skills ~/.codex/skills` where applicable | Say no local skill catalog was available |
### Quick Mode (inline)
Before writing a utility or adding functionality, mentally run through:
0. Does this already exist in the repo? → `rg` through relevant modules/tests first
1. Is this a common problem? → Search npm/PyPI
2. Is there an MCP for this? → Check `~/.claude/settings.json` and search
3. Is there a skill for this? → Check `~/.claude/skills/`
4. Is there a GitHub implementation/template? → Run GitHub code search for maintained OSS before writing net-new code
### Full Mode (agent)
For non-trivial functionality, launch the researcher agent:
```
Agent(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
")
```
Older Claude Code docs may call this `Task(...)`; use the current agent/subagent
tool name exposed by the active harness.
## Search Shortcuts by Category
### Development Tooling
- Linting → `eslint`, `ruff`, `textlint`, `markdownlint`
- Formatting → `prettier`, `black`, `gofmt`
- Testing → `jest`, `pytest`, `go test`
- Pre-commit → `husky`, `lint-staged`, `pre-commit`
### AI/LLM Integration
- Claude SDK → Context7 for latest docs
- Prompt management → Check MCP servers
- Document processing → `unstructured`, `pdfplumber`, `mammoth`
### Data & APIs
- HTTP clients → `httpx` (Python), `ky`/`undici` (Node)
- Validation → `zod` (TS), `pydantic` (Python)
- Database → Check for MCP servers first
### Content & Publishing
- Markdown processing → `remark`, `unified`, `markdown-it`
- Image optimization → `sharp`, `imagemin`
## Integration Points
### With planner agent
The planner should invoke researcher before Phase 1 (Architecture Review):
- Researcher identifies available tools
- Planner incorporates them into the implementation plan
- Avoids "reinventing the wheel" in the plan
### With architect agent
The architect should consult researcher for:
- Technology stack decisions
- Integration pattern discovery
- Existing reference architectures
### With iterative-retrieval skill
Combine for progressive discovery:
- Cycle 1: Broad search (npm, PyPI, MCP)
- Cycle 2: Evaluate top candidates in detail
- Cycle 3: Test compatibility with project constraints
## Examples
### Example 1: "Add dead link checking"
```
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
```
### Example 2: "Add HTTP client wrapper"
```
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
```
### Example 3: "Add config file 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
```
## Anti-Patterns
- **Jumping to code**: Writing a utility without checking if one exists
- **Ignoring MCP**: Not checking if an MCP server already provides the capability
- **Silent skipping**: Reporting "nothing found" when a search channel was unavailable
- **Over-customizing**: Wrapping a library so heavily it loses its benefits
- **Dependency bloat**: Installing a massive package for one small feature
모든 파일
1개 파일search-first 설치
스킬 파일을 다운로드하여 .claude/skills/ 디렉터리에 압축을 풀어주세요.
ZIP 다운로드저장소를 클론하고 스킬 파일을 프로젝트에 복사하세요.
git clone https://github.com/affaan-m/ECC/tree/main/skills/search-first # Copy SKILL.md to your .claude/skills/ directory
복사





집
