본문으로 건너뛰기
cccskills

cavecrew 검증 로그

과제별로 요청문과 채점 항목, 항목별 점수, 실행마다의 시간・토큰, Claude Code의 전체 로그, 만든 파일을 싣습니다. 배점을 바꿔도 다시 계산할 수 있도록 원본 데이터도 둡니다.

2026년 11월 23일 실행(실행: claude-sonnet-5-5 / 채점: claude-opus-5-5). 수치는 중앙값입니다. 과제는 AI가 SKILL.md를 바탕으로 만든 것이라 스킬에 유리한 상황으로 치우칠 수 있습니다.

원본 데이터 (JSON)과제, 실행별 측정값, 채점, 집계를 그대로 둡니다.

실행별 측정값

실행결과시간토큰비용턴스킬 사용로그
과제 1 1번째 스킬 없음완료15초105,535$0.0598-전체 로그
과제 1 1번째 스킬 있음완료15초130,719$0.06210사용전체 로그
과제 1 1번째 스킬 있음 (이름 지정 없음)완료15초105,144$0.0528미사용전체 로그
과제 1 2번째 스킬 있음완료15초130,498$0.04010사용전체 로그
과제 1 2번째 스킬 없음완료15초104,841$0.0388-전체 로그
과제 1 2번째 스킬 있음 (이름 지정 없음)완료15초105,025$0.0368미사용전체 로그
과제 2 1번째 스킬 없음완료7초33,262$0.0313-전체 로그
과제 2 1번째 스킬 있음완료10초53,076$0.0456사용전체 로그
과제 2 1번째 스킬 있음 (이름 지정 없음)완료7초33,498$0.0303미사용전체 로그
과제 2 2번째 스킬 있음완료10초70,931$0.0256사용전체 로그
과제 2 2번째 스킬 없음완료6초33,231$0.0123-전체 로그
과제 2 2번째 스킬 있음 (이름 지정 없음)완료7초33,503$0.0133미사용전체 로그

“스킬 있음 (이름 지정 없음)” 실행은 호출률만 측정하며 채점하지 않습니다.

과제 1: parseDuration 정의와 호출 위치를 찾고 복합 단위 버그 수정

요청문

In this repo, where is `parseDuration` defined and what calls it? Give me a list of every call site as file:line (include tests). Then fix the bug: a value like "1h30m" should be 5400 seconds but it currently comes back as 3600. Keep the change as small as possible (don't touch the callers unless you have to) and make sure single-unit inputs like "45s" and "2h" still work and garbage input still throws. Run the existing tests to confirm.

채점 기준

  1. The answer names src/time/parse.js as where parseDuration is defined and lists the call sites in src/scheduler.js, src/config/load.js (two calls), src/cli.js and test/parse.test.js, each with a file:line reference that matches the actual line in the file
  2. It does not wrongly list src/legacy/timer.js (parseDurationLegacy) as a caller of parseDuration, or if it mentions it, it says clearly that it is a separate, unused function
  3. After the fix, parseDuration('1h30m') returns 5400 (and, for example, '2h15m10s' returns 8110), while '45s', '2h' and '10m' still return 45, 7200 and 600
  4. Invalid input such as 'soon' (and ideally an empty string) still throws an error, and the existing tests pass
  5. The code change stays in src/time/parse.js (plus optionally new test cases); the callers are left unchanged

채점 항목별 점수 (1 = 충족・0.5 = 일부・0 = 미충족)

#1번째
스킬 없음 / 스킬 있음
2번째
스킬 없음 / 스킬 있음
11 / 11 / 1
21 / 11 / 1
31 / 11 / 1
41 / 11 / 1
51 / 11 / 1
초기 파일(7)

package.json

{
  "name": "duration-demo",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "test": "node --test test/"
  }
}

src/time/parse.js

'use strict';

const UNITS = { s: 1, m: 60, h: 3600 };

/**
 * Parse a human duration like "45s", "2h" or "1h30m" into seconds.
 */
