Communitygithub.com

search-first

コードを書く前に既存のツールやライブラリ、パターンを検索するためのスキルです。リサーチャーエージェントを起動し、車輪の再発明を防ぎます。

search-first とは?

このスキルは、新しい機能の実装や依存関係の追加を行う前に、既存のソリューションを徹底的に調査するワークフローを体系化します。npm/PyPI、MCPサーバー、GitHub、Web検索などの複数のチャネルを並列で検索し、見つかった候補を機能性、メンテナンス状況、コミュニティ、ドキュメント、ライセンス、依存関係などの基準で評価します。最終的に「Adopt(そのまま採用)」「Extend(拡張/ラップ)」「Compose(複数組み合わせ)」「Build(カスタム構築)」の4つの選択肢から最適な判断を下します。特にClaude CodeやCursor、CodexといったAIエージェントツール上で動作し、リサーチャーエージェントを活用することで、車輪の再発明を防ぎ、メンテナンス性の高いコードベースを維持します。

対応✓Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/affaan-m/everything-claude-code/tree/main/skills/search-first

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

/search-first — コードを書く前にリサーチせよ

「既存のソリューションを実装前に検索する」ワークフローを体系化します。

トリガー

以下の状況でこのスキルを使用します:

  • 既存のソリューションが存在しそうな新機能の開始時
  • 依存関係やインテグレーションの追加時
  • ユーザーが「Xの機能を追加して」と頼み、コードを書き始めようとしたとき
  • 新しいユーティリティ、ヘルパー、抽象化を作成する前

ワークフロー

┌─────────────────────────────────────────────┐
│  0. ツール利用可能性の事前チェック          │
│     検索チャネルの可用性を確認し、           │
│     利用不可のチャネルは正直に報告する       │
├─────────────────────────────────────────────┤
│  1. ニーズ分析                             │
│     必要な機能を定義する                     │
│     言語・フレームワークの制約を特定する     │
├─────────────────────────────────────────────┤
│  2. 並列検索(リサーチャーエージェント)     │
│     ┌──────────┐ ┌──────────┐ ┌──────────┐  │
│     │  npm /   │ │  MCP /   │ │  GitHub / │  │
│     │  PyPI    │ │  スキル  │ │  Web      │  │
│     └──────────┘ └──────────┘ └──────────┘  │
├─────────────────────────────────────────────┤
│  3. 評価                                   │
│     候補を評価する(機能性、メンテナンス、    │
│     コミュニティ、ドキュメント、ライセンス、  │
│     依存関係)                              │
├─────────────────────────────────────────────┤
│  4. 決定                                   │
│     ┌─────────┐  ┌──────────┐  ┌─────────┐  │
│     │  採用   │  │  拡張    │  │  カスタム│  │
│     │  そのまま│  │  /ラップ │  │  構築    │  │
│     └─────────┘  └──────────┘  └─────────┘  │
├─────────────────────────────────────────────┤
│  5. 実装                                   │
│     パッケージのインストール / MCPの設定 /   │
│     最小限のカスタムコードを記述             │
└─────────────────────────────────────────────┘

判断マトリックス

シグナルアクション
完全一致、メンテナンス良好、MIT/Apacheライセンス採用 — インストールしてそのまま使用する
部分一致、良い基盤あり拡張 — インストール + 薄いラッパーを記述する
複数の弱い一致組み合わせ — 2~3の小さなパッケージを組み合わせる
適切なものが見つからない構築 — カスタム実装するが、リサーチに基づいて行う

使い方

ステップ0: ツール利用可能性の事前チェック

これは実行可能なセットアップスクリプトではなく、エージェント向けのガイダンスです。現在のタスクとプロジェクトに関連するチャネルのみをチェックします。

チャネル確認方法見つからない場合
リポジトリ検索rg --files および対象を絞った rg クエリ可視ファイルのみを検査したことを明記する
パッケージレジストリnpm --version、python -m pip --version、またはプロジェクトのパッケージマネージャーWeb/ドキュメント検索を使用し、レジストリの網羅性は主張しない
GitHub CLIgh auth status公開Webまたはローカルgit履歴のみを使用する
MCP/ドキュメントツール利用可能なツール一覧またはローカルMCP設定公式ドキュメント/Web検索にフォールバックする
スキルディレクトリ該当する場合 ls ~/.claude/skills ~/.codex/skillsローカルのスキルカタログが利用できなかったことを明記する

クイックモード(インライン)

