| name | search-first |
| description | Search npm / PyPI / MCP / GitHub / existing skills before writing code for any new feature, integration, library selection, or utility. Use whenever the user says 'add X functionality', 'implement Y', 'set up Z', 'integrate W', asks 'what library should I use for...', 'is there a package/client/MCP for...', proposes a specific tool while open to alternatives, or invokes planning.md Phase 0 External Research. Especially when the task adds a dependency, picks between tools, or builds a utility that likely already exists (parser, checker, converter, linter, CI step, E2E framework, payment / auth / API client). DO NOT use for bug fixes, refactoring, config value edits, file summarization, or throwaway scripts whose approach the user already fully specified. |
| compatibility | Developed and tested on Claude Code; portable to other Agent Skills-compatible agents. |
| user-invocable | true |
| origin | shimo4228 |
/search-first โ Research Before You Code
Before writing a new feature, utility, integration, or picking a library, search
for an existing solution first. The best code is code you don't have to write.
This skill is discipline, not mechanism. The how of searching โ parallel
subagents, live documentation lookup, registry queries โ belongs to your agent
harness and keeps changing. What this skill pins down is the part that survives
those changes: articulate before you search, search by source priority, and
end with a recorded verdict. Lead with the discipline; delegate the mechanism.
Step 0 โ Articulate the requirement (mandatory, user-visible text)
Before any tool call or subagent, write 2โ3 sentences of plain assistant text
(not buried inside tool arguments) stating:
- What functionality is needed โ concretely, not "X support"
- Language / framework the implementation will use
- Constraints โ existing deps, performance limits, license requirements
Why: this externalizes the search query so the user can redirect before you
spend effort, and it leaves an auditable record. A subagent call whose args
carry the requirement does not satisfy this step โ the user reads chat text,
not tool arguments. Emit the articulation as text first, then call tools whose
arguments may mirror it.
Step 1 โ Search by source priority
Check these in order; stop early when you find a strong match:
- This repo โ
rg / grep through the relevant modules and tests. The thing
may already exist here.
- Package registries โ npm / PyPI / crates / Go modules for the language in play.
- MCP servers โ already-configured servers first, then the registry. The
capability may already be wired in.
- Installed skills / agents / tools โ your harness may already carry it.
- Maintained OSS / templates โ code-search GitHub before writing net-new code.
Query live documentation at decision time (e.g. context7, or the registry
itself) rather than trusting remembered package facts โ recommendations age.
Step 2 โ Decide, and record a Verdict
Assess candidates holistically: functional fit, maintenance (last commit,
issue-response speed), community, docs, license, dependency footprint. Describe
strengths and weaknesses in prose. Do not assign numeric scores (8/10),
letter grades, or weighted point tables โ they manufacture false precision; one
evidence-backed verdict is the honest output.
| Verdict | When | Action |
|---|
| Adopt | Exact match, well-maintained, permissive license | Install and use directly |
| Extend | Good foundation, partial fit | Install + thin wrapper / config |
| Compose | Several weak matches | Combine 2โ3 small packages |
| Build | Nothing suitable | Write custom โ but informed by what you found |
End every pass with one recognizable verdict line โ this line is the deliverable:
Verdict: <Adopt|Extend|Compose|Build> โ <package(s) or "custom"> โ <evidence-based reason>
A search with no verdict line is an incomplete pass: you did the work but left
no decision the user (or the next step) can act on โ the single most common failure
of this workflow. Back the reason with evidence (stars, last-commit date, the
specific feature match), never adjectives ("looks good", "popular").
Quick Mode vs Full Mode
- Quick Mode (inline) โ for a single obvious need: run Steps 0โ2 yourself with
a few searches and state the verdict.
- Full Mode (delegate) โ for non-trivial needs: after Step 0, hand the sweep to
a research subagent (whatever your harness provides for solution discovery).
Mirror the articulation into its prompt and have it return candidates plus a
verdict in the format above. Reserve heavyweight multi-source research for
genuinely hard questions โ finding a library is lighter than a research report.
When the user says "skip research"
If the user tells you to skip research ("just implement", "no time", "use
whatever"), still record the decision as a verdict line before implementing โ
skipping research is itself a decision, so it gets a verdict like any other pass
(this keeps the choice auditable and the course-correct window open):
Skipping research at your request โ I haven't checked for an existing library for X.
Verdict: <Adopt|Build> โ <tentative choice or "custom"> โ chosen without research at your request; say the word for a 60-second scan.
Why: the user may not know a solution already exists; a silent skip removes their
chance to course-correct. After the verdict line, proceed without searching โ
don't use this as a backdoor to do full research anyway.
Anti-Patterns
- Jumping to code โ writing a utility without checking whether one exists.
- Ignoring MCP / installed capability โ rebuilding what is already wired in.
- Over-customizing โ wrapping a library so heavily its benefit is lost.
- Dependency bloat โ installing a massive package for one small feature.
- Search without verdict โ doing the legwork but never recording a decision.
Examples (illustrative โ verify packages live)
These show how a verdict reads; they are not current package endorsements.
Re-search before relying on any specific package.
- Dead-link checking โ a maintained, permissively-licensed link-check rule
covering all link types โ
Verdict: Adopt โ textlint-rule-no-dead-link โ active maintenance, MIT, full coverage
- Qiita cross-posting โ only unmaintained partial wrappers exist โ
Verdict: Build โ custom โ no maintained complete solution; reuse the platform API via an HTTP client
- JP terminology consistency โ a dictionary-based checker needing a project config โ
Verdict: Extend โ textlint-rule-prh โ install + a project dictionary