function parseDuration(str) {
  const re = /(\d+)([smh])/;
  const match = String(str).match(re);
  if (!match) throw new Error(`bad duration: ${str}`);
  return Number(match[1]) * UNITS[match[2]];
}

module.exports = { parseDuration };

src/scheduler.js

'use strict';

const { parseDuration } = require('./time/parse');

function scheduleJob(job) {
  const delaySec = parseDuration(job.every);
  return { name: job.name, runInMs: delaySec * 1000 };
}

module.exports = { scheduleJob };

src/config/load.js

'use strict';

const fs = require('fs');
const { parseDuration } = require('../time/parse');

function loadConfig(path) {
  const raw = JSON.parse(fs.readFileSync(path, 'utf8'));
  return {
    ...raw,
    timeoutSec: parseDuration(raw.timeout || '30s'),
    retryAfterSec: parseDuration(raw.retryAfter || '5m'),
  };
}

module.exports = { loadConfig };

src/cli.js

'use strict';

const { parseDuration } = require('./time/parse');
const { scheduleJob } = require('./scheduler');

function main(argv) {
  const [name, every] = argv;
  if (!name || !every) {
    console.error('usage: cli <name> <every>');
    process.exit(1);
  }
  console.log(`interval: ${parseDuration(every)}s`);
  console.log(JSON.stringify(scheduleJob({ name, every })));
}

if (require.main === module) main(process.argv.slice(2));

module.exports = { main };

src/legacy/timer.js

'use strict';

// Old implementation kept for reference; NOT used anywhere.
function parseDurationLegacy(str) {
  return parseInt(str, 10) * 60;
}

module.exports = { parseDurationLegacy };

test/parse.test.js

'use strict';

const test = require('node:test');
const assert = require('node:assert');
const { parseDuration } = require('../src/time/parse');

test('single units', () => {
  assert.strictEqual(parseDuration('45s'), 45);
  assert.strictEqual(parseDuration('2h'), 7200);
  assert.strictEqual(parseDuration('10m'), 600);
});

test('invalid input throws', () => {
  assert.throws(() => parseDuration('soon'));
});

1번째: 무승부 (달성률 100% / 100%)

A와 B의 호출 위치 목록, 수정 코드, 테스트 결과가 거의 같아 실질적인 차이가 없다.

스킬 없음100%

최종 메시지

parseDuration is defined in src/time/parse.js:8, and "1h30m" now returns 5400. The existing tests pass when run directly (node --test test/parse.test.js, 2 of 2). npm test fails on this Node 22 because node --test test/ treats the directory as a module. That's a separate, existing problem and I left package.json alone.

Call sites

  • src/cli.js:3 (import) and src/cli.js:12 (call)
  • src/scheduler.js:3 (import) and src/scheduler.js:6 (call)
  • src/config/load.js:4 (import), src/config/load.js:10 and src/config/load.js:11 (calls)
  • test/parse.test.js:5 (import), then calls at lines 8, 9, 10 and 14

src/legacy/timer.js:4 defines parseDurationLegacy, which is a different function and isn't a caller.

The bug: the regex /(\d+)([smh])/ was unanchored and not global, so it only matched the first <number><unit> pair. "1h30m" therefore returned 1h = 3600 and dropped the 30m.

The fix is in parseDuration only; no callers changed. It now checks the whole string against /^(?:\d+[smh])+$/ and throws bad duration otherwise. Then it sums every <number><unit> pair.

I also ran it by hand: "1h30m" gives 5400, "45s" gives 45, "2h" gives 7200, and "soon" still throws.

Behaviour change: the check is now anchored, so input with junk around a valid duration, like "xx5s" or "5s!", now throws. Before, it was silently accepted. Nothing in the repo relies on that, but it is stricter than before.

I didn't add a test for the multi-unit case. Say so if you want one.

만들거나 바꾼 파일

스킬 있음100%

최종 메시지

parseDuration is defined in src/time/parse.js:8, and "1h30m" now returns 5400. The two existing tests pass when I run the file directly, but npm test itself fails.

