firecrawl-build の検証ログ
課題ごとに、依頼文と採点項目、項目ごとの点数、実行ごとの時間・トークン、Claude Code の全ログ、作られたファイルを載せています。配点を変えても計算し直せるよう、生データも置いています。
2026年11月2日 に実行(実行: claude-sonnet-5-5/採点: claude-opus-5-5)。数値は中央値です。課題は SKILL.md をもとに AI が作ったもので、スキルに有利な場面に偏ることがあります。
生データ(JSON)課題・実行ごとの測定値・採点・集計をそのまま置いています。
実行ごとの測定値
| 実行 | 結果 | 時間 | トークン | 費用 | ターン | スキル使用 | ログ |
|---|---|---|---|---|---|---|---|
| 課題 1 1 回目 スキルなし | 完了 | 30秒 | 111,478 | $0.082 | 6 | - | 全ログ |
| 課題 1 1 回目 スキルあり | 完了 | 38秒 | 149,781 | $0.093 | 9 | 使った | 全ログ |
| 課題 1 1 回目 スキルあり(名指しなし) | 完了 | 37秒 | 128,026 | $0.092 | 8 | 使った | 全ログ |
| 課題 1 2 回目 スキルあり | 完了 | 35秒 | 179,652 | $0.088 | 11 | 使った | 全ログ |
| 課題 1 2 回目 スキルなし | 完了 | 41秒 | 151,795 | $0.068 | 8 | - | 全ログ |
| 課題 1 2 回目 スキルあり(名指しなし) | 完了 | 26秒 | 150,716 | $0.079 | 9 | 使った | 全ログ |
| 課題 2 1 回目 スキルなし | 完了 | 33秒 | 70,692 | $0.069 | 4 | - | 全ログ |
| 課題 2 1 回目 スキルあり | 完了 | 28秒 | 79,378 | $0.079 | 6 | 使った | 全ログ |
| 課題 2 1 回目 スキルあり(名指しなし) | 完了 | 22秒 | 79,220 | $0.076 | 6 | 使った | 全ログ |
| 課題 2 2 回目 スキルあり | 完了 | 29秒 | 99,388 | $0.066 | 7 | 使った | 全ログ |
| 課題 2 2 回目 スキルなし | 完了 | 26秒 | 70,547 | $0.052 | 4 | - | 全ログ |
| 課題 2 2 回目 スキルあり(名指しなし) | 完了 | 27秒 | 80,070 | $0.066 | 6 | 使った | 全ログ |
「スキルあり(名指しなし)」は呼ばれやすさを測るための実行で、採点はしていません。
課題 1: 既存Nodeアプリにページ本文取得機能をFirecrawlで実装
依頼文
Our Node app (see src/) generates link previews and summaries for URLs that users paste. The fetchPageContent(url) function in src/services/pageContent.js is still a stub. Please implement it using Firecrawl so it returns the page as clean markdown plus title/description metadata. We can't add npm dependencies right now, so call the API directly over HTTP. Follow the existing conventions in the repo (config handling, the shared http helper, the error classes). The API key must come from the environment, and we sometimes run a self-hosted Firecrawl, so the base URL should be configurable. Add tests with node:test that mock the network (no real requests) covering success, a failed/non-2xx response, and a missing API key. Update .env.example and make sure npm test passes.採点基準
- fetchPageContent sends a POST to a Firecrawl scrape endpoint (e.g. /v1/scrape or /v2/scrape) with the target url and a markdown format request, and maps the response's markdown and metadata title/description into { url, title, description, markdown }
- The API key is read from an environment variable through src/config.js (not hardcoded) and sent as a Bearer Authorization header; the base URL is configurable via env with a sensible default to the hosted Firecrawl API
- Existing conventions are reused: the request goes through postJson in src/lib/http.js, a missing key raises ConfigError, and failed/unsuccessful responses surface as UpstreamError (including a success:false body)
- New node:test tests mock fetch (no real network) and cover success, failure, and missing-key cases; npm test passes
- No new npm dependencies were added, and .env.example documents the Firecrawl key and optional base URL variable
項目ごとの点数(1 = 満たした・0.5 = 一部・0 = 満たさない)
| # | 1 回目 スキルなし / スキルあり | 2 回目 スキルなし / スキルあり |
|---|---|---|
| 1 | 1 / 1 | 1 / 1 |
| 2 | 1 / 1 | 1 / 1 |
| 3 | 1 / 1 | 1 / 1 |
| 4 | 1 / 1 | 1 / 1 |
| 5 | 1 / 1 | 1 / 1 |
初期ファイル(8)
package.json
{
"name": "link-preview",
"version": "0.1.0",
"type": "module",
"private": true,
"scripts": {
"test": "node --test test/"
}
}
src/config.js
// Central config. All env access goes through here.
export const getConfig = (env = process.env) => ({
port: Number(env.PORT ?? 3000),
requestTimeoutMs: Number(env.REQUEST_TIMEOUT_MS ?? 30000),
});
src/lib/errors.js
export class ConfigError extends Error {
constructor(message) {
super(message);
this.name = 'ConfigError';
}
}
export class UpstreamError extends Error {
constructor(message, { status, service } = {}) {
super(message);
this.name = 'UpstreamError';
this.status = status;
this.service = service;
}
}
src/lib/http.js
import { UpstreamError } from './errors.js';
// Shared JSON POST helper. Pass fetchImpl in tests to avoid real network.
export const postJson = async (url, body, { headers = {}, timeoutMs = 30000, service = 'upstream', fetchImpl = globalThis.fetch } = {}) => {
const res = await fetchImpl(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json', ...headers },
body: JSON.stringify(body),
signal: AbortSignal.timeout(timeoutMs),
});
const text = await res.text();
let json;
try { json = text ? JSON.parse(text) : {}; } catch { json = { raw: text }; }
if (!res.ok) {
throw new UpstreamError(`${service} responded ${res.status}`, { status: res.status, service });
}
return json;
};
src/services/pageContent.js
// Returns { url, title, description, markdown } for a public web page.
// Used by the summarizer and the link-preview card.
export const fetchPageContent = async (url, deps = {}) => {
throw new Error('not implemented');
};
src/services/preview.js
import { fetchPageContent } from './pageContent.js';
export const buildPreview = async (url, deps) => {
const page = await fetchPageContent(url, deps);
return {
url: page.url,
title: page.title || url,
description: page.description || page.markdown.slice(0, 200),
};
};
test/config.test.js
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { getConfig } from '../src/config.js';
test('defaults', () => {
const c = getConfig({});
assert.equal(c.port, 3000);
});
.env.example
PORT=3000 REQUEST_TIMEOUT_MS=30000
1 回目: 引き分け (達成率 100% / 100%)
両者とも postJson・ConfigError・UpstreamError・設定可能なベース URL・モックしたテストを備え、実質的な差がない。
スキルなし100%
最終メッセージ
fetchPageContent(url) now calls Firecrawl over plain HTTP and returns { url, title, description, markdown }. npm test passes: 6 tests, with the network mocked so no real requests are made.
- Config (
src/config.js): it now readsFIRECRAWL_API_KEYandFIRECRAWL_BASE_URL. The base URL defaults tohttps://api.firecrawl.dev, and a trailing slash is stripped, so a self-hosted instance only needs the variable set. - Implementation (
src/services/pageContent.js):- It uses the shared
postJsonhelper to POST to/v1/scrapewith the key as a Bearer token, asking for main-content markdown. - It takes optional
deps(env,fetchImpl) so tests can inject a fake environment and fetch. - The returned
urlis Firecrawl'ssourceURLwhen present, otherwise the URL you passed in.
- It uses the shared
- Errors:
- A missing key throws
ConfigErrorbefore any request is made. - A non-2xx response throws
UpstreamErrorfrom the helper. - A 200 response with
success: falseor no data also throwsUpstreamError.
- A missing key throws
- Tests (
test/pageContent.test.js): success, custom base URL, non-2xx,success: false, and missing key. .env.example: both new variables are added.- Key required everywhere: I made the API key mandatory, including for self-hosted instances. Self-hosted Firecrawl often runs without auth, so if yours does, we may want to relax that.
package.jsonchange you didn't ask for:npm testwas failing on Node 22 with "Cannot find module '/work/test'", becausenode --test test/treats the directory as a module path. I changed the script tonode --test, which finds thetest/directory by itself.
作った・変えたファイル
スキルあり100%
最終メッセージ
fetchPageContent(url) now calls Firecrawl over plain HTTP and returns { url, title, description, markdown }. npm test passes with 6 tests. The tests mock the network, so I haven't made a real Firecrawl request. I wrote the request and response shapes from memory of Firecrawl's v2 scrape API and didn't check them against the docs.
- Request: it POSTs to
<base>/v2/scrapewithformats: ['markdown']andonlyMainContent: true. TheAuthorization: Bearer <key>header carries the key, and the request goes through the sharedpostJsonhelper. - Missing key: it throws
ConfigErrorbefore any network call. - Failed responses: a non-2xx status throws
UpstreamErrorfrom the helper. A 200 response withsuccess: falseor no markdown also throwsUpstreamError. - Config:
src/config.jsnow readsFIRECRAWL_API_KEYandFIRECRAWL_API_URL. The URL defaults tohttps://api.firecrawl.devand any trailing slash is stripped, which covers self-hosted instances. - Injection: the function takes
{ env, fetchImpl }as its second argument, so tests can override both. - Tests:
test/pageContent.test.jscovers success, a custom base URL, a 402 response, asuccess: falsebody, and the missing key. .env.example: it now listsFIRECRAWL_API_KEYand a commented-outFIRECRAWL_API_URL.
I also had to change package.json. node --test test/ fails on this machine's Node 22 with "Cannot find module '/work/test'". The test script now uses the glob node --test "test/**/*.test.js".
作った・変えたファイル
2 回目: 引き分け (達成率 100% / 100%)
両者とも既存の慣習に沿った実装・モックテスト・.env.example 更新がほぼ同一で実質差がない。
スキルなし100%
最終メッセージ
fetchPageContent now calls Firecrawl over plain HTTP, and npm test passes: 6 tests, 0 failures. The tests mock the network, so I haven't run it against a real Firecrawl.
- Request: it POSTs to
{FIRECRAWL_BASE_URL}/v1/scrapewith{url, formats: ['markdown'], onlyMainContent: true}and a Bearer token. It uses the sharedpostJsonhelper and the existingrequestTimeoutMs. - Return value:
{ url, title, description, markdown }.urlcomes from Firecrawl'ssourceURLwhen present, andtitleanddescriptiondefault to''. - Config:
src/config.jsnow exposesfirecrawlApiKeyandfirecrawlBaseUrl. The base URL defaults tohttps://api.firecrawl.devand trailing slashes are stripped..env.examplehasFIRECRAWL_API_KEYandFIRECRAWL_BASE_URL. - Errors: a missing key throws
ConfigErrorbefore any request is made. A non-2xx response throwsUpstreamErrorfrom the helper, withservice: 'firecrawl'and the status. A 200 withsuccess: falseor no markdown also throwsUpstreamError. - Tests:
test/pageContent.test.jsmocksfetchand covers success, the default base URL, non-2xx,success: false, and a missing key.
Key required for self-hosted too: a self-hosted Firecrawl that doesn't use auth would still need a dummy FIRECRAWL_API_KEY, because I made the key mandatory as you asked. If you want it optional when a custom base URL is set, that's a small change.
npm test script change: the original node --test test/ fails on this machine's Node 22 with "Cannot find module '/work/test'". I changed the script to node --test test/*.test.js, which is the only edit outside the feature. It only picks up test files directly in test/, not in subfolders.
作った・変えたファイル
スキルあり100%
最終メッセージ
fetchPageContent(url) now calls Firecrawl over plain HTTP and returns { url, title, description, markdown }. npm test passes with 6 tests. I didn't check the request or response shape against the Firecrawl docs, and no real request was made. I wrote the code from my own knowledge of the /v1/scrape API, so run one real scrape before you rely on it.
- Config:
src/config.jsnow readsFIRECRAWL_API_KEYandFIRECRAWL_API_URL. The URL defaults tohttps://api.firecrawl.dev, and trailing slashes are stripped so a self-hosted instance works. - Request:
src/services/pageContent.jssends a POST to/v1/scrapethrough the sharedpostJsonhelper, with a Bearer auth header. It asks for markdown only, restricted to the main page content. - Errors:
- A missing API key throws
ConfigErrorbefore any request is made. - A non-2xx response throws
UpstreamError, withstatusandservice: 'firecrawl', becausepostJsonalready does that. - A 200 response with
success: falseor no markdown also throwsUpstreamError.
- A missing API key throws
- Missing metadata: if Firecrawl returns no title or description, they come back as empty strings.
buildPreviewalready falls back to the URL and the first 200 characters of the markdown. - Tests:
test/pageContent.test.jsinjectsenvandfetchImplthroughdeps, so nothing touches the network. It covers success, a custom base URL, a 402 response,success: false, and a missing key (which also checks that no request was sent). .env.example: it now listsFIRECRAWL_API_KEYand a commented-outFIRECRAWL_API_URL.package.json: I changed the test script fromnode --test test/tonode --test test/*.test.js. On this Node version (22) the old form tried to loadtestas a module and failed, even for the existing config test.
作った・変えたファイル
課題 2: PythonエージェントにWeb検索ツールをFirecrawlで追加
依頼文
I'm building a small research agent in Python (see agent/). The agent has a tool registry in agent/tools.py, and I need a new tool called web_search that takes a query string (and an optional limit, default 5) and returns live web search results the LLM can cite: a list of dicts with title, url, a short snippet, and the page markdown content when available. Please implement it with Firecrawl. Only the Python standard library is available (no pip installs), so use urllib. Read the API key from the environment and raise a clear error if it's missing; allow an optional self-hosted base URL. Register the tool the same way the existing tools are registered, and add unittest tests under tests/ that mock the HTTP call (no network) for a normal result, an empty result, and an HTTP error. Make sure python3 -m unittest discover -s tests passes.採点基準
- web_search is registered via the existing @tool decorator in the TOOLS registry and returns a list of dicts with title, url, snippet, and markdown (markdown may be empty/None when absent)
- The implementation calls a Firecrawl search endpoint (e.g. /v1/search or /v2/search) with the query and limit, requests page content as markdown, and correctly parses the response results list
- The API key comes from the environment via agent/settings.py and is sent as a Bearer token; a missing key raises a clear error (e.g. ToolError) before any request; the base URL is optionally overridable
- HTTP errors and unsuccessful responses are converted into a clear ToolError rather than leaking raw exceptions, and an empty result returns an empty list
- Tests mock urllib (no real network), cover normal, empty, and HTTP-error cases, and python3 -m unittest discover -s tests passes using only the standard library
項目ごとの点数(1 = 満たした・0.5 = 一部・0 = 満たさない)
| # | 1 回目 スキルなし / スキルあり | 2 回目 スキルなし / スキルあり |
|---|---|---|
| 1 | 1 / 0.5 | 1 / 1 |
| 2 | 1 / 1 | 1 / 1 |
| 3 | 1 / 1 | 1 / 1 |
| 4 | 1 / 1 | 1 / 0.5 |
| 5 | 1 / 1 | 1 / 1 |
初期ファイル(6)
agent/__init__.py
agent/tools.py
"""Tool registry for the research agent.
Each tool is a plain function registered with @tool. The agent passes the
returned JSON-serialisable value back to the model.
"""
import datetime
TOOLS = {}
class ToolError(Exception):
"""Raised by tools for errors that should be reported to the model."""
def tool(name, description):
def wrap(fn):
TOOLS[name] = {"fn": fn, "description": description}
return fn
return wrap
@tool("current_date", "Return today's date in ISO format.")
def current_date():
return datetime.date.today().isoformat()
agent/settings.py
import os
def get_setting(name, default=None):
"""All environment access goes through here."""
value = os.environ.get(name, default)
if isinstance(value, str):
value = value.strip()
return value or default
tests/__init__.py
tests/test_tools.py
import unittest
from agent.tools import TOOLS, current_date
class CurrentDateTest(unittest.TestCase):
def test_registered(self):
self.assertIn("current_date", TOOLS)
self.assertEqual(len(current_date()), 10)
if __name__ == "__main__":
unittest.main()
.env.example
# Agent settings MODEL_NAME=example-model
1 回目: スキルなし (達成率 100% / 90%)
Bは結果のキーをmarkdownではなくcontentにしており要件と異なるため、Aが優位。
スキルなし100%
最終メッセージ
I added web_search to agent/tools.py. python3 -m unittest discover -s tests passes, all 7 tests. Nothing was run against the real Firecrawl API, so the request and response format is untested live.
- Call:
web_search(query, limit=5)sends aPOSTto{base}/v1/searchusingurllib, with the API key as a Bearer token. It requests markdown for each result. - Result: it returns a list of
{title, url, snippet, markdown}dicts.markdownisNonewhen the page content is unavailable. If a result has no description, the snippet is the first 300 characters of the markdown. - Response shape: it reads both
data: [...]anddata: {"web": [...]}, because I wasn't sure which shape your Firecrawl version returns. It readstitle,urlanddescriptionfrom the result'smetadatawhen they aren't top-level. - Config: the key comes from
FIRECRAWL_API_KEY, read through your existingget_setting. The optionalFIRECRAWL_BASE_URLpoints it at a self-hosted instance; the default ishttps://api.firecrawl.dev. - Errors: a missing key, an empty query, a bad
limit, an HTTP error, a network error and an API-reported failure all raiseToolErrorwith a clear message. A missing key fails before any request is made. - Registration: it uses the same
@tooldecorator ascurrent_date. - Tests:
tests/test_web_search.pymocksurlopen, so no network is used. It covers a normal result (including the request URL, auth header and body), an empty result, an HTTP 401, a missing key, a custom base URL, and registration.
I used the /v1/search endpoint because I believe self-hosted Firecrawl supports it. If you only target the hosted API, switching to /v2/search is a one-line change in _firecrawl_search.
作った・変えたファイル
スキルあり90%
最終メッセージ
I added web_search(query, limit=5) to agent/tools.py, registered with @tool like current_date. python3 -m unittest discover -s tests passes (7 tests). I haven't called the real Firecrawl API, so the request and response shapes come from my memory of the Firecrawl v2 docs. The firecrawl-build-search skill file wasn't in the repo for me to check against.
- Request: it sends a
POSTto{base}/v2/searchusingurllib, asking for markdown content. The key is sent as a Bearer token. - Configuration: it reads
FIRECRAWL_API_KEYthroughagent/settings.py. It raisesToolErrorif the key is missing, before any network call. SetFIRECRAWL_API_URLto use a self-hosted instance; otherwise it useshttps://api.firecrawl.dev. - Results: each result is
{title, url, snippet, content}.snippetis the search description, or the first 300 characters of the markdown if there's no description.contentis the page markdown, orNoneif Firecrawl didn't return any. It accepts both the v2 response shape (data.web) and a bare list indata, in case a self-hosted version returns the older shape. - Errors: an empty query or a
limitbelow 1 raisesToolError. HTTP errors, network errors andsuccess: falseresponses also raiseToolError, with the status code or message included. - Tests:
tests/test_web_search.pymocksurlopen, so nothing touches the network. It covers a normal result, an empty result, an HTTP 429 error, and the missing-key case. It also checks the registration and the self-hosted URL.
To check the response shape against the real API, run web_search("test") once with a live key.
作った・変えたファイル
2 回目: スキルなし (達成率 100% / 90%)
Bはsuccess:falseや不正JSONもToolErrorに変換するが、Aは失敗応答を扱わない点で差がついた。
スキルなし100%
最終メッセージ
I added the web_search tool to agent/tools.py, and python3 -m unittest discover -s tests passes (7 tests, no network). I haven't called the real Firecrawl API, so the request and response format comes from my memory of their /v1/search docs.
- Behavior:
web_search(query, limit=5)POSTs to Firecrawl's/v1/searchand asks for markdown. It returns a list of{title, url, snippet, markdown}dicts. The snippet is Firecrawl's description, or the first 300 characters of the markdown if there's no description.markdownisNonewhen Firecrawl didn't return page content. - Config: it reads
FIRECRAWL_API_KEYthrough your existingget_setting. It raisesToolErrorwith a clear message if the key is missing, before making any request.FIRECRAWL_BASE_URLis optional for a self-hosted instance and defaults tohttps://api.firecrawl.dev. I added both to.env.example. - Errors: an empty or non-string query, a bad
limit, an HTTP error, a network error, invalid JSON, orsuccess: falseall raiseToolError. - Response shape: it also accepts the newer
{"data": {"web": [...]}}response shape. - Registration: it uses the same
@tooldecorator ascurrent_date. - Tests:
tests/test_web_search.pymocksurllib.request.urlopen. It covers a normal result, an empty result and an HTTP 429, plus registration, a custom base URL and a missing key.
I'd run one real query against your Firecrawl account or instance to confirm the response shape before relying on it.
作った・変えたファイル
スキルあり90%
最終メッセージ
I added web_search(query, limit=5) to agent/tools.py, registered with the same @tool decorator as current_date. python3 -m unittest discover -s tests passes (7 tests), but nothing has been run against the real Firecrawl API.
- Request: it posts to Firecrawl's
/v2/searchwithurlliband asks for markdown of each result page. - Response parsing: it returns a list of
{title, url, snippet, markdown}. The snippet is the result's description, cut to 300 characters.markdownisNonewhen Firecrawl doesn't return page content. - Config: the key comes from
FIRECRAWL_API_KEY, read throughget_settinginagent/settings.py. A missing key raisesToolError.FIRECRAWL_API_URLoptionally points it at a self-hosted instance and defaults tohttps://api.firecrawl.dev. - Errors: an empty query, a limit below 1, an HTTP error or a network failure also raise
ToolError. The HTTP error message includes the status code and the start of the response body. - Tests: in
tests/test_tools.pythey mockurlopen, so there's no network. They cover a normal result, an empty result and an HTTP 401. I also added tests for a custom base URL, a missing key and registration.
I wrote the request and response shape from memory, because the skill's search page and the Firecrawl docs weren't available here. Run one real query with your key to confirm the endpoint path and response fields. The parser also accepts the older list-style data.