langsmith-code-eval

作成者: langchain-ai

LangSmithでトレースされたエージェント向けのコードベース評価器を作成します。カスタム評価ロジックの構築、ツール使用パターンのテスト、エージェント出力のスコアリングなどに使用します…

npx skills add https://github.com/langchain-ai/lca-skills --skill langsmith-code-eval

LangSmith Code Evaluator Creation

Creates evaluators for LangSmith experiments through structured inspection and implementation.

Prerequisites

  • langsmith Python package installed
  • LANGSMITH_API_KEY environment variable set (check project's .env file)

Workflow

Copy this checklist and track progress:

Evaluator Creation Progress:
- [ ] Step 1: Gather info from user
- [ ] Step 2: Inspect trace and dataset structure
- [ ] Step 3: Read agent code
- [ ] Step 4: Write evaluator
- [ ] Step 5: Write experiment runner
- [ ] Step 6: Run and iterate

Step 1: Gather Info from User

IMPORTANT: Do NOT search or explore the codebase. Ask the user all of these questions upfront using AskUserQuestion before doing anything else.

Ask the user the following in a single AskUserQuestion call:

  1. Python command: How do you run Python in this project? (e.g., python, python3, uv run python, poetry run python)
  2. Agent file path: What is the path to your agent file?
  3. LangSmith project name: What is your LangSmith project name (where traces are logged)?
  4. LangSmith dataset name: What is the name of the dataset to evaluate against?
  5. Evaluation goal: What behavior should pass vs fail? Common types:
    • Tool usage: Did the agent call the correct tool?
    • Output correctness: Does output match expected format/content?
    • Policy compliance: Did it follow specific rules?
    • Classification: Did it categorize correctly?

Step 2: Inspect Trace and Dataset Structure

Using the info from Step 1, run the inspection scripts located in this skill's directory:

{python_cmd} {skill_dir}/scripts/inspect_trace.py PROJECT_NAME [RUN_ID]
{python_cmd} {skill_dir}/scripts/inspect_dataset.py DATASET_NAME

Replace {python_cmd} with the command from Step 1, and {skill_dir} with this skill's directory path.

Verify the trace matches the agent:

  • Does the trace type match? (e.g., OpenAI trace for OpenAI agent)
  • Does it contain the data needed for evaluation?
  • If mismatched, clarify before proceeding.

From the dataset inspection, note:

  • Input schema (what gets passed to the agent)
  • Output schema (reference/expected outputs)
  • Metadata fields (e.g., expected_tool, difficulty, labels)

The dataset metadata often contains ground truth for evaluation (e.g., which tool should be called, expected classification).

Step 3: Read Agent Code

Read the agent file provided in Step 1 to identify:

  • Entry point function (look for @traceable decorator)
  • Available tools
  • Output format (what the function returns)

Step 4: Write the Evaluator

Create evaluator functions based on trace and dataset structure. See EVALUATOR_REFERENCE.md for function signatures and return formats.

Step 5: Write Experiment Runner

Create a script that:

  1. Imports the agent's entry function
  2. Wraps it as a target function
  3. Runs evaluate() or aevaluate() against the dataset

See EVALUATOR_REFERENCE.md for evaluate() usage.

Step 6: Run and Iterate

Execute the experiment, review results in LangSmith, refine evaluators as needed.

langchain-aiのその他のスキル

arxiv-search
langchain-ai
arXivでプレプリントや学術論文をトピック別に検索し、アブストラクトを取得します。物理学、数学、コンピュータサイエンス、生物学、統計学および関連分野をクエリベースで検索可能。結果件数は設定可能(デフォルト10件)で、関連性順にソートされます。各該当論文のタイトルとアブストラクトを返します。arxiv Pythonパッケージが必要で、未インストールの場合はpipでインストールしてください。
official
blog-post
langchain-ai
調査委任、構造化コンテンツテンプレート、AI生成のカバー画像を用いた長文ブログ記事作成。執筆前にサブエージェントに調査を委任し、結果をマークダウンで保存して参照・文脈として活用。フック、背景、本文(3~5セクション)、実践応用、行動喚起付き結論の5部構成を適用。被写体、スタイル、構図、色彩、照明を詳細に指定したプロンプトでSEO最適化されたカバー画像を生成。記事を出力先は…
official
code-review
langchain-ai
変更点に対して構造化されたコードレビューを実施し、正確性、スタイル、テスト、潜在的な問題を確認します。
official
coding-prefs
langchain-ai
ユーザーのコーディング設定を /memory/coding-prefs.md から読み取り、重要なスタイル判断を行う前に参照し、ユーザーが新しい設定を指定した場合はそれを追加します。
official
competitor-analysis
langchain-ai
競合他社を分析するよう求められた場合:
official
cudf-analytics
langchain-ai
GPUアクセラレーションによるデータセット、CSV、または表形式データの分析にNVIDIA cuDFを使用します。groupby集約や統計処理を含むタスクで起動します。
official
cuml-machine-learning
langchain-ai
GPUアクセラレーションによる表形式データの機械学習に使用します。NVIDIA cuMLを利用します。分類、回帰、クラスタリング、次元削減を含むタスクで起動します。
official
data-visualization
langchain-ai
出版品質のチャートやマルチパネル分析サマリーを作成するために使用します。データの可視化、結果のプロット、作成などを含むタスクで起動します。
official