I used no cavecrew subagents because those agent types aren't registered in this session, so I searched and edited directly.

Call sites

  • src/cli.js:12 (imported at src/cli.js:3)
  • src/config/load.js:10 (raw.timeout || '30s')
  • src/config/load.js:11 (raw.retryAfter || '5m')
  • src/scheduler.js:6 (imported at src/scheduler.js:3)
  • test/parse.test.js:8 ('45s')
  • test/parse.test.js:9 ('2h')
  • test/parse.test.js:10 ('10m')
  • test/parse.test.js:14 ('soon', expects a throw)

parseDurationLegacy in src/legacy/timer.js is a different function and nothing uses it.

Bug: the regex in src/time/parse.js had no g flag and no anchors, so it matched only the first <number><unit> pair. "1h30m" therefore read as 1h, which is 3600.

Fix: src/time/parse.js now first checks that the whole string is one or more <number><unit> pairs. It then sums every pair. No callers changed.

Verification

  • A direct node run gave 1h30m → 5400, 45s → 45 and 2h → 7200.
  • "soon" and "1h xyz" both still throw.
  • node --test test/parse.test.js: 2 of 2 pass.
  • npm test fails with Cannot find module '/work/test'. The script node --test test/ doesn't work on this Node (v22), which doesn't accept a bare directory argument. It broke before my change and I left package.json alone. Changing the script to node --test should fix it, if you want that.

I didn't add a test for "1h30m". Say if you want one.

만들거나 바꾼 파일

2번째: 무승부 (달성률 100% / 100%)

두 결과의 수정 코드가 같고 호출 위치 줄 번호와 legacy 처리도 같아 실질적 차이가 없다

스킬 없음100%

최종 메시지

parseDuration is defined in src/time/parse.js:8. "1h30m" now returns 5400, and the existing tests pass when run directly.

Call sites

  • src/cli.js:12 (imported at line 3)
  • src/config/load.js:10 (timeout, default '30s')
  • src/config/load.js:11 (retryAfter, default '5m')
  • src/scheduler.js:6 (imported at line 3)
  • test/parse.test.js:8, :9 and :10 (the single-unit cases "45s", "2h" and "10m")
  • test/parse.test.js:14 (the garbage-input case, "soon")

src/legacy/timer.js:4 defines parseDurationLegacy, a separate function. It only matched the grep by name and doesn't call parseDuration.

Bug and fix The regex /(\d+)([smh])/ was unanchored and not global, so it only read the first <number><unit> pair. "1h30m" matched "1h" and returned 3600. I changed only the body of parseDuration, so no callers needed touching. It now:

  • rejects anything that isn't entirely <number><unit> pairs, using /^(\d+[smh])+$/
  • sums every pair with matchAll

Checks

  • Outputs: "1h30m" gives 5400, "45s" gives 45 and "2h" gives 7200.
  • Garbage still throws: "soon", "1h30", "30m1h x" and the empty string all throw.
  • node --test test/parse.test.js passes both tests.
  • npm test fails on Node 22 before running anything, because node --test test/ treats the directory as a module and gives Cannot find module '/work/test'. I left package.json alone since you wanted a minimal change. Changing the script to node --test would fix it.

I didn't add a test for the multi-unit case, which would be a one-liner in test/parse.test.js. Say if you want it.

만들거나 바꾼 파일

스킬 있음100%

최종 메시지

"1h30m" now returns 5400 instead of 3600. The existing tests pass when I run the test file directly, but npm test fails (see below). The cavecrew agent types aren't registered in this session, so I did the search and the fix myself instead of delegating.

Definition: src/time/parse.js:8 (parseDuration). src/legacy/timer.js:4 has a separate parseDurationLegacy, which isn't related.

Imports and calls

  • src/cli.js:3 (import), src/cli.js:12 (call)
  • src/config/load.js:4 (import), src/config/load.js:10, src/config/load.js:11 (calls)
  • src/scheduler.js:3 (import), src/scheduler.js:6 (call)
  • test/parse.test.js:5 (import), test/parse.test.js:8, :9, :10, :14 (calls)

