All skills
affaan-m avatar

/search-first

@0765f7a
by Affaan Mustafaaffaan-m/everything-claude-code270k stars
40,422

Research-before-coding workflow: search npm/PyPI, MCP servers, skills, and GitHub for existing tools before writing custom code, then adopt, extend, or build. Launches the researcher agent for non-trivial needs. Use when starting a feature, adding a dependency or integration, or about to write a utility that may already exist.

Use this Skill: https://skilld.dev/gh/affaan-m/everything-claude-code/search-first

This session only. Nothing lands on disk.

SKILL.md

β‰ˆ86 tokens always: the name and description. β‰ˆ2k when used: this file.

/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:

  1. Does this already exist in the repo? β†’ rg through relevant modules/tests first
  2. Is this a common problem? β†’ Search npm/PyPI
  3. Is there an MCP for this? β†’ Check ~/.claude/settings.json and search
  4. Is there a skill for this? β†’ Check ~/.claude/skills/
  5. 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

Source: SKILL.md on GitHub

1 warning3d5 checks Β· Risk SAFE
  • Gen Agent Trust Hub3d

    This skill defines a research-before-coding workflow that encourages agents to find existing open-source libraries and patterns. It is generally safe but creates an indirect prompt injection surface by instructing the agent to ingest and act upon untrusted data from external registries and websites.

  • Socket3d

    No alerts

  • Snyk3d

    Risk: MEDIUM Β· 1 issue

  • Runlayer7mo

    1 file scanned Β· No issues

  • ZeroLeaks5mo

    Score: 93/100 Β· 2 sections analyzed

Signed by skilld at 0765f7a. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 8 hours ago.

Activeupdated 4 days ago
metadata
{
  "origin": "ECC"
}
  • MCP
  • research
  • workflow
  • dependencies
  • agent
  • decision-making
  • code-reuse
  • package-discovery

README badge

README badge for affaan-m/everything-claude-code/search-first

Guides AI agents to search for existing tools, libraries, and patterns before writing custom code by running research across npm, PyPI, MCP servers, GitHub, and local skills. Systematizes the decision to adopt, extend, compose, or build custom solutions based on what's available.

Generated from the current SKILL.md.

Does this skill work with languages other than JavaScript/Node?
Yes. The skill systematizes research across npm, PyPI, MCP servers, GitHub, and local repositories, so it applies to Python, Go, Rust, and other ecosystems. The examples include both Node and Python workflows.
What if a search channel is unavailable in my environment?
The skill requires you to report honestly which channels are missing or skippedβ€”for example, if GitHub CLI is not authenticated, fall back to public web search. Do not claim registry coverage you cannot verify.
Does this replace writing custom code?
No. The skill guides you to search first and then decide whether to adopt an existing tool, extend one, compose multiple packages, or build custom code informed by your research. Writing custom code is one of four valid outcomes.
Can this skill be invoked automatically, or is it manual?
Both. You can run through the workflow mentally in quick mode before writing utilities, or invoke a researcher agent for non-trivial features. The skill is guidance; the researcher agent is the executable form.
Does this integrate with other Claude Code agents?
Yes. The planner should invoke researcher before Phase 1, and the architect should consult it for technology stack and integration pattern decisions. It also combines well with the iterative-retrieval skill for progressive discovery cycles.

Generated from the current SKILL.md. These answers refresh after source changes.