| name | search-first |
| description | Research-before-coding workflow. Search for existing tools, libraries, and patterns before writing custom code. Invokes the researcher agent. |
| origin | ECC |
/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
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 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
Quick Mode (inline)
Before writing a utility or adding functionality, mentally run through:
- Does this already exist in the repo? โ
rg through relevant modules/tests first
- Is this a common problem? โ Search npm/PyPI
- Is there an MCP for this? โ Check
~/.claude/settings.json and search
- Is there a skill for this? โ Check
~/.claude/skills/
- 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:
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
")
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/got (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
- Over-customizing: Wrapping a library so heavily it loses its benefits
- Dependency bloat: Installing a massive package for one small feature