Cause: the regex /(\d+)([smh])/ had no g flag, so it matched only the first 1h and ignored 30m.

Fix: I changed only src/time/parse.js. The function now requires the whole string to be one or more number-plus-unit groups, then sums them. No callers were touched.

Verification

  • 1h30m returns 5400, 45s returns 45, and 2h returns 7200.
  • soon throws, and so does 1h30mx.
  • node --test test/parse.test.js passes both existing tests (2 of 2).
  • npm test fails because its script runs node --test test/, which Node 22 resolves as a module path (Cannot find module '/work/test'). I left package.json alone since you wanted the change kept small. Changing the script to node --test would fix it if you want that.

만들거나 바꾼 파일

과제 2: 병합 전 장바구니 가격 계산 diff 리뷰로 버그 찾기

요청문

A teammate opened a PR that refactors our cart pricing. The diff is in review/cart.diff and the new version is already in src/cart.py. Please review it for bugs before I merge. For each problem give me the file:line, how serious it is, what goes wrong, and a suggested fix. Only report actual problems, no style nitpicks, and don't change any files. I'll decide what to fix.

채점 기준

  1. Flags the mutable default argument items=[] in __init__ (line 9): carts created without arguments share one list, so items leak between carts; suggests going back to None plus a new list
  2. Flags that the bulk-discount check changed from >= to > (line 25), so an order of exactly 10 items no longer gets the discount the comment promises
  3. Flags that the coupon None check was removed (line 27): total() with no coupon (the default) raises AttributeError
  4. Flags that subtotal() lost its Decimal('0') start value (line 21), so an empty cart returns int 0 and .quantize() in total() fails
  5. Each finding has an accurate file:line reference, a severity, and a concrete fix, and the review does not invent problems that aren't in the code
  6. No files were modified (src/cart.py and review/cart.diff are unchanged)

채점 항목별 점수 (1 = 충족・0.5 = 일부・0 = 미충족)

#1번째
스킬 없음 / 스킬 있음
2번째
스킬 없음 / 스킬 있음
11 / 11 / 1
21 / 11 / 1
31 / 11 / 1
41 / 11 / 1
51 / 11 / 1
61 / 11 / 1
초기 파일(2)

src/cart.py

"""Shopping cart pricing."""
from decimal import Decimal

BULK_THRESHOLD = 10  # orders of 10 or more items get bulk discount
BULK_RATE = Decimal("0.05")


class Cart:
    def __init__(self, items=[]):
        self.items = items

    def add(self, sku, unit_price, qty=1):
        if qty <= 0:
            raise ValueError("qty must be positive")
        self.items.append({"sku": sku, "price": Decimal(str(unit_price)), "qty": qty})

    def item_count(self):
        return sum(i["qty"] for i in self.items)

    def subtotal(self):
        return sum(i["price"] * i["qty"] for i in self.items)

    def total(self, coupon=None):
        amount = self.subtotal()
        if self.item_count() > BULK_THRESHOLD:
            amount -= amount * BULK_RATE
        if coupon.percent:
            amount -= amount * Decimal(coupon.percent) / 100
        return amount.quantize(Decimal("0.01"))

review/cart.diff

--- a/src/cart.py
+++ b/src/cart.py
@@ -6,21 +6,24 @@ BULK_RATE = Decimal("0.05")
 
 
 class Cart:
-    def __init__(self, items=None):
-        self.items = items if items is not None else []
+    def __init__(self, items=[]):
+        self.items = items
 
     def add(self, sku, unit_price, qty=1):
         if qty <= 0:
             raise ValueError("qty must be positive")
         self.items.append({"sku": sku, "price": Decimal(str(unit_price)), "qty": qty})
 
+    def item_count(self):
+        return sum(i["qty"] for i in self.items)
+
     def subtotal(self):
