本文へ移動
cccskills

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.0826-全ログ
課題 1 1 回目 スキルあり完了38秒149,781$0.0939使った全ログ
課題 1 1 回目 スキルあり(名指しなし)完了37秒128,026$0.0928使った全ログ
課題 1 2 回目 スキルあり完了35秒179,652$0.08811使った全ログ
課題 1 2 回目 スキルなし完了41秒151,795$0.0688-全ログ
課題 1 2 回目 スキルあり(名指しなし)完了26秒150,716$0.0799使った全ログ
課題 2 1 回目 スキルなし完了33秒70,692$0.0694-全ログ
課題 2 1 回目 スキルあり完了28秒79,378$0.0796使った全ログ
課題 2 1 回目 スキルあり(名指しなし)完了22秒79,220$0.0766使った全ログ
課題 2 2 回目 スキルあり完了29秒99,388$0.0667使った全ログ
課題 2 2 回目 スキルなし完了26秒70,547$0.0524-全ログ
課題 2 2 回目 スキルあり(名指しなし)完了27秒80,070$0.0666使った全ログ

「スキルあり(名指しなし)」は呼ばれやすさを測るための実行で、採点はしていません。

課題 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.

採点基準

  1. 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 }
  2. 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
  3. 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)
  4. New node:test tests mock fetch (no real network) and cover success, failure, and missing-key cases; npm test passes
  5. No new npm dependencies were added, and .env.example documents the Firecrawl key and optional base URL variable

項目ごとの点数(1 = 満たした・0.5 = 一部・0 = 満たさない)

#1 回目
スキルなし / スキルあり
2 回目
スキルなし / スキルあり
11 / 11 / 1
21 / 11 / 1
31 / 11 / 1
41 / 11 / 1
51 / 11 / 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 reads FIRECRAWL_API_KEY and FIRECRAWL_BASE_URL. The base URL defaults to https://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 postJson helper to POST to /v1/scrape with 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 url is Firecrawl's sourceURL when present, otherwise the URL you passed in.
  • Errors:
    • A missing key throws ConfigError before any request is made.
    • A non-2xx response throws UpstreamError from the helper.
    • A 200 response with success: false or no data also throws UpstreamError.
  • 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.json change you didn't ask for: npm test was failing on Node 22 with "Cannot find module '/work/test'", because node --test test/ treats the directory as a module path. I changed the script to node --test, which finds the test/ 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/scrape with formats: ['markdown'] and onlyMainContent: true. The Authorization: Bearer <key> header carries the key, and the request goes through the shared postJson helper.
  • Missing key: it throws ConfigError before any network call.
  • Failed responses: a non-2xx status throws UpstreamError from the helper. A 200 response with success: false or no markdown also throws UpstreamError.
  • Config: src/config.js now reads FIRECRAWL_API_KEY and FIRECRAWL_API_URL. The URL defaults to https://api.firecrawl.dev and 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.js covers success, a custom base URL, a 402 response, a success: false body, and the missing key.
  • .env.example: it now lists FIRECRAWL_API_KEY and a commented-out FIRECRAWL_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/scrape with {url, formats: ['markdown'], onlyMainContent: true} and a Bearer token. It uses the shared postJson helper and the existing requestTimeoutMs.
  • Return value: { url, title, description, markdown }. url comes from Firecrawl's sourceURL when present, and title and description default to ''.
  • Config: src/config.js now exposes firecrawlApiKey and firecrawlBaseUrl. The base URL defaults to https://api.firecrawl.dev and trailing slashes are stripped. .env.example has FIRECRAWL_API_KEY and FIRECRAWL_BASE_URL.
  • Errors: a missing key throws ConfigError before any request is made. A non-2xx response throws UpstreamError from the helper, with service: 'firecrawl' and the status. A 200 with success: false or no markdown also throws UpstreamError.
  • Tests: test/pageContent.test.js mocks fetch and 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.js now reads FIRECRAWL_API_KEY and FIRECRAWL_API_URL. The URL defaults to https://api.firecrawl.dev, and trailing slashes are stripped so a self-hosted instance works.
  • Request: src/services/pageContent.js sends a POST to /v1/scrape through the shared postJson helper, with a Bearer auth header. It asks for markdown only, restricted to the main page content.
  • Errors:
    • A missing API key throws ConfigError before any request is made.
    • A non-2xx response throws UpstreamError, with status and service: 'firecrawl', because postJson already does that.
    • A 200 response with success: false or no markdown also throws UpstreamError.
  • Missing metadata: if Firecrawl returns no title or description, they come back as empty strings. buildPreview already falls back to the URL and the first 200 characters of the markdown.
  • Tests: test/pageContent.test.js injects env and fetchImpl through deps, 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 lists FIRECRAWL_API_KEY and a commented-out FIRECRAWL_API_URL.
  • package.json: I changed the test script from node --test test/ to node --test test/*.test.js. On this Node version (22) the old form tried to load test as 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.

採点基準

  1. 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)
  2. 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
  3. 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
  4. HTTP errors and unsuccessful responses are converted into a clear ToolError rather than leaking raw exceptions, and an empty result returns an empty list
  5. 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 回目
スキルなし / スキルあり
11 / 0.51 / 1
21 / 11 / 1
31 / 11 / 1
41 / 11 / 0.5
51 / 11 / 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 a POST to {base}/v1/search using urllib, 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. markdown is None when 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: [...] and data: {"web": [...]}, because I wasn't sure which shape your Firecrawl version returns. It reads title, url and description from the result's metadata when they aren't top-level.
  • Config: the key comes from FIRECRAWL_API_KEY, read through your existing get_setting. The optional FIRECRAWL_BASE_URL points it at a self-hosted instance; the default is https://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 raise ToolError with a clear message. A missing key fails before any request is made.
  • Registration: it uses the same @tool decorator as current_date.
  • Tests: tests/test_web_search.py mocks urlopen, 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 POST to {base}/v2/search using urllib, asking for markdown content. The key is sent as a Bearer token.
  • Configuration: it reads FIRECRAWL_API_KEY through agent/settings.py. It raises ToolError if the key is missing, before any network call. Set FIRECRAWL_API_URL to use a self-hosted instance; otherwise it uses https://api.firecrawl.dev.
  • Results: each result is {title, url, snippet, content}. snippet is the search description, or the first 300 characters of the markdown if there's no description. content is the page markdown, or None if Firecrawl didn't return any. It accepts both the v2 response shape (data.web) and a bare list in data, in case a self-hosted version returns the older shape.
  • Errors: an empty query or a limit below 1 raises ToolError. HTTP errors, network errors and success: false responses also raise ToolError, with the status code or message included.
  • Tests: tests/test_web_search.py mocks urlopen, 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/search and 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. markdown is None when Firecrawl didn't return page content.
  • Config: it reads FIRECRAWL_API_KEY through your existing get_setting. It raises ToolError with a clear message if the key is missing, before making any request. FIRECRAWL_BASE_URL is optional for a self-hosted instance and defaults to https://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, or success: false all raise ToolError.
  • Response shape: it also accepts the newer {"data": {"web": [...]}} response shape.
  • Registration: it uses the same @tool decorator as current_date.
  • Tests: tests/test_web_search.py mocks urllib.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/search with urllib and 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. markdown is None when Firecrawl doesn't return page content.
  • Config: the key comes from FIRECRAWL_API_KEY, read through get_setting in agent/settings.py. A missing key raises ToolError. FIRECRAWL_API_URL optionally points it at a self-hosted instance and defaults to https://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.py they mock urlopen, 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.

作った・変えたファイル