ユーティリティを書いたり機能を追加する前に、頭の中で以下を実行します:

  1. これはリポジトリにすでに存在するか? → まず rg で関連モジュール/テストを検索する
  2. これは一般的な問題か? → npm/PyPIを検索する
  3. これに対するMCPはあるか? → ~/.claude/settings.json を確認し、検索する
  4. これに対するスキルはあるか? → ~/.claude/skills/ を確認する
  5. GitHubに実装/テンプレートはあるか? → 新しいコードを書く前に、メンテナンスされたOSSをGitHubコード検索する

フルモード(エージェント)

重要な機能の場合は、リサーチャーエージェントを起動します:

Agent(subagent_type="general-purpose", prompt="
  [説明] に対する既存ツールをリサーチしてください
  言語/フレームワーク: [言語]
  制約: [任意]

  検索対象: npm/PyPI、MCPサーバー、Claude Codeスキル、GitHub
  戻り値: 推奨事項を含む構造化比較表
")

古いClaude Codeのドキュメントではこれを Task(...) と呼んでいる場合があります。アクティブなハーネスが公開している現在のagent/subagentツール名を使用してください。

カテゴリ別検索ショートカット

開発ツール

  • Lint → eslint、ruff、textlint、markdownlint
  • フォーマット → prettier、black、gofmt
  • テスト → jest、pytest、go test
  • プリコミット → husky、lint-staged、pre-commit

AI/LLM連携

  • Claude SDK → 最新ドキュメントはContext7を確認
  • プロンプト管理 → MCPサーバーを確認
  • ドキュメント処理 → unstructured、pdfplumber、mammoth

データとAPI

  • HTTPクライアント → httpx(Python)、ky/undici(Node)
  • バリデーション → zod(TS)、pydantic(Python)
  • データベース → 最初にMCPサーバーを確認

コンテンツと公開

  • Markdown処理 → remark、unified、markdown-it
  • 画像最適化 → sharp、imagemin

連携ポイント

プランナーエージェントとの連携

プランナーはフェーズ1(アーキテクチャレビュー)の前にリサーチャーを起動します:

  • リサーチャーが利用可能なツールを特定する
  • プランナーがそれらを実装計画に組み込む
  • 計画内で「車輪の再発明」を回避する

アーキテクトエージェントとの連携

アーキテクトは以下のためにリサーチャーを参照します:

  • テクノロジースタックの決定
  • インテグレーションパターンの発見
  • 既存のリファレンスアーキテクチャ

反復検索スキルとの連携

プログレッシブな発見のために組み合わせます:

  • サイクル1: 広域検索(npm、PyPI、MCP)
  • サイクル2: 上位候補を詳細に評価
  • サイクル3: プロジェクトの制約との互換性をテスト

例

例1: 「デッドリンクチェックを追加」

ニーズ: Markdownファイルの壊れたリンクをチェックする
検索: npm "markdown dead link checker"
発見: textlint-rule-no-dead-link(スコア: 9/10)
アクション: 採用 — npm install textlint-rule-no-dead-link
結果: カスタムコードゼロ、実戦で試されたソリューション

例2: 「HTTPクライアントラッパーを追加」

ニーズ: リトライとタイムアウト処理を備えた堅牢なHTTPクライアント
検索: npm "http client retry"、PyPI "httpx retry"
発見: got(Node)にretryプラグインあり、httpx(Python)に組み込みretryあり
アクション: 採用 — got/httpxをretry設定付きで直接使用
結果: カスタムコードゼロ、本番実績のあるライブラリ

例3: 「設定ファイルリンターを追加」

ニーズ: プロジェクト設定ファイルをスキーマに対して検証する
検索: npm "config linter schema"、"json schema validator cli"
発見: ajv-cli(スコア: 8/10)
アクション: 採用 + 拡張 — ajv-cliをインストールし、プロジェクト固有のスキーマを記述
結果: 1パッケージ + 1スキーマファイル、カスタムバリデーションロジックなし

アンチパターン

  • コードに飛びつく: 既存のものがあるか確認せずにユーティリティを書く
  • MCPを無視する: MCPサーバーがすでに機能を提供しているか確認しない
  • 黙ってスキップする: 検索チャネルが利用不可だったときに「何も見つからなかった」と報告する
  • 過剰なカスタマイズ: ライブラリを過度にラップして、その利点を失わせる
  • 依存関係の肥大化: 小さな一機能のために巨大なパッケージをインストールする

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

関連スキル