-        return sum((i["price"] * i["qty"] for i in self.items), Decimal("0"))
+        return sum(i["price"] * i["qty"] for i in self.items)
 
     def total(self, coupon=None):
         amount = self.subtotal()
-        if sum(i["qty"] for i in self.items) >= BULK_THRESHOLD:
+        if self.item_count() > BULK_THRESHOLD:
             amount -= amount * BULK_RATE
-        if coupon and coupon.percent:
+        if coupon.percent:
             amount -= amount * Decimal(coupon.percent) / 100
         return amount.quantize(Decimal("0.01"))

1번째: 무승부 (달성률 100% / 100%)

양쪽 모두 네 가지 버그를 정확한 줄 번호, 심각도, 수정안과 함께 지적해 실질적 차이가 없음

스킬 없음100%

최종 메시지

Review of src/cart.py against review/cart.diff. The file matches the diff. I found four problems and changed no files.

1. src/cart.py:9: mutable default argument (High)

  • What goes wrong: items=[] is created once and shared by every Cart() built without arguments. add() appends to that shared list, so items from one cart show up in all the others. A new cart can start non-empty, and customers can be charged for each other's items.
  • Fix: Restore the original code:
    def __init__(self, items=None):
        self.items = items if items is not None else []
    

2. src/cart.py:27: coupon is no longer None-checked (High)

  • What goes wrong: total() still defaults to coupon=None, but coupon.percent now runs unconditionally. Calling cart.total() with no coupon raises AttributeError: 'NoneType' object has no attribute 'percent'. That is the most common checkout path.
  • Fix: Restore the guard: if coupon and coupon.percent:.

3. src/cart.py:25: bulk threshold off by one (Medium)

  • What goes wrong: The comment on line 4 says 10 or more items get the discount, and the original code used >=. The new > means an order of exactly 10 items loses the 5% discount, so the customer is overcharged.
  • Fix: if self.item_count() >= BULK_THRESHOLD:.

4. src/cart.py:21: sum() has no Decimal start value (Medium)

  • What goes wrong: The original passed Decimal("0") as the start value. Without it, sum() starts from the int 0. For an empty cart subtotal() returns the int 0, so total() hits amount.quantize(...) on an int and raises AttributeError. A non-empty cart works, because int + Decimal gives a Decimal.
  • Fix: return sum((i["price"] * i["qty"] for i in self.items), Decimal("0")).

Items 1 and 2 will fail in normal use, so I'd block the merge until they're fixed. The item_count() helper itself is fine. The bugs are in how it's used and in the other changes around it.

만들거나 바꾼 파일

바뀐 파일이 없습니다.

스킬 있음100%

최종 메시지

I reviewed this inline. cavecrew-reviewer isn't available as an agent type here. I checked the diff against src/cart.py and they match. I found four bugs and changed no files.

src/cart.py:9 — 🔴 High: the mutable default argument items=[] is shared by every Cart() created without arguments.

  • What goes wrong: one list is shared across all carts. Items added to one cart show up in every other default-constructed cart, so customers see and are charged for each other's items.
  • Fix: restore the original code:
    def __init__(self, items=None):
        self.items = items if items is not None else []
    

src/cart.py:27 — 🔴 High: coupon.percent no longer checks for coupon=None.

  • What goes wrong: total() defaults to coupon=None, so any call without a coupon raises AttributeError: 'NoneType' object has no attribute 'percent'. That is the normal checkout path.
  • Fix: restore the guard: if coupon and coupon.percent:.

src/cart.py:25 — 🟡 Medium: > should be >=.

  • What goes wrong: the constant's comment (line 4) says 10 or more items get the discount, and the original code used >=. A cart with exactly 10 items now loses the 5% discount and is overcharged.
  • Fix: if self.item_count() >= BULK_THRESHOLD:.

src/cart.py:21 — 🟡 Medium: sum() lost its Decimal("0") start value.

  • What goes wrong: for an empty cart, sum() returns the int 0. With no coupon and no bulk discount, total() then calls 0.quantize(...) and raises AttributeError. Checking out an empty cart crashes instead of returning Decimal("0.00").
  • Fix: return sum((i["price"] * i["qty"] for i in self.items), Decimal("0")).

