firecrawl-build 검증 로그
과제별로 요청문과 채점 항목, 항목별 점수, 실행마다의 시간・토큰, Claude Code의 전체 로그, 만든 파일을 싣습니다. 배점을 바꿔도 다시 계산할 수 있도록 원본 데이터도 둡니다.
2026년 11월 2일 실행(실행: claude-sonnet-5-5 / 채점: claude-opus-5-5). 수치는 중앙값입니다. 과제는 AI가 SKILL.md를 바탕으로 만든 것이라 스킬에 유리한 상황으로 치우칠 수 있습니다.
원본 데이터 (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 에이전트에 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.