Skip to content
cccskills

Test log of firecrawl-build

For each task: the request, the rubric and the score for each item, time and tokens for every run, Claude Code’s full logs, and the files it produced. The raw data is here too, so the score can be recomputed if the weighting changes.

Run on Nov 2, 2026 (runs: claude-sonnet-5-5 / judge: claude-opus-5-5). Figures are medians. The tasks were written by AI from SKILL.md, so they may lean toward situations where the skill helps.

Raw data (JSON)Tasks, per-run measurements, judgments and the summary as stored.

Measurements per run

RunResultTimeTokensCostTurnsSkill usedLog
Task 1 Run 1 Without skillDone30s111,478$0.0826-Full log
Task 1 Run 1 With skillDone38s149,781$0.0939YesFull log
Task 1 Run 1 With skill (not named)Done37s128,026$0.0928YesFull log
Task 1 Run 2 With skillDone35s179,652$0.08811YesFull log
Task 1 Run 2 Without skillDone41s151,795$0.0688-Full log
Task 1 Run 2 With skill (not named)Done26s150,716$0.0799YesFull log
Task 2 Run 1 Without skillDone33s70,692$0.0694-Full log
Task 2 Run 1 With skillDone28s79,378$0.0796YesFull log
Task 2 Run 1 With skill (not named)Done22s79,220$0.0766YesFull log
Task 2 Run 2 With skillDone29s99,388$0.0667YesFull log
Task 2 Run 2 Without skillDone26s70,547$0.0524-Full log
Task 2 Run 2 With skill (not named)Done27s80,070$0.0666YesFull log

“With skill (not named)” runs only measure the pick-up rate and are not judged.

Task 1: Implement page-content fetching via Firecrawl in an existing Node app

Request

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.

Rubric

  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

Score per rubric item (1 = met, 0.5 = partly, 0 = not met)

#Run 1
Without skill / With skill
Run 2
Without skill / With skill
11 / 11 / 1
21 / 11 / 1
31 / 11 / 1
41 / 11 / 1
51 / 11 / 1
Starting files(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

Run 1: Tie (Rubric met 100% / 100%)

Both use postJson, ConfigError, UpstreamError, a configurable base URL and mocked tests; no real difference.

Without skill100%

Final message

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.

Files created or changed

With skill100%

Final message

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".

Files created or changed

Run 2: Tie (Rubric met 100% / 100%)

Both have nearly identical convention-following code, mocked tests and .env.example updates; no real difference.

Without skill100%

Final message

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.

Files created or changed

With skill100%

Final message

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.

Files created or changed

Task 2: Add a Firecrawl-backed web search tool to a Python agent

Request

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.

Rubric

  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

Score per rubric item (1 = met, 0.5 = partly, 0 = not met)

#Run 1
Without skill / With skill
Run 2
Without skill / With skill
11 / 0.51 / 1
21 / 11 / 1
31 / 11 / 1
41 / 11 / 0.5
51 / 11 / 1
Starting files(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

Run 1: Without skill (Rubric met 100% / 90%)

B returns the page markdown under a 'content' key instead of the required 'markdown' key, so A better matches the spec.

Without skill100%

Final message

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.

Files created or changed

With skill90%

Final message

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.

Files created or changed

Run 2: Without skill (Rubric met 100% / 90%)

B also converts success:false and invalid JSON responses into ToolError, while A ignores unsuccessful responses.

Without skill100%

Final message

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.

Files created or changed

With skill90%

Final message

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.

Files created or changed