totals: 2🔴 2🟡

The item_count() helper itself is fine. Its only problem is the > comparison at line 25.

만들거나 바꾼 파일

바뀐 파일이 없습니다.

2번째: 무승부 (달성률 100% / 100%)

두 리뷰 모두 네 가지 버그를 정확한 줄 번호, 심각도, 수정안과 함께 지적했으며 실질적인 차이가 없다.

스킬 없음100%

최종 메시지

Four problems found in src/cart.py. I didn't change any files.

1. src/cart.py:9-10 — High — mutable default argument shared across carts

  • What goes wrong: Cart() with no argument uses the same list object every time, so every default-constructed cart shares one items list. Items added to one customer's cart show up in every other cart created without arguments. That means wrong totals and data leaking between users.
  • Fix: Restore the original code:
    def __init__(self, items=None):
        self.items = items if items is not None else []
    

2. src/cart.py:27 — High — coupon=None crashes

  • What goes wrong: total() defaults to coupon=None, but the coupon and guard was removed. Cart().total() and any checkout without a coupon raise AttributeError: 'NoneType' object has no attribute 'percent'.
  • Fix: Restore the guard: if coupon and coupon.percent:.

3. src/cart.py:25 — Medium — bulk discount boundary is off by one

  • What goes wrong: > was changed from >=. The constant's comment (line 4) says "10 or more items get bulk discount". A cart with exactly 10 items no longer gets the 5% discount, so those customers are overcharged.
  • Fix: Use if self.item_count() >= BULK_THRESHOLD:.

4. src/cart.py:21 — Medium — empty cart returns int 0, so total() crashes

  • What goes wrong: The Decimal("0") start value was dropped from sum(). For an empty cart, subtotal() returns the int 0. total() then calls amount.quantize(...) on that int and raises AttributeError: 'int' object has no attribute 'quantize'. subtotal() also returns an inconsistent type.
  • Fix: Restore the start value: sum((i["price"] * i["qty"] for i in self.items), Decimal("0")).

Items 1–4 are all regressions from the refactor. The item_count() helper itself is fine, apart from the boundary change in item 3.

만들거나 바꾼 파일

바뀐 파일이 없습니다.

스킬 있음100%

최종 메시지

Four bugs. The diff matches src/cart.py, and the line numbers below are from the new file. I changed no files. The cavecrew-reviewer agent isn't registered in this environment, so I reviewed inline.

src/cart.py:9-10 — 🔴 high: mutable default argument

  • What goes wrong: Cart() with no arguments shares one list across every instance. Items from one cart show up in the next, so subtotals and totals include other customers' items. The old code created a fresh list each time.
  • Fix: restore def __init__(self, items=None): self.items = items if items is not None else [].

src/cart.py:27 — 🔴 high: coupon.percent fails when there is no coupon

  • What goes wrong: total() defaults to coupon=None, so total() raises AttributeError: 'NoneType' object has no attribute 'percent'. Any checkout without a coupon crashes. The old if coupon and coupon.percent: guarded this.
  • Fix: restore if coupon and coupon.percent:.

src/cart.py:25 — 🟡 medium: bulk discount threshold is off by one

  • What goes wrong: > was changed from >=. The comment on line 4 says 10 or more items get the discount, but exactly 10 items now get none. Customers are overcharged by 5% at the boundary.
  • Fix: use >= BULK_THRESHOLD.

src/cart.py:21 — 🟡 medium: subtotal() returns int 0 for an empty cart

  • What goes wrong: the Decimal("0") start value was dropped, so an empty cart returns int 0. total() then calls .quantize on that int (line 29) and raises AttributeError. Checking out an empty cart, or one with every item removed, crashes.
  • Fix: restore sum((...), Decimal("0")).

만들거나 바꾼 파일

바뀐 파일이 없습니다.