search-first
affaan-m/ECC
Pesquise ferramentas, bibliotecas e padrões existentes antes de escrever código personalizado, invocando um agente de pesquisa.
...Expandir tudo/search-first — Pesquise Antes de Codificar
Sistematiza o fluxo de trabalho de "buscar soluções existentes antes de implementar".
Gatilho
Use esta habilidade quando:
- Iniciar um novo recurso que provavelmente possui soluções existentes
- Adicionar uma dependência ou integração
- O usuário solicitar "adicionar funcionalidade X" e você estiver prestes a escrever código
- Antes de criar um novo utilitário, auxiliar ou abstração
Fluxo de Trabalho
┌─────────────────────────────────────────────┐
│ 0. PRÉ-VISUALIZAÇÃO DE DISPONIBILIDADE DE │
│ FERRAMENTAS │
│ Verifique os canais de pesquisa antes │
│ de depender deles; reporte os canais │
│ ignorados com honestidade │
├─────────────────────────────────────────────┤
│ 1. ANÁLISE DE NECESSIDADE │
│ Defina qual funcionalidade é necessária │
│ Identifique as restrições de │
│ linguagem/framework │
├─────────────────────────────────────────────┤
│ 2. PESQUISA PARALELA (agente de pesquisa) │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ npm / │ │ MCP / │ │ GitHub / │ │
│ │ PyPI │ │ Habilidades│ │ Web │ │
│ └──────────┘ └──────────┘ └──────────┘ │
├─────────────────────────────────────────────┤
│ 3. AVALIAÇÃO │
│ Classifique os candidatos (funcionalidade,│
│ manutenção, comunidade, documentação, │
│ licença, dependências) │
├─────────────────────────────────────────────┤
│ 4. DECISÃO │
│ ┌─────────┐ ┌──────────┐ ┌─────────┐ │
│ │ Adotar │ │ Estender│ │ Construir│ │
│ │ como está│ │ /Envolver│ │ Personalizado│ │
│ └─────────┘ └──────────┘ └─────────┘ │
├─────────────────────────────────────────────┤
│ 5. IMPLEMENTAÇÃO │
│ Instale o pacote / Configure o MCP / │
│ Escreva código personalizado mínimo │
└─────────────────────────────────────────────┘
Matriz de Decisão
| Sinal | Ação |
|---|---|
| Correspondência exata, bem mantida, MIT/Apache | **Adotar** — instalar e usar diretamente |
| Correspondência parcial, boa base | **Estender** — instalar + escrever wrapper fino |
| Múltiplas correspondências fracas | **Compor** — combinar 2-3 pequenos pacotes |
| Nenhuma opção adequada encontrada | **Construir** — escrever personalizado, mas informado pela pesquisa |
Como Usar
Etapa 0: Pré-visualização de Disponibilidade de Ferramentas
Este é um direcionamento do agente, não um script de configuração executável. Verifique apenas os canais relevantes para a tarefa e o projeto em questão.
| Canal | Verificação | Se ausente |
|---|---|---|
| Pesquisa em repositório | `rg --files` e consultas direcionadas `rg` | Declare que apenas arquivos visíveis foram inspecionados |
| Registro de pacotes | `npm --version`, `python -m pip --version` ou gerenciador de pacotes do projeto | Use pesquisa na web/documentação e evite afirmar cobertura do registro |
| CLI do GitHub | `gh auth status` | Use apenas a web pública ou o histórico git local |
| Ferramentas MCP/docs | Lista de ferramentas disponíveis ou configuração MCP local | Recorra à documentação oficial/pesquisa na web |
| Diretório de habilidades | `ls ~/.claude/skills ~/.codex/skills` quando aplicável | Diga que nenhum catálogo de habilidades local estava disponível |
Modo Rápido (inline)
Antes de escrever um utilitário ou adicionar funcionalidade, percorra mentalmente:
- Isso já existe no repositório? → Use
rgnos módulos/testes relevantes primeiro - Este é um problema comum? → Pesquise no npm/PyPI
- Existe um MCP para isso? → Verifique
~/.claude/settings.jsone pesquise - Existe uma habilidade para isso? → Verifique
~/.claude/skills/ - Existe uma implementação/template no GitHub? → Execute a pesquisa de código do GitHub para OSS mantido antes de escrever código totalmente novo
Modo Completo (agente)
Para funcionalidades não triviais, inicie o agente de pesquisa:
Agente(subagent_type="general-purpose", prompt="
Pesquise ferramentas existentes para: [DESCRIÇÃO]
Linguagem/framework: [LING]
Restrições: [QUALQUER]
Pesquisar: npm/PyPI, servidores MCP, habilidades do Claude Code, GitHub
Retornar: Comparação estruturada com recomendação
")
Documentos mais antigos do Claude Code podem chamar isso de Task(...); use o nome atual da ferramenta de agente/subagente exposto pelo barramento ativo.
Atalhos de Pesquisa por Categoria
Ferramentas de Desenvolvimento
- Linting →
eslint,ruff,textlint,markdownlint - Formatação →
prettier,black,gofmt - Testes →
jest,pytest,go test - Pré-commit →
husky,lint-staged,pre-commit
Integração de IA/LLM
- SDK do Claude → Context7 para documentação mais recente
- Gerenciamento de prompts → Verifique servidores MCP
- Processamento de documentos →
unstructured,pdfplumber,mammoth
Dados e APIs
- Clientes HTTP →
httpx(Python),ky/undici(Node) - Validação →
zod(TS),pydantic(Python) - Banco de dados → Verifique servidores MCP primeiro
Conteúdo e Publicação
- Processamento de Markdown →
remark,unified,markdown-it - Otimização de imagens →
sharp,imagemin
Pontos de Integração
Com o agente planejador
O planejador deve invocar o pesquisador antes da Fase 1 (Revisão de Arquitetura):
- O pesquisador identifica ferramentas disponíveis
- O planejador as incorpora no plano de implementação
- Evita "reinventar a roda" no plano
Com o agente arquiteto
O arquiteto deve consultar o pesquisador para:
- Decisões de pilha tecnológica
- Descoberta de padrões de integração
- Arquiteturas de referência existentes
Com a habilidade de recuperação iterativa
Combine para descoberta progressiva:
- Ciclo 1: Pesquisa ampla (npm, PyPI, MCP)
- Ciclo 2: Avalie os principais candidatos em detalhes
- Ciclo 3: Teste a compatibilidade com as restrições do projeto
Exemplos
Exemplo 1: "Adicionar verificação de links mortos"
Necessidade: Verificar arquivos markdown por links quebrados
Pesquisa: npm "verificador de links mortos markdown"
Encontrado: textlint-rule-no-dead-link (pontuação: 9/10)
Ação: ADOTAR — npm install textlint-rule-no-dead-link
Resultado: Zero código personalizado, solução testada em produção
Exemplo 2: "Adicionar wrapper de cliente HTTP"
Necessidade: Cliente HTTP resiliente com retentativas e tratamento de tempo limite
Pesquisa: npm "cliente http retry", PyPI "httpx retry"
Encontrado: got (Node) com plugin de retry, httpx (Python) com retry integrado
Ação: ADOTAR — use got/httpx diretamente com configuração de retry
Resultado: Zero código personalizado, bibliotecas comprovadas em produção
Exemplo 3: "Adicionar linter de arquivo de configuração"
Necessidade: Validar arquivos de configuração do projeto contra um esquema
Pesquisa: npm "linter de configuração esquema", "validador de esquema json cli"
Encontrado: ajv-cli (pontuação: 8/10)
Ação: ADOTAR + ESTENDER — instale ajv-cli, escreva esquema específico do projeto
Resultado: 1 pacote + 1 arquivo de esquema, sem lógica de validação personalizada
Antipadrões
- Pular para o código: Escrever um utilitário sem verificar se um existe
- Ignorar MCP: Não verificar se um servidor MCP já fornece a capacidade
- Ignorar silenciosamente: Relatar "nada encontrado" quando um canal de pesquisa estava indisponível
- Personalização excessiva: Envolver uma biblioteca tão fortemente que ela perde seus benefícios
- Inchaço de dependências: Instalar um pacote massivo para uma pequena funcionalidade
---
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
Todos os arquivos
1 arquivosInstalar search-first
Baixe e extraia os arquivos de habilidade para o diretório .claude/skills/.
Baixar ZIPClone o repositório e copie os arquivos da habilidade para o seu projeto.
git clone https://github.com/affaan-m/ECC/tree/main/skills/search-first # Copy SKILL.md to your .claude/skills/ directory
Copiar





Lar
