- 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
```
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 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 ~/.gemini/skills` | 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 `~/.gemini/settings.json` and search
3. Is there a skill for this? โ Check `~/.gemini/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:
```
Task(subagent_type="general-purpose", prompt="
Research existing tools for: [DESCRIPTION]
Language/framework: [LANG]
Constraints: [ANY]
Search: npm/PyPI, MCP servers, Gemini CLI skills, GitHub
Return: Structured comparison with recommendation
")
```
The exact subagent/dispatch tool name depends on the active harness โ use the
name your current Gemini CLI / Antigravity surface exposes rather than copying
the example verbatim.
## 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
- Gemini 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: undici (Node) with retry interceptor, httpx (Python) with built-in retry
Action: ADOPT โ use undici/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
